[Bf-blender-cvs] [d070d33aa3b] blender-v2.90-release: Cleanup: Use proper bool type and literals for operators poll functions.

Bastien Montagne noreply at git.blender.org
Wed Aug 12 11:12:52 CEST 2020


Commit: d070d33aa3bf0cdc3f6656e46476b75b367cd482
Author: Bastien Montagne
Date:   Wed Aug 12 10:53:35 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rBd070d33aa3bf0cdc3f6656e46476b75b367cd482

Cleanup: Use proper bool type and literals for operators poll functions.

===================================================================

M	source/blender/editors/object/object_gpencil_modifier.c
M	source/blender/editors/object/object_shader_fx.c

===================================================================

diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c
index ab1de9e20ec..cfa55c68a56 100644
--- a/source/blender/editors/object/object_gpencil_modifier.c
+++ b/source/blender/editors/object/object_gpencil_modifier.c
@@ -412,30 +412,30 @@ void OBJECT_OT_gpencil_modifier_add(wmOperatorType *ot)
 
 /********** generic functions for operators using mod names and data context *********************/
 
-static int gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag)
+static bool gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag)
 {
   PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type);
   Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C);
   GpencilModifierData *mod = ptr.data; /* May be NULL. */
 
   if (!ob || ID_IS_LINKED(ob)) {
-    return 0;
+    return false;
   }
   if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) {
-    return 0;
+    return false;
   }
   if (ptr.owner_id && ID_IS_LINKED(ptr.owner_id)) {
-    return 0;
+    return false;
   }
 
   if (ID_IS_OVERRIDE_LIBRARY(ob)) {
     if ((mod == NULL) || (mod->flag & eGpencilModifierFlag_OverrideLibrary_Local) == 0) {
       CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers coming from library override");
-      return 0;
+      return false;
     }
   }
 
-  return 1;
+  return true;
 }
 
 static bool gpencil_edit_modifier_poll(bContext *C)
diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c
index 9cfba767dad..e2a30c4ce98 100644
--- a/source/blender/editors/object/object_shader_fx.c
+++ b/source/blender/editors/object/object_shader_fx.c
@@ -335,23 +335,23 @@ static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obt
   ShaderFxData *fx = ptr.data; /* May be NULL. */
 
   if (!ob || ID_IS_LINKED(ob)) {
-    return 0;
+    return false;
   }
   if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) {
-    return 0;
+    return false;
   }
   if (ptr.owner_id && ID_IS_LINKED(ptr.owner_id)) {
-    return 0;
+    return false;
   }
 
   if (ID_IS_OVERRIDE_LIBRARY(ob)) {
     if ((fx == NULL) || (fx->flag & eShaderFxFlag_OverrideLibrary_Local) == 0) {
       CTX_wm_operator_poll_msg_set(C, "Cannot edit shaderfxs coming from library override");
-      return 0;
+      return false;
     }
   }
 
-  return 1;
+  return true;
 }
 
 static bool edit_shaderfx_poll(bContext *C)



More information about the Bf-blender-cvs mailing list