Skip to content

Commit c42d358

Browse files
committed
Treat unreachable code correctly, fix fallthrough in switch
1 parent 3a0280e commit c42d358

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/ConnectionGraphicsObject.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
#include "ConnectionGraphicsObject.hpp"
22

3-
#include <QtWidgets/QGraphicsSceneMouseEvent>
4-
#include <QtWidgets/QGraphicsDropShadowEffect>
5-
#include <QtWidgets/QGraphicsBlurEffect>
6-
#include <QtWidgets/QStyleOptionGraphicsItem>
7-
#include <QtWidgets/QGraphicsView>
8-
9-
#include <QtCore/QDebug>
10-
113
#include "AbstractGraphModel.hpp"
124
#include "AbstractNodeGeometry.hpp"
135
#include "BasicGraphicsScene.hpp"
@@ -20,6 +12,16 @@
2012
#include "StyleCollection.hpp"
2113
#include "locateNode.hpp"
2214

15+
#include <QtWidgets/QGraphicsSceneMouseEvent>
16+
#include <QtWidgets/QGraphicsDropShadowEffect>
17+
#include <QtWidgets/QGraphicsBlurEffect>
18+
#include <QtWidgets/QStyleOptionGraphicsItem>
19+
#include <QtWidgets/QGraphicsView>
20+
21+
#include <QtCore/QDebug>
22+
23+
#include <stdexcept>
24+
2325

2426
namespace QtNodes
2527
{
@@ -376,6 +378,8 @@ pointsC1C2() const
376378
return pointsC1C2Vertical();
377379
break;
378380
}
381+
382+
throw std::logic_error("Unreachable code after switch statement");
379383
}
380384

381385

src/DefaultVerticalNodeGeometry.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ portCaptionsHeight(NodeId const nodeId,
360360
break;
361361
}
362362
}
363+
break;
363364
}
364365

365366
case PortType::Out:
@@ -377,6 +378,7 @@ portCaptionsHeight(NodeId const nodeId,
377378
break;
378379
}
379380
}
381+
break;
380382
}
381383

382384
default:

0 commit comments

Comments
 (0)