Skip to content

Commit b332a64

Browse files
committed
solve existing warnings in msvc build process
1 parent c52d977 commit b332a64

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ target_compile_definitions(QtNodes
165165
QT_NO_KEYWORDS
166166
)
167167

168+
if(MSVC)
169+
string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
170+
endif()
168171

169172
target_compile_options(QtNodes
170173
PRIVATE

src/AbstractGraphModel.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ void AbstractGraphModel::portsAboutToBeDeleted(NodeId const nodeId,
4040
// Erases the information about the port on one side;
4141
auto c = makeIncompleteConnectionId(connectionId, portType);
4242

43-
c = makeCompleteConnectionId(c, nodeId, portIndex - nRemovedPorts);
43+
c = makeCompleteConnectionId(c,
44+
nodeId,
45+
portIndex - static_cast<QtNodes::PortIndex>(nRemovedPorts));
4446

4547
_shiftedByDynamicPortsConnections.push_back(c);
4648

@@ -84,7 +86,9 @@ void AbstractGraphModel::portsAboutToBeInserted(NodeId const nodeId,
8486
// Erases the information about the port on one side;
8587
auto c = makeIncompleteConnectionId(connectionId, portType);
8688

87-
c = makeCompleteConnectionId(c, nodeId, portIndex + nNewPorts);
89+
c = makeCompleteConnectionId(c,
90+
nodeId,
91+
portIndex + static_cast<QtNodes::PortIndex>(nNewPorts));
8892

8993
_shiftedByDynamicPortsConnections.push_back(c);
9094

0 commit comments

Comments
 (0)