Skip to content

Commit

Permalink
Treat unreachable code correctly, fix fallthrough in switch
Browse files Browse the repository at this point in the history
  • Loading branch information
paceholder committed Dec 25, 2022
1 parent 3a0280e commit c42d358
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/ConnectionGraphicsObject.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#include "ConnectionGraphicsObject.hpp"

#include <QtWidgets/QGraphicsSceneMouseEvent>
#include <QtWidgets/QGraphicsDropShadowEffect>
#include <QtWidgets/QGraphicsBlurEffect>
#include <QtWidgets/QStyleOptionGraphicsItem>
#include <QtWidgets/QGraphicsView>

#include <QtCore/QDebug>

#include "AbstractGraphModel.hpp"
#include "AbstractNodeGeometry.hpp"
#include "BasicGraphicsScene.hpp"
Expand All @@ -20,6 +12,16 @@
#include "StyleCollection.hpp"
#include "locateNode.hpp"

#include <QtWidgets/QGraphicsSceneMouseEvent>
#include <QtWidgets/QGraphicsDropShadowEffect>
#include <QtWidgets/QGraphicsBlurEffect>
#include <QtWidgets/QStyleOptionGraphicsItem>
#include <QtWidgets/QGraphicsView>

#include <QtCore/QDebug>

#include <stdexcept>


namespace QtNodes
{
Expand Down Expand Up @@ -376,6 +378,8 @@ pointsC1C2() const
return pointsC1C2Vertical();
break;
}

throw std::logic_error("Unreachable code after switch statement");
}


Expand Down
2 changes: 2 additions & 0 deletions src/DefaultVerticalNodeGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ portCaptionsHeight(NodeId const nodeId,
break;
}
}
break;
}

case PortType::Out:
Expand All @@ -377,6 +378,7 @@ portCaptionsHeight(NodeId const nodeId,
break;
}
}
break;
}

default:
Expand Down

0 comments on commit c42d358

Please sign in to comment.