Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-07-20 13:16:20 +0300
committerJacques Lucke <jacques@blender.org>2020-07-20 13:16:20 +0300
commit8cbbdedaf4dfec9e320e7e2be58b75d256950df1 (patch)
tree496b9620e11ac44e515b0bb4ca52c05834d557f9 /source/blender/nodes/NOD_node_tree_ref.hh
parent686ab4c9401a90b22fb17e46c992eb513fe4f693 (diff)
Refactor: Update integer type usage
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
Diffstat (limited to 'source/blender/nodes/NOD_node_tree_ref.hh')
-rw-r--r--source/blender/nodes/NOD_node_tree_ref.hh26
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/nodes/NOD_node_tree_ref.hh b/source/blender/nodes/NOD_node_tree_ref.hh
index 907184125b8..ebf5709ef50 100644
--- a/source/blender/nodes/NOD_node_tree_ref.hh
+++ b/source/blender/nodes/NOD_node_tree_ref.hh
@@ -71,8 +71,8 @@ class SocketRef : NonCopyable, NonMovable {
NodeRef *node_;
bNodeSocket *bsocket_;
bool is_input_;
- uint id_;
- uint index_;
+ int id_;
+ int index_;
PointerRNA rna_;
Vector<SocketRef *> linked_sockets_;
Vector<SocketRef *> directly_linked_sockets_;
@@ -87,8 +87,8 @@ class SocketRef : NonCopyable, NonMovable {
const NodeRef &node() const;
const NodeTreeRef &tree() const;
- uint id() const;
- uint index() const;
+ int id() const;
+ int index() const;
bool is_input() const;
bool is_output() const;
@@ -124,7 +124,7 @@ class NodeRef : NonCopyable, NonMovable {
NodeTreeRef *tree_;
bNode *bnode_;
PointerRNA rna_;
- uint id_;
+ int id_;
Vector<InputSocketRef *> inputs_;
Vector<OutputSocketRef *> outputs_;
@@ -136,8 +136,8 @@ class NodeRef : NonCopyable, NonMovable {
Span<const InputSocketRef *> inputs() const;
Span<const OutputSocketRef *> outputs() const;
- const InputSocketRef &input(uint index) const;
- const OutputSocketRef &output(uint index) const;
+ const InputSocketRef &input(int index) const;
+ const OutputSocketRef &output(int index) const;
bNode *bnode() const;
bNodeTree *btree() const;
@@ -146,7 +146,7 @@ class NodeRef : NonCopyable, NonMovable {
StringRefNull idname() const;
StringRefNull name() const;
- uint id() const;
+ int id() const;
bool is_reroute_node() const;
bool is_group_node() const;
@@ -220,12 +220,12 @@ inline const NodeTreeRef &SocketRef::tree() const
return node_->tree();
}
-inline uint SocketRef::id() const
+inline int SocketRef::id() const
{
return id_;
}
-inline uint SocketRef::index() const
+inline int SocketRef::index() const
{
return index_;
}
@@ -334,12 +334,12 @@ inline Span<const OutputSocketRef *> NodeRef::outputs() const
return outputs_;
}
-inline const InputSocketRef &NodeRef::input(uint index) const
+inline const InputSocketRef &NodeRef::input(int index) const
{
return *inputs_[index];
}
-inline const OutputSocketRef &NodeRef::output(uint index) const
+inline const OutputSocketRef &NodeRef::output(int index) const
{
return *outputs_[index];
}
@@ -369,7 +369,7 @@ inline StringRefNull NodeRef::name() const
return bnode_->name;
}
-inline uint NodeRef::id() const
+inline int NodeRef::id() const
{
return id_;
}