Skip to content

Commit d987427

Browse files
authored
Merge pull request #8262 from osamahammad21/fix-coverity
ODB: fix coverity defects
2 parents 666be19 + 8515eae commit d987427

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

src/odb/include/odb/dbStream.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class dbIStream
390390
T2 val;
391391
*this >> key;
392392
*this >> val;
393-
m[key] = val;
393+
m[key] = std::move(val);
394394
}
395395
return *this;
396396
}
@@ -405,7 +405,7 @@ class dbIStream
405405
T2 val;
406406
*this >> key;
407407
*this >> val;
408-
m[key] = val;
408+
m[key] = std::move(val);
409409
}
410410
return *this;
411411
}
@@ -420,7 +420,7 @@ class dbIStream
420420
T2 val;
421421
*this >> key;
422422
*this >> val;
423-
m[key] = val;
423+
m[key] = std::move(val);
424424
}
425425
return *this;
426426
}
@@ -435,7 +435,7 @@ class dbIStream
435435
for (uint i = 0; i < sz; i++) {
436436
T1 val;
437437
*this >> val;
438-
m.push_back(val);
438+
m.push_back(std::move(val));
439439
}
440440
return *this;
441441
}
@@ -501,7 +501,7 @@ class dbIStream
501501
if (I == index) {
502502
std::variant_alternative_t<I, std::variant<Ts...>> val;
503503
*this >> val;
504-
v = val;
504+
v = std::move(val);
505505
}
506506
return (*this).variantHelper<I + 1>(index, v);
507507
}

src/odb/src/codeGenerator/schema/chip/dbChipConn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "dbObject",
44
"fields": [
55
{ "name": "name_", "type": "std::string", "flags": ["no-set"] },
6-
{ "name": "thickness_", "type": "int", "flags": [] },
6+
{ "name": "thickness_", "type": "int", "flags": [], "default": 0 },
77
{ "name": "chip_", "type": "dbId<_dbChip>", "flags": ["private"] },
88
{ "name": "chip_conn_next_", "type": "dbId<_dbChipConn>", "flags": ["private"] },
99
{ "name": "top_region_", "type": "dbId<_dbChipRegionInst>", "flags": ["private"] },

src/odb/src/codeGenerator/schema/chip/dbChipInst.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
{
1616
"name": "orient_",
1717
"type": "dbOrientType::Value",
18-
"flags": ["private" ,"cmpgt", "no-serial"]
18+
"flags": ["private" ,"cmpgt", "no-serial"],
19+
"default": "dbOrientType::R0"
1920
},
2021
{
2122
"name": "master_chip_",

src/odb/src/codeGenerator/schema/chip/dbChipRegion.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"fields": [
1313
{ "name": "name_", "type": "std::string", "flags": ["no-set"]},
14-
{ "name": "side_", "type": "uint8_t", "flags": ["private"] },
14+
{ "name": "side_", "type": "uint8_t", "flags": ["private"] , "default": "static_cast<uint8_t>(dbChipRegion::Side::FRONT)"},
1515
{ "name": "layer_", "type": "dbId<_dbTechLayer>", "flags": ["private"] },
1616
{ "name": "box_", "type": "Rect", "flags": ["set-const-ref"]}
1717
],

src/odb/src/db/dbChipConn.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ bool _dbChipConn::operator<(const _dbChipConn& rhs) const
4949

5050
_dbChipConn::_dbChipConn(_dbDatabase* db)
5151
{
52+
thickness_ = 0;
5253
}
5354

5455
dbIStream& operator>>(dbIStream& stream, _dbChipConn& obj)

src/odb/src/db/dbChipInst.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ bool _dbChipInst::operator<(const _dbChipInst& rhs) const
5858

5959
_dbChipInst::_dbChipInst(_dbDatabase* db)
6060
{
61+
orient_ = dbOrientType::R0;
6162
}
6263

6364
dbIStream& operator>>(dbIStream& stream, _dbChipInst& obj)

src/odb/src/db/dbChipRegion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ bool _dbChipRegion::operator<(const _dbChipRegion& rhs) const
5151

5252
_dbChipRegion::_dbChipRegion(_dbDatabase* db)
5353
{
54+
side_ = static_cast<uint8_t>(dbChipRegion::Side::FRONT);
5455
chip_bump_tbl_ = new dbTable<_dbChipBump>(
5556
db, this, (GetObjTbl_t) &_dbChipRegion::getObjectTable, dbChipBumpObj);
5657
}

0 commit comments

Comments
 (0)