From d7a2e0b83cf3d32ad883a3ae26d09e3897cadfe6 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 25 Jan 2021 21:11:57 -0600 Subject: [PATCH] Cleanup: Use const arguments --- source/blender/blenkernel/BKE_node.h | 6 +++--- source/blender/blenkernel/intern/node.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 12266cd48d9..fb517b7c1d0 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -685,7 +685,7 @@ void nodeSetSocketAvailability(struct bNodeSocket *sock, bool is_available); int nodeSocketLinkLimit(const struct bNodeSocket *sock); /* Node Clipboard */ -void BKE_node_clipboard_init(struct bNodeTree *ntree); +void BKE_node_clipboard_init(const struct bNodeTree *ntree); void BKE_node_clipboard_clear(void); void BKE_node_clipboard_free(void); bool BKE_node_clipboard_validate(void); @@ -706,8 +706,8 @@ extern const bNodeInstanceKey NODE_INSTANCE_KEY_BASE; extern const bNodeInstanceKey NODE_INSTANCE_KEY_NONE; bNodeInstanceKey BKE_node_instance_key(bNodeInstanceKey parent_key, - struct bNodeTree *ntree, - struct bNode *node); + const struct bNodeTree *ntree, + const struct bNode *node); bNodeInstanceHash *BKE_node_instance_hash_new(const char *info); void BKE_node_instance_hash_free(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index f121f34d772..f4f0d991f06 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3574,7 +3574,7 @@ typedef struct bNodeClipboard { static bNodeClipboard node_clipboard = {{NULL}}; -void BKE_node_clipboard_init(struct bNodeTree *ntree) +void BKE_node_clipboard_init(const struct bNodeTree *ntree) { node_clipboard.type = ntree->type; } @@ -3718,11 +3718,11 @@ static bNodeInstanceKey node_hash_int_str(bNodeInstanceKey hash, const char *str return hash; } -bNodeInstanceKey BKE_node_instance_key(bNodeInstanceKey parent_key, bNodeTree *ntree, bNode *node) +bNodeInstanceKey BKE_node_instance_key(bNodeInstanceKey parent_key, + const bNodeTree *ntree, + const bNode *node) { - bNodeInstanceKey key; - - key = node_hash_int_str(parent_key, ntree->id.name + 2); + bNodeInstanceKey key = node_hash_int_str(parent_key, ntree->id.name + 2); if (node) { key = node_hash_int_str(key, node->name);