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:
authorCampbell Barton <ideasman42@gmail.com>2019-06-03 17:10:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-06-03 17:10:44 +0300
commit7b28a31f2c3a6bd28b465f6a48d9ee064ecb5176 (patch)
treea20a7e1c1559a9524a63fcfd07f0afcf8a056483 /source/blender/makesrna/intern/makesrna.c
parentd5f6e573ed43521e497c83eff02f828aea1a35c9 (diff)
Cleanup: style, use braces in makesrna
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c57
1 files changed, 38 insertions, 19 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 7eee3661074..3b9fa40fcae 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1459,7 +1459,7 @@ static char *rna_def_property_lookup_int_func(FILE *f,
item_type = (cprop->item_type) ? (const char *)cprop->item_type : "UnknownType";
if (dp->dnalengthname || dp->dnalengthfixed) {
- if (dp->dnalengthname)
+ if (dp->dnalengthname) {
fprintf(f,
"\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), data->%s, "
"index);\n",
@@ -1467,7 +1467,8 @@ static char *rna_def_property_lookup_int_func(FILE *f,
dp->dnaname,
dp->dnaname,
dp->dnalengthname);
- else
+ }
+ else {
fprintf(
f,
"\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), %d, index);\n",
@@ -1475,18 +1476,21 @@ static char *rna_def_property_lookup_int_func(FILE *f,
dp->dnaname,
dp->dnaname,
dp->dnalengthfixed);
+ }
}
else {
- if (dp->dnapointerlevel == 0)
+ if (dp->dnapointerlevel == 0) {
fprintf(f,
"\n return rna_listbase_lookup_int(ptr, &RNA_%s, &data->%s, index);\n",
item_type,
dp->dnaname);
- else
+ }
+ else {
fprintf(f,
"\n return rna_listbase_lookup_int(ptr, &RNA_%s, data->%s, index);\n",
item_type,
dp->dnaname);
+ }
}
#endif
@@ -2040,12 +2044,15 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
/* disabled for now to avoid msvc compiler error due to large file size */
#if 0
- if (prop->name && prop->description && prop->description[0] != '\0')
+ if (prop->name && prop->description && prop->description[0] != '\0') {
fprintf(f, "\t/* %s: %s */\n", prop->name, prop->description);
- else if (prop->name)
+ }
+ else if (prop->name) {
fprintf(f, "\t/* %s */\n", prop->name);
- else
+ }
+ else {
fprintf(f, "\t/* */\n");
+ }
#endif
switch (prop->type) {
@@ -2234,11 +2241,13 @@ static void rna_def_struct_function_prototype_cpp(FILE *f,
fprintf(f, "\tinline %s %s(", retval_type, rna_safe_id(func->identifier));
}
- if (func->flag & FUNC_USE_MAIN)
+ if (func->flag & FUNC_USE_MAIN) {
WRITE_PARAM("void *main");
+ }
- if (func->flag & FUNC_USE_CONTEXT)
+ if (func->flag & FUNC_USE_CONTEXT) {
WRITE_PARAM("Context C");
+ }
for (dp = dfunc->cont.properties.first; dp; dp = dp->next) {
int type, flag, flag_parameter, pout;
@@ -2416,7 +2425,7 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
#if 0
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop;
- if (cprop->type)
+ if (cprop->type) {
fprintf(f,
"\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)",
(const char *)cprop->type,
@@ -2425,7 +2434,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
(cprop->length ? "true" : "false"),
(cprop->lookupint ? "true" : "false"),
(cprop->lookupstring ? "true" : "false"));
- else
+ }
+ else {
fprintf(f,
"\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)",
"UnknownType",
@@ -2434,6 +2444,7 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
(cprop->length ? "true" : "false"),
(cprop->lookupint ? "true" : "false"),
(cprop->lookupstring ? "true" : "false"));
+ }
#endif
break;
}
@@ -2458,8 +2469,9 @@ static void rna_def_struct_function_call_impl_cpp(FILE *f, StructRNA *srna, Func
dsrna = rna_find_struct_def(srna);
- if (func->flag & FUNC_USE_SELF_ID)
+ if (func->flag & FUNC_USE_SELF_ID) {
WRITE_PARAM("(::ID *) ptr.id.data");
+ }
if ((func->flag & FUNC_NO_SELF) == 0) {
WRITE_COMMA;
@@ -2478,14 +2490,17 @@ static void rna_def_struct_function_call_impl_cpp(FILE *f, StructRNA *srna, Func
fprintf(f, "this->ptr.type");
}
- if (func->flag & FUNC_USE_MAIN)
+ if (func->flag & FUNC_USE_MAIN) {
WRITE_PARAM("(::Main *) main");
+ }
- if (func->flag & FUNC_USE_CONTEXT)
+ if (func->flag & FUNC_USE_CONTEXT) {
WRITE_PARAM("(::bContext *) C.ptr.data");
+ }
- if (func->flag & FUNC_USE_REPORTS)
+ if (func->flag & FUNC_USE_REPORTS) {
WRITE_PARAM("NULL");
+ }
dp = dfunc->cont.properties.first;
for (; dp; dp = dp->next) {
@@ -2630,8 +2645,9 @@ static void rna_def_function_wrapper_funcs(FILE *f, StructDefRNA *dsrna, Functio
first = 1;
- if (func->flag & FUNC_USE_SELF_ID)
+ if (func->flag & FUNC_USE_SELF_ID) {
WRITE_PARAM("_selfid");
+ }
if ((func->flag & FUNC_NO_SELF) == 0) {
WRITE_PARAM("_self");
@@ -2640,14 +2656,17 @@ static void rna_def_function_wrapper_funcs(FILE *f, StructDefRNA *dsrna, Functio
WRITE_PARAM("_type");
}
- if (func->flag & FUNC_USE_MAIN)
+ if (func->flag & FUNC_USE_MAIN) {
WRITE_PARAM("bmain");
+ }
- if (func->flag & FUNC_USE_CONTEXT)
+ if (func->flag & FUNC_USE_CONTEXT) {
WRITE_PARAM("C");
+ }
- if (func->flag & FUNC_USE_REPORTS)
+ if (func->flag & FUNC_USE_REPORTS) {
WRITE_PARAM("reports");
+ }
dparm = dfunc->cont.properties.first;
for (; dparm; dparm = dparm->next) {