Cleanup: Use const arguments for node group poll function
Also make the disabled hint argument optional.
This commit is contained in:
parent
f42569bb71
commit
3676d6b88d
|
@ -960,8 +960,8 @@ void nodeLabel(const struct bNodeTree *ntree, const struct bNode *node, char *la
|
|||
*/
|
||||
const char *nodeSocketLabel(const struct bNodeSocket *sock);
|
||||
|
||||
bool nodeGroupPoll(struct bNodeTree *nodetree,
|
||||
struct bNodeTree *grouptree,
|
||||
bool nodeGroupPoll(const struct bNodeTree *nodetree,
|
||||
const struct bNodeTree *grouptree,
|
||||
const char **r_disabled_hint);
|
||||
|
||||
/**
|
||||
|
|
|
@ -82,7 +82,9 @@ bool node_group_poll_instance(bNode *node, bNodeTree *nodetree, const char **dis
|
|||
return false;
|
||||
}
|
||||
|
||||
bool nodeGroupPoll(bNodeTree *nodetree, bNodeTree *grouptree, const char **r_disabled_hint)
|
||||
bool nodeGroupPoll(const bNodeTree *nodetree,
|
||||
const bNodeTree *grouptree,
|
||||
const char **r_disabled_hint)
|
||||
{
|
||||
bool valid = true;
|
||||
|
||||
|
@ -94,13 +96,16 @@ bool nodeGroupPoll(bNodeTree *nodetree, bNodeTree *grouptree, const char **r_dis
|
|||
}
|
||||
|
||||
if (nodetree == grouptree) {
|
||||
*r_disabled_hint = TIP_("Nesting a node group inside of itself is not allowed");
|
||||
if (r_disabled_hint) {
|
||||
*r_disabled_hint = TIP_("Nesting a node group inside of itself is not allowed");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
LISTBASE_FOREACH (bNode *, node, &grouptree->nodes) {
|
||||
LISTBASE_FOREACH (const bNode *, node, &grouptree->nodes) {
|
||||
if (node->typeinfo->poll_instance &&
|
||||
!node->typeinfo->poll_instance(node, nodetree, r_disabled_hint)) {
|
||||
!node->typeinfo->poll_instance(
|
||||
const_cast<bNode *>(node), const_cast<bNodeTree *>(nodetree), r_disabled_hint)) {
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue