[Bf-blender-cvs] [21443056b71] master: Turn most flags in BlenderDefRNA into proper bool.

Bastien Montagne noreply at git.blender.org
Tue Jun 2 15:25:47 CEST 2020


Commit: 21443056b71541528ac9b48c6041ecc62c98cc64
Author: Bastien Montagne
Date:   Tue Jun 2 15:14:54 2020 +0200
Branches: master
https://developer.blender.org/rB21443056b71541528ac9b48c6041ecc62c98cc64

Turn most flags in BlenderDefRNA into proper bool.

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

M	source/blender/makesrna/intern/makesrna.c
M	source/blender/makesrna/intern/rna_define.c
M	source/blender/makesrna/intern/rna_internal.h

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

diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 9153130546e..2960cea7f53 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -637,7 +637,7 @@ static char *rna_def_property_get_func(
   if (!manualfunc) {
     if (!dp->dnastructname || !dp->dnaname) {
       CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier);
-      DefRNA.error = 1;
+      DefRNA.error = true;
       return NULL;
     }
 
@@ -654,7 +654,7 @@ static char *rna_def_property_get_func(
                        prop->identifier,
                        dp->dnatype,
                        RNA_property_typename(prop->type));
-            DefRNA.error = 1;
+            DefRNA.error = true;
             return NULL;
           }
         }
@@ -667,7 +667,7 @@ static char *rna_def_property_get_func(
                      prop->identifier,
                      dp->dnatype,
                      RNA_property_typename(prop->type));
-          DefRNA.error = 1;
+          DefRNA.error = true;
           return NULL;
         }
       }
@@ -679,7 +679,7 @@ static char *rna_def_property_get_func(
                      prop->identifier,
                      dp->dnatype,
                      RNA_property_typename(prop->type));
-          DefRNA.error = 1;
+          DefRNA.error = true;
           return NULL;
         }
       }
@@ -1020,7 +1020,7 @@ static char *rna_def_property_set_func(
     if (!dp->dnastructname || !dp->dnaname) {
       if (prop->flag & PROP_EDITABLE) {
         CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier);
-        DefRNA.error = 1;
+        DefRNA.error = true;
       }
       return NULL;
     }
@@ -1263,7 +1263,7 @@ static char *rna_def_property_length_func(
     if (!manualfunc) {
       if (!dp->dnastructname || !dp->dnaname) {
         CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier);
-        DefRNA.error = 1;
+        DefRNA.error = true;
         return NULL;
       }
     }
@@ -1289,7 +1289,7 @@ static char *rna_def_property_length_func(
       if (prop->type == PROP_COLLECTION &&
           (!(dp->dnalengthname || dp->dnalengthfixed) || !dp->dnaname)) {
         CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier);
-        DefRNA.error = 1;
+        DefRNA.error = true;
         return NULL;
       }
     }
@@ -1338,7 +1338,7 @@ static char *rna_def_property_begin_func(
   if (!manualfunc) {
     if (!dp->dnastructname || !dp->dnaname) {
       CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier);
-      DefRNA.error = 1;
+      DefRNA.error = true;
       return NULL;
     }
   }
@@ -1848,7 +1848,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
       if (!pprop->type) {
         CLOG_ERROR(
             &LOG, "%s.%s, pointer must have a struct type.", srna->identifier, prop->identifier);
-        DefRNA.error = 1;
+        DefRNA.error = true;
       }
       break;
     }
@@ -1896,21 +1896,21 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
                      "%s.%s, collection must have a begin function.",
                      srna->identifier,
                      prop->identifier);
-          DefRNA.error = 1;
+          DefRNA.error = true;
         }
         if (!cprop->next) {
           CLOG_ERROR(&LOG,
                      "%s.%s, collection must have a next function.",
                      srna->identifier,
                      prop->identifier);
-          DefRNA.error = 1;
+          DefRNA.error = true;
         }
         if (!cprop->get) {
           CLOG_ERROR(&LOG,
                      "%s.%s, collection must have a get function.",
                      srna->identifier,
                      prop->identifier);
-          DefRNA.error = 1;
+          DefRNA.error = true;
         }
       }
       if (!cprop->item_type) {
@@ -1918,7 +1918,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
                    "%s.%s, collection must have a struct type.",
                    srna->identifier,
                    prop->identifier);
-        DefRNA.error = 1;
+        DefRNA.error = true;
       }
       break;
     }
@@ -3656,7 +3656,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        errnest,
                        prop->identifier,
                        eprop->defaultvalue & ~totflag);
-            DefRNA.error = 1;
+            DefRNA.error = true;
           }
         }
         else {
@@ -3666,7 +3666,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                        srna->identifier,
                        errnest,
                        prop->identifier);
-            DefRNA.error = 1;
+            DefRNA.error = true;
           }
         }
       }
@@ -3676,7 +3676,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                    srna->identifier,
                    errnest,
                    prop->identifier);
-        DefRNA.error = 1;
+        DefRNA.error = true;
       }
       break;
     }
@@ -4218,7 +4218,7 @@ static void rna_generate_struct(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE
   if (srna->reg && !srna->refine) {
     CLOG_ERROR(
         &LOG, "%s has a register function, must also have refine function.", srna->identifier);
-    DefRNA.error = 1;
+    DefRNA.error = true;
   }
 
   func = srna->functions.first;
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 0b074678ba6..9bcc8cc63b5 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -701,13 +701,13 @@ BlenderRNA *RNA_create(void)
   BLI_listbase_clear(&DefRNA.structs);
   brna->structs_map = BLI_ghash_str_new_ex(__func__, 2048);
 
-  DefRNA.error = 0;
-  DefRNA.preprocess = 1;
+  DefRNA.error = false;
+  DefRNA.preprocess = true;
 
   DefRNA.sdna = DNA_sdna_from_data(DNAstr, DNAlen, false, false, &error_message);
   if (DefRNA.sdna == NULL) {
     CLOG_ERROR(&LOG, "Failed to decode SDNA: %s.", error_message);
-    DefRNA.error = 1;
+    DefRNA.error = true;
   }
 
   /* We need both alias and static (on-disk) DNA names. */
@@ -747,7 +747,7 @@ void RNA_define_free(BlenderRNA *UNUSED(brna))
     DefRNA.sdna = NULL;
   }
 
-  DefRNA.error = 0;
+  DefRNA.error = false;
 }
 
 void RNA_define_verify_sdna(bool verify)
@@ -920,7 +920,7 @@ StructRNA *RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRN
 
     if (rna_validate_identifier(identifier, error, false) == 0) {
       CLOG_ERROR(&LOG, "struct identifier \"%s\" error - %s", identifier, error);
-      DefRNA.error = 1;
+      DefRNA.error = true;
     }
   }
 
@@ -1050,7 +1050,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
     srnafrom = BLI_ghash_lookup(brna->structs_map, from);
     if (!srnafrom) {
       CLOG_ERROR(&LOG, "struct %s not found to define %s.", from, identifier);
-      DefRNA.error = 1;
+      DefRNA.error = true;
     }
   }
 
@@ -1075,7 +1075,7 @@ void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
   if (DNA_struct_find_nr_wrapper(DefRNA.sdna, structname) == -1) {
     if (!DefRNA.silent) {
       CLOG_ERROR(&LOG, "%s not found.", structname);
-      DefRNA.error = 1;
+      DefRNA.error = true;
     }
     return;
   }
@@ -1103,7 +1103,7 @@ void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const cha
   if (DNA_struct_find_nr_wrapper(DefRNA.sdna, structname) == -1) {
     if (!DefRNA.silent) {
       CLOG_ERROR(&LOG, "%s not found.", structname);
-      DefRNA.error = 1;
+      DefRNA.error = true;
     }
     return;
   }
@@ -1116,7 +1116,7 @@ void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *pr
 {
   if (prop->type != PROP_STRING) {
     CLOG_ERROR(&LOG, "\"%s.%s\", must be a string property.", srna->identifier, prop->identifier);
-    DefRNA.error = 1;
+    DefRNA.error = true;
   }
   else {
     srna->nameproperty = prop;
@@ -1131,7 +1131,7 @@ void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *struct
   srnafrom = BLI_ghash_lookup(brna->structs_map, structname);
   if (!srnafrom) {
     CLOG_ERROR(&LOG, "struct %s not found for %s.", structname, srna->identifier);
-    DefRNA.error = 1;
+    DefRNA.error = true;
   }
 
   srna->nested = srnafrom;
@@ -1281,7 +1281,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
     if (rna_validate_identifier(identifier, error, true) == 0) {
       CLOG_ERROR(
           &LOG, "property identifier \"%s.%s\" - %s", CONTAINER_RNA_ID(cont), identifier, error);
-      DefRNA.error = 1;
+      DefRNA.error = true;
     }
 
     dcont = rna_find_container_def(cont);
@@ -1289,7 +1289,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
     /* XXX - toto, detect supertype collisions */
     if (rna_findlink(&dcont->properties, identifier)) {
       CLOG_ERROR(&LOG, "duplicate identifier \"%s.%s\"", CONTAINER_RNA_ID(cont), identifier);
-      DefRNA.error = 1;
+      DefRNA.error = true;
     }
 
     dprop = MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA");
@@ -1304,7 +1304,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
                  CONTAINER_RNA_ID(cont),
                  identifier,
                  error);
-      DefRNA.error = 1;
+      DefRNA.error = true;
     }
 #endif
   }
@@ -1319,7 +1319,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
                      "subtype does not apply to 'PROP_BOOLEAN' \"%s.%s\"",
                      CONTAINER_RNA_ID(cont),
                      identifier);
-          DefRNA.error = 1;
+          DefRNA.error = true;
         }
       }
       break;
@@ -1332,7 +1332,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
                    "subtype does not apply to 'PROP_INT' \"%s.%s\"",
                    CONTAINER_RNA_ID(cont),
             

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list