Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-06-02 16:14:54 +0300
committerBastien Montagne <bastien@blender.org>2020-06-02 16:18:14 +0300
commit21443056b71541528ac9b48c6041ecc62c98cc64 (patch)
tree96c9b345a9db247c810129f32127da611d57070f /source/blender/makesrna
parent43ec8c287f6ed1426466ed7b9545b1cc5b678383 (diff)
Turn most flags in BlenderDefRNA into proper bool.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/makesrna.c34
-rw-r--r--source/blender/makesrna/intern/rna_define.c176
-rw-r--r--source/blender/makesrna/intern/rna_internal.h7
3 files changed, 111 insertions, 106 deletions
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),
identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
#endif
@@ -1381,7 +1381,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
break;
default:
CLOG_ERROR(&LOG, "\"%s.%s\", invalid property type.", CONTAINER_RNA_ID(cont), identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return NULL;
}
@@ -1423,42 +1423,42 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_,
if (DefRNA.preprocess) {
switch (type) {
case PROP_BOOLEAN:
- DefRNA.silent = 1;
+ DefRNA.silent = true;
RNA_def_property_boolean_sdna(prop, NULL, identifier, 0);
- DefRNA.silent = 0;
+ DefRNA.silent = false;
break;
case PROP_INT: {
- DefRNA.silent = 1;
+ DefRNA.silent = true;
RNA_def_property_int_sdna(prop, NULL, identifier);
- DefRNA.silent = 0;
+ DefRNA.silent = false;
break;
}
case PROP_FLOAT: {
- DefRNA.silent = 1;
+ DefRNA.silent = true;
RNA_def_property_float_sdna(prop, NULL, identifier);
- DefRNA.silent = 0;
+ DefRNA.silent = false;
break;
}
case PROP_STRING: {
- DefRNA.silent = 1;
+ DefRNA.silent = true;
RNA_def_property_string_sdna(prop, NULL, identifier);
- DefRNA.silent = 0;
+ DefRNA.silent = false;
break;
}
case PROP_ENUM:
- DefRNA.silent = 1;
+ DefRNA.silent = true;
RNA_def_property_enum_sdna(prop, NULL, identifier);
- DefRNA.silent = 0;
+ DefRNA.silent = false;
break;
case PROP_POINTER:
- DefRNA.silent = 1;
+ DefRNA.silent = true;
RNA_def_property_pointer_sdna(prop, NULL, identifier);
- DefRNA.silent = 0;
+ DefRNA.silent = false;
break;
case PROP_COLLECTION:
- DefRNA.silent = 1;
+ DefRNA.silent = true;
RNA_def_property_collection_sdna(prop, NULL, identifier, NULL);
- DefRNA.silent = 0;
+ DefRNA.silent = false;
break;
}
}
@@ -1553,7 +1553,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
"\"%s.%s\", array length must be zero of greater.",
srna->identifier,
prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -1563,7 +1563,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
srna->identifier,
prop->identifier,
RNA_MAX_ARRAY_LENGTH);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -1573,7 +1573,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
srna->identifier,
prop->identifier,
prop->arraydimension);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -1590,7 +1590,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
"\"%s.%s\", only boolean/int/float can be array.",
srna->identifier,
prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1616,7 +1616,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le
srna->identifier,
prop->identifier,
RNA_MAX_ARRAY_DIMENSION);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -1630,7 +1630,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le
"\"%s.%s\", only boolean/int/float can be array.",
srna->identifier,
prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
@@ -1690,22 +1690,22 @@ void RNA_def_property_ui_range(
#ifndef NDEBUG
if (min > max) {
CLOG_ERROR(&LOG, "\"%s.%s\", min > max.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
if (step < 0 || step > 100) {
CLOG_ERROR(&LOG, "\"%s.%s\", step outside range.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
if (step == 0) {
CLOG_ERROR(&LOG, "\"%s.%s\", step is zero.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
if (precision < -1 || precision > UI_PRECISION_FLOAT_MAX) {
CLOG_ERROR(&LOG, "\"%s.%s\", precision outside range.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
#endif
@@ -1728,7 +1728,7 @@ void RNA_def_property_ui_range(
default:
CLOG_ERROR(
&LOG, "\"%s.%s\", invalid type for ui range.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1740,7 +1740,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
#ifdef DEBUG
if (min > max) {
CLOG_ERROR(&LOG, "\"%s.%s\", min > max.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
#endif
@@ -1763,7 +1763,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", invalid type for range.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1791,7 +1791,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
default:
CLOG_ERROR(
&LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1824,7 +1824,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
default:
CLOG_ERROR(
&LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1841,7 +1841,7 @@ void RNA_def_property_enum_native_type(PropertyRNA *prop, const char *native_enu
default:
CLOG_ERROR(
&LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1866,7 +1866,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
"\"%s.%s\", enum identifiers must not contain spaces.",
srna->identifier,
prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
else if (item[i].value == eprop->defaultvalue) {
@@ -1889,7 +1889,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
default:
CLOG_ERROR(
&LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1906,7 +1906,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1930,7 +1930,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1947,7 +1947,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const bool *array
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1969,7 +1969,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -1991,7 +1991,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -2013,7 +2013,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -2035,7 +2035,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -2053,7 +2053,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
"\"%s.%s\", NULL string passed (dont call in this case).",
srna->identifier,
prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
@@ -2062,7 +2062,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
"\"%s.%s\", empty string passed (dont call in this case).",
srna->identifier,
prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
// BLI_assert(0);
break;
}
@@ -2076,7 +2076,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -2106,7 +2106,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
srna->identifier,
prop->identifier,
eprop->defaultvalue & ~totflag);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
}
else {
@@ -2123,7 +2123,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
else {
CLOG_ERROR(
&LOG, "\"%s.%s\", default is not in items.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
}
}
@@ -2132,7 +2132,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not enum.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -2185,7 +2185,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop,
structname,
propname,
prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return NULL;
}
}
@@ -2229,13 +2229,13 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop,
if (prop->type != PROP_BOOLEAN) {
CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
if ((dp = rna_def_property_sdna(prop, structname, propname))) {
- if (DefRNA.silent == 0) {
+ if (!DefRNA.silent) {
/* error check to ensure floats are not wrapped as ints/bools */
if (dp->dnatype && *dp->dnatype && IS_DNATYPE_BOOLEAN_COMPAT(dp->dnatype) == 0) {
CLOG_ERROR(&LOG,
@@ -2244,7 +2244,7 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop,
prop->identifier,
dp->dnatype,
RNA_property_typename(prop->type));
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
}
@@ -2333,14 +2333,14 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
if (prop->type != PROP_INT) {
CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
if ((dp = rna_def_property_sdna(prop, structname, propname))) {
/* error check to ensure floats are not wrapped as ints/bools */
- if (DefRNA.silent == 0) {
+ if (!DefRNA.silent) {
if (dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
CLOG_ERROR(&LOG,
"%s.%s is a '%s' but wrapped as type '%s'.",
@@ -2348,7 +2348,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
prop->identifier,
dp->dnatype,
RNA_property_typename(prop->type));
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
}
@@ -2480,13 +2480,13 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
if (prop->type != PROP_FLOAT) {
CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
if ((dp = rna_def_property_sdna(prop, structname, propname))) {
/* silent is for internal use */
- if (DefRNA.silent == 0) {
+ if (!DefRNA.silent) {
if (dp->dnatype && *dp->dnatype && IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
/* Colors are an exception. these get translated. */
if (prop->subtype != PROP_COLOR_GAMMA) {
@@ -2496,7 +2496,7 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
prop->identifier,
dp->dnatype,
RNA_property_typename(prop->type));
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
}
@@ -2588,7 +2588,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
if (prop->type != PROP_ENUM) {
CLOG_ERROR(&LOG, "\"%s.%s\", type is not enum.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -2599,7 +2599,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
if (!DefRNA.silent) {
CLOG_ERROR(&LOG, "\"%s.%s\", array not supported for enum type.", structname, propname);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
}
@@ -2682,7 +2682,7 @@ void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, con
if (prop->type != PROP_STRING) {
CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -2726,7 +2726,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co
if (prop->type != PROP_POINTER) {
CLOG_ERROR(&LOG, "\"%s.%s\", type is not pointer.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -2737,7 +2737,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co
if (!DefRNA.silent) {
CLOG_ERROR(&LOG, "\"%s.%s\", array not supported for pointer type.", structname, propname);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
}
}
@@ -2759,7 +2759,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop,
if (prop->type != PROP_COLLECTION) {
CLOG_ERROR(&LOG, "\"%s.%s\", type is not collection.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -2770,7 +2770,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop,
if (!DefRNA.silent) {
CLOG_ERROR(&LOG, "\"%s.%s\", array of collections not supported.", structname, propname);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
}
@@ -2816,7 +2816,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop,
else {
if (!DefRNA.silent) {
CLOG_ERROR(&LOG, "\"%s.%s\" not found.", structname, lengthpropname);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
}
}
@@ -2914,7 +2914,7 @@ void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getleng
if (!(prop->flag & PROP_DYNAMIC)) {
CLOG_ERROR(&LOG, "property is a not dynamic array.");
- DefRNA.error = 1;
+ DefRNA.error = true;
return;
}
@@ -2956,7 +2956,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -3046,7 +3046,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop,
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -3144,7 +3144,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop,
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -3232,7 +3232,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop,
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not enum.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -3299,7 +3299,7 @@ void RNA_def_property_string_funcs(PropertyRNA *prop,
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -3361,7 +3361,7 @@ void RNA_def_property_pointer_funcs(
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not pointer.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -3415,7 +3415,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop,
}
default:
CLOG_ERROR(&LOG, "\"%s.%s\", type is not collection.", srna->identifier, prop->identifier);
- DefRNA.error = 1;
+ DefRNA.error = true;
break;
}
}
@@ -4180,7 +4180,7 @@ static FunctionRNA *rna_def_function(StructRNA *srna, const char *identifier)
if (rna_validate_identifier(identifier, error, false) == 0) {
CLOG_ERROR(&LOG, "function identifier \"%s\" - %s", identifier, error);
- DefRNA.error = 1;
+ DefRNA.error = true;
}
}
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index cb59eee6afa..f7d453cdc32 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -118,7 +118,12 @@ typedef struct BlenderDefRNA {
ListBase structs;
ListBase allocs;
struct StructRNA *laststruct;
- int error, silent, preprocess, verify, animate;
+ bool error;
+ bool silent;
+ bool preprocess;
+ bool verify;
+ bool animate;
+
/* Keep last. */
#ifndef RNA_RUNTIME
struct {