Cleanup: use bool for poll functions
This commit is contained in:
@@ -202,9 +202,9 @@ typedef struct bNodeType {
|
||||
void (*copyfunc_api)(struct PointerRNA *ptr, struct bNode *src_node);
|
||||
|
||||
/* can this node type be added to a node tree */
|
||||
int (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree);
|
||||
bool (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree);
|
||||
/* can this node be added to a node tree */
|
||||
int (*poll_instance)(struct bNode *node, struct bNodeTree *nodetree);
|
||||
bool (*poll_instance)(struct bNode *node, struct bNodeTree *nodetree);
|
||||
|
||||
/* optional handling of link insertion */
|
||||
void (*insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link);
|
||||
@@ -283,7 +283,7 @@ typedef struct bNodeTreeType {
|
||||
void (*free_node_cache)(struct bNodeTree *ntree, struct bNode *node);
|
||||
void (*foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func); /* iteration over all node classes */
|
||||
/* Check visibility in the node editor */
|
||||
int (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
|
||||
bool (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
|
||||
/* Select a node tree from the context */
|
||||
void (*get_from_context)(const struct bContext *C, struct bNodeTreeType *ntreetype,
|
||||
struct bNodeTree **r_ntree, struct ID **r_id, struct ID **r_from);
|
||||
@@ -296,7 +296,7 @@ typedef struct bNodeTreeType {
|
||||
/* Tree update. Overrides nodetype->updatetreefunc! */
|
||||
void (*update)(struct bNodeTree *ntree);
|
||||
|
||||
int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
|
||||
bool (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
|
||||
|
||||
void (*node_add_init)(struct bNodeTree *ntree, struct bNode *bnode);
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ typedef struct PanelType {
|
||||
int flag;
|
||||
|
||||
/* verify if the panel should draw or not */
|
||||
int (*poll)(const struct bContext *C, struct PanelType *pt);
|
||||
bool (*poll)(const struct bContext *C, struct PanelType *pt);
|
||||
/* draw header (optional) */
|
||||
void (*draw_header)(const struct bContext *C, struct Panel *pa);
|
||||
/* draw entirely, view changes should be handled here */
|
||||
@@ -256,7 +256,7 @@ typedef struct MenuType {
|
||||
const char *description;
|
||||
|
||||
/* verify if the menu should draw or not */
|
||||
int (*poll)(const struct bContext *C, struct MenuType *mt);
|
||||
bool (*poll)(const struct bContext *C, struct MenuType *mt);
|
||||
/* draw entirely, view changes should be handled here */
|
||||
void (*draw)(const struct bContext *C, struct Menu *menu);
|
||||
|
||||
|
||||
@@ -3232,13 +3232,13 @@ static void node_type_base_defaults(bNodeType *ntype)
|
||||
}
|
||||
|
||||
/* allow this node for any tree type */
|
||||
static int node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(ntree))
|
||||
static bool node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(ntree))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* use the basic poll function */
|
||||
static int node_poll_instance_default(bNode *node, bNodeTree *ntree)
|
||||
static bool node_poll_instance_default(bNode *node, bNodeTree *ntree)
|
||||
{
|
||||
return node->typeinfo->poll(node->typeinfo, ntree);
|
||||
}
|
||||
@@ -3431,7 +3431,7 @@ void node_type_compatibility(struct bNodeType *ntype, short compatibility)
|
||||
|
||||
/* callbacks for undefined types */
|
||||
|
||||
static int node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree))
|
||||
static bool node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree))
|
||||
{
|
||||
/* this type can not be added deliberately, it's just a placeholder */
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user