Skip to content

Commit 95274f1

Browse files
committed
Fixed various warnings.
1 parent a7b8299 commit 95274f1

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

VisualNode.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ bool Node::FromJson(Json::Value Json)
224224
Input[i] = nullptr;
225225
}
226226

227-
std::pair<int, int> SocketCountInClassDefinition = NODE_FACTORY.GetSocketCount(Type);
227+
std::pair<size_t, size_t> SocketCountInClassDefinition = NODE_FACTORY.GetSocketCount(Type);
228228
Input.resize(InputsList.size());
229229

230230
// Validate if the number of input sockets in the JSON data matches the current class definition.
@@ -306,6 +306,8 @@ bool Node::FromJson(Json::Value Json)
306306
Output[i] = new NodeSocket(this, Type, Name, true);
307307
Output[i]->ID = ID;
308308
}
309+
310+
return true;
309311
}
310312

311313
void Node::UpdateClientRegion()

VisualNodeFactory.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Node* NodeFactory::CopyNode(const std::string& Type, const Node& Node) const
4646
return CopyConstructorIterator->second(Node);
4747
}
4848

49-
std::pair<int, int> NodeFactory::GetSocketCount(std::string NodeClassName)
49+
std::pair<size_t, size_t> NodeFactory::GetSocketCount(std::string NodeClassName)
5050
{
5151
auto NodeClassNameToSocketCountIterator = NodeClassNameToSocketCount.find(NodeClassName);
5252
if (NodeClassNameToSocketCountIterator != NodeClassNameToSocketCount.end())
@@ -58,15 +58,15 @@ std::pair<int, int> NodeFactory::GetSocketCount(std::string NodeClassName)
5858
Node* TemporaryNode = CreateNode(NodeClassName);
5959
if (TemporaryNode != nullptr)
6060
{
61-
int InputCount = TemporaryNode->GetInputSocketCount();
62-
int OutputCount = TemporaryNode->GetOutputSocketCount();
63-
NodeClassNameToSocketCount[NodeClassName] = std::pair<int, int>(InputCount, OutputCount);
61+
size_t InputCount = TemporaryNode->GetInputSocketCount();
62+
size_t OutputCount = TemporaryNode->GetOutputSocketCount();
63+
NodeClassNameToSocketCount[NodeClassName] = std::pair<size_t, size_t>(InputCount, OutputCount);
6464
delete TemporaryNode;
65-
return std::pair<int, int>(InputCount, OutputCount);
65+
return std::pair<size_t, size_t>(InputCount, OutputCount);
6666
}
6767
else
6868
{
69-
return std::pair<int, int>(0, 0);
69+
return std::pair<size_t, size_t>(0, 0);
7070
}
7171
}
7272
}

VisualNodeFactory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ namespace VisNodeSys
1313
std::unordered_map<std::string, std::function<Node* ()>> Constructors;
1414
std::unordered_map<std::string, std::function<Node* (const Node&)>> CopyConstructors;
1515

16-
std::unordered_map<std::string, std::pair<int, int>> NodeClassNameToSocketCount;
16+
std::unordered_map<std::string, std::pair<size_t, size_t>> NodeClassNameToSocketCount;
1717
// Retrieves the expected number of input and output sockets for a given node type,
1818
// as defined by its current C++ class implementation.
1919
// It is used to validate loaded node data (e.g., from a JSON file)
2020
// If a node class's socket structure(number of inputs / outputs) has changed since a file was saved,
2121
// loading that file could lead to inconsistencies or crashes.
2222
// TO-DO: Implement a more robust NodeClass integrity check. With socket type validation and more.
23-
std::pair<int, int> GetSocketCount(std::string NodeClassName);
23+
std::pair<size_t, size_t> GetSocketCount(std::string NodeClassName);
2424
public:
2525
SINGLETON_PUBLIC_PART(NodeFactory)
2626

0 commit comments

Comments
 (0)