Skip to content

Commit 07f7d55

Browse files
committed
fix bugprone-switch-missing-default-case (except def parsing)
Signed-off-by: Matt Liberty <[email protected]>
1 parent 0a278ca commit 07f7d55

File tree

8 files changed

+10
-8
lines changed

8 files changed

+10
-8
lines changed

src/drt/src/dr/FlexDR_init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ frLayerNum FlexDRWorker::initTrackCoords_getNonPref(frLayerNum lNum)
15851585
const auto lDir = getTech()->getLayer(lNum)->getDir();
15861586
auto lDir2 = dbTechLayerDir::NONE;
15871587

1588-
switch (lDir) {
1588+
switch (lDir.getValue()) {
15891589
case dbTechLayerDir::HORIZONTAL:
15901590
lDir2 = dbTechLayerDir::VERTICAL;
15911591
break;

src/drt/src/dr/FlexGridGraph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ class FlexGridGraph
836836
if (x2 < x1 || y2 < y1) {
837837
return;
838838
}
839-
switch (getZDir(z)) {
839+
switch (getZDir(z).getValue()) {
840840
case odb::dbTechLayerDir::HORIZONTAL:
841841
for (int i = y1; i <= y2; i++) {
842842
auto idx1 = getIdx(x1, i, z);
@@ -861,7 +861,7 @@ class FlexGridGraph
861861
if (x2 < x1 || y2 < y1) {
862862
return;
863863
}
864-
switch (getZDir(z)) {
864+
switch (getZDir(z).getValue()) {
865865
case odb::dbTechLayerDir::HORIZONTAL:
866866
for (int i = y1; i <= y2; i++) {
867867
auto idx1 = getIdx(x1, i, z);

src/drt/test/fixture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ frViaDef* Fixture::makeViaDef(const char* name,
754754
case 1:
755755
via_p->addLayer2Fig(std::move(pinFig));
756756
break;
757+
default:
758+
logger->error(DRT, 624, "Unexpected layer diff {}", l - layer_num);
757759
}
758760
}
759761

src/gui/src/dbDescriptors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5493,7 +5493,7 @@ void DbBoxDescriptor::populateProperties(odb::dbBox* box, Properties& props)
54935493
{
54945494
auto* gui = Gui::get();
54955495

5496-
switch (box->getOwnerType()) {
5496+
switch (box->getOwnerType().getValue()) {
54975497
case odb::dbBoxOwner::BLOCK:
54985498
props.push_back(
54995499
{"Owner", gui->makeSelected((odb::dbBlock*) box->getBoxOwner())});

src/gui/src/layoutViewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ LayoutViewer::getRowRects(odb::dbBlock* block, const odb::Rect& bounds)
14761476
bool w_visible = w >= min_resolution_site;
14771477
bool h_visible = h >= min_resolution_row;
14781478

1479-
switch (row->getOrient()) {
1479+
switch (row->getOrient().getValue()) {
14801480
case dbOrientType::R0:
14811481
case dbOrientType::R180:
14821482
case dbOrientType::MY:

src/gui/src/mainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ std::string MainWindow::addToolbarButton(const std::string& name,
951951

952952
void MainWindow::removeToolbarButton(const std::string& name)
953953
{
954-
if (!buttons_.contains(name)b) {
954+
if (!buttons_.contains(name)) {
955955
return;
956956
}
957957

src/mpl/src/graphics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ void Graphics::drawObjects(gui::Painter& painter)
467467
bbox.yCenter(),
468468
gui::Painter::kCenter,
469469
std::to_string(i++));
470-
switch (macro.getOrientation()) {
470+
switch (macro.getOrientation().getValue()) {
471471
case odb::dbOrientType::R0: {
472472
painter.drawLine(bbox.xMin(),
473473
bbox.yMin() + 0.1 * height,

src/pdn/src/via.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Enclosure::Enclosure(odb::dbTechLayerCutEnclosureRule* rule,
5151
swap(layer);
5252
break;
5353
case odb::dbTechLayerCutEnclosureRule::EOL:
54-
switch (direction) {
54+
switch (direction.getValue()) {
5555
case odb::dbTechLayerDir::HORIZONTAL:
5656
x_ = rule->getFirstOverhang();
5757
y_ = rule->getSecondOverhang();

0 commit comments

Comments
 (0)