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:
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 0c1701f6089..9058f715d87 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -221,11 +221,11 @@ static int replace_if_different(const char *tmpfile, const char *dep_files[])
static const char *rna_safe_id(const char *id)
{
- if (strcmp(id, "default") == 0)
+ if (STREQ(id, "default"))
return "default_value";
- else if (strcmp(id, "operator") == 0)
+ else if (STREQ(id, "operator"))
return "operator_value";
- else if (strcmp(id, "new") == 0)
+ else if (STREQ(id, "new"))
return "create";
return id;
@@ -246,11 +246,11 @@ static int cmp_property(const void *a, const void *b)
const PropertyRNA *propa = *(const PropertyRNA **)a;
const PropertyRNA *propb = *(const PropertyRNA **)b;
- if (strcmp(propa->identifier, "rna_type") == 0) return -1;
- else if (strcmp(propb->identifier, "rna_type") == 0) return 1;
+ if (STREQ(propa->identifier, "rna_type")) return -1;
+ else if (STREQ(propb->identifier, "rna_type")) return 1;
- if (strcmp(propa->identifier, "name") == 0) return -1;
- else if (strcmp(propb->identifier, "name") == 0) return 1;
+ if (STREQ(propa->identifier, "name")) return -1;
+ else if (STREQ(propb->identifier, "name")) return 1;
return strcmp(propa->name, propb->name);
}
@@ -372,7 +372,7 @@ static StructRNA *rna_find_struct(const char *identifier)
StructDefRNA *ds;
for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
- if (strcmp(ds->srna->identifier, identifier) == 0)
+ if (STREQ(ds->srna->identifier, identifier))
return ds->srna;
return NULL;
@@ -383,7 +383,7 @@ static const char *rna_find_type(const char *type)
StructDefRNA *ds;
for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
- if (ds->dnaname && strcmp(ds->dnaname, type) == 0)
+ if (ds->dnaname && STREQ(ds->dnaname, type))
return ds->srna->identifier;
return NULL;
@@ -394,7 +394,7 @@ static const char *rna_find_dna_type(const char *type)
StructDefRNA *ds;
for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
- if (strcmp(ds->srna->identifier, type) == 0)
+ if (STREQ(ds->srna->identifier, type))
return ds->dnaname;
return NULL;
@@ -621,9 +621,9 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, "static PointerRNA %s(CollectionPropertyIterator *iter)\n", func);
fprintf(f, "{\n");
if (manualfunc) {
- if (strcmp(manualfunc, "rna_iterator_listbase_get") == 0 ||
- strcmp(manualfunc, "rna_iterator_array_get") == 0 ||
- strcmp(manualfunc, "rna_iterator_array_dereference_get") == 0)
+ if (STREQ(manualfunc, "rna_iterator_listbase_get") ||
+ STREQ(manualfunc, "rna_iterator_array_get") ||
+ STREQ(manualfunc, "rna_iterator_array_dereference_get"))
{
fprintf(f, " return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n",
(cprop->item_type) ? (const char *)cprop->item_type : "UnknownType", manualfunc);
@@ -1168,8 +1168,8 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
return NULL;
/* only supported in case of standard next functions */
- if (strcmp(nextfunc, "rna_iterator_array_next") == 0) {}
- else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) {}
+ if (STREQ(nextfunc, "rna_iterator_array_next")) {}
+ else if (STREQ(nextfunc, "rna_iterator_listbase_next")) {}
else return NULL;
}
@@ -1190,7 +1190,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
fprintf(f, " %s_%s_begin(&iter, ptr);\n\n", srna->identifier, rna_safe_id(prop->identifier));
fprintf(f, " if (iter.valid) {\n");
- if (strcmp(nextfunc, "rna_iterator_array_next") == 0) {
+ if (STREQ(nextfunc, "rna_iterator_array_next")) {
fprintf(f, " ArrayIterator *internal = &iter.internal.array;\n");
fprintf(f, " if (index < 0 || index >= internal->length) {\n");
fprintf(f, "#ifdef __GNUC__\n");
@@ -1210,7 +1210,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
fprintf(f, " found = 1;\n");
fprintf(f, " }\n");
}
- else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) {
+ else if (STREQ(nextfunc, "rna_iterator_listbase_next")) {
fprintf(f, " ListBaseIterator *internal = &iter.internal.listbase;\n");
fprintf(f, " if (internal->skip) {\n");
fprintf(f, " while (index-- > 0 && iter.valid) {\n");
@@ -1396,23 +1396,23 @@ static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop)
if (!dp->dnatype || !dp->dnaname || !dp->dnastructname)
return;
- if (strcmp(dp->dnatype, "char") == 0) {
+ if (STREQ(dp->dnatype, "char")) {
prop->rawtype = PROP_RAW_CHAR;
prop->flag |= PROP_RAW_ACCESS;
}
- else if (strcmp(dp->dnatype, "short") == 0) {
+ else if (STREQ(dp->dnatype, "short")) {
prop->rawtype = PROP_RAW_SHORT;
prop->flag |= PROP_RAW_ACCESS;
}
- else if (strcmp(dp->dnatype, "int") == 0) {
+ else if (STREQ(dp->dnatype, "int")) {
prop->rawtype = PROP_RAW_INT;
prop->flag |= PROP_RAW_ACCESS;
}
- else if (strcmp(dp->dnatype, "float") == 0) {
+ else if (STREQ(dp->dnatype, "float")) {
prop->rawtype = PROP_RAW_FLOAT;
prop->flag |= PROP_RAW_ACCESS;
}
- else if (strcmp(dp->dnatype, "double") == 0) {
+ else if (STREQ(dp->dnatype, "double")) {
prop->rawtype = PROP_RAW_DOUBLE;
prop->flag |= PROP_RAW_ACCESS;
}
@@ -1525,7 +1525,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
const char *nextfunc = (const char *)cprop->next;
const char *item_type = (const char *)cprop->item_type;
- if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) {
+ if (dp->dnatype && STREQ(dp->dnatype, "ListBase")) {
/* pass */
}
else if (dp->dnalengthname || dp->dnalengthfixed) {
@@ -1535,8 +1535,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
/* test if we can allow raw array access, if it is using our standard
* array get/next function, we can be sure it is an actual array */
if (cprop->next && cprop->get)
- if (strcmp((const char *)cprop->next, "rna_iterator_array_next") == 0 &&
- strcmp((const char *)cprop->get, "rna_iterator_array_get") == 0)
+ if (STREQ((const char *)cprop->next, "rna_iterator_array_next") &&
+ STREQ((const char *)cprop->get, "rna_iterator_array_get"))
{
prop->flag |= PROP_RAW_ARRAY;
}
@@ -2419,11 +2419,11 @@ static void rna_auto_types(void)
for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
/* DNA name for Screen is patched in 2.5, we do the reverse here .. */
- if (ds->dnaname && strcmp(ds->dnaname, "Screen") == 0)
+ if (ds->dnaname && STREQ(ds->dnaname, "Screen"))
ds->dnaname = "bScreen";
for (dp = ds->cont.properties.first; dp; dp = dp->next) {
- if (dp->dnastructname && strcmp(dp->dnastructname, "Screen") == 0)
+ if (dp->dnastructname && STREQ(dp->dnastructname, "Screen"))
dp->dnastructname = "bScreen";
if (dp->dnatype) {
@@ -2443,7 +2443,7 @@ static void rna_auto_types(void)
else if (dp->prop->type == PROP_COLLECTION) {
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop;
- if (!cprop->item_type && !cprop->get && strcmp(dp->dnatype, "ListBase") == 0)
+ if (!cprop->item_type && !cprop->get && STREQ(dp->dnatype, "ListBase"))
cprop->item_type = (StructRNA *)rna_find_type(dp->dnatype);
}
}
@@ -2786,7 +2786,7 @@ static void rna_generate_struct_prototypes(FILE *f)
const char *struct_name = rna_parameter_type_name(dp->prop);
for (a = 0; a < all_structures; a++) {
- if (strcmp(struct_name, structures[a]) == 0) {
+ if (STREQ(struct_name, structures[a])) {
found = 1;
break;
}
@@ -3326,10 +3326,10 @@ static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_test.c", NULL, RNA_def_test},
{"rna_text.c", "rna_text_api.c", RNA_def_text},
{"rna_timeline.c", NULL, RNA_def_timeline_marker},
- {"rna_sound.c", NULL, RNA_def_sound},
+ {"rna_sound.c", "rna_sound_api.c", RNA_def_sound},
{"rna_ui.c", "rna_ui_api.c", RNA_def_ui},
{"rna_userdef.c", NULL, RNA_def_userdef},
- {"rna_vfont.c", NULL, RNA_def_vfont},
+ {"rna_vfont.c", "rna_vfont_api.c", RNA_def_vfont},
{"rna_wm.c", "rna_wm_api.c", RNA_def_wm},
{"rna_world.c", NULL, RNA_def_world},
{"rna_movieclip.c", NULL, RNA_def_movieclip},
@@ -3418,7 +3418,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
if (!filename || ds->filename == filename)
rna_generate_struct(brna, ds->srna, f);
- if (strcmp(filename, "rna_ID.c") == 0) {
+ if (STREQ(filename, "rna_ID.c")) {
/* this is ugly, but we cannot have c files compiled for both
* makesrna and blender with some build systems at the moment */
fprintf(f, "#include \"rna_define.c\"\n\n");
@@ -3780,7 +3780,7 @@ static int rna_is_collection_functions_struct(const char **collection_structs, c
int a = 0, found = 0;
while (collection_structs[a]) {
- if (!strcmp(collection_structs[a], struct_name)) {
+ if (STREQ(collection_structs[a], struct_name)) {
found = 1;
break;
}
@@ -3881,7 +3881,7 @@ static void rna_generate_header_cpp(BlenderRNA *UNUSED(brna), FILE *f)
for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
srna = ds->srna;
- if (!strcmp(srna->identifier, first_collection_func_struct)) {
+ if (STREQ(srna->identifier, first_collection_func_struct)) {
StructDefRNA *ds2;
StructRNA *srna2;