Code cleanup in rna files (huge, higly automated with py script).
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 5 Mar 2012 23:30:41 +0000 (23:30 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 5 Mar 2012 23:30:41 +0000 (23:30 +0000)
Addresses:
* C++ comments.
* Spaces after if/for/while/switch statements.
* Spaces around assignment operators.

82 files changed:
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_actuator_api.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_animation_api.c
source/blender/makesrna/intern/rna_animviz.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_armature_api.c
source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_camera.c
source/blender/makesrna/intern/rna_camera_api.c
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_controller.c
source/blender/makesrna/intern/rna_controller_api.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_dynamicpaint.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_fcurve_api.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_gpencil.c
source/blender/makesrna/intern/rna_group.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_lamp.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_material_api.c
source/blender/makesrna/intern/rna_mesh_api.c
source/blender/makesrna/intern/rna_mesh_utils.h
source/blender/makesrna/intern/rna_meta.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_movieclip.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_packedfile.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_pose_api.c
source/blender/makesrna/intern/rna_property.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_sensor.c
source/blender/makesrna/intern/rna_sensor_api.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_sequencer_api.c
source/blender/makesrna/intern/rna_smoke.c
source/blender/makesrna/intern/rna_sound.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_speaker.c
source/blender/makesrna/intern/rna_test.c
source/blender/makesrna/intern/rna_text.c
source/blender/makesrna/intern/rna_text_api.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_texture_api.c
source/blender/makesrna/intern/rna_timeline.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_vfont.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/makesrna/intern/rna_world.c

index f6bf7b6..5e2669d 100644 (file)
 static int file_older(const char *file1, const char *file2)
 {
        struct stat st1, st2;
-       // printf("compare: %s %s\n", file1, file2);
+       /* printf("compare: %s %s\n", file1, file2); */
 
-       if(stat(file1, &st1)) return 0;
-       if(stat(file2, &st2)) return 0;
+       if (stat(file1, &st1)) return 0;
+       if (stat(file2, &st2)) return 0;
 
        return (st1.st_mtime < st2.st_mtime);
 }
-static const char *makesrna_path= NULL;
+static const char *makesrna_path = NULL;
 
 static int replace_if_different(char *tmpfile, const char *dep_files[])
 {
-       // return 0; // use for testing had edited rna
+       /* return 0;  *//* use for testing had edited rna */
 
 #define REN_IF_DIFF                                                           \
        {                                                                         \
-               FILE *file_test= fopen(orgfile, "rb");                                \
-               if(file_test) {                                                       \
+               FILE *file_test = fopen(orgfile, "rb");                                \
+               if (file_test) {                                                       \
                        fclose(file_test);                                                \
-                       if(fp_org) fclose(fp_org);                                        \
-                       if(fp_new) fclose(fp_new);                                        \
-                       if(remove(orgfile) != 0) {                                        \
+                       if (fp_org) fclose(fp_org);                                        \
+                       if (fp_new) fclose(fp_new);                                        \
+                       if (remove(orgfile) != 0) {                                        \
                                fprintf(stderr, "%s:%d, Remove Error (%s): \"%s\"\n",         \
                                        __FILE__, __LINE__, strerror(errno), orgfile);        \
                                return -1;                                                    \
                        }                                                                 \
                }                                                                     \
        }                                                                         \
-       if(rename(tmpfile, orgfile) != 0) {                                       \
+       if (rename(tmpfile, orgfile) != 0) {                                       \
                fprintf(stderr, "%s:%d, Rename Error (%s): \"%s\" -> \"%s\"\n",       \
                        __FILE__, __LINE__, strerror(errno), tmpfile, orgfile);       \
                return -1;                                                            \
@@ -100,7 +100,7 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
 /* end REN_IF_DIFF */
 
 
-       FILE *fp_new= NULL, *fp_org= NULL;
+       FILE *fp_new = NULL, *fp_org = NULL;
        int len_new, len_org;
        char *arr_new, *arr_org;
        int cmp;
@@ -110,9 +110,9 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
        strcpy(orgfile, tmpfile);
        orgfile[strlen(orgfile) - strlen(TMP_EXT)] = '\0'; /* strip '.tmp' */
 
-       fp_org= fopen(orgfile, "rb");
+       fp_org = fopen(orgfile, "rb");
 
-       if(fp_org==NULL) {
+       if (fp_org == NULL) {
                REN_IF_DIFF;
        }
 
@@ -120,30 +120,30 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
        /* XXX, trick to work around dependency problem
         * assumes dep_files is in the same dir as makesrna.c, which is true for now. */
 
-       if(1) {
+       if (1) {
                /* first check if makesrna.c is newer then generated files
                 * for development on makesrna.c you may want to disable this */
-               if(file_older(orgfile, __FILE__)) {
+               if (file_older(orgfile, __FILE__)) {
                        REN_IF_DIFF;
                }
 
-               if(file_older(orgfile, makesrna_path)) {
+               if (file_older(orgfile, makesrna_path)) {
                        REN_IF_DIFF;
                }
 
                /* now check if any files we depend on are newer then any generated files */
-               if(dep_files) {
+               if (dep_files) {
                        int pass;
-                       for(pass=0; dep_files[pass]; pass++) {
-                               char from_path[4096]= __FILE__;
+                       for (pass = 0; dep_files[pass]; pass++) {
+                               char from_path[4096] = __FILE__;
                                char *p1, *p2;
 
                                /* dir only */
-                               p1= strrchr(from_path, '/');
-                               p2= strrchr(from_path, '\\');
+                               p1 = strrchr(from_path, '/');
+                               p2 = strrchr(from_path, '\\');
                                strcpy((p1 > p2 ? p1 : p2)+1, dep_files[pass]);
                                /* account for build deps, if makesrna.c (this file) is newer */
-                               if(file_older(orgfile, from_path)) {
+                               if (file_older(orgfile, from_path)) {
                                        REN_IF_DIFF;
                                }
                        }
@@ -152,9 +152,9 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
        /* XXX end dep trick */
 
 
-       fp_new= fopen(tmpfile, "rb");
+       fp_new = fopen(tmpfile, "rb");
 
-       if(fp_new==NULL) {
+       if (fp_new == NULL) {
                /* shouldn't happen, just to be safe */
                fprintf(stderr, "%s:%d, open error: \"%s\"\n", __FILE__, __LINE__, tmpfile);
                fclose(fp_org);
@@ -165,30 +165,30 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
        fseek(fp_org, 0L, SEEK_END); len_org = ftell(fp_org); fseek(fp_org, 0L, SEEK_SET);
 
 
-       if(len_new != len_org) {
+       if (len_new != len_org) {
                fclose(fp_new);
                fclose(fp_org);
                REN_IF_DIFF;
        }
 
        /* now compare the files... */
-       arr_new= MEM_mallocN(sizeof(char)*len_new, "rna_cmp_file_new");
-       arr_org= MEM_mallocN(sizeof(char)*len_org, "rna_cmp_file_org");
+       arr_new = MEM_mallocN(sizeof(char)*len_new, "rna_cmp_file_new");
+       arr_org = MEM_mallocN(sizeof(char)*len_org, "rna_cmp_file_org");
 
-       if(fread(arr_new, sizeof(char), len_new, fp_new) != len_new)
+       if (fread(arr_new, sizeof(char), len_new, fp_new) != len_new)
                fprintf(stderr, "%s:%d, error reading file %s for comparison.\n", __FILE__, __LINE__, tmpfile);
-       if(fread(arr_org, sizeof(char), len_org, fp_org) != len_org)
+       if (fread(arr_org, sizeof(char), len_org, fp_org) != len_org)
                fprintf(stderr, "%s:%d, error reading file %s for comparison.\n", __FILE__, __LINE__, orgfile);
 
        fclose(fp_new);
        fclose(fp_org);
 
-       cmp= memcmp(arr_new, arr_org, len_new);
+       cmp = memcmp(arr_new, arr_org, len_new);
 
        MEM_freeN(arr_new);
        MEM_freeN(arr_org);
 
-       if(cmp) {
+       if (cmp) {
                REN_IF_DIFF;
        }
        else {
@@ -203,9 +203,9 @@ static int replace_if_different(char *tmpfile, const char *dep_files[])
 
 static const char *rna_safe_id(const char *id)
 {
-       if(strcmp(id, "default") == 0)
+       if (strcmp(id, "default") == 0)
                return "default_value";
-       else if(strcmp(id, "operator") == 0)
+       else if (strcmp(id, "operator") == 0)
                return "operator_value";
 
        return id;
@@ -215,38 +215,38 @@ static const char *rna_safe_id(const char *id)
 
 static int cmp_struct(const void *a, const void *b)
 {
-       const StructRNA *structa= *(const StructRNA**)a;
-       const StructRNA *structb= *(const StructRNA**)b;
+       const StructRNA *structa = *(const StructRNA**)a;
+       const StructRNA *structb = *(const StructRNA**)b;
 
        return strcmp(structa->identifier, structb->identifier);
 }
 
 static int cmp_property(const void *a, const void *b)
 {
-       const PropertyRNA *propa= *(const PropertyRNA**)a;
-       const PropertyRNA *propb= *(const PropertyRNA**)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 (strcmp(propa->identifier, "rna_type") == 0) return -1;
+       else if (strcmp(propb->identifier, "rna_type") == 0) return 1;
 
-       if(strcmp(propa->identifier, "name") == 0) return -1;
-       else if(strcmp(propb->identifier, "name") == 0) return 1;
+       if (strcmp(propa->identifier, "name") == 0) return -1;
+       else if (strcmp(propb->identifier, "name") == 0) return 1;
 
        return strcmp(propa->name, propb->name);
 }
 
 static int cmp_def_struct(const void *a, const void *b)
 {
-       const StructDefRNA *dsa= *(const StructDefRNA**)a;
-       const StructDefRNA *dsb= *(const StructDefRNA**)b;
+       const StructDefRNA *dsa = *(const StructDefRNA**)a;
+       const StructDefRNA *dsb = *(const StructDefRNA**)b;
 
        return cmp_struct(&dsa->srna, &dsb->srna);
 }
 
 static int cmp_def_property(const void *a, const void *b)
 {
-       const PropertyDefRNA *dpa= *(const PropertyDefRNA**)a;
-       const PropertyDefRNA *dpb= *(const PropertyDefRNA**)b;
+       const PropertyDefRNA *dpa = *(const PropertyDefRNA**)a;
+       const PropertyDefRNA *dpb = *(const PropertyDefRNA**)b;
 
        return cmp_property(&dpa->prop, &dpb->prop);
 }
@@ -257,22 +257,22 @@ static void rna_sortlist(ListBase *listbase, int(*cmp)(const void*, const void*)
        void **array;
        int a, size;
        
-       if(listbase->first == listbase->last)
+       if (listbase->first == listbase->last)
                return;
 
-       for(size=0, link=listbase->first; link; link=link->next)
+       for (size = 0, link = listbase->first; link; link = link->next)
                size++;
 
-       array= MEM_mallocN(sizeof(void*)*size, "rna_sortlist");
-       for(a=0, link=listbase->first; link; link=link->next, a++)
-               array[a]= link;
+       array = MEM_mallocN(sizeof(void*)*size, "rna_sortlist");
+       for (a = 0, link = listbase->first; link; link = link->next, a++)
+               array[a] = link;
 
        qsort(array, size, sizeof(void*), cmp);
 
-       listbase->first= listbase->last= NULL;
-       for(a=0; a<size; a++) {
-               link= array[a];
-               link->next= link->prev= NULL;
+       listbase->first = listbase->last = NULL;
+       for (a = 0; a<size; a++) {
+               link = array[a];
+               link->next = link->prev = NULL;
                rna_addtail(listbase, link);
        }
 
@@ -286,18 +286,18 @@ static void rna_print_c_string(FILE *f, const char *str)
        static const char *escape[] = {"\''", "\"\"", "\??", "\\\\","\aa", "\bb", "\ff", "\nn", "\rr", "\tt", "\vv", NULL};
        int i, j;
 
-       if(!str) {
+       if (!str) {
                fprintf(f, "NULL");
                return;
        }
 
        fprintf(f, "\"");
-       for(i=0; str[i]; i++) {
-               for(j=0; escape[j]; j++)
-                       if(str[i] == escape[j][0])
+       for (i = 0; str[i]; i++) {
+               for (j = 0; escape[j]; j++)
+                       if (str[i] == escape[j][0])
                                break;
 
-               if(escape[j]) fprintf(f, "\\%c", escape[j][1]);
+               if (escape[j]) fprintf(f, "\\%c", escape[j][1]);
                else fprintf(f, "%c", str[i]);
        }
        fprintf(f, "\"");
@@ -305,7 +305,7 @@ static void rna_print_c_string(FILE *f, const char *str)
 
 static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
 {
-       if(dp->dnastructfromname && dp->dnastructfromprop)
+       if (dp->dnastructfromname && dp->dnastructfromprop)
                fprintf(f, "    %s *data= (%s*)(((%s*)ptr->data)->%s);\n", dp->dnastructname, dp->dnastructname, dp->dnastructfromname, dp->dnastructfromprop);
        else
                fprintf(f, "    %s *data= (%s*)(ptr->data);\n", dp->dnastructname, dp->dnastructname);
@@ -323,11 +323,11 @@ static char *rna_alloc_function_name(const char *structname, const char *propnam
        char *result;
 
        snprintf(buffer, sizeof(buffer), "%s_%s_%s", structname, propname, type);
-       result= MEM_callocN(sizeof(char)*strlen(buffer)+1, "rna_alloc_function_name");
+       result = MEM_callocN(sizeof(char)*strlen(buffer)+1, "rna_alloc_function_name");
        strcpy(result, buffer);
 
-       alloc= MEM_callocN(sizeof(AllocDefRNA), "AllocDefRNA");
-       alloc->mem= result;
+       alloc = MEM_callocN(sizeof(AllocDefRNA), "AllocDefRNA");
+       alloc->mem = result;
        rna_addtail(&DefRNA.allocs, alloc);
 
        return result;
@@ -337,8 +337,8 @@ 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)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+               if (strcmp(ds->srna->identifier, identifier) == 0)
                        return ds->srna;
 
        return NULL;
@@ -348,8 +348,8 @@ 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)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+               if (ds->dnaname && strcmp(ds->dnaname, type) == 0)
                        return ds->srna->identifier;
 
        return NULL;
@@ -359,8 +359,8 @@ 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)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+               if (strcmp(ds->srna->identifier, type) == 0)
                        return ds->dnaname;
 
        return NULL;
@@ -368,7 +368,7 @@ static const char *rna_find_dna_type(const char *type)
 
 static const char *rna_type_type_name(PropertyRNA *prop)
 {
-       switch(prop->type) {
+       switch (prop->type) {
                case PROP_BOOLEAN:
                case PROP_INT:
                case PROP_ENUM:
@@ -376,7 +376,7 @@ static const char *rna_type_type_name(PropertyRNA *prop)
                case PROP_FLOAT:
                        return "float";
                case PROP_STRING:
-                       if(prop->flag & PROP_THICK_WRAP) {
+                       if (prop->flag & PROP_THICK_WRAP) {
                                return "char*";
                        }
                        else {
@@ -391,9 +391,9 @@ static const char *rna_type_type(PropertyRNA *prop)
 {
        const char *type;
 
-       type= rna_type_type_name(prop);
+       type = rna_type_type_name(prop);
 
-       if(type)
+       if (type)
                return type;
 
        return "PointerRNA";
@@ -403,9 +403,9 @@ static const char *rna_type_struct(PropertyRNA *prop)
 {
        const char *type;
 
-       type= rna_type_type_name(prop);
+       type = rna_type_type_name(prop);
 
-       if(type)
+       if (type)
                return "";
 
        return "struct ";
@@ -415,16 +415,16 @@ static const char *rna_parameter_type_name(PropertyRNA *parm)
 {
        const char *type;
 
-       type= rna_type_type_name(parm);
+       type = rna_type_type_name(parm);
 
-       if(type)
+       if (type)
                return type;
 
-       switch(parm->type) {
+       switch (parm->type) {
                case PROP_POINTER:  {
-                       PointerPropertyRNA *pparm= (PointerPropertyRNA*)parm;
+                       PointerPropertyRNA *pparm = (PointerPropertyRNA*)parm;
 
-                       if(parm->flag & PROP_RNAPTR)
+                       if (parm->flag & PROP_RNAPTR)
                                return "PointerRNA";
                        else
                                return rna_find_dna_type((const char *)pparm->type);
@@ -439,12 +439,12 @@ static const char *rna_parameter_type_name(PropertyRNA *parm)
 
 static int rna_enum_bitmask(PropertyRNA *prop)
 {
-       EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
-       int a, mask= 0;
+       EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+       int a, mask = 0;
 
-       if(eprop->item) {
-               for(a=0; a<eprop->totitem; a++)
-                       if(eprop->item[a].identifier[0])
+       if (eprop->item) {
+               for (a = 0; a<eprop->totitem; a++)
+                       if (eprop->item[a].identifier[0])
                                mask |= eprop->item[a].value;
        }
        
@@ -454,7 +454,7 @@ static int rna_enum_bitmask(PropertyRNA *prop)
 static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp)
 {
        return ( (prop->type == PROP_FLOAT) &&
-                (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA) &&
+                (prop->subtype == PROP_COLOR || prop->subtype == PROP_COLOR_GAMMA) &&
                 (IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) );
 }
 
@@ -465,16 +465,16 @@ static const char *rna_function_string(void *func)
 
 static void rna_float_print(FILE *f, float num)
 {
-       if(num == -FLT_MAX) fprintf(f, "-FLT_MAX");
-       else if(num == FLT_MAX) fprintf(f, "FLT_MAX");
-       else if((int)num == num) fprintf(f, "%.1ff", num);
+       if (num == -FLT_MAX) fprintf(f, "-FLT_MAX");
+       else if (num == FLT_MAX) fprintf(f, "FLT_MAX");
+       else if ((int)num == num) fprintf(f, "%.1ff", num);
        else fprintf(f, "%.10ff", num);
 }
 
 static void rna_int_print(FILE *f, int num)
 {
-       if(num == INT_MIN) fprintf(f, "INT_MIN");
-       else if(num == INT_MAX) fprintf(f, "INT_MAX");
+       if (num == INT_MIN) fprintf(f, "INT_MIN");
+       else if (num == INT_MAX) fprintf(f, "INT_MAX");
        else fprintf(f, "%d", num);
 }
 
@@ -482,35 +482,35 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
 {
        char *func;
 
-       if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+       if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
                return NULL;
 
-       if(!manualfunc) {
-               if(!dp->dnastructname || !dp->dnaname) {
+       if (!manualfunc) {
+               if (!dp->dnastructname || !dp->dnaname) {
                        fprintf(stderr, "%s (0): %s.%s has no valid dna info.\n",
                                __func__, srna->identifier, prop->identifier);
-                       DefRNA.error= 1;
+                       DefRNA.error = 1;
                        return NULL;
                }
 
                /* typecheck,  */
-               if(dp->dnatype && *dp->dnatype) {
+               if (dp->dnatype && *dp->dnatype) {
 
-                       if(prop->type == PROP_FLOAT) {
-                               if(IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
-                                       if(prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
+                       if (prop->type == PROP_FLOAT) {
+                               if (IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
+                                       if (prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
                                                fprintf(stderr, "%s (1): %s.%s is a '%s' but wrapped as type '%s'.\n",
                                                        __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
-                                               DefRNA.error= 1;
+                                               DefRNA.error = 1;
                                                return NULL;
                                        }
                                }
                        }
-                       else if(prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) {
-                               if(IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
+                       else if (prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) {
+                               if (IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
                                        fprintf(stderr, "%s (2): %s.%s is a '%s' but wrapped as type '%s'.\n",
                                                __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
-                                       DefRNA.error= 1;
+                                       DefRNA.error = 1;
                                        return NULL;
                                }
                        }
@@ -518,26 +518,26 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
 
        }
 
-       func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
+       func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
 
-       switch(prop->type) {
+       switch (prop->type) {
                case PROP_STRING: {
-                       StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+                       StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
                        fprintf(f, "void %s(PointerRNA *ptr, char *value)\n", func);
                        fprintf(f, "{\n");
-                       if(manualfunc) {
+                       if (manualfunc) {
                                fprintf(f, "    %s(ptr, value);\n", manualfunc);
                        }
                        else {
-                               const PropertySubType subtype= prop->subtype;
-                               const char *string_copy_func= (subtype==PROP_FILEPATH ||
-                                                              subtype==PROP_DIRPATH  ||
-                                                              subtype==PROP_FILENAME ||
-                                                              subtype==PROP_BYTESTRING) ?
+                               const PropertySubType subtype = prop->subtype;
+                               const char *string_copy_func = (subtype == PROP_FILEPATH ||
+                                                              subtype == PROP_DIRPATH  ||
+                                                              subtype == PROP_FILENAME ||
+                                                              subtype == PROP_BYTESTRING) ?
                                            "BLI_strncpy" : "BLI_strncpy_utf8";
 
                                rna_print_data_get(f, dp);
-                               if(sprop->maxlength)
+                               if (sprop->maxlength)
                                        fprintf(f, "    %s(value, data->%s, %d);\n", string_copy_func, dp->dnaname, sprop->maxlength);
                                else
                                        fprintf(f, "    %s(value, data->%s, sizeof(data->%s));\n", string_copy_func, dp->dnaname, dp->dnaname);
@@ -548,13 +548,13 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                case PROP_POINTER: {
                        fprintf(f, "PointerRNA %s(PointerRNA *ptr)\n", func);
                        fprintf(f, "{\n");
-                       if(manualfunc) {
+                       if (manualfunc) {
                                fprintf(f, "    return %s(ptr);\n", manualfunc);
                        }
                        else {
-                               PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+                               PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
                                rna_print_data_get(f, dp);
-                               if(dp->dnapointerlevel == 0)
+                               if (dp->dnapointerlevel == 0)
                                        fprintf(f, "    return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (const char*)pprop->type, dp->dnaname);
                                else
                                        fprintf(f, "    return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", (const char*)pprop->type, dp->dnaname);
@@ -563,12 +563,12 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                        break;
                }
                case PROP_COLLECTION: {
-                       CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+                       CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
 
                        fprintf(f, "static PointerRNA %s(CollectionPropertyIterator *iter)\n", func);
                        fprintf(f, "{\n");
-                       if(manualfunc) {
-                               if(strcmp(manualfunc, "rna_iterator_listbase_get") == 0 ||
+                       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)
                                        fprintf(f, "    return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", (cprop->item_type)? (const char*)cprop->item_type: "UnknownType", manualfunc);
@@ -579,21 +579,21 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                        break;
                }
                default:
-                       if(prop->arraydimension) {
-                               if(prop->flag & PROP_DYNAMIC)
+                       if (prop->arraydimension) {
+                               if (prop->flag & PROP_DYNAMIC)
                                        fprintf(f, "void %s(PointerRNA *ptr, %s values[])\n", func, rna_type_type(prop));
                                else
                                        fprintf(f, "void %s(PointerRNA *ptr, %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
                                fprintf(f, "{\n");
 
-                               if(manualfunc) {
+                               if (manualfunc) {
                                        fprintf(f, "    %s(ptr, values);\n", manualfunc);
                                }
                                else {
                                        rna_print_data_get(f, dp);
 
-                                       if(prop->flag & PROP_DYNAMIC) {
-                                               char *lenfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get_length");
+                                       if (prop->flag & PROP_DYNAMIC) {
+                                               char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get_length");
                                                fprintf(f, "    int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
                                                fprintf(f, "    int len= %s(ptr, arraylen);\n\n", lenfunc);
                                                fprintf(f, "    for(i=0; i<len; i++) {\n");
@@ -604,21 +604,21 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                                fprintf(f, "    for(i=0; i<%u; i++) {\n", prop->totarraylength);
                                        }
 
-                                       if(dp->dnaarraylength == 1) {
-                                               if(prop->type == PROP_BOOLEAN && dp->booleanbit)
+                                       if (dp->dnaarraylength == 1) {
+                                               if (prop->type == PROP_BOOLEAN && dp->booleanbit)
                                                        fprintf(f, "            values[i]= %s((data->%s & (%d<<i)) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
                                                else
                                                        fprintf(f, "            values[i]= (%s)%s((&data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
                                        }
                                        else {
-                                               if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+                                               if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
                                                        fprintf(f, "            values[i]= %s((data->%s[i] & ", (dp->booleannegative)? "!": "", dp->dnaname);
                                                        rna_int_print(f, dp->booleanbit);
                                                        fprintf(f, ") != 0);\n");
                                                }
-                                               else if(rna_color_quantize(prop, dp))
+                                               else if (rna_color_quantize(prop, dp))
                                                        fprintf(f, "            values[i]= (%s)(data->%s[i]*(1.0f/255.0f));\n", rna_type_type(prop), dp->dnaname);
-                                               else if(dp->dnatype)
+                                               else if (dp->dnatype)
                                                        fprintf(f, "            values[i]= (%s)%s(((%s*)data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnatype, dp->dnaname);
                                                else
                                                        fprintf(f, "            values[i]= (%s)%s((data->%s)[i]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname);
@@ -631,17 +631,17 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                fprintf(f, "%s %s(PointerRNA *ptr)\n", rna_type_type(prop), func);
                                fprintf(f, "{\n");
 
-                               if(manualfunc) {
+                               if (manualfunc) {
                                        fprintf(f, "    return %s(ptr);\n", manualfunc);
                                }
                                else {
                                        rna_print_data_get(f, dp);
-                                       if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+                                       if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
                                                fprintf(f, "    return %s(((data->%s) & ", (dp->booleannegative)? "!": "", dp->dnaname);
                                                rna_int_print(f, dp->booleanbit);
                                                fprintf(f, ") != 0);\n");
                                        }
-                                       else if(prop->type == PROP_ENUM && dp->enumbitflags) {
+                                       else if (prop->type == PROP_ENUM && dp->enumbitflags) {
                                                fprintf(f, "    return ((data->%s) & ", dp->dnaname);
                                                rna_int_print(f, rna_enum_bitmask(prop));
                                                fprintf(f, ");\n");
@@ -661,16 +661,16 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
 /* defined min/max variables to be used by rna_clamp_value() */
 static void rna_clamp_value_range(FILE *f, PropertyRNA *prop)
 {
-       if(prop->type == PROP_FLOAT) {
-               FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
-               if(fprop->range) {
+       if (prop->type == PROP_FLOAT) {
+               FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
+               if (fprop->range) {
                        fprintf(f, "    float prop_clamp_min, prop_clamp_max;\n");
                        fprintf(f, "    %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(fprop->range));
                }
        }
-       else if(prop->type == PROP_INT) {
-               IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
-               if(iprop->range) {
+       else if (prop->type == PROP_INT) {
+               IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
+               if (iprop->range) {
                        fprintf(f, "    int prop_clamp_min, prop_clamp_max;\n");
                        fprintf(f, "    %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(iprop->range));
                }
@@ -679,13 +679,13 @@ static void rna_clamp_value_range(FILE *f, PropertyRNA *prop)
 
 static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
 {
-       if(prop->type == PROP_INT) {
-               IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+       if (prop->type == PROP_INT) {
+               IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
 
-               if(iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) {
-                       if(array) fprintf(f, "CLAMPIS(values[i], ");
+               if (iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) {
+                       if (array) fprintf(f, "CLAMPIS(values[i], ");
                        else fprintf(f, "CLAMPIS(value, ");
-                       if(iprop->range) {
+                       if (iprop->range) {
                                fprintf(f, "prop_clamp_min, prop_clamp_max);");
                        }
                        else {
@@ -695,13 +695,13 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
                        return;
                }
        }
-       else if(prop->type == PROP_FLOAT) {
-               FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+       else if (prop->type == PROP_FLOAT) {
+               FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
 
-               if(fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) {
-                       if(array) fprintf(f, "CLAMPIS(values[i], ");
+               if (fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) {
+                       if (array) fprintf(f, "CLAMPIS(values[i], ");
                        else fprintf(f, "CLAMPIS(value, ");
-                       if(fprop->range) {
+                       if (fprop->range) {
                                fprintf(f, "prop_clamp_min, prop_clamp_max);");
                        }
                        else {
@@ -712,7 +712,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
                }
        }
 
-       if(array)
+       if (array)
                fprintf(f, "values[i];\n");
        else
                fprintf(f, "value;\n");
@@ -722,42 +722,42 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
 {
        char *func;
 
-       if(!(prop->flag & PROP_EDITABLE))
+       if (!(prop->flag & PROP_EDITABLE))
                return NULL;
-       if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+       if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
                return NULL;
 
-       if(!manualfunc) {
-               if(!dp->dnastructname || !dp->dnaname) {
-                       if(prop->flag & PROP_EDITABLE) {
+       if (!manualfunc) {
+               if (!dp->dnastructname || !dp->dnaname) {
+                       if (prop->flag & PROP_EDITABLE) {
                                fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
                                        __func__, srna->identifier, prop->identifier);
-                               DefRNA.error= 1;
+                               DefRNA.error = 1;
                        }
                        return NULL;
                }
        }
 
-       func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set");
+       func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set");
 
-       switch(prop->type) {
+       switch (prop->type) {
                case PROP_STRING: {
-                       StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+                       StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
                        fprintf(f, "void %s(PointerRNA *ptr, const char *value)\n", func);
                        fprintf(f, "{\n");
-                       if(manualfunc) {
+                       if (manualfunc) {
                                fprintf(f, "    %s(ptr, value);\n", manualfunc);
                        }
                        else {
-                               const PropertySubType subtype= prop->subtype;
-                               const char *string_copy_func= (subtype==PROP_FILEPATH ||
-                                                              subtype==PROP_DIRPATH  ||
-                                                              subtype==PROP_FILENAME ||
-                                                              subtype==PROP_BYTESTRING) ?
+                               const PropertySubType subtype = prop->subtype;
+                               const char *string_copy_func = (subtype == PROP_FILEPATH ||
+                                                              subtype == PROP_DIRPATH  ||
+                                                              subtype == PROP_FILENAME ||
+                                                              subtype == PROP_BYTESTRING) ?
                                            "BLI_strncpy" : "BLI_strncpy_utf8";
 
                                rna_print_data_get(f, dp);
-                               if(sprop->maxlength)
+                               if (sprop->maxlength)
                                        fprintf(f, "    %s(data->%s, value, %d);\n", string_copy_func, dp->dnaname, sprop->maxlength);
                                else
                                        fprintf(f, "    %s(data->%s, value, sizeof(data->%s));\n", string_copy_func, dp->dnaname, dp->dnaname);
@@ -768,27 +768,27 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                case PROP_POINTER: {
                        fprintf(f, "void %s(PointerRNA *ptr, PointerRNA value)\n", func);
                        fprintf(f, "{\n");
-                       if(manualfunc) {
+                       if (manualfunc) {
                                fprintf(f, "    %s(ptr, value);\n", manualfunc);
                        }
                        else {
                                rna_print_data_get(f, dp);
 
-                               if(prop->flag & PROP_ID_SELF_CHECK) {
+                               if (prop->flag & PROP_ID_SELF_CHECK) {
                                        rna_print_id_get(f, dp);
                                        fprintf(f, "    if(id==value.data) return;\n\n");
                                }
 
-                               if(prop->flag & PROP_ID_REFCOUNT) {
+                               if (prop->flag & PROP_ID_REFCOUNT) {
                                        fprintf(f, "\n  if(data->%s)\n", dp->dnaname);
                                        fprintf(f, "            id_us_min((ID*)data->%s);\n", dp->dnaname);
                                        fprintf(f, "    if(value.data)\n");
                                        fprintf(f, "            id_us_plus((ID*)value.data);\n\n");
                                }
                                else {
-                                       PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
-                                       StructRNA *type= rna_find_struct((const char*)pprop->type);
-                                       if(type && (type->flag & STRUCT_ID)) {
+                                       PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
+                                       StructRNA *type = rna_find_struct((const char*)pprop->type);
+                                       if (type && (type->flag & STRUCT_ID)) {
                                                fprintf(f, "    if(value.data)\n");
                                                fprintf(f, "            id_lib_extern((ID*)value.data);\n\n");
                                        }
@@ -801,21 +801,21 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                        break;
                }
                default:
-                       if(prop->arraydimension) {
-                               if(prop->flag & PROP_DYNAMIC)
+                       if (prop->arraydimension) {
+                               if (prop->flag & PROP_DYNAMIC)
                                        fprintf(f, "void %s(PointerRNA *ptr, const %s values[])\n", func, rna_type_type(prop));
                                else
                                        fprintf(f, "void %s(PointerRNA *ptr, const %s values[%u])\n", func, rna_type_type(prop), prop->totarraylength);
                                fprintf(f, "{\n");
 
-                               if(manualfunc) {
+                               if (manualfunc) {
                                        fprintf(f, "    %s(ptr, values);\n", manualfunc);
                                }
                                else {
                                        rna_print_data_get(f, dp);
 
-                                       if(prop->flag & PROP_DYNAMIC) {
-                                               char *lenfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set_length");
+                                       if (prop->flag & PROP_DYNAMIC) {
+                                               char *lenfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set_length");
                                                fprintf(f, "    int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
                                                fprintf(f, "    int len= %s(ptr, arraylen);\n\n", lenfunc);
                                                rna_clamp_value_range(f, prop);
@@ -828,8 +828,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                                fprintf(f, "    for(i=0; i<%u; i++) {\n", prop->totarraylength);
                                        }
 
-                                       if(dp->dnaarraylength == 1) {
-                                               if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+                                       if (dp->dnaarraylength == 1) {
+                                               if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
                                                        fprintf(f, "            if(%svalues[i]) data->%s |= (%d<<i);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit);
                                                        fprintf(f, "            else data->%s &= ~(%d<<i);\n", dp->dnaname, dp->booleanbit);
                                                }
@@ -839,7 +839,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                                }
                                        }
                                        else {
-                                               if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+                                               if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
                                                        fprintf(f, "            if(%svalues[i]) data->%s[i] |= ", (dp->booleannegative)? "!": "", dp->dnaname);
                                                        rna_int_print(f, dp->booleanbit);
                                                        fprintf(f, ";\n");
@@ -847,11 +847,11 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                                        rna_int_print(f, dp->booleanbit);
                                                        fprintf(f, ";\n");
                                                }
-                                               else if(rna_color_quantize(prop, dp)) {
+                                               else if (rna_color_quantize(prop, dp)) {
                                                        fprintf(f, "            data->%s[i]= FTOCHAR(values[i]);\n", dp->dnaname);
                                                }
                                                else {
-                                                       if(dp->dnatype)
+                                                       if (dp->dnatype)
                                                                fprintf(f, "            ((%s*)data->%s)[i]= %s", dp->dnatype, dp->dnaname, (dp->booleannegative)? "!": "");
                                                        else
                                                                fprintf(f, "            (data->%s)[i]= %s", dp->dnaname, (dp->booleannegative)? "!": "");
@@ -866,12 +866,12 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                fprintf(f, "void %s(PointerRNA *ptr, %s value)\n", func, rna_type_type(prop));
                                fprintf(f, "{\n");
 
-                               if(manualfunc) {
+                               if (manualfunc) {
                                        fprintf(f, "    %s(ptr, value);\n", manualfunc);
                                }
                                else {
                                        rna_print_data_get(f, dp);
-                                       if(prop->type == PROP_BOOLEAN && dp->booleanbit) {
+                                       if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
                                                fprintf(f, "    if(%svalue) data->%s |= ", (dp->booleannegative)? "!": "", dp->dnaname);
                                                rna_int_print(f, dp->booleanbit);
                                                fprintf(f, ";\n");
@@ -879,7 +879,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
                                                rna_int_print(f, dp->booleanbit);
                                                fprintf(f, ";\n");
                                        }
-                                       else if(prop->type == PROP_ENUM && dp->enumbitflags) {
+                                       else if (prop->type == PROP_ENUM && dp->enumbitflags) {
                                                fprintf(f, "    data->%s &= ~", dp->dnaname);
                                                rna_int_print(f, rna_enum_bitmask(prop));
                                                fprintf(f, ";\n");
@@ -901,26 +901,26 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
 
 static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
 {
-       char *func= NULL;
+       char *func = NULL;
 
-       if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+       if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
                return NULL;
 
-       if(prop->type == PROP_STRING) {
-               if(!manualfunc) {
-                       if(!dp->dnastructname || !dp->dnaname) {
+       if (prop->type == PROP_STRING) {
+               if (!manualfunc) {
+                       if (!dp->dnastructname || !dp->dnaname) {
                                fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
                                        __func__, srna->identifier, prop->identifier);
-                               DefRNA.error= 1;
+                               DefRNA.error = 1;
                                return NULL;
                        }
                }
 
-               func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
+               func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
 
                fprintf(f, "int %s(PointerRNA *ptr)\n", func);
                fprintf(f, "{\n");
-               if(manualfunc) {
+               if (manualfunc) {
                        fprintf(f, "    return %s(ptr);\n", manualfunc);
                }
                else {
@@ -929,26 +929,26 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
                }
                fprintf(f, "}\n\n");
        }
-       else if(prop->type == PROP_COLLECTION) {
-               if(!manualfunc) {
-                       if(prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) {
+       else if (prop->type == PROP_COLLECTION) {
+               if (!manualfunc) {
+                       if (prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) {
                                fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
                                        __func__, srna->identifier, prop->identifier);
-                               DefRNA.error= 1;
+                               DefRNA.error = 1;
                                return NULL;
                        }
                }
 
-               func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
+               func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "length");
 
                fprintf(f, "int %s(PointerRNA *ptr)\n", func);
                fprintf(f, "{\n");
-               if(manualfunc) {
+               if (manualfunc) {
                        fprintf(f, "    return %s(ptr);\n", manualfunc);
                }
                else {
                        rna_print_data_get(f, dp);
-                       if(dp->dnalengthname)
+                       if (dp->dnalengthname)
                                fprintf(f, "    return (data->%s == NULL)? 0: data->%s;\n", dp->dnaname, dp->dnalengthname);
                        else
                                fprintf(f, "    return (data->%s == NULL)? 0: %d;\n", dp->dnaname, dp->dnalengthfixed);
@@ -963,51 +963,51 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *
 {
        char *func, *getfunc;
 
-       if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+       if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
                return NULL;
 
-       if(!manualfunc) {
-               if(!dp->dnastructname || !dp->dnaname) {
+       if (!manualfunc) {
+               if (!dp->dnastructname || !dp->dnaname) {
                        fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
                                __func__, srna->identifier, prop->identifier);
-                       DefRNA.error= 1;
+                       DefRNA.error = 1;
                        return NULL;
                }
        }
 
-       func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "begin");
+       func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "begin");
 
        fprintf(f, "void %s(CollectionPropertyIterator *iter, PointerRNA *ptr)\n", func);
        fprintf(f, "{\n");
 
-       if(!manualfunc)
+       if (!manualfunc)
                rna_print_data_get(f, dp);
 
        fprintf(f, "\n  memset(iter, 0, sizeof(*iter));\n");
        fprintf(f, "    iter->parent= *ptr;\n");
        fprintf(f, "    iter->prop= (PropertyRNA*)&rna_%s_%s;\n", srna->identifier, prop->identifier);
 
-       if(dp->dnalengthname || dp->dnalengthfixed) {
-               if(manualfunc) {
+       if (dp->dnalengthname || dp->dnalengthfixed) {
+               if (manualfunc) {
                        fprintf(f, "\n  %s(iter, ptr);\n", manualfunc);
                }
                else {
-                       if(dp->dnalengthname)
+                       if (dp->dnalengthname)
                                fprintf(f, "\n  rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), data->%s, 0, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthname);
                        else
                                fprintf(f, "\n  rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), %d, 0, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthfixed);
                }
        }
        else {
-               if(manualfunc)
+               if (manualfunc)
                        fprintf(f, "\n  %s(iter, ptr);\n", manualfunc);
-               else if(dp->dnapointerlevel == 0)
+               else if (dp->dnapointerlevel == 0)
                        fprintf(f, "\n  rna_iterator_listbase_begin(iter, &data->%s, NULL);\n", dp->dnaname);
                else
                        fprintf(f, "\n  rna_iterator_listbase_begin(iter, data->%s, NULL);\n", dp->dnaname);
        }
 
-       getfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
+       getfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
 
        fprintf(f, "\n  if(iter->valid)\n");
        fprintf(f, "            iter->ptr= %s(iter);\n", getfunc);
@@ -1024,25 +1024,25 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
         * so the the index can only be checked against the length when there is no 'skip' funcion. */
        char *func;
 
-       if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+       if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
                return NULL;
 
-       if(!manualfunc) {
-               if(!dp->dnastructname || !dp->dnaname)
+       if (!manualfunc) {
+               if (!dp->dnastructname || !dp->dnaname)
                        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 (strcmp(nextfunc, "rna_iterator_array_next") == 0);
+               else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0);
                else return NULL;
        }
 
-       func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "lookup_int");
+       func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "lookup_int");
 
        fprintf(f, "int %s(PointerRNA *ptr, int index, PointerRNA *r_ptr)\n", func);
        fprintf(f, "{\n");
 
-       if(manualfunc) {
+       if (manualfunc) {
                fprintf(f, "\n  return %s(ptr, index, r_ptr);\n", manualfunc);
                fprintf(f, "}\n\n");
                return func;
@@ -1054,7 +1054,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 (strcmp(nextfunc, "rna_iterator_array_next") == 0) {
                fprintf(f, "            ArrayIterator *internal= iter.internal;\n");
                fprintf(f, "            if(index < 0 || index >= internal->length) {\n");
                fprintf(f, "#ifdef __GNUC__\n");
@@ -1074,7 +1074,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 (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) {
                fprintf(f, "            ListBaseIterator *internal= iter.internal;\n");
                fprintf(f, "            if(internal->skip) {\n");
                fprintf(f, "                    while(index-- > 0 && iter.valid) {\n");
@@ -1097,16 +1097,16 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property
 
 #if 0
        rna_print_data_get(f, dp);
-       item_type= (cprop->item_type)? (const char*)cprop->item_type: "UnknownType";
+       item_type = (cprop->item_type)? (const char*)cprop->item_type: "UnknownType";
 
-       if(dp->dnalengthname || dp->dnalengthfixed) {
-               if(dp->dnalengthname)
+       if (dp->dnalengthname || dp->dnalengthfixed) {
+               if (dp->dnalengthname)
                        fprintf(f, "\n  rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), data->%s, index);\n", item_type, dp->dnaname, dp->dnaname, dp->dnalengthname);
                else
                        fprintf(f, "\n  rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), %d, index);\n", item_type, 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
                        fprintf(f, "\n  return rna_listbase_lookup_int(ptr, &RNA_%s, data->%s, index);\n", item_type, dp->dnaname);
@@ -1122,19 +1122,19 @@ static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *p
 {
        char *func, *getfunc;
 
-       if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+       if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
                return NULL;
 
-       if(!manualfunc)
+       if (!manualfunc)
                return NULL;
 
-       func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "next");
+       func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "next");
 
        fprintf(f, "void %s(CollectionPropertyIterator *iter)\n", func);
        fprintf(f, "{\n");
        fprintf(f, "    %s(iter);\n", manualfunc);
 
-       getfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
+       getfunc = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get");
 
        fprintf(f, "\n  if(iter->valid)\n");
        fprintf(f, "            iter->ptr= %s(iter);\n", getfunc);
@@ -1148,14 +1148,14 @@ static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *pr
 {
        char *func;
 
-       if(prop->flag & PROP_IDPROPERTY && manualfunc==NULL)
+       if (prop->flag & PROP_IDPROPERTY && manualfunc == NULL)
                return NULL;
 
-       func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "end");
+       func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "end");
 
        fprintf(f, "void %s(CollectionPropertyIterator *iter)\n", func);
        fprintf(f, "{\n");
-       if(manualfunc)
+       if (manualfunc)
                fprintf(f, "    %s(iter);\n", manualfunc);
        fprintf(f, "}\n\n");
 
@@ -1164,36 +1164,36 @@ static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *pr
 
 static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop)
 {
-       if(dp->dnapointerlevel != 0)
+       if (dp->dnapointerlevel != 0)
                return;
-       if(!dp->dnatype || !dp->dnaname || !dp->dnastructname)
+       if (!dp->dnatype || !dp->dnaname || !dp->dnastructname)
                return;
        
-       if(strcmp(dp->dnatype, "char") == 0) {
-               prop->rawtype= PROP_RAW_CHAR;
+       if (strcmp(dp->dnatype, "char") == 0) {
+               prop->rawtype = PROP_RAW_CHAR;
                prop->flag |= PROP_RAW_ACCESS;
        }
-       else if(strcmp(dp->dnatype, "short") == 0) {
-               prop->rawtype= PROP_RAW_SHORT;
+       else if (strcmp(dp->dnatype, "short") == 0) {
+               prop->rawtype = PROP_RAW_SHORT;
                prop->flag |= PROP_RAW_ACCESS;
        }
-       else if(strcmp(dp->dnatype, "int") == 0) {
-               prop->rawtype= PROP_RAW_INT;
+       else if (strcmp(dp->dnatype, "int") == 0) {
+               prop->rawtype = PROP_RAW_INT;
                prop->flag |= PROP_RAW_ACCESS;
        }
-       else if(strcmp(dp->dnatype, "float") == 0) {
-               prop->rawtype= PROP_RAW_FLOAT;
+       else if (strcmp(dp->dnatype, "float") == 0) {
+               prop->rawtype = PROP_RAW_FLOAT;
                prop->flag |= PROP_RAW_ACCESS;
        }
-       else if(strcmp(dp->dnatype, "double") == 0) {
-               prop->rawtype= PROP_RAW_DOUBLE;
+       else if (strcmp(dp->dnatype, "double") == 0) {
+               prop->rawtype = PROP_RAW_DOUBLE;
                prop->flag |= PROP_RAW_ACCESS;
        }
 }
 
 static void rna_set_raw_offset(FILE *f, StructRNA *srna, PropertyRNA *prop)
 {
-       PropertyDefRNA *dp= rna_find_struct_property_def(srna, prop);
+       PropertyDefRNA *dp = rna_find_struct_property_def(srna, prop);
 
        fprintf(f, "\toffsetof(%s, %s), %d", dp->dnastructname, dp->dnaname, prop->rawtype);
 }
@@ -1202,132 +1202,132 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
 {
        PropertyRNA *prop;
 
-       prop= dp->prop;
+       prop = dp->prop;
 
-       switch(prop->type) {
+       switch (prop->type) {
                case PROP_BOOLEAN: {
-                       BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+                       BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
 
-                       if(!prop->arraydimension) {
-                               if(!bprop->get && !bprop->set && !dp->booleanbit)
+                       if (!prop->arraydimension) {
+                               if (!bprop->get && !bprop->set && !dp->booleanbit)
                                        rna_set_raw_property(dp, prop);
 
-                               bprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->get);
-                               bprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->set);
+                               bprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->get);
+                               bprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->set);
                        }
                        else {
-                               bprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->getarray);
-                               bprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->setarray);
+                               bprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->getarray);
+                               bprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->setarray);
                        }
                        break;
                }
                case PROP_INT: {
-                       IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+                       IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
 
-                       if(!prop->arraydimension) {
-                               if(!iprop->get && !iprop->set)
+                       if (!prop->arraydimension) {
+                               if (!iprop->get && !iprop->set)
                                        rna_set_raw_property(dp, prop);
 
-                               iprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->get);
-                               iprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->set);
+                               iprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->get);
+                               iprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->set);
                        }
                        else {
-                               if(!iprop->getarray && !iprop->setarray)
+                               if (!iprop->getarray && !iprop->setarray)
                                        rna_set_raw_property(dp, prop);
 
-                               iprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->getarray);
-                               iprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->setarray);
+                               iprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->getarray);
+                               iprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->setarray);
                        }
                        break;
                }
                case PROP_FLOAT: {
-                       FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+                       FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
 
-                       if(!prop->arraydimension) {
-                               if(!fprop->get && !fprop->set)
+                       if (!prop->arraydimension) {
+                               if (!fprop->get && !fprop->set)
                                        rna_set_raw_property(dp, prop);
 
-                               fprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->get);
-                               fprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->set);
+                               fprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->get);
+                               fprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->set);
                        }
                        else {
-                               if(!fprop->getarray && !fprop->setarray)
+                               if (!fprop->getarray && !fprop->setarray)
                                        rna_set_raw_property(dp, prop);
 
-                               fprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->getarray);
-                               fprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->setarray);
+                               fprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->getarray);
+                               fprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->setarray);
                        }
                        break;
                }
                case PROP_ENUM: {
-                       EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+                       EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
 
-                       eprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)eprop->get);
-                       eprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)eprop->set);
+                       eprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)eprop->get);
+                       eprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)eprop->set);
                        break;
                }
                case PROP_STRING: {
-                       StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+                       StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
 
-                       sprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)sprop->get);
-                       sprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)sprop->length);
-                       sprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)sprop->set);
+                       sprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)sprop->get);
+                       sprop->length = (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)sprop->length);
+                       sprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)sprop->set);
                        break;
                }
                case PROP_POINTER: {
-                       PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+                       PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
 
-                       pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get);
-                       pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set);
-                       if(!pprop->type) {
+                       pprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get);
+                       pprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set);
+                       if (!pprop->type) {
                                fprintf(stderr, "%s: %s.%s, pointer must have a struct type.\n",
                                        __func__, srna->identifier, prop->identifier);
-                               DefRNA.error= 1;
+                               DefRNA.error = 1;
                        }
                        break;
                }
                case PROP_COLLECTION: {
-                       CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
-                       const char *nextfunc= (const char*)cprop->next;
+                       CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
+                       const char *nextfunc = (const char*)cprop->next;
 
-                       if(dp->dnatype && strcmp(dp->dnatype, "ListBase")==0);
-                       else if(dp->dnalengthname || dp->dnalengthfixed)
-                               cprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)cprop->length);
+                       if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0);
+                       else if (dp->dnalengthname || dp->dnalengthfixed)
+                               cprop->length = (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)cprop->length);
 
                        /* 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 &&
+                       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)
                                        prop->flag |= PROP_RAW_ARRAY;
 
-                       cprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)cprop->get);
-                       cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp, (const char*)cprop->begin);
-                       cprop->next= (void*)rna_def_property_next_func(f, srna, prop, dp, (const char*)cprop->next);
-                       cprop->end= (void*)rna_def_property_end_func(f, srna, prop, dp, (const char*)cprop->end);
-                       cprop->lookupint= (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, (const char*)cprop->lookupint, nextfunc);
+                       cprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)cprop->get);
+                       cprop->begin = (void*)rna_def_property_begin_func(f, srna, prop, dp, (const char*)cprop->begin);
+                       cprop->next = (void*)rna_def_property_next_func(f, srna, prop, dp, (const char*)cprop->next);
+                       cprop->end = (void*)rna_def_property_end_func(f, srna, prop, dp, (const char*)cprop->end);
+                       cprop->lookupint = (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, (const char*)cprop->lookupint, nextfunc);
 
-                       if(!(prop->flag & PROP_IDPROPERTY)) {
-                               if(!cprop->begin) {
+                       if (!(prop->flag & PROP_IDPROPERTY)) {
+                               if (!cprop->begin) {
                                        fprintf(stderr, "%s: %s.%s, collection must have a begin function.\n",
                                                __func__, srna->identifier, prop->identifier);
-                                       DefRNA.error= 1;
+                                       DefRNA.error = 1;
                                }
-                               if(!cprop->next) {
+                               if (!cprop->next) {
                                        fprintf(stderr, "%s: %s.%s, collection must have a next function.\n",
                                                __func__, srna->identifier, prop->identifier);
-                                       DefRNA.error= 1;
+                                       DefRNA.error = 1;
                                }
-                               if(!cprop->get) {
+                               if (!cprop->get) {
                                        fprintf(stderr, "%s: %s.%s, collection must have a get function.\n",
                                                __func__, srna->identifier, prop->identifier);
-                                       DefRNA.error= 1;
+                                       DefRNA.error = 1;
                                }
                        }
-                       if(!cprop->item_type) {
+                       if (!cprop->item_type) {
                                fprintf(stderr, "%s: %s.%s, collection must have a struct type.\n",
                                        __func__, srna->identifier, prop->identifier);
-                               DefRNA.error= 1;
+                               DefRNA.error = 1;
                        }
                        break;
                }
@@ -1339,89 +1339,89 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR
        PropertyRNA *prop;
        char *func;
 
-       prop= dp->prop;
+       prop = dp->prop;
 
-       if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
+       if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
                return;
 
-       func= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "");
+       func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "");
 
-       switch(prop->type) {
+       switch (prop->type) {
                case PROP_BOOLEAN:
                case PROP_INT: {
-                       if(!prop->arraydimension) {
+                       if (!prop->arraydimension) {
                                fprintf(f, "int %sget(PointerRNA *ptr);\n", func);
-                               //fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
+                               /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */
                        }
-                       else if(prop->arraydimension && prop->totarraylength) {
+                       else if (prop->arraydimension && prop->totarraylength) {
                                fprintf(f, "void %sget(PointerRNA *ptr, int values[%u]);\n", func, prop->totarraylength);
-                               //fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength);
+                               /*fprintf(f, "void %sset(PointerRNA *ptr, const int values[%d]);\n", func, prop->arraylength); */
                        }
                        else {
                                fprintf(f, "void %sget(PointerRNA *ptr, int values[]);\n", func);
-                               //fprintf(f, "void %sset(PointerRNA *ptr, const int values[]);\n", func);
+                               /*fprintf(f, "void %sset(PointerRNA *ptr, const int values[]);\n", func); */
                        }
                        break;
                }
                case PROP_FLOAT: {
-                       if(!prop->arraydimension) {
+                       if (!prop->arraydimension) {
                                fprintf(f, "float %sget(PointerRNA *ptr);\n", func);
-                               //fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func);
+                               /*fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); */
                        }
-                       else if(prop->arraydimension && prop->totarraylength) {
+                       else if (prop->arraydimension && prop->totarraylength) {
                                fprintf(f, "void %sget(PointerRNA *ptr, float values[%u]);\n", func, prop->totarraylength);
-                               //fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength);
+                               /*fprintf(f, "void %sset(PointerRNA *ptr, const float values[%d]);\n", func, prop->arraylength); */
                        }
                        else {
                                fprintf(f, "void %sget(PointerRNA *ptr, float values[]);\n", func);
-                               //fprintf(f, "void %sset(PointerRNA *ptr, const float values[]);\n", func);
+                               /*fprintf(f, "void %sset(PointerRNA *ptr, const float values[]);\n", func); */
                        }
                        break;
                }
                case PROP_ENUM: {
-                       EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+                       EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
                        int i;
 
-                       if(eprop->item) {
+                       if (eprop->item) {
                                fprintf(f, "enum {\n");
 
-                               for(i=0; i<eprop->totitem; i++)
-                                       if(eprop->item[i].identifier[0])
+                               for (i = 0; i<eprop->totitem; i++)
+                                       if (eprop->item[i].identifier[0])
                                                fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value);
 
                                fprintf(f, "};\n\n");
                        }
 
                        fprintf(f, "int %sget(PointerRNA *ptr);\n", func);
-                       //fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func);
+                       /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */
 
                        break;
                }
                case PROP_STRING: {
-                       StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+                       StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
 
-                       if(sprop->maxlength) {
+                       if (sprop->maxlength) {
                                fprintf(f, "#define %s_%s_MAX %d\n\n", srna->identifier, prop->identifier, sprop->maxlength);
                        }
                        
                        fprintf(f, "void %sget(PointerRNA *ptr, char *value);\n", func);
                        fprintf(f, "int %slength(PointerRNA *ptr);\n", func);
-                       //fprintf(f, "void %sset(PointerRNA *ptr, const char *value);\n", func);
+                       /*fprintf(f, "void %sset(PointerRNA *ptr, const char *value);\n", func); */
 
                        break;
                }
                case PROP_POINTER: {
                        fprintf(f, "PointerRNA %sget(PointerRNA *ptr);\n", func);
-                       //fprintf(f, "void %sset(PointerRNA *ptr, PointerRNA value);\n", func);
+                       /*fprintf(f, "void %sset(PointerRNA *ptr, PointerRNA value);\n", func); */
                        break;
                }
                case PROP_COLLECTION: {
                        fprintf(f, "void %sbegin(CollectionPropertyIterator *iter, PointerRNA *ptr);\n", func);
                        fprintf(f, "void %snext(CollectionPropertyIterator *iter);\n", func);
                        fprintf(f, "void %send(CollectionPropertyIterator *iter);\n", func);
-                       //fprintf(f, "int %slength(PointerRNA *ptr);\n", func);
-                       //fprintf(f, "void %slookup_int(PointerRNA *ptr, int key, StructRNA **type);\n", func);
-                       //fprintf(f, "void %slookup_string(PointerRNA *ptr, const char *key, StructRNA **type);\n", func);
+                       /*fprintf(f, "int %slength(PointerRNA *ptr);\n", func); */
+                       /*fprintf(f, "void %slookup_int(PointerRNA *ptr, int key, StructRNA **type);\n", func); */
+                       /*fprintf(f, "void %slookup_string(PointerRNA *ptr, const char *key, StructRNA **type);\n", func); */
                        break;
                }
        }
@@ -1433,49 +1433,49 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
 {
        PropertyRNA *prop;
 
-       prop= dp->prop;
+       prop = dp->prop;
 
-       if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
+       if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
                return;
        
-       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
                fprintf(f, "\t/* */\n");
 
-       switch(prop->type) {
+       switch (prop->type) {
                case PROP_BOOLEAN: {
-                       if(!prop->arraydimension)
+                       if (!prop->arraydimension)
                                fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier));
-                       else if(prop->totarraylength)
+                       else if (prop->totarraylength)
                                fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_INT: {
-                       if(!prop->arraydimension)
+                       if (!prop->arraydimension)
                                fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier));
-                       else if(prop->totarraylength)
+                       else if (prop->totarraylength)
                                fprintf(f, "\tinline Array<int, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_FLOAT: {
-                       if(!prop->arraydimension)
+                       if (!prop->arraydimension)
                                fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier));
-                       else if(prop->totarraylength)
+                       else if (prop->totarraylength)
                                fprintf(f, "\tinline Array<float, %u> %s(void);", prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_ENUM: {
-                       EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+                       EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
                        int i;
 
-                       if(eprop->item) {
+                       if (eprop->item) {
                                fprintf(f, "\tenum %s_enum {\n", rna_safe_id(prop->identifier));
 
-                               for(i=0; i<eprop->totitem; i++)
-                                       if(eprop->item[i].identifier[0])
+                               for (i = 0; i<eprop->totitem; i++)
+                                       if (eprop->item[i].identifier[0])
                                                fprintf(f, "\t\t%s_%s = %d,\n", rna_safe_id(prop->identifier), eprop->item[i].identifier, eprop->item[i].value);
 
                                fprintf(f, "\t};\n");
@@ -1489,18 +1489,18 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property
                        break;
                }
                case PROP_POINTER: {
-                       PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+                       PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
 
-                       if(pprop->type)
+                       if (pprop->type)
                                fprintf(f, "\tinline %s %s(void);", (const char*)pprop->type, rna_safe_id(prop->identifier));
                        else
                                fprintf(f, "\tinline %s %s(void);", "UnknownType", rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_COLLECTION: {
-                       CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
+                       CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)dp->prop;
 
-                       if(cprop->item_type)
+                       if (cprop->item_type)
                                fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->item_type, srna->identifier, rna_safe_id(prop->identifier));
                        else
                                fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier));
@@ -1515,30 +1515,30 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
 {
        PropertyRNA *prop;
 
-       prop= dp->prop;
+       prop = dp->prop;
 
-       if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
+       if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))
                return;
 
-       switch(prop->type) {
+       switch (prop->type) {
                case PROP_BOOLEAN: {
-                       if(!prop->arraydimension)
+                       if (!prop->arraydimension)
                                fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
-                       else if(prop->totarraylength)
+                       else if (prop->totarraylength)
                                fprintf(f, "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_INT: {
-                       if(!prop->arraydimension)
+                       if (!prop->arraydimension)
                                fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
-                       else if(prop->totarraylength)
+                       else if (prop->totarraylength)
                                fprintf(f, "\tINT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
                case PROP_FLOAT: {
-                       if(!prop->arraydimension)
+                       if (!prop->arraydimension)
                                fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier));
-                       else if(prop->totarraylength)
+                       else if (prop->totarraylength)
                                fprintf(f, "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)", srna->identifier, prop->totarraylength, rna_safe_id(prop->identifier));
                        break;
                }
@@ -1552,9 +1552,9 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe
                        break;
                }
                case PROP_POINTER: {
-                       PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+                       PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
 
-                       if(pprop->type)
+                       if (pprop->type)
                                fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (const char*)pprop->type, srna->identifier, rna_safe_id(prop->identifier));
                        else
                                fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier));
@@ -1582,16 +1582,16 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
        PropertyType type;
        const char *funcname, *valstr;
        const char *ptrstr;
-       const short has_data= (dfunc->cont.properties.first != NULL);
+       const short has_data = (dfunc->cont.properties.first != NULL);
        int flag, pout, cptr, first;
 
-       srna= dsrna->srna;
-       func= dfunc->func;
+       srna = dsrna->srna;
+       func = dfunc->func;
 
-       if(!dfunc->call)
+       if (!dfunc->call)
                return;
 
-       funcname= rna_alloc_function_name(srna->identifier, func->identifier, "call");
+       funcname = rna_alloc_function_name(srna->identifier, func->identifier, "call");
 
        /* function definition */
        fprintf(f, "void %s(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)", funcname);
@@ -1599,35 +1599,35 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
 
        /* variable definitions */
        
-       if(func->flag & FUNC_USE_SELF_ID) {
+       if (func->flag & FUNC_USE_SELF_ID) {
                fprintf(f, "\tstruct ID *_selfid;\n");
        }
 
-       if((func->flag & FUNC_NO_SELF)==0) {
-               if(dsrna->dnaname) fprintf(f, "\tstruct %s *_self;\n", dsrna->dnaname);
+       if ((func->flag & FUNC_NO_SELF) == 0) {
+               if (dsrna->dnaname) fprintf(f, "\tstruct %s *_self;\n", dsrna->dnaname);
                else fprintf(f, "\tstruct %s *_self;\n", srna->identifier);
        }
 
-       dparm= dfunc->cont.properties.first;
-       for(; dparm; dparm= dparm->next) {
+       dparm = dfunc->cont.properties.first;
+       for (; dparm; dparm = dparm->next) {
                type = dparm->prop->type;
                flag = dparm->prop->flag;
                pout = (flag & PROP_OUTPUT);
                cptr = ((type == PROP_POINTER) && !(flag & PROP_RNAPTR));
 
-               if(dparm->prop==func->c_ret)
-                       ptrstr= cptr || dparm->prop->arraydimension ? "*" : "";
+               if (dparm->prop == func->c_ret)
+                       ptrstr = cptr || dparm->prop->arraydimension ? "*" : "";
                /* XXX only arrays and strings are allowed to be dynamic, is this checked anywhere? */
                else if (cptr || (flag & PROP_DYNAMIC))
-                       ptrstr= pout ? "**" : "*";
+                       ptrstr = pout ? "**" : "*";
                /* fixed size arrays and RNA pointers are pre-allocated on the ParameterList stack, pass a pointer to it */
                else if (type == PROP_POINTER || dparm->prop->arraydimension)
-                       ptrstr= "*";
+                       ptrstr = "*";
                /* PROP_THICK_WRAP strings are pre-allocated on the ParameterList stack, but type name for string props is already char*, so leave empty */
                else if (type == PROP_STRING && (flag & PROP_THICK_WRAP))
-                       ptrstr= "";
+                       ptrstr = "";
                else
-                       ptrstr= pout ? "*" : "";
+                       ptrstr = pout ? "*" : "";
 
                /* for dynamic parameters we pass an additional int for the length of the parameter */
                if (flag & PROP_DYNAMIC)
@@ -1636,62 +1636,62 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
                fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
        }
 
-       if(has_data) {
+       if (has_data) {
                fprintf(f, "\tchar *_data");
-               if(func->c_ret) fprintf(f, ", *_retdata");
+               if (func->c_ret) fprintf(f, ", *_retdata");
                fprintf(f, ";\n");
                fprintf(f, "\t\n");
        }
 
        /* assign self */
-       if(func->flag & FUNC_USE_SELF_ID) {
+       if (func->flag & FUNC_USE_SELF_ID) {
                fprintf(f, "\t_selfid= (struct ID*)_ptr->id.data;\n");
        }
        
-       if((func->flag & FUNC_NO_SELF)==0) {
-               if(dsrna->dnaname) fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", dsrna->dnaname);
+       if ((func->flag & FUNC_NO_SELF) == 0) {
+               if (dsrna->dnaname) fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", dsrna->dnaname);
                else fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", srna->identifier);
        }
 
-       if(has_data) {
+       if (has_data) {
                fprintf(f, "\t_data= (char *)_parms->data;\n");
        }
 
-       dparm= dfunc->cont.properties.first;
-       for(; dparm; dparm= dparm->next) {
+       dparm = dfunc->cont.properties.first;
+       for (; dparm; dparm = dparm->next) {
                type = dparm->prop->type;
                flag = dparm->prop->flag;
                pout = (flag & PROP_OUTPUT);
                cptr = ((type == PROP_POINTER) && !(flag & PROP_RNAPTR));
 
-               if(dparm->prop==func->c_ret)
+               if (dparm->prop == func->c_ret)
                        fprintf(f, "\t_retdata= _data;\n");
                else  {
                        const char *data_str;
                        if (cptr || (flag & PROP_DYNAMIC)) {
-                               ptrstr= "**";
-                               valstr= "*";
+                               ptrstr = "**";
+                               valstr = "*";
                        }
                        else if (type == PROP_POINTER || dparm->prop->arraydimension) {
-                               ptrstr= "*";
-                               valstr= "";
+                               ptrstr = "*";
+                               valstr = "";
                        }
                        else if (type == PROP_STRING && (flag & PROP_THICK_WRAP)) {
-                               ptrstr= "";
-                               valstr= "";
+                               ptrstr = "";
+                               valstr = "";
                        }
                        else {
-                               ptrstr= "*";
-                               valstr= "*";
+                               ptrstr = "*";
+                               valstr = "*";
                        }
 
                        /* this must be kept in sync with RNA_parameter_length_get_data, we could just call the function directly, but this is faster */
                        if (flag & PROP_DYNAMIC) {
                                fprintf(f, "\t%s_len= %s((int *)_data);\n", dparm->prop->identifier, pout ? "" : "*");
-                               data_str= "(&(((char *)_data)[sizeof(void *)]))";
+                               data_str = "(&(((char *)_data)[sizeof(void *)]))";
                        }
                        else {
-                               data_str= "_data";
+                               data_str = "_data";
                        }
                        fprintf(f, "\t%s= ", dparm->prop->identifier);
 
@@ -1701,54 +1701,54 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
                        fprintf(f, "((%s%s%s)%s);\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, data_str);
                }
 
-               if(dparm->next)
+               if (dparm->next)
                        fprintf(f, "\t_data+= %d;\n", rna_parameter_size_alloc(dparm->prop));
        }
 
-       if(dfunc->call) {
+       if (dfunc->call) {
                fprintf(f, "\t\n");
                fprintf(f, "\t");
-               if(func->c_ret) fprintf(f, "%s= ", func->c_ret->identifier);
+               if (func->c_ret) fprintf(f, "%s= ", func->c_ret->identifier);
                fprintf(f, "%s(", dfunc->call);
 
-               first= 1;
+               first = 1;
 
-               if(func->flag & FUNC_USE_SELF_ID) {
+               if (func->flag & FUNC_USE_SELF_ID) {
                        fprintf(f, "_selfid");
-                       first= 0;
+                       first = 0;
                }
 
-               if((func->flag & FUNC_NO_SELF)==0) {
-                       if(!first) fprintf(f, ", ");
+               if ((func->flag & FUNC_NO_SELF) == 0) {
+                       if (!first) fprintf(f, ", ");
                        fprintf(f, "_self");
-                       first= 0;
+                       first = 0;
                }
 
-               if(func->flag & FUNC_USE_MAIN) {
-                       if(!first) fprintf(f, ", ");
-                       first= 0;
+               if (func->flag & FUNC_USE_MAIN) {
+                       if (!first) fprintf(f, ", ");
+                       first = 0;
                        fprintf(f, "CTX_data_main(C)"); /* may have direct access later */
                }
 
-               if(func->flag & FUNC_USE_CONTEXT) {
-                       if(!first) fprintf(f, ", ");
-                       first= 0;
+               if (func->flag & FUNC_USE_CONTEXT) {
+                       if (!first) fprintf(f, ", ");
+                       first = 0;
                        fprintf(f, "C");
                }
 
-               if(func->flag & FUNC_USE_REPORTS) {
-                       if(!first) fprintf(f, ", ");
-                       first= 0;
+               if (func->flag & FUNC_USE_REPORTS) {
+                       if (!first) fprintf(f, ", ");
+                       first = 0;
                        fprintf(f, "reports");
                }
 
-               dparm= dfunc->cont.properties.first;
-               for(; dparm; dparm= dparm->next) {
-                       if(dparm->prop==func->c_ret)
+               dparm = dfunc->cont.properties.first;
+               for (; dparm; dparm = dparm->next) {
+                       if (dparm->prop == func->c_ret)
                                continue;
 
-                       if(!first) fprintf(f, ", ");
-                       first= 0;
+                       if (!first) fprintf(f, ", ");
+                       first = 0;
 
                        if (dparm->prop->flag & PROP_DYNAMIC)
                                fprintf(f, "%s_len, %s", dparm->prop->identifier, dparm->prop->identifier);
@@ -1758,16 +1758,16 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
 
                fprintf(f, ");\n");
 
-               if(func->c_ret) {
-                       dparm= rna_find_parameter_def(func->c_ret);
-                       ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraydimension))? "*": "";
+               if (func->c_ret) {
+                       dparm = rna_find_parameter_def(func->c_ret);
+                       ptrstr = (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraydimension))? "*": "";
                        fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, func->c_ret->identifier);
                }
        }
 
        fprintf(f, "}\n\n");
 
-       dfunc->gencall= funcname;
+       dfunc->gencall = funcname;
 }
 
 static void rna_auto_types(void)
@@ -1775,34 +1775,34 @@ static void rna_auto_types(void)
        StructDefRNA *ds;
        PropertyDefRNA *dp;
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
+       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)
-                       ds->dnaname= "bScreen";
+               if (ds->dnaname && strcmp(ds->dnaname, "Screen") == 0)
+                       ds->dnaname = "bScreen";
 
-               for(dp=ds->cont.properties.first; dp; dp=dp->next) {
-                       if(dp->dnastructname && strcmp(dp->dnastructname, "Screen") == 0)
-                               dp->dnastructname= "bScreen";
+               for (dp = ds->cont.properties.first; dp; dp = dp->next) {
+                       if (dp->dnastructname && strcmp(dp->dnastructname, "Screen") == 0)
+                               dp->dnastructname = "bScreen";
 
-                       if(dp->dnatype) {
-                               if(dp->prop->type == PROP_POINTER) {
-                                       PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
+                       if (dp->dnatype) {
+                               if (dp->prop->type == PROP_POINTER) {
+                                       PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop;
                                        StructRNA *type;
 
-                                       if(!pprop->type && !pprop->get)
-                                               pprop->type= (StructRNA*)rna_find_type(dp->dnatype);
+                                       if (!pprop->type && !pprop->get)
+                                               pprop->type = (StructRNA*)rna_find_type(dp->dnatype);
 
-                                       if(pprop->type) {
-                                               type= rna_find_struct((const char*)pprop->type);
-                                               if(type && (type->flag & STRUCT_ID_REFCOUNT))
+                                       if (pprop->type) {
+                                               type = rna_find_struct((const char*)pprop->type);
+                                               if (type && (type->flag & STRUCT_ID_REFCOUNT))
                                                        pprop->property.flag |= PROP_ID_REFCOUNT;
                                        }
                                }
-                               else if(dp->prop->type== PROP_COLLECTION) {
-                                       CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
+                               else if (dp->prop->type == PROP_COLLECTION) {
+                                       CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)dp->prop;
 
-                                       if(!cprop->item_type && !cprop->get && strcmp(dp->dnatype, "ListBase")==0)
-                                               cprop->item_type= (StructRNA*)rna_find_type(dp->dnatype);
+                                       if (!cprop->item_type && !cprop->get && strcmp(dp->dnatype, "ListBase") == 0)
+                                               cprop->item_type = (StructRNA*)rna_find_type(dp->dnatype);
                                }
                        }
                }
@@ -1817,16 +1817,16 @@ static void rna_sort(BlenderRNA *brna)
        rna_sortlist(&brna->structs, cmp_struct);
        rna_sortlist(&DefRNA.structs, cmp_def_struct);
 
-       for(srna=brna->structs.first; srna; srna=srna->cont.next)
+       for (srna = brna->structs.first; srna; srna = srna->cont.next)
                rna_sortlist(&srna->cont.properties, cmp_property);
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
                rna_sortlist(&ds->cont.properties, cmp_def_property);
 }
 
 static const char *rna_property_structname(PropertyType type)
 {
-       switch(type) {
+       switch (type) {
                case PROP_BOOLEAN: return "BoolPropertyRNA";
                case PROP_INT: return "IntPropertyRNA";
                case PROP_FLOAT: return "FloatPropertyRNA";
@@ -1840,7 +1840,7 @@ static const char *rna_property_structname(PropertyType type)
 
 static const char *rna_property_subtypename(PropertySubType type)
 {
-       switch(type) {
+       switch (type) {
                case PROP_NONE: return "PROP_NONE";
                case PROP_FILEPATH: return "PROP_FILEPATH";
                case PROP_FILENAME: return "PROP_FILENAME";
@@ -1869,7 +1869,7 @@ static const char *rna_property_subtypename(PropertySubType type)
                case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
                default: {
                        /* incase we dont have a type preset that includes the subtype */
-                       if(RNA_SUBTYPE_UNIT(type)) {
+                       if (RNA_SUBTYPE_UNIT(type)) {
                                return rna_property_subtypename(type & ~RNA_SUBTYPE_UNIT(type));
                        }
                        else {
@@ -1881,7 +1881,7 @@ static const char *rna_property_subtypename(PropertySubType type)
 
 static const char *rna_property_subtype_unit(PropertySubType type)
 {
-       switch(RNA_SUBTYPE_UNIT(type)) {
+       switch (RNA_SUBTYPE_UNIT(type)) {
                case PROP_UNIT_NONE:            return "PROP_UNIT_NONE";
                case PROP_UNIT_LENGTH:          return "PROP_UNIT_LENGTH";
                case PROP_UNIT_AREA:            return "PROP_UNIT_AREA";
@@ -1899,7 +1899,7 @@ static void rna_generate_prototypes(BlenderRNA *brna, FILE *f)
 {
        StructRNA *srna;
 
-       for(srna=brna->structs.first; srna; srna=srna->cont.next)
+       for (srna = brna->structs.first; srna; srna = srna->cont.next)
                fprintf(f, "extern StructRNA RNA_%s;\n", srna->identifier);
        fprintf(f, "\n");
 }
@@ -1910,12 +1910,12 @@ static void rna_generate_blender(BlenderRNA *brna, FILE *f)
 
        fprintf(f, "BlenderRNA BLENDER_RNA = {");
 
-       srna= brna->structs.first;
-       if(srna) fprintf(f, "{&RNA_%s, ", srna->identifier);
+       srna = brna->structs.first;
+       if (srna) fprintf(f, "{&RNA_%s, ", srna->identifier);
        else fprintf(f, "{NULL, ");
 
-       srna= brna->structs.last;
-       if(srna) fprintf(f, "&RNA_%s}", srna->identifier);
+       srna = brna->structs.last;
+       if (srna) fprintf(f, "&RNA_%s}", srna->identifier);
        else fprintf(f, "NULL}");
 
        fprintf(f, "};\n\n");
@@ -1926,18 +1926,18 @@ static void rna_generate_property_prototypes(BlenderRNA *brna, StructRNA *srna,
        PropertyRNA *prop;
        StructRNA *base;
 
-       base= srna->base;
+       base = srna->base;
        while (base) {
                fprintf(f, "\n");
-               for(prop=base->cont.properties.first; prop; prop=prop->next)
+               for (prop = base->cont.properties.first; prop; prop = prop->next)
                        fprintf(f, "%s%s rna_%s_%s;\n", "extern ", rna_property_structname(prop->type), base->identifier, prop->identifier);
-               base= base->base;
+               base = base->base;
        }
 
-       if(srna->cont.properties.first)
+       if (srna->cont.properties.first)
                fprintf(f, "\n");
 
-       for(prop=srna->cont.properties.first; prop; prop=prop->next)
+       for (prop = srna->cont.properties.first; prop; prop = prop->next)
                fprintf(f, "%s%s rna_%s_%s;\n", (prop->flag & PROP_EXPORT)? "": "", rna_property_structname(prop->type), srna->identifier, prop->identifier);
        fprintf(f, "\n");
 }
@@ -1946,10 +1946,10 @@ static void rna_generate_parameter_prototypes(BlenderRNA *brna, StructRNA *srna,
 {
        PropertyRNA *parm;
 
-       for(parm= func->cont.properties.first; parm; parm= parm->next)
+       for (parm = func->cont.properties.first; parm; parm = parm->next)
                fprintf(f, "%s%s rna_%s_%s_%s;\n", "extern ", rna_property_structname(parm->type), srna->identifier, func->identifier, parm->identifier);
 
-       if(func->cont.properties.first)
+       if (func->cont.properties.first)
                fprintf(f, "\n");
 }
 
@@ -1958,25 +1958,25 @@ static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna,
        FunctionRNA *func;
        StructRNA *base;
 
-       base= srna->base;
+       base = srna->base;
        while (base) {
-               for(func= base->functions.first; func; func= func->cont.next) {
+               for (func = base->functions.first; func; func = func->cont.next) {
                        fprintf(f, "%s%s rna_%s_%s_func;\n", "extern ", "FunctionRNA", base->identifier, func->identifier);
                        rna_generate_parameter_prototypes(brna, base, func, f);
                }
 
-               if(base->functions.first)
+               if (base->functions.first)
                        fprintf(f, "\n");
 
-               base= base->base;
+               base = base->base;
        }
 
-       for(func= srna->functions.first; func; func= func->cont.next) {
+       for (func = srna->functions.first; func; func = func->cont.next) {
                fprintf(f, "%s%s rna_%s_%s_func;\n", "extern ", "FunctionRNA", srna->identifier, func->identifier);
                rna_generate_parameter_prototypes(brna, srna, func, f);
        }
 
-       if(srna->functions.first)
+       if (srna->functions.first)
                fprintf(f, "\n");
 }
 
@@ -1989,15 +1989,15 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
        int flag, pout, cptr, first;
        const char *ptrstr;
 
-       dsrna= rna_find_struct_def(srna);
-       func= dfunc->func;
+       dsrna = rna_find_struct_def(srna);
+       func = dfunc->func;
 
        /* return type */
-       for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) {
-               if(dparm->prop==func->c_ret) {
-                       if(dparm->prop->arraydimension)
+       for (dparm = dfunc->cont.properties.first; dparm; dparm = dparm->next) {
+               if (dparm->prop == func->c_ret) {
+                       if (dparm->prop->arraydimension)
                                fprintf(f, "XXX no array return types yet"); /* XXX not supported */
-                       else if(dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR))
+                       else if (dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR))
                                fprintf(f, "%s%s *", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
                        else
                                fprintf(f, "%s%s ", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
@@ -2007,71 +2007,71 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
        }
 
        /* void if nothing to return */
-       if(!dparm)
+       if (!dparm)
                fprintf(f, "void ");
 
        /* function name */
        fprintf(f, "%s(", dfunc->call);
 
-       first= 1;
+       first = 1;
 
        /* self, context and reports parameters */
-       if(func->flag & FUNC_USE_SELF_ID) {
+       if (func->flag & FUNC_USE_SELF_ID) {
                fprintf(f, "struct ID *_selfid");
-               first= 0;               
+               first = 0;              
        }
        
-       if((func->flag & FUNC_NO_SELF)==0) {
-               if(!first) fprintf(f, ", ");
-               if(dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname);
+       if ((func->flag & FUNC_NO_SELF) == 0) {
+               if (!first) fprintf(f, ", ");
+               if (dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname);
                else fprintf(f, "struct %s *_self", srna->identifier);
-               first= 0;
+               first = 0;
        }
 
-       if(func->flag & FUNC_USE_MAIN) {
-               if(!first) fprintf(f, ", ");
-               first= 0;
+       if (func->flag & FUNC_USE_MAIN) {
+               if (!first) fprintf(f, ", ");
+               first = 0;
                fprintf(f, "Main *bmain");
        }
 
-       if(func->flag & FUNC_USE_CONTEXT) {
-               if(!first) fprintf(f, ", ");
-               first= 0;
+       if (func->flag & FUNC_USE_CONTEXT) {
+               if (!first) fprintf(f, ", ");
+               first = 0;
                fprintf(f, "bContext *C");
        }
 
-       if(func->flag & FUNC_USE_REPORTS) {
-               if(!first) fprintf(f, ", ");
-               first= 0;
+       if (func->flag & FUNC_USE_REPORTS) {
+               if (!first) fprintf(f, ", ");
+               first = 0;
                fprintf(f, "ReportList *reports");
        }
 
        /* defined parameters */
-       for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) {
+       for (dparm = dfunc->cont.properties.first; dparm; dparm = dparm->next) {
                type = dparm->prop->type;
                flag = dparm->prop->flag;
                pout = (flag & PROP_OUTPUT);
                cptr = ((type == PROP_POINTER) && !(flag & PROP_RNAPTR));
 
-               if(dparm->prop==func->c_ret)
+               if (dparm->prop == func->c_ret)
                        continue;
 
                if (cptr || (flag & PROP_DYNAMIC))
-                       ptrstr= pout ? "**" : "*";
+                       ptrstr = pout ? "**" : "*";
                else if (type == PROP_POINTER || dparm->prop->arraydimension)
-                       ptrstr= "*";
+                       ptrstr = "*";
                else if (type == PROP_STRING && (flag & PROP_THICK_WRAP))
-                       ptrstr= "";
+                       ptrstr = "";
                else
-                       ptrstr= pout ? "*" : "";
+                       ptrstr = pout ? "*" : "";
 
-               if(!first) fprintf(f, ", ");
-               first= 0;
+               if (!first) fprintf(f, ", ");
+               first = 0;
 
                if (flag & PROP_DYNAMIC)
                        fprintf(f, "int %s%s_len, ", pout ? "*" : "", dparm->prop->identifier);
 
-               if(!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension)
+               if (!(flag & PROP_DYNAMIC) && dparm->prop->arraydimension)
                        fprintf(f, "%s%s %s[%u]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->totarraylength);
                else
                        fprintf(f, "%s%s %s%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
@@ -2085,15 +2085,15 @@ static void rna_generate_static_function_prototypes(BlenderRNA *brna, StructRNA
 {
        FunctionRNA *func;
        FunctionDefRNA *dfunc;
-       int first= 1;
+       int first = 1;
 
-       for(func= srna->functions.first; func; func= func->cont.next) {
-               dfunc= rna_find_function_def(func);
+       for (func = srna->functions.first; func; func = func->cont.next) {
+               dfunc = rna_find_function_def(func);
 
-               if(dfunc->call) {
-                       if(first) {
+               if (dfunc->call) {
+                       if (first) {
                                fprintf(f, "/* Repeated prototypes to detect errors */\n\n");
-                               first= 0;
+                               first = 0;
                        }
 
                        rna_generate_static_parameter_prototypes(brna, srna, dfunc, f);
@@ -2105,43 +2105,43 @@ static void rna_generate_static_function_prototypes(BlenderRNA *brna, StructRNA
 
 static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, PropertyRNA *prop) 
 {
-       char *strnest= "", *errnest= "";
-       int len, freenest= 0;
+       char *strnest = "", *errnest = "";
+       int len, freenest = 0;
        
-       if(nest != NULL) {
-               len= strlen(nest);
+       if (nest != NULL) {
+               len = strlen(nest);
 
-               strnest= MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> strnest");
-               errnest= MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> errnest");
+               strnest = MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> strnest");
+               errnest = MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> errnest");
 
                strcpy(strnest, "_"); strcat(strnest, nest);
                strcpy(errnest, "."); strcat(errnest, nest);
 
-               freenest= 1;
+               freenest = 1;
        }
 
-       switch(prop->type) {
+       switch (prop->type) {
                        case PROP_ENUM: {
-                               EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
-                               int i, defaultfound= 0, totflag= 0;
+                               EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
+                               int i, defaultfound = 0, totflag = 0;
 
-                               if(eprop->item) {
+                               if (eprop->item) {
                                        fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {\n\t", srna->identifier, strnest, prop->identifier, eprop->totitem+1);
 
-                                       for(i=0; i<eprop->totitem; i++) {
+                                       for (i = 0; i<eprop->totitem; i++) {
                                                fprintf(f, "{%d, ", eprop->item[i].value);
                                                rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", ");
                                                fprintf(f, "%d, ", eprop->item[i].icon);
                                                rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", ");
                                                rna_print_c_string(f, eprop->item[i].description); fprintf(f, "},\n\t");
 
-                                               if(eprop->item[i].identifier[0]) {
-                                                       if(prop->flag & PROP_ENUM_FLAG) {
+                                               if (eprop->item[i].identifier[0]) {
+                                                       if (prop->flag & PROP_ENUM_FLAG) {
                                                                totflag |= eprop->item[i].value;
                                                        }
                                                        else {
-                                                               if(eprop->defaultvalue == eprop->item[i].value) {
-                                                                       defaultfound= 1;
+                                                               if (eprop->defaultvalue == eprop->item[i].value) {
+                                                                       defaultfound = 1;
                                                                }
                                                        }
                                                }
@@ -2149,41 +2149,41 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
 
                                        fprintf(f, "{0, NULL, 0, NULL, NULL}\n};\n\n");
 
-                                       if(prop->flag & PROP_ENUM_FLAG) {
-                                               if(eprop->defaultvalue & ~totflag) {
+                                       if (prop->flag & PROP_ENUM_FLAG) {
+                                               if (eprop->defaultvalue & ~totflag) {
                                                        fprintf(stderr, "%s: %s%s.%s, enum default includes unused bits (%d).\n",
                                                                __func__, srna->identifier, errnest, prop->identifier, eprop->defaultvalue & ~totflag);
-                                                       DefRNA.error= 1;
+                                                       DefRNA.error = 1;
                                                }
                                        }
                                        else {
-                                               if(!defaultfound) {
+                                               if (!defaultfound) {
                                                        fprintf(stderr, "%s: %s%s.%s, enum default is not in items.\n",
                                                                __func__, srna->identifier, errnest, prop->identifier);
-                                                       DefRNA.error= 1;
+                                                       DefRNA.error = 1;
                                                }
                                        }
                                }
                                else {
                                        fprintf(stderr, "%s: %s%s.%s, enum must have items defined.\n",
                                                __func__, srna->identifier, errnest, prop->identifier);
-                                       DefRNA.error= 1;
+                                       DefRNA.error = 1;
                                }
                                break;
                        }
                        case PROP_BOOLEAN: {
-                               BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+                               BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
                                unsigned int i;
 
-                               if(prop->arraydimension && prop->totarraylength) {
+                               if (prop->arraydimension && prop->totarraylength) {
                                        fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
 
-                                       for(i=0; i<prop->totarraylength; i++) {
-                                               if(bprop->defaultarray)
+                                       for (i = 0; i<prop->totarraylength; i++) {
+                                               if (bprop->defaultarray)
                                                        fprintf(f, "%d", bprop->defaultarray[i]);
                                                else
                                                        fprintf(f, "%d", bprop->defaultvalue);
-                                               if(i != prop->totarraylength-1)
+                                               if (i != prop->totarraylength-1)
                                                        fprintf(f, ",\n\t");
                                        }
 
@@ -2192,18 +2192,18 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                                break;
                        }
                        case PROP_INT: {
-                               IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+                               IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
                                unsigned int i;
 
-                               if(prop->arraydimension && prop->totarraylength) {
+                               if (prop->arraydimension && prop->totarraylength) {
                                        fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
 
-                                       for(i=0; i<prop->totarraylength; i++) {
-                                               if(iprop->defaultarray)
+                                       for (i = 0; i<prop->totarraylength; i++) {
+                                               if (iprop->defaultarray)
                                                        fprintf(f, "%d", iprop->defaultarray[i]);
                                                else
                                                        fprintf(f, "%d", iprop->defaultvalue);
-                                               if(i != prop->totarraylength-1)
+                                               if (i != prop->totarraylength-1)
                                                        fprintf(f, ",\n\t");
                                        }
 
@@ -2212,18 +2212,18 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                                break;
                        }
                        case PROP_FLOAT: {
-                               FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+                               FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
                                unsigned int i;
 
-                               if(prop->arraydimension && prop->totarraylength) {
+                               if (prop->arraydimension && prop->totarraylength) {
                                        fprintf(f, "static float rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, prop->identifier, prop->totarraylength);
 
-                                       for(i=0; i<prop->totarraylength; i++) {
-                                               if(fprop->defaultarray)
+                                       for (i = 0; i<prop->totarraylength; i++) {
+                                               if (fprop->defaultarray)
                                                        rna_float_print(f, fprop->defaultarray[i]);
                                                else
                                                        rna_float_print(f, fprop->defaultvalue);
-                                               if(i != prop->totarraylength-1)
+                                               if (i != prop->totarraylength-1)
                                                        fprintf(f, ",\n\t");
                                        }
 
@@ -2237,9 +2237,9 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
 
        fprintf(f, "%s%s rna_%s%s_%s = {\n", (prop->flag & PROP_EXPORT)? "": "", rna_property_structname(prop->type), srna->identifier, strnest, prop->identifier);
 
-       if(prop->next) fprintf(f, "\t{(PropertyRNA*)&rna_%s%s_%s, ", srna->identifier, strnest, prop->next->identifier);
+       if (prop->next) fprintf(f, "\t{(PropertyRNA*)&rna_%s%s_%s, ", srna->identifier, strnest, prop->next->identifier);
        else fprintf(f, "\t{NULL, ");
-       if(prop->prev) fprintf(f, "(PropertyRNA*)&rna_%s%s_%s,\n", srna->identifier, strnest, prop->prev->identifier);
+       if (prop->prev) fprintf(f, "(PropertyRNA*)&rna_%s%s_%s,\n", srna->identifier, strnest, prop->prev->identifier);
        else fprintf(f, "NULL,\n");
        fprintf(f, "\t%d, ", prop->magic);
        rna_print_c_string(f, prop->identifier);
@@ -2251,25 +2251,25 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
        fprintf(f, "\t%s, %s|%s, %s, %u, {%u, %u, %u}, %u,\n", RNA_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), rna_function_string(prop->getlength), prop->arraydimension, prop->arraylength[0], prop->arraylength[1], prop->arraylength[2], prop->totarraylength);
        fprintf(f, "\t%s%s, %d, %s, %s,\n", (prop->flag & PROP_CONTEXT_UPDATE)? "(UpdateFunc)": "", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), rna_function_string(prop->itemeditable));
 
-       if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
+       if (prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
        else fprintf(f, "\t0, -1");
 
        /* our own type - collections/arrays only */
-       if(prop->srna) fprintf(f, ", &RNA_%s", (const char*)prop->srna);
+       if (prop->srna) fprintf(f, ", &RNA_%s", (const char*)prop->srna);
        else fprintf(f, ", NULL");
 
        fprintf(f, "},\n");
 
-       switch(prop->type) {
+       switch (prop->type) {
                        case PROP_BOOLEAN: {
-                               BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+                               BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
                                fprintf(f, "\t%s, %s, %s, %s, %d, ", rna_function_string(bprop->get), rna_function_string(bprop->set), rna_function_string(bprop->getarray), rna_function_string(bprop->setarray), bprop->defaultvalue);
-                               if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
+                               if (prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
                                else fprintf(f, "NULL\n");
                                break;
                        }
                        case PROP_INT: {
-                               IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+                               IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
                                fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", rna_function_string(iprop->get), rna_function_string(iprop->set), rna_function_string(iprop->getarray), rna_function_string(iprop->setarray), rna_function_string(iprop->range));
                                rna_int_print(f, iprop->softmin); fprintf(f, ", ");
                                rna_int_print(f, iprop->softmax); fprintf(f, ", ");
@@ -2277,12 +2277,12 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                                rna_int_print(f, iprop->hardmax); fprintf(f, ", ");
                                rna_int_print(f, iprop->step); fprintf(f, ", ");
                                rna_int_print(f, iprop->defaultvalue); fprintf(f, ", ");
-                               if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
+                               if (prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
                                else fprintf(f, "NULL\n");
                                break;
                        }
                        case PROP_FLOAT: {
-                               FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+                               FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
                                fprintf(f, "\t%s, %s, %s, %s, %s, ", rna_function_string(fprop->get), rna_function_string(fprop->set), rna_function_string(fprop->getarray), rna_function_string(fprop->setarray), rna_function_string(fprop->range));
                                rna_float_print(f, fprop->softmin); fprintf(f, ", ");
                                rna_float_print(f, fprop->softmax); fprintf(f, ", ");
@@ -2291,20 +2291,20 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                                rna_float_print(f, fprop->step); fprintf(f, ", ");
                                rna_int_print(f, (int)fprop->precision); fprintf(f, ", ");
                                rna_float_print(f, fprop->defaultvalue); fprintf(f, ", ");
-                               if(prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
+                               if (prop->arraydimension && prop->totarraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier);
                                else fprintf(f, "NULL\n");
                                break;
                        }
                        case PROP_STRING: {
-                               StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
+                               StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
                                fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength);
                                rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n");
                                break;
                        }
                        case PROP_ENUM: {
-                               EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+                               EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
                                fprintf(f, "\t%s, %s, %s, NULL, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->itemf));
-                               if(eprop->item)
+                               if (eprop->item)
                                        fprintf(f, "rna_%s%s_%s_items, ", srna->identifier, strnest, prop->identifier);
                                else
                                        fprintf(f, "NULL, ");
@@ -2312,16 +2312,16 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
                                break;
                        }
                        case PROP_POINTER: {
-                               PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+                               PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
                                fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef), rna_function_string(pprop->poll));
-                               if(pprop->type) fprintf(f, "&RNA_%s\n", (const char*)pprop->type);
+                               if (pprop->type) fprintf(f, "&RNA_%s\n", (const char*)pprop->type);
                                else fprintf(f, "NULL\n");
                                break;
                        }
                        case PROP_COLLECTION: {
-                               CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+                               CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
                                fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring), rna_function_string(cprop->assignint));
-                               if(cprop->item_type) fprintf(f, "&RNA_%s\n", (const char*)cprop->item_type);
+                               if (cprop->item_type) fprintf(f, "&RNA_%s\n", (const char*)cprop->item_type);
                                else fprintf(f, "NULL\n");
                                break;
                        }
@@ -2329,7 +2329,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
 
        fprintf(f, "};\n\n");
 
-       if(freenest) {
+       if (freenest) {
                MEM_freeN(strnest);
                MEM_freeN(errnest);
        }
@@ -2344,28 +2344,28 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
 
        fprintf(f, "/* %s */\n", srna->name);
 
-       for(prop= srna->cont.properties.first; prop; prop= prop->next)
+       for (prop = srna->cont.properties.first; prop; prop = prop->next)
                rna_generate_property(f, srna, NULL, prop);
 
-       for(func= srna->functions.first; func; func= func->cont.next) {
-               for(parm= func->cont.properties.first; parm; parm= parm->next)
+       for (func = srna->functions.first; func; func = func->cont.next) {
+               for (parm = func->cont.properties.first; parm; parm = parm->next)
                        rna_generate_property(f, srna, func->identifier, parm);
 
                fprintf(f, "%s%s rna_%s_%s_func = {\n", "", "FunctionRNA", srna->identifier, func->identifier);
 
-               if(func->cont.next) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, ((FunctionRNA*)func->cont.next)->identifier);
+               if (func->cont.next) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, ((FunctionRNA*)func->cont.next)->identifier);
                else fprintf(f, "\t{NULL, ");
-               if(func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier);
+               if (func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier);
                else fprintf(f, "NULL,\n");
 
                fprintf(f, "\tNULL,\n");
 
-               parm= func->cont.properties.first;
-               if(parm) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s_%s, ", srna->identifier, func->identifier, parm->identifier);
+               parm = func->cont.properties.first;
+               if (parm) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s_%s, ", srna->identifier, func->identifier, parm->identifier);
                else fprintf(f, "\t{NULL, ");
 
-               parm= func->cont.properties.last;
-               if(parm) fprintf(f, "(PropertyRNA*)&rna_%s_%s_%s}},\n", srna->identifier, func->identifier, parm->identifier);
+               parm = func->cont.properties.last;
+               if (parm) fprintf(f, "(PropertyRNA*)&rna_%s_%s_%s}},\n", srna->identifier, func->identifier, parm->identifier);
                else fprintf(f, "NULL}},\n");
 
                fprintf(f, "\t");
@@ -2373,11 +2373,11 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
                fprintf(f, ", %d, ", func->flag);
                rna_print_c_string(f, func->description); fprintf(f, ",\n");
 
-               dfunc= rna_find_function_def(func);
-               if(dfunc->gencall) fprintf(f, "\t%s,\n", dfunc->gencall);
+               dfunc = rna_find_function_def(func);
+               if (dfunc->gencall) fprintf(f, "\t%s,\n", dfunc->gencall);
                else fprintf(f, "\tNULL,\n");
 
-               if(func->c_ret) fprintf(f, "\t(PropertyRNA*)&rna_%s_%s_%s\n", srna->identifier, func->identifier, func->c_ret->identifier);
+               if (func->c_ret) fprintf(f, "\t(PropertyRNA*)&rna_%s_%s_%s\n", srna->identifier, func->identifier, func->c_ret->identifier);
                else fprintf(f, "\tNULL\n");
 
                fprintf(f, "};\n");
@@ -2386,19 +2386,19 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
 
        fprintf(f, "StructRNA RNA_%s = {\n", srna->identifier);
 
-       if(srna->cont.next) fprintf(f, "\t{(ContainerRNA *)&RNA_%s, ", ((StructRNA*)srna->cont.next)->identifier);
+       if (srna->cont.next) fprintf(f, "\t{(ContainerRNA *)&RNA_%s, ", ((StructRNA*)srna->cont.next)->identifier);
        else fprintf(f, "\t{NULL, ");
-       if(srna->cont.prev) fprintf(f, "(ContainerRNA *)&RNA_%s,\n", ((StructRNA*)srna->cont.prev)->identifier);
+       if (srna->cont.prev) fprintf(f, "(ContainerRNA *)&RNA_%s,\n", ((StructRNA*)srna->cont.prev)->identifier);
        else fprintf(f, "NULL,\n");
 
        fprintf(f, "\tNULL,\n");
 
-       prop= srna->cont.properties.first;
-       if(prop) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->identifier);
+       prop = srna->cont.properties.first;
+       if (prop) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->identifier);
        else fprintf(f, "\t{NULL, ");
 
-       prop= srna->cont.properties.last;
-       if(prop) fprintf(f, "(PropertyRNA*)&rna_%s_%s}},\n", srna->identifier, prop->identifier);
+       prop = srna->cont.properties.last;
+       if (prop) fprintf(f, "(PropertyRNA*)&rna_%s_%s}},\n", srna->identifier, prop->identifier);
        else fprintf(f, "NULL}},\n");
        fprintf(f, "\t");
        rna_print_c_string(f, srna->identifier);
@@ -2409,26 +2409,26 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
        rna_print_c_string(f, srna->description);
        fprintf(f, ",\n\t%d,\n", srna->icon);
 
-       prop= srna->nameproperty;
-       if(prop) {
-               base= srna;
-               while (base->base && base->base->nameproperty==prop)
-                       base= base->base;
+       prop = srna->nameproperty;
+       if (prop) {
+               base = srna;
+               while (base->base && base->base->nameproperty == prop)
+                       base = base->base;
 
                fprintf(f, "\t(PropertyRNA*)&rna_%s_%s, ", base->identifier, prop->identifier);
        }
        else fprintf(f, "\tNULL, ");
 
-       prop= srna->iteratorproperty;
-       base= srna;
-       while (base->base && base->base->iteratorproperty==prop)
-               base= base->base;
+       prop = srna->iteratorproperty;
+       base = srna;
+       while (base->base && base->base->iteratorproperty == prop)
+               base = base->base;
        fprintf(f, "(PropertyRNA*)&rna_%s_rna_properties,\n", base->identifier);
 
-       if(srna->base) fprintf(f, "\t&RNA_%s,\n", srna->base->identifier);
+       if (srna->base) fprintf(f, "\t&RNA_%s,\n", srna->base->identifier);
        else fprintf(f, "\tNULL,\n");
 
-       if(srna->nested) fprintf(f, "\t&RNA_%s,\n", srna->nested->identifier);
+       if (srna->nested) fprintf(f, "\t&RNA_%s,\n", srna->nested->identifier);
        else fprintf(f, "\tNULL,\n");
 
        fprintf(f, "\t%s,\n", rna_function_string(srna->refine));
@@ -2438,18 +2438,18 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
        fprintf(f, "\t%s,\n", rna_function_string(srna->instance));
        fprintf(f, "\t%s,\n", rna_function_string(srna->idproperties));
 
-       if(srna->reg && !srna->refine) {
+       if (srna->reg && !srna->refine) {
                fprintf(stderr, "%s: %s has a register function, must also have refine function.\n",
                        __func__, srna->identifier);
-               DefRNA.error= 1;
+               DefRNA.error = 1;
        }
 
-       func= srna->functions.first;
-       if(func) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, func->identifier);
+       func = srna->functions.first;
+       if (func) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, func->identifier);
        else fprintf(f, "\t{NULL, ");
 
-       func= srna->functions.last;
-       if(func) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func}\n", srna->identifier, func->identifier);
+       func = srna->functions.last;
+       if (func) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func}\n", srna->identifier, func->identifier);
        else fprintf(f, "NULL}\n");
 
        fprintf(f, "};\n");
@@ -2463,7 +2463,7 @@ typedef struct RNAProcessItem {
        void (*define)(BlenderRNA *brna);
 } RNAProcessItem;
 
-static RNAProcessItem PROCESS_ITEMS[]= {
+static RNAProcessItem PROCESS_ITEMS[] = {
        {"rna_rna.c", NULL, RNA_def_rna},
        {"rna_ID.c", NULL, RNA_def_ID},
        {"rna_texture.c", "rna_texture_api.c", RNA_def_texture},
@@ -2559,38 +2559,38 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
        rna_generate_prototypes(brna, f);
 
        fprintf(f, "#include \"%s\"\n", filename);
-       if(api_filename)
+       if (api_filename)
                fprintf(f, "#include \"%s\"\n", api_filename);
        fprintf(f, "\n");
 
        fprintf(f, "/* Autogenerated Functions */\n\n");
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
-               if(!filename || ds->filename == filename) {
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+               if (!filename || ds->filename == filename) {
                        rna_generate_property_prototypes(brna, ds->srna, f);
                        rna_generate_function_prototypes(brna, ds->srna, f);
                }
        }
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
-               if(!filename || ds->filename == filename)
-                       for(dp=ds->cont.properties.first; dp; dp=dp->next)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+               if (!filename || ds->filename == filename)
+                       for (dp = ds->cont.properties.first; dp; dp = dp->next)
                                rna_def_property_funcs(f, ds->srna, dp);
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
-               if(!filename || ds->filename == filename) {
-                       for(dfunc=ds->functions.first; dfunc; dfunc= dfunc->cont.next)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+               if (!filename || ds->filename == filename) {
+                       for (dfunc = ds->functions.first; dfunc; dfunc = dfunc->cont.next)
                                rna_def_function_funcs(f, ds, dfunc);
 
                        rna_generate_static_function_prototypes(brna, ds->srna, f);
                }
        }
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
-               if(!filename || ds->filename == filename)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+               if (!filename || ds->filename == filename)
                        rna_generate_struct(brna, ds->srna, f);
 
-       if(strcmp(filename, "rna_ID.c") == 0) {
+       if (strcmp(filename, "rna_ID.c") == 0) {
                /* 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");
@@ -2626,18 +2626,18 @@ static void rna_generate_header(BlenderRNA *brna, FILE *f)
        fprintf(f, "            property##_end(&rna_macro_iter); \\\n");
        fprintf(f, "    }\n\n");
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
-               srna= ds->srna;
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+               srna = ds->srna;
 
                fprintf(f, "/**************** %s ****************/\n\n", srna->name);
 
-               while(srna) {
+               while (srna) {
                        fprintf(f, "extern StructRNA RNA_%s;\n", srna->identifier);
-                       srna= srna->base;
+                       srna = srna->base;
                }
                fprintf(f, "\n");
 
-               for(dp=ds->cont.properties.first; dp; dp=dp->next)
+               for (dp = ds->cont.properties.first; dp; dp = dp->next)
                        rna_def_property_funcs_header(f, ds->srna, dp);
        }
 
@@ -2781,25 +2781,25 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
 
        fprintf(f, "/**************** Declarations ****************/\n\n");
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
                fprintf(f, "class %s;\n", ds->srna->identifier);
        fprintf(f, "\n");
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
-               srna= ds->srna;
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+               srna = ds->srna;
 
                fprintf(f, "/**************** %s ****************/\n\n", srna->name);
 
                fprintf(f, "class %s : public %s {\n", srna->identifier, (srna->base)? srna->base->identifier: "Pointer");
                fprintf(f, "public:\n");
                fprintf(f, "\t%s(const PointerRNA& ptr) :\n\t\t%s(ptr)", srna->identifier, (srna->base)? srna->base->identifier: "Pointer");
-               for(dp=ds->cont.properties.first; dp; dp=dp->next)
-                       if(!(dp->prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)))
-                               if(dp->prop->type == PROP_COLLECTION)
+               for (dp = ds->cont.properties.first; dp; dp = dp->next)
+                       if (!(dp->prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)))
+                               if (dp->prop->type == PROP_COLLECTION)
                                        fprintf(f, ",\n\t\t%s(ptr)", dp->prop->identifier);
                fprintf(f, "\n\t\t{}\n\n");
 
-               for(dp=ds->cont.properties.first; dp; dp=dp->next)
+               for (dp = ds->cont.properties.first; dp; dp = dp->next)
                        rna_def_property_funcs_header_cpp(f, ds->srna, dp);
                fprintf(f, "};\n\n");
        }
@@ -2807,8 +2807,8 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
 
        fprintf(f, "/**************** Implementation ****************/\n");
 
-       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next) {
-               for(dp=ds->cont.properties.first; dp; dp=dp->next)
+       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
+               for (dp = ds->cont.properties.first; dp; dp = dp->next)
                        rna_def_property_funcs_impl_cpp(f, ds->srna, dp);
 
                fprintf(f, "\n");
@@ -2819,7 +2819,7 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
 
 static void make_bad_file(const char *file, int line)
 {
-       FILE *fp= fopen(file, "w");
+       FILE *fp = fopen(file, "w");
        fprintf(fp, "#error \"Error! can't make correct RNA file from %s:%d, STUPID!\"\n", __FILE__, line);
        fclose(fp);
 }
@@ -2834,15 +2834,15 @@ static int rna_preprocess(const char *outfile)
        const char *deps[3]; /* expand as needed */
 
        /* define rna */
-       brna= RNA_create();
+       brna = RNA_create();
 
-       for(i=0; PROCESS_ITEMS[i].filename; i++) {
-               if(PROCESS_ITEMS[i].define) {
+       for (i = 0; PROCESS_ITEMS[i].filename; i++) {
+               if (PROCESS_ITEMS[i].define) {
                        PROCESS_ITEMS[i].define(brna);
 
-                       for(ds=DefRNA.structs.first; ds; ds=ds->cont.next)
-                               if(!ds->filename)
-                                       ds->filename= PROCESS_ITEMS[i].filename;
+                       for (ds = DefRNA.structs.first; ds; ds = ds->cont.next)
+                               if (!ds->filename)
+                                       ds->filename = PROCESS_ITEMS[i].filename;
                }
        }
 
@@ -2853,22 +2853,22 @@ static int rna_preprocess(const char *outfile)
        strcpy(deffile, outfile);
        strcat(deffile, "RNA_blender_cpp.h" TMP_EXT);
 
-       status= (DefRNA.error != 0);
+       status = (DefRNA.error != 0);
 
-       if(status) {
+       if (status) {
                make_bad_file(deffile, __LINE__);
        }
        else {
                file = fopen(deffile, "w");
 
-               if(!file) {
+               if (!file) {
                        fprintf(stderr, "Unable to open file: %s\n", deffile);
                        status = 1;
                }
                else {
                        rna_generate_header_cpp(brna, file);
                        fclose(file);
-                       status= (DefRNA.error != 0);
+                       status = (DefRNA.error != 0);
                }
        }
 
@@ -2877,33 +2877,33 @@ static int rna_preprocess(const char *outfile)
        rna_sort(brna);
 
        /* create rna_gen_*.c files */
-       for(i=0; PROCESS_ITEMS[i].filename; i++) {
+       for (i = 0; PROCESS_ITEMS[i].filename; i++) {
                strcpy(deffile, outfile);
                strcat(deffile, PROCESS_ITEMS[i].filename);
                deffile[strlen(deffile)-2] = '\0';
                strcat(deffile, "_gen.c" TMP_EXT);
 
-               if(status) {
+               if (status) {
                        make_bad_file(deffile, __LINE__);
                }
                else {
                        file = fopen(deffile, "w");
 
-                       if(!file) {
+                       if (!file) {
                                fprintf(stderr, "Unable to open file: %s\n", deffile);
                                status = 1;
                        }
                        else {
                                rna_generate(brna, file, PROCESS_ITEMS[i].filename, PROCESS_ITEMS[i].api_filename);
                                fclose(file);
-                               status= (DefRNA.error != 0);
+                               status = (DefRNA.error != 0);
                        }
                }
 
                /* avoid unneeded rebuilds */
-               deps[0]= PROCESS_ITEMS[i].filename;
-               deps[1]= PROCESS_ITEMS[i].api_filename;
-               deps[2]= NULL;
+               deps[0] = PROCESS_ITEMS[i].filename;
+               deps[1] = PROCESS_ITEMS[i].api_filename;
+               deps[2] = NULL;
 
                replace_if_different(deffile, deps);
        }
@@ -2912,20 +2912,20 @@ static int rna_preprocess(const char *outfile)
        strcpy(deffile, outfile);
        strcat(deffile, "RNA_blender.h" TMP_EXT);
 
-       if(status) {
+       if (status) {
                make_bad_file(deffile, __LINE__);
        }
        else {
                file = fopen(deffile, "w");
 
-               if(!file) {
+               if (!file) {
                        fprintf(stderr, "Unable to open file: %s\n", deffile);
                        status = 1;
                }
                else {
                        rna_generate_header(brna, file);
                        fclose(file);
-                       status= (DefRNA.error != 0);
+                       status = (DefRNA.error != 0);
                }
        }
 
@@ -2948,18 +2948,18 @@ int main(int argc, char **argv)
 {
        int totblock, return_status = 0;
 
-       if(argc<2) {
+       if (argc<2) {
                fprintf(stderr, "Usage: %s outdirectory/\n", argv[0]);
                return_status = 1;
        }
        else {
                fprintf(stderr, "Running makesrna, program versions %s\n",  RNA_VERSION_DATE);
-               makesrna_path= argv[0];
-               return_status= rna_preprocess(argv[1]);
+               makesrna_path = argv[0];
+               return_status = rna_preprocess(argv[1]);
        }
 
-       totblock= MEM_get_memory_blocks_in_use();
-       if(totblock!=0) {
+       totblock = MEM_get_memory_blocks_in_use();
+       if (totblock != 0) {
                fprintf(stderr, "Error Totblock: %d\n",totblock);
                MEM_set_error_callback(mem_error_cb);
                MEM_printmemlist();
index de0cd6d..6ca66f1 100644 (file)
@@ -84,30 +84,30 @@ EnumPropertyItem id_type_items[] = {
 /* name functions that ignore the first two ID characters */
 void rna_ID_name_get(PointerRNA *ptr, char *value)
 {
-       ID *id= (ID*)ptr->data;
+       ID *id = (ID*)ptr->data;
        BLI_strncpy(value, id->name+2, sizeof(id->name)-2);
 }
 
 int rna_ID_name_length(PointerRNA *ptr)
 {
-       ID *id= (ID*)ptr->data;
+       ID *id = (ID*)ptr->data;
        return strlen(id->name+2);
 }
 
 void rna_ID_name_set(PointerRNA *ptr, const char *value)
 {
-       ID *id= (ID*)ptr->data;
+       ID *id = (ID*)ptr->data;
        BLI_strncpy_utf8(id->name+2, value, sizeof(id->name)-2);
        test_idbutton(id->name+2);
 }
 
 static int rna_ID_name_editable(PointerRNA *ptr)
 {
-       ID *id= (ID*)ptr->data;
+       ID *id = (ID*)ptr->data;
        
        if (GS(id->name) == ID_VF) {
-               VFont *vf= (VFont *)id;
-               if (strcmp(vf->name, FO_BUILTIN_NAME)==0)
+               VFont *vf = (VFont *)id;
+               if (strcmp(vf->name, FO_BUILTIN_NAME) == 0)
                        return 0;
        }
        
@@ -116,41 +116,41 @@ static int rna_ID_name_editable(PointerRNA *ptr)
 
 short RNA_type_to_ID_code(StructRNA *type)
 {
-       if(RNA_struct_is_a(type, &RNA_Action)) return ID_AC;
-       if(RNA_struct_is_a(type, &RNA_Armature)) return ID_AR;
-       if(RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
-       if(RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
-       if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
-       if(RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
-       if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
-       if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
-       if(RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
-       if(RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA;
-       if(RNA_struct_is_a(type, &RNA_Library)) return ID_LI;
-       if(RNA_struct_is_a(type, &RNA_Lattice)) return ID_LT;
-       if(RNA_struct_is_a(type, &RNA_Material)) return ID_MA;
-       if(RNA_struct_is_a(type, &RNA_MetaBall)) return ID_MB;
-       if(RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT;
-       if(RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME;
-       if(RNA_struct_is_a(type, &RNA_Object)) return ID_OB;
-       if(RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
-       if(RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
-       if(RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
-       if(RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
-       if(RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
-       if(RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
-       if(RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
-       if(RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
-       if(RNA_struct_is_a(type, &RNA_World)) return ID_WO;
-       if(RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
-       if(RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
+       if (RNA_struct_is_a(type, &RNA_Action)) return ID_AC;
+       if (RNA_struct_is_a(type, &RNA_Armature)) return ID_AR;
+       if (RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
+       if (RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
+       if (RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
+       if (RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
+       if (RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
+       if (RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
+       if (RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
+       if (RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA;
+       if (RNA_struct_is_a(type, &RNA_Library)) return ID_LI;
+       if (RNA_struct_is_a(type, &RNA_Lattice)) return ID_LT;
+       if (RNA_struct_is_a(type, &RNA_Material)) return ID_MA;
+       if (RNA_struct_is_a(type, &RNA_MetaBall)) return ID_MB;
+       if (RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT;
+       if (RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME;
+       if (RNA_struct_is_a(type, &RNA_Object)) return ID_OB;
+       if (RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
+       if (RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
+       if (RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
+       if (RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
+       if (RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
+       if (RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
+       if (RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
+       if (RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
+       if (RNA_struct_is_a(type, &RNA_World)) return ID_WO;
+       if (RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
+       if (RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
 
        return 0;
 }
 
 StructRNA *ID_code_to_RNA_type(short idcode)
 {
-       switch(idcode) {
+       switch (idcode) {
                case ID_AC: return &RNA_Action;
                case ID_AR: return &RNA_Armature;
                case ID_BR: return &RNA_Brush;
@@ -185,7 +185,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
 
 StructRNA *rna_ID_refine(PointerRNA *ptr)
 {
-       ID *id= (ID*)ptr->data;
+       ID *id = (ID*)ptr->data;
 
        return ID_code_to_RNA_type(GS(id->name));
 }
@@ -197,13 +197,13 @@ IDProperty *rna_ID_idprops(PointerRNA *ptr, int create)
 
 void rna_ID_fake_user_set(PointerRNA *ptr, int value)
 {
-       ID *id= (ID*)ptr->data;
+       ID *id = (ID*)ptr->data;
 
-       if(value && !(id->flag & LIB_FAKEUSER)) {
+       if (value && !(id->flag & LIB_FAKEUSER)) {
                id->flag |= LIB_FAKEUSER;
                id_us_plus(id);
        }
-       else if(!value && (id->flag & LIB_FAKEUSER)) {
+       else if (!value && (id->flag & LIB_FAKEUSER)) {
                id->flag &= ~LIB_FAKEUSER;
                id_us_min(id);
        }
@@ -227,19 +227,19 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports,
        RNA_pointer_create(NULL, &RNA_PropertyGroup, NULL, &dummyptr);
 
        /* validate the python class */
-       if(validate(&dummyptr, data, NULL) != 0)
+       if (validate(&dummyptr, data, NULL) != 0)
                return NULL;
 
        /* note: it looks like there is no length limit on the srna id since its
         * just a char pointer, but take care here, also be careful that python
         * owns the string pointer which it could potentially free while blender
         * is running. */
-       if(BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
+       if (BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
                BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier);
                return NULL;
        }
 
-       return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup");  // XXX
+       return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup");  /* XXX */
 }
 
 StructRNA* rna_PropertyGroup_refine(PointerRNA *ptr)
@@ -251,8 +251,8 @@ ID *rna_ID_copy(ID *id)
 {
        ID *newid;
 
-       if(id_copy(id, &newid, 0)) {
-               if(newid) id_us_min(newid);
+       if (id_copy(id, &newid, 0)) {
+               if (newid) id_us_min(newid);
                return newid;
        }
        
@@ -268,14 +268,14 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
                BKE_text_to_curve(sce, ob, CU_LEFT);
        }*/
 
-       if(flag == 0) {
+       if (flag == 0) {
                /* pass */
        }
        else {
                /* ensure flag us correct for the type */
-               switch(GS(id->name)) {
+               switch (GS(id->name)) {
                case ID_OB:
-                       if(flag & ~(OB_RECALC_ALL)) {
+                       if (flag & ~(OB_RECALC_ALL)) {
                                BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type");
                                return;
                        }
@@ -298,28 +298,28 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
 
 void rna_ID_user_clear(ID *id)
 {
-       id->us= 0; /* dont save */
+       id->us = 0; /* dont save */
        id->flag &= ~LIB_FAKEUSER;
 }
 
 static void rna_IDPArray_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
 {
-       IDProperty *prop= (IDProperty *)ptr->data;
+       IDProperty *prop = (IDProperty *)ptr->data;
        rna_iterator_array_begin(iter, IDP_IDPArray(prop), sizeof(IDProperty), prop->len, 0, NULL);
 }
 
 static int rna_IDPArray_length(PointerRNA *ptr)
 {
-       IDProperty *prop= (IDProperty *)ptr->data;
+       IDProperty *prop = (IDProperty *)ptr->data;
        return prop->len;
 }
 
 int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr)
 {
-       ID *id=           ptr->id.data;
-       short *totcol= give_totcolp_id(id);
-       Material *mat_id= assign_ptr->id.data;
-       if(totcol && (key >= 0 && key < *totcol)) {
+       ID *id =           ptr->id.data;
+       short *totcol = give_totcolp_id(id);
+       Material *mat_id = assign_ptr->id.data;
+       if (totcol && (key >= 0 && key < *totcol)) {
                assign_material_id(id, mat_id, key + 1);
                return 1;
        }
@@ -330,7 +330,7 @@ int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assig
 
 void rna_Library_filepath_set(PointerRNA *ptr, const char *value)
 {
-       Library *lib= (Library*)ptr->data;
+       Library *lib = (Library*)ptr->data;
        BKE_library_filepath_set(lib, value);
 }
 
@@ -343,56 +343,56 @@ static void rna_def_ID_properties(BlenderRNA *brna)
 
        /* this is struct is used for holding the virtual
         * PropertyRNA's for ID properties */
-       srna= RNA_def_struct(brna, "PropertyGroupItem", NULL);
+       srna = RNA_def_struct(brna, "PropertyGroupItem", NULL);
        RNA_def_struct_sdna(srna, "IDProperty");
        RNA_def_struct_ui_text(srna, "ID Property", "Property that stores arbitrary, user defined properties");
        
        /* IDP_STRING */
-       prop= RNA_def_property(srna, "string", PROP_STRING, PROP_NONE);
+       prop = RNA_def_property(srna, "string", PROP_STRING, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
 
        /* IDP_INT */
-       prop= RNA_def_property(srna, "int", PROP_INT, PROP_NONE);
+       prop = RNA_def_property(srna, "int", PROP_INT, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
 
-       prop= RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE);
+       prop = RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
        RNA_def_property_array(prop, 1);
 
        /* IDP_FLOAT */
-       prop= RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE);
+       prop = RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
 
-       prop= RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE);
+       prop = RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
        RNA_def_property_array(prop, 1);
 
        /* IDP_DOUBLE */
-       prop= RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE);
+       prop = RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
 
-       prop= RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE);
+       prop = RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
        RNA_def_property_array(prop, 1);
 
        /* IDP_GROUP */
-       prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
+       prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_struct_type(prop, "PropertyGroup");
 
-       prop= RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE);
+       prop = RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
        RNA_def_property_struct_type(prop, "PropertyGroup");
 
-       prop= RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
+       prop = RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_struct_type(prop, "PropertyGroup");
        RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
 
-       // never tested, maybe its useful to have this?
+       /* never tested, maybe its useful to have this? */
 #if 0
-       prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+       prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting");
@@ -404,7 +404,7 @@ static void rna_def_ID_properties(BlenderRNA *brna)
        /* ID property groups > level 0, since level 0 group is merged
         * with native RNA properties. the builtin_properties will take
         * care of the properties here */
-       srna= RNA_def_struct(brna, "PropertyGroup", NULL);
+       srna = RNA_def_struct(brna, "PropertyGroup", NULL);
        RNA_def_struct_sdna(srna, "IDPropertyGroup");
        RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties");
        RNA_def_struct_idprops_func(srna, "rna_PropertyGroup_idprops");
@@ -414,9 +414,9 @@ static void rna_def_ID_properties(BlenderRNA *brna)
        /* important so python types can have their name used in list views
         * however this isnt prefect because it overrides how python would set the name
         * when we only really want this so RNA_def_struct_name_property() is set to something useful */
-       prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+       prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
-       //RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+       /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
        RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting");
        RNA_def_struct_name_property(srna, prop);
 }
@@ -429,21 +429,21 @@ static void rna_def_ID_materials(BlenderRNA *brna)
        PropertyRNA *parm;
        
        /* for mesh/mball/curve materials */
-       srna= RNA_def_struct(brna, "IDMaterials", NULL);
+       srna = RNA_def_struct(brna, "IDMaterials", NULL);
        RNA_def_struct_sdna(srna, "ID");
        RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials");
 
-       func= RNA_def_function(srna, "append", "material_append_id");
+       func = RNA_def_function(srna, "append", "material_append_id");
        RNA_def_function_ui_description(func, "Add a new material to the data block");
-       parm= RNA_def_pointer(func, "material", "Material", "", "Material to add");
+       parm = RNA_def_pointer(func, "material", "Material", "", "Material to add");
        RNA_def_property_flag(parm, PROP_REQUIRED);
        
-       func= RNA_def_function(srna, "pop", "material_pop_id");
+       func = RNA_def_function(srna, "pop", "material_pop_id");
        RNA_def_function_ui_description(func, "Remove a material from the data block");
-       parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT);
+       parm = RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT);
        RNA_def_property_flag(parm, PROP_REQUIRED);
        RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned");
-       parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove");
+       parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
        RNA_def_function_return(func, parm);
 }
 
@@ -459,13 +459,13 @@ static void rna_def_ID(BlenderRNA *brna)
                {OB_RECALC_TIME, "TIME", 0, "Time", ""},
                {0, NULL, 0, NULL, NULL}};
 
-       srna= RNA_def_struct(brna, "ID", NULL);
+       srna = RNA_def_struct(brna, "ID", NULL);
        RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection");
        RNA_def_struct_flag(srna, STRUCT_ID|STRUCT_ID_REFCOUNT);
        RNA_def_struct_refine_func(srna, "rna_ID_refine");
        RNA_def_struct_idprops_func(srna, "rna_ID_idprops");
 
-       prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+       prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name");
        RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
        RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
@@ -473,55 +473,55 @@ static void rna_def_ID(BlenderRNA *brna)
        RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL);
        RNA_def_struct_name_property(srna, prop);
 
-       prop= RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
+       prop = RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
        RNA_def_property_int_sdna(prop, NULL, "us");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Users", "Number of times this datablock is referenced");
 
-       prop= RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER);
        RNA_def_property_ui_text(prop, "Fake User", "Save this datablock even if it has no users");
        RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set");
 
-       prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT);
        RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
        RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data (initial state is undefined)");
 
-       prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Is Updated", "Datablock is tagged for recalculation");
 
-       prop= RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC_DATA);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Is Updated Data", "Datablock data is tagged for recalculation");
 
-       prop= RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE);
+       prop = RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "lib");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from");
 
        /* functions */
-       func= RNA_def_function(srna, "copy", "rna_ID_copy");
+       func = RNA_def_function(srna, "copy", "rna_ID_copy");
        RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)");
-       parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID");
+       parm = RNA_def_pointer(func, "id", "ID", "", "New copy of the ID");
        RNA_def_function_return(func, parm);
 
-       func= RNA_def_function(srna, "user_clear", "rna_ID_user_clear");
+       func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear");
        RNA_def_function_ui_description(func, "Clear the user count of a datablock so its not saved, "
                                              "on reload the data will be removed");
 
-       func= RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata");
+       func = RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata");
        RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this");
-       parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL");
+       parm = RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL");
        RNA_def_function_return(func, parm);
 
-       func= RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata");
+       func = RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata");
        RNA_def_function_ui_description(func, "Clear animation on this this ID");
 
-       func= RNA_def_function(srna, "update_tag", "rna_ID_update_tag");
+       func = RNA_def_function(srna, "update_tag", "rna_ID_update_tag");
        RNA_def_function_flag(func, FUNC_USE_REPORTS);
        RNA_def_function_ui_description(func, "Tag the ID to update its display data");
        RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform");
@@ -532,16 +532,16 @@ static void rna_def_library(BlenderRNA *brna)
        StructRNA *srna;
        PropertyRNA *prop;
 
-       srna= RNA_def_struct(brna, "Library", "ID");
+       srna = RNA_def_struct(brna, "Library", "ID");
        RNA_def_struct_ui_text(srna, "Library", "External .blend file from which data is linked");
        RNA_def_struct_ui_icon(srna, ICON_LIBRARY_DATA_DIRECT);
 
-       prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+       prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
        RNA_def_property_string_sdna(prop, NULL, "name");
        RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file");
        RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Library_filepath_set");
        
-       prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+       prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
        RNA_def_property_struct_type(prop, "Library");
        RNA_def_property_ui_text(prop, "Parent", "");   
 }
@@ -550,11 +550,11 @@ void RNA_def_ID(BlenderRNA *brna)
        StructRNA *srna;
 
        /* built-in unknown type */
-       srna= RNA_def_struct(brna, "UnknownType", NULL);
+       srna = RNA_def_struct(brna, "UnknownType", NULL);
        RNA_def_struct_ui_text(srna, "Unknown Type", "Stub RNA type used for pointers to unknown or internal data");
 
        /* built-in any type */
-       srna= RNA_def_struct(brna, "AnyType", NULL);
+       srna = RNA_def_struct(brna, "AnyType", NULL);
        RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data");
 
        rna_def_ID(brna);
index 0df8a62..0a420b1 100644 (file)
@@ -63,7 +63,7 @@
 
 #include "rna_internal.h"
 
-const PointerRNA PointerRNA_NULL= {{NULL}};
+const PointerRNA PointerRNA_NULL = {{NULL}};
 
 /* Init/Exit */
 
@@ -72,12 +72,12 @@ void RNA_init(void)
        StructRNA *srna;
        PropertyRNA *prop;
 
-       for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) {
-               if(!srna->cont.prophash) {
-                       srna->cont.prophash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "RNA_init gh");
+       for (srna = BLENDER_RNA.structs.first; srna; srna = srna->cont.next) {
+               if (!srna->cont.prophash) {
+                       srna->cont.prophash = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "RNA_init gh");
 
-                       for(prop=srna->cont.properties.first; prop; prop=prop->next)
-                               if(!(prop->flag & PROP_BUILTIN))
+                       for (prop = srna->cont.properties.first; prop; prop = prop->next)
+                               if (!(prop->flag & PROP_BUILTIN))
                                        BLI_ghash_insert(srna->cont.prophash, (void*)prop->identifier, prop);
                }
        }
@@ -89,10 +89,10 @@ void RNA_exit(void)
        
        RNA_property_update_cache_free();
        
-       for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) {
-               if(srna->cont.prophash) {
+       for (srna = BLENDER_RNA.structs.first; srna; srna = srna->cont.next) {
+               if (srna->cont.prophash) {
                        BLI_ghash_free(srna->cont.prophash, NULL, NULL);
-                       srna->cont.prophash= NULL;
+                       srna->cont.prophash = NULL;
                }
        }
 
@@ -103,95 +103,95 @@ void RNA_exit(void)
 
 void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr)
 {
-       r_ptr->id.data= NULL;
-       r_ptr->type= &RNA_BlendData;
-       r_ptr->data= main;
+       r_ptr->id.data = NULL;
+       r_ptr->type = &RNA_BlendData;
+       r_ptr->data = main;
 }
 
 void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
 {
-       StructRNA *type, *idtype= NULL;
+       StructRNA *type, *idtype = NULL;
 
-       if(id) {
-               PointerRNA tmp= {{NULL}};
-               tmp.data= id;
-               idtype= rna_ID_refine(&tmp);
+       if (id) {
+               PointerRNA tmp = {{NULL}};
+               tmp.data = id;
+               idtype = rna_ID_refine(&tmp);
                
-               while(idtype->refine) {
-                       type= idtype->refine(&tmp);
+               while (idtype->refine) {
+                       type = idtype->refine(&tmp);
 
-                       if(type == idtype)
+                       if (type == idtype)
                                break;
                        else
-                               idtype= type;
+                               idtype = type;
                }
        }
        
-       r_ptr->id.data= id;
-       r_ptr->type= idtype;
-       r_ptr->data= id;
+       r_ptr->id.data = id;
+       r_ptr->type = idtype;
+       r_ptr->data = id;
 }
 
 void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
 {
 #if 0 /* UNUSED */
-       StructRNA *idtype= NULL;
+       StructRNA *idtype = NULL;
 
-       if(id) {
-               PointerRNA tmp= {{0}};
-               tmp.data= id;
-               idtype= rna_ID_refine(&tmp);
+       if (id) {
+               PointerRNA tmp = {{0}};
+               tmp.data = id;
+               idtype = rna_ID_refine(&tmp);
        }
 #endif
 
-       r_ptr->id.data= id;
-       r_ptr->type= type;
-       r_ptr->data= data;
+       r_ptr->id.data = id;
+       r_ptr->type = type;
+       r_ptr->data = data;
 
-       if(data) {
-               while(r_ptr->type && r_ptr->type->refine) {
-                       StructRNA *rtype= r_ptr->type->refine(r_ptr);
+       if (data) {
+               while (r_ptr->type && r_ptr->type->refine) {
+                       StructRNA *rtype = r_ptr->type->refine(r_ptr);
 
-                       if(rtype == r_ptr->type)
+                       if (rtype == r_ptr->type)
                                break;
                        else
-                               r_ptr->type= rtype;
+                               r_ptr->type = rtype;
                }
        }
 }
 
 static void rna_pointer_inherit_id(StructRNA *type, PointerRNA *parent, PointerRNA *ptr)
 {
-       if(type && type->flag & STRUCT_ID) {
-               ptr->id.data= ptr->data;
+       if (type && type->flag & STRUCT_ID) {
+               ptr->id.data = ptr->data;
        }
        else {
-               ptr->id.data= parent->id.data;
+               ptr->id.data = parent->id.data;
        }
 }
 
 void RNA_blender_rna_pointer_create(PointerRNA *r_ptr)
 {
-       r_ptr->id.data= NULL;
-       r_ptr->type= &RNA_BlenderRNA;
-       r_ptr->data= &BLENDER_RNA;
+       r_ptr->id.data = NULL;
+       r_ptr->type = &RNA_BlenderRNA;
+       r_ptr->data = &BLENDER_RNA;
 }
 
 PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
 {
-       if(data) {
+       if (data) {
                PointerRNA result;
-               result.data= data;
-               result.type= type;
+               result.data = data;
+               result.type = type;
                rna_pointer_inherit_id(type, ptr, &result);
 
-               while(result.type->refine) {
-                       type= result.type->refine(&result);
+               while (result.type->refine) {
+                       type = result.type->refine(&result);
 
-                       if(type == result.type)
+                       if (type == result.type)
                                break;
                        else
-                               result.type= type;
+                               result.type = type;
                }
                return result;
        }
@@ -203,8 +203,8 @@ PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *da
 /**/
 void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr)
 {
-#if 0 // works but this case if covered by more general code below.
-       if(RNA_struct_is_ID(ptr->type)) {
+#if 0 /* works but this case if covered by more general code below. */
+       if (RNA_struct_is_ID(ptr->type)) {
                /* simple case */
                RNA_id_pointer_create(ptr->id.data, r_ptr);
        }
@@ -213,12 +213,12 @@ void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr)
        {
                StructRNA *base;
                PointerRNA t_ptr;
-               *r_ptr= *ptr; /* initialize as the same incase cant recast */
+               *r_ptr = *ptr; /* initialize as the same incase cant recast */
 
-               for(base=ptr->type->base; base; base=base->base) {
-                       t_ptr= rna_pointer_inherit_refine(ptr, base, ptr->data);
-                       if(t_ptr.type && t_ptr.type != ptr->type) {
-                               *r_ptr= t_ptr;
+               for (base = ptr->type->base; base; base = base->base) {
+                       t_ptr = rna_pointer_inherit_refine(ptr, base, ptr->data);
+                       if (t_ptr.type && t_ptr.type != ptr->type) {
+                               *r_ptr = t_ptr;
                        }
                }
        }
@@ -237,14 +237,14 @@ IDProperty *rna_idproperty_ui(PropertyRNA *prop)
 {
        IDProperty *idprop;
 
-       for(idprop= ((IDProperty *)prop)->prev; idprop; idprop= idprop->prev) {
-               if (strcmp(RNA_IDP_UI, idprop->name)==0)
+       for (idprop = ((IDProperty *)prop)->prev; idprop; idprop = idprop->prev) {
+               if (strcmp(RNA_IDP_UI, idprop->name) == 0)
                        break;
        }
 
-       if(idprop==NULL) {
-               for(idprop= ((IDProperty *)prop)->next; idprop; idprop= idprop->next) {
-                       if (strcmp(RNA_IDP_UI, idprop->name)==0)
+       if (idprop == NULL) {
+               for (idprop = ((IDProperty *)prop)->next; idprop; idprop = idprop->next) {
+                       if (strcmp(RNA_IDP_UI, idprop->name) == 0)
                                break;
                }
        }
@@ -258,9 +258,9 @@ IDProperty *rna_idproperty_ui(PropertyRNA *prop)
 
 IDProperty *RNA_struct_idprops(PointerRNA *ptr, int create)
 {
-       StructRNA *type= ptr->type;
+       StructRNA *type = ptr->type;
 
-       if(type && type->idproperties)
+       if (type && type->idproperties)
                return type->idproperties(ptr, create);
        
        return NULL;
@@ -273,9 +273,9 @@ int RNA_struct_idprops_check(StructRNA *srna)
 
 static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
 {
-       IDProperty *group= RNA_struct_idprops(ptr, 0);
+       IDProperty *group = RNA_struct_idprops(ptr, 0);
 
-       if(group)
+       if (group)
                return IDP_GetPropertyFromGroup(group, name);
 
        return NULL;
@@ -283,14 +283,14 @@ static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name)
 
 static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
 {
-       if(prop->magic == RNA_MAGIC) {
+       if (prop->magic == RNA_MAGIC) {
                int arraylen[RNA_MAX_ARRAY_DIMENSION];
                return (prop->getlength && ptr->data)? prop->getlength(ptr, arraylen): prop->totarraylength;
        }
        else {
-               IDProperty *idprop= (IDProperty*)prop;
+               IDProperty *idprop = (IDProperty*)prop;
 
-               if(idprop->type == IDP_ARRAY)
+               if (idprop->type == IDP_ARRAY)
                        return idprop->len;
                else
                        return 0;
@@ -299,11 +299,11 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
 
 static int rna_ensure_property_array_check(PropertyRNA *prop)
 {
-       if(prop->magic == RNA_MAGIC) {
+       if (prop->magic == RNA_MAGIC) {
                return (prop->getlength || prop->totarraylength) ? 1:0;
        }
        else {
-               IDProperty *idprop= (IDProperty*)prop;
+               IDProperty *idprop = (IDProperty*)prop;
 
                return idprop->type == IDP_ARRAY ? 1:0;
        }
@@ -311,19 +311,19 @@ static int rna_ensure_property_array_check(PropertyRNA *prop)
 
 static void rna_ensure_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int length[])
 {
-       if(prop->magic == RNA_MAGIC) {
-               if(prop->getlength)
+       if (prop->magic == RNA_MAGIC) {
+               if (prop->getlength)
                        prop->getlength(ptr, length);
                else
                        memcpy(length, prop->arraylength, prop->arraydimension*sizeof(int));
        }
        else {
-               IDProperty *idprop= (IDProperty*)prop;
+               IDProperty *idprop = (IDProperty*)prop;
 
-               if(idprop->type == IDP_ARRAY)
-                       length[0]= idprop->len;
+               if (idprop->type == IDP_ARRAY)
+                       length[0] = idprop->len;
                else
-                       length[0]= 0;
+                       length[0] = 0;
        }
 }
 
@@ -334,36 +334,36 @@ static int rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDPro
         * rna property access is type safe, e.g. if you defined the rna
         * to have a certain array length you can count on that staying so */
        
-       switch(idprop->type) {
+       switch (idprop->type) {
                case IDP_IDPARRAY:
-                       if(prop->type != PROP_COLLECTION)
+                       if (prop->type != PROP_COLLECTION)
                                return 0;
                        break;
                case IDP_ARRAY:
-                       if(rna_ensure_property_array_length(ptr, prop) != idprop->len)
+                       if (rna_ensure_property_array_length(ptr, prop) != idprop->len)
                                return 0;
 
-                       if(idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT)
+                       if (idprop->subtype == IDP_FLOAT && prop->type != PROP_FLOAT)
                                return 0;
-                       if(idprop->subtype == IDP_INT && !ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+                       if (idprop->subtype == IDP_INT && !ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
                                return 0;
 
                        break;
                case IDP_INT:
-                       if(!ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
+                       if (!ELEM3(prop->type, PROP_BOOLEAN, PROP_INT, PROP_ENUM))
                                return 0;
                        break;
                case IDP_FLOAT:
                case IDP_DOUBLE:
-                       if(prop->type != PROP_FLOAT)
+                       if (prop->type != PROP_FLOAT)
                                return 0;
                        break;
                case IDP_STRING:
-                       if(prop->type != PROP_STRING)
+                       if (prop->type != PROP_STRING)
                                return 0;
                        break;
                case IDP_GROUP:
-                       if(prop->type != PROP_POINTER)
+                       if (prop->type != PROP_POINTER)
                                return 0;
                        break;
                default:
@@ -398,12 +398,12 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
         * we look up an IDP PropertyRNA based on the type, and set the data
         * pointer to the IDProperty. */
 
-       if((*prop)->magic == RNA_MAGIC) {
-               if((*prop)->flag & PROP_IDPROPERTY) {
-                       IDProperty *idprop= rna_idproperty_find(ptr, (*prop)->identifier);
+       if ((*prop)->magic == RNA_MAGIC) {
+               if ((*prop)->flag & PROP_IDPROPERTY) {
+                       IDProperty *idprop = rna_idproperty_find(ptr, (*prop)->identifier);
 
-                       if(idprop && !rna_idproperty_verify_valid(ptr, *prop, idprop)) {
-                               IDProperty *group= RNA_struct_idprops(ptr, 0);
+                       if (idprop && !rna_idproperty_verify_valid(ptr, *prop, idprop)) {
+                               IDProperty *group = RNA_struct_idprops(ptr, 0);
 
                                IDP_RemFromGroup(group, idprop);
                                IDP_FreeProperty(idprop);
@@ -418,12 +418,12 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
        }
 
        {
-               IDProperty *idprop= (IDProperty*)(*prop);
+               IDProperty *idprop = (IDProperty*)(*prop);
 
-               if(idprop->type == IDP_ARRAY)
-                       *prop= arraytypemap[(int)(idprop->subtype)];
-               else 
-                       *prop= typemap[(int)(idprop->type)];
+               if (idprop->type == IDP_ARRAY)
+                       *prop = arraytypemap[(int)(idprop->subtype)];
+               else
+                       *prop = typemap[(int)(idprop->type)];
 
                return idprop;
        }
@@ -433,22 +433,22 @@ static PropertyRNA *rna_ensure_property(PropertyRNA *prop)
 {
        /* the quick version if we don't need the idproperty */
 
-       if(prop->magic == RNA_MAGIC)
+       if (prop->magic == RNA_MAGIC)
                return prop;
 
        {
-               IDProperty *idprop= (IDProperty*)prop;
+               IDProperty *idprop = (IDProperty*)prop;
 
-               if(idprop->type == IDP_ARRAY)
+               if (idprop->type == IDP_ARRAY)
                        return arraytypemap[(int)(idprop->subtype)];
-               else 
+               else
                        return typemap[(int)(idprop->type)];
        }
 }
 
 static const char *rna_ensure_property_identifier(PropertyRNA *prop)
 {
-       if(prop->magic == RNA_MAGIC)
+       if (prop->magic == RNA_MAGIC)
                return prop->identifier;
        else
                return ((IDProperty*)prop)->name;
@@ -456,27 +456,27 @@ static const char *rna_ensure_property_identifier(PropertyRNA *prop)
 
 static const char *rna_ensure_property_description(PropertyRNA *prop)
 {
-       const char *description= NULL;
+       const char *description = NULL;
 
-       if(prop->magic == RNA_MAGIC)
-               description= prop->description;
+       if (prop->magic == RNA_MAGIC)
+               description = prop->description;
        else {
                /* attempt to get the local ID values */
-               IDProperty *idp_ui= rna_idproperty_ui(prop);
+               IDProperty *idp_ui = rna_idproperty_ui(prop);
 
-               if(idp_ui) {
-                       IDProperty *item= IDP_GetPropertyTypeFromGroup(idp_ui, "description", IDP_STRING);
-                       if(item)
-                               description= IDP_String(item);
+               if (idp_ui) {
+                       IDProperty *item = IDP_GetPropertyTypeFromGroup(idp_ui, "description", IDP_STRING);
+                       if (item)
+                               description = IDP_String(item);
                }
 
-               if(description == NULL)
-                       description= ((IDProperty*)prop)->name; /* XXX - not correct */
+               if (description == NULL)
+                       description = ((IDProperty*)prop)->name; /* XXX - not correct */
        }
 
 #ifdef WITH_INTERNATIONAL
-       if(description && BLF_translate_tooltips())
-               description= BLF_gettext(description);
+       if (description && BLF_translate_tooltips())
+               description = BLF_gettext(description);
 #endif
 
        return description;
@@ -486,14 +486,14 @@ static const char *rna_ensure_property_name(PropertyRNA *prop)
 {
        const char *name;
 
-       if(prop->magic == RNA_MAGIC)
-               name= prop->name;
+       if (prop->magic == RNA_MAGIC)
+               name = prop->name;
        else
-               name= ((IDProperty*)prop)->name;
+               name = ((IDProperty*)prop)->name;
 
 #ifdef WITH_INTERNATIONAL
-       if(BLF_translate_iface()) {
-               if(prop->translation_context)
+       if (BLF_translate_iface()) {
+               if (prop->translation_context)
                        name = BLF_pgettext(prop->translation_context, name);
                else
                        name = BLF_gettext(name);
@@ -510,7 +510,7 @@ StructRNA *RNA_struct_find(const char *identifier)
        StructRNA *type;
        if (identifier) {
                for (type = BLENDER_RNA.structs.first; type; type = type->cont.next)
-                       if (strcmp(type->identifier, identifier)==0)
+                       if (strcmp(type->identifier, identifier) == 0)
                                return type;
        }
        return NULL;
@@ -528,7 +528,7 @@ const char *RNA_struct_ui_name(StructRNA *type)
 
 int RNA_struct_ui_icon(StructRNA *type)
 {
-       if(type)
+       if (type)
                return type->icon;
        else
                return ICON_DOT;
@@ -572,11 +572,11 @@ int RNA_struct_idprops_register_check(StructRNA *type)
 /* remove an id-property */
 int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier)
 {
-       IDProperty *group= RNA_struct_idprops(ptr, 0);
+       IDProperty *group = RNA_struct_idprops(ptr, 0);
 
-       if(group) {
-               IDProperty *idp= IDP_GetPropertyFromGroup(group, identifier);
-               if(idp) {
+       if (group) {
+               IDProperty *idp = IDP_GetPropertyFromGroup(group, identifier);
+               if (idp) {
                        IDP_RemFromGroup(group, idp);
                        IDP_FreeProperty(idp);
                        MEM_freeN(idp);
@@ -591,12 +591,12 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna)
 {
        StructRNA *base;
 
-       if(!type)
+       if (!type)
                return 0;
 
        /* ptr->type is always maximally refined */
-       for(base=type; base; base=base->base)
-               if(base == srna)
+       for (base = type; base; base = base->base)
+               if (base == srna)
                        return 1;
        
        return 0;
@@ -604,19 +604,19 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna)
 
 PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
 {
-       if(identifier[0]=='[' && identifier[1]=='"') { // "  (dummy comment to avoid confusing some function lists in text editors)
+       if (identifier[0] =='[' && identifier[1] =='"') { /* "  (dummy comment to avoid confusing some function lists in text editors) */
                /* id prop lookup, not so common */
-               PropertyRNA *r_prop= NULL;
+               PropertyRNA *r_prop = NULL;
                PointerRNA r_ptr; /* only support single level props */
-               if(RNA_path_resolve(ptr, identifier, &r_ptr, &r_prop) && r_ptr.type==ptr->type && r_ptr.data==ptr->data)
+               if (RNA_path_resolve(ptr, identifier, &r_ptr, &r_prop) && r_ptr.type == ptr->type && r_ptr.data == ptr->data)
                        return r_prop;
        }
        else {
                /* most common case */
-               PropertyRNA *iterprop= RNA_struct_iterator_property(ptr->type);
+               PropertyRNA *iterprop = RNA_struct_iterator_property(ptr->type);
                PointerRNA propptr;
 
-               if(RNA_property_collection_lookup_string(ptr, iterprop, identifier, &propptr))
+               if (RNA_property_collection_lookup_string(ptr, iterprop, identifier, &propptr))
                        return propptr.data;
        }
        
@@ -626,12 +626,12 @@ PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
 /* Find the property which uses the given nested struct */
 PropertyRNA *RNA_struct_find_nested(PointerRNA *ptr, StructRNA *srna)
 {
-       PropertyRNA *prop= NULL;
+       PropertyRNA *prop = NULL;
 
        RNA_STRUCT_BEGIN(ptr, iprop) {
                /* This assumes that there can only be one user of this nested struct */
                if (RNA_property_pointer_type(ptr, iprop) == srna) {
-                       prop= iprop;
+                       prop = iprop;
                        break;
                }
        }
@@ -646,14 +646,14 @@ int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
 
        /* validate the RNA is ok */
        PropertyRNA *iterprop;
-       int found= FALSE;
+       int found = FALSE;
 
-       iterprop= RNA_struct_iterator_property(ptr->type);
+       iterprop = RNA_struct_iterator_property(ptr->type);
 
        RNA_PROP_BEGIN(ptr, itemptr, iterprop) {
                /* PropertyRNA *prop= itemptr.data; */
-               if(prop_test == (PropertyRNA *)itemptr.data) {
-                       found= TRUE;
+               if (prop_test == (PropertyRNA *)itemptr.data) {
+                       found = TRUE;
                        break;
                }
        }
@@ -678,9 +678,9 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
 #if 1
        FunctionRNA *func;
        StructRNA *type;
-       for(type= ptr->type; type; type= type->base) {
-               func= (FunctionRNA *)BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
-               if(func) {
+       for (type = ptr->type; type; type = type->base) {
+               func = (FunctionRNA *)BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
+               if (func) {
                        return func;
                }
        }
@@ -693,13 +693,13 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
        FunctionRNA *func;
 
        RNA_pointer_create(NULL, &RNA_Struct, ptr->type, &tptr);
-       iterprop= RNA_struct_find_property(&tptr, "functions");
+       iterprop = RNA_struct_find_property(&tptr, "functions");
 
-       func= NULL;
+       func = NULL;
 
        RNA_PROP_BEGIN(&tptr, funcptr, iterprop) {
-               if(strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) {
-                       func= funcptr.data;
+               if (strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) {
+                       func = funcptr.data;
                        break;
                }
        }
@@ -722,21 +722,21 @@ StructRegisterFunc RNA_struct_register(StructRNA *type)
 StructUnregisterFunc RNA_struct_unregister(StructRNA *type)
 {
        do {
-               if(type->unreg)
+               if (type->unreg)
                        return type->unreg;
-       } while((type=type->base));
+       } while ((type = type->base));
 
        return NULL;
 }
 
 void **RNA_struct_instance(PointerRNA *ptr)
 {
-       StructRNA *type= ptr->type;
+       StructRNA *type = ptr->type;
 
        do {
-               if(type->instance)
+               if (type->instance)
                        return type->instance(ptr);
-       } while((type=type->base));
+       } while ((type = type->base));
 
        return NULL;
 }
@@ -748,7 +748,7 @@ void *RNA_struct_py_type_get(StructRNA *srna)
 
 void RNA_struct_py_type_set(StructRNA *srna, void *py_type)
 {
-       srna->py_type= py_type;
+       srna->py_type = py_type;
 }
 
 void *RNA_struct_blender_type_get(StructRNA *srna)
@@ -758,14 +758,14 @@ void *RNA_struct_blender_type_get(StructRNA *srna)
 
 void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
 {
-       srna->blender_type= blender_type;
+       srna->blender_type = blender_type;
 }
 
 char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len)
 {
        PropertyRNA *nameprop;
 
-       if(ptr->data && (nameprop = RNA_struct_name_property(ptr->type)))
+       if (ptr->data && (nameprop = RNA_struct_name_property(ptr->type)))
                return RNA_property_string_get_alloc(ptr, nameprop, fixedbuf, fixedlen, r_len);
 
        return NULL;
@@ -821,9 +821,9 @@ int RNA_property_array_check(PropertyRNA *prop)
 /* used by BPY to make an array from the python object */
 int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[])
 {
-       PropertyRNA *rprop= rna_ensure_property(prop);
+       PropertyRNA *rprop = rna_ensure_property(prop);
 
-       if(length)
+       if (length)
                        rna_ensure_property_multi_array_length(ptr, prop, length);
 
        return rprop->arraydimension;
@@ -841,16 +841,16 @@ int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dim)
 
 char RNA_property_array_item_char(PropertyRNA *prop, int index)
 {
-       const char *vectoritem= "XYZW";
-       const char *quatitem= "WXYZ";
-       const char *coloritem= "RGBA";
-       PropertySubType subtype= rna_ensure_property(prop)->subtype;
+       const char *vectoritem = "XYZW";
+       const char *quatitem = "WXYZ";
+       const char *coloritem = "RGBA";
+       PropertySubType subtype = rna_ensure_property(prop)->subtype;
 
        /* get string to use for array index */
        if ((index < 4) && ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE)) {
                return quatitem[index];
        }
-       else if((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH,
+       else if ((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH,
                                              PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS))
        {
                return vectoritem[index];
@@ -864,7 +864,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index)
 
 int RNA_property_array_item_index(PropertyRNA *prop, char name)
 {
-       PropertySubType subtype= rna_ensure_property(prop)->subtype;
+       PropertySubType subtype = rna_ensure_property(prop)->subtype;
 
        /* get index based on string name/alias */
        /* maybe a function to find char index in string would be better than all the switches */
@@ -880,7 +880,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
                                return 3;
                }
        }
-       else if(ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ,
+       else if (ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ,
                               PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION))
        {
                switch (name) {
@@ -913,142 +913,142 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
 
 void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)rna_ensure_property(prop);
+       IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop);
 
-       if(prop->magic != RNA_MAGIC) {
+       if (prop->magic != RNA_MAGIC) {
                /* attempt to get the local ID values */
-               IDProperty *idp_ui= rna_idproperty_ui(prop);
+               IDProperty *idp_ui = rna_idproperty_ui(prop);
 
-               if(idp_ui) {
+               if (idp_ui) {
                        IDProperty *item;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_INT);
-                       *hardmin= item ? IDP_Int(item) : INT_MIN;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_INT);
+                       *hardmin = item ? IDP_Int(item) : INT_MIN;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_INT);
-                       *hardmax= item ? IDP_Int(item) : INT_MAX;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_INT);
+                       *hardmax = item ? IDP_Int(item) : INT_MAX;
 
                        return;
                }
        }
 
-       if(iprop->range) {
+       if (iprop->range) {
                iprop->range(ptr, hardmin, hardmax);
        }
        else {
-               *hardmin= iprop->hardmin;
-               *hardmax= iprop->hardmax;
+               *hardmin = iprop->hardmin;
+               *hardmax = iprop->hardmax;
        }
 }
 
 void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)rna_ensure_property(prop);
+       IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop);
        int hardmin, hardmax;
        
-       if(prop->magic != RNA_MAGIC) {
+       if (prop->magic != RNA_MAGIC) {
                /* attempt to get the local ID values */
-               IDProperty *idp_ui= rna_idproperty_ui(prop);
+               IDProperty *idp_ui = rna_idproperty_ui(prop);
 
-               if(idp_ui) {
+               if (idp_ui) {
                        IDProperty *item;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_INT);
-                       *softmin= item ? IDP_Int(item) : INT_MIN;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_INT);
+                       *softmin = item ? IDP_Int(item) : INT_MIN;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_INT);
-                       *softmax= item ? IDP_Int(item) : INT_MAX;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_INT);
+                       *softmax = item ? IDP_Int(item) : INT_MAX;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_INT);
-                       *step= item ? IDP_Int(item) : 1;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_INT);
+                       *step = item ? IDP_Int(item) : 1;
 
                        return;
                }
        }
 
-       if(iprop->range) {
+       if (iprop->range) {
                iprop->range(ptr, &hardmin, &hardmax);
-               *softmin= MAX2(iprop->softmin, hardmin);
-               *softmax= MIN2(iprop->softmax, hardmax);
+               *softmin = MAX2(iprop->softmin, hardmin);
+               *softmax = MIN2(iprop->softmax, hardmax);
        }
        else {
-               *softmin= iprop->softmin;
-               *softmax= iprop->softmax;
+               *softmin = iprop->softmin;
+               *softmax = iprop->softmax;
        }
 
-       *step= iprop->step;
+       *step = iprop->step;
 }
 
 void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
 {
-       FloatPropertyRNA *fprop= (FloatPropertyRNA*)rna_ensure_property(prop);
+       FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop);
 
-       if(prop->magic != RNA_MAGIC) {
+       if (prop->magic != RNA_MAGIC) {
                /* attempt to get the local ID values */
-               IDProperty *idp_ui= rna_idproperty_ui(prop);
+               IDProperty *idp_ui = rna_idproperty_ui(prop);
 
-               if(idp_ui) {
+               if (idp_ui) {
                        IDProperty *item;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_DOUBLE);
-                       *hardmin= item ? (float)IDP_Double(item) : FLT_MIN;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "min", IDP_DOUBLE);
+                       *hardmin = item ? (float)IDP_Double(item) : FLT_MIN;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_DOUBLE);
-                       *hardmax= item ? (float)IDP_Double(item) : FLT_MAX;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "max", IDP_DOUBLE);
+                       *hardmax = item ? (float)IDP_Double(item) : FLT_MAX;
 
                        return;
                }
        }
 
-       if(fprop->range) {
+       if (fprop->range) {
                fprop->range(ptr, hardmin, hardmax);
        }
        else {
-               *hardmin= fprop->hardmin;
-               *hardmax= fprop->hardmax;
+               *hardmin = fprop->hardmin;
+               *hardmax = fprop->hardmax;
        }
 }
 
 void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
 {
-       FloatPropertyRNA *fprop= (FloatPropertyRNA*)rna_ensure_property(prop);
+       FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop);
        float hardmin, hardmax;
 
-       if(prop->magic != RNA_MAGIC) {
+       if (prop->magic != RNA_MAGIC) {
                /* attempt to get the local ID values */
-               IDProperty *idp_ui= rna_idproperty_ui(prop);
+               IDProperty *idp_ui = rna_idproperty_ui(prop);
 
-               if(idp_ui) {
+               if (idp_ui) {
                        IDProperty *item;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_DOUBLE);
-                       *softmin= item ? (float)IDP_Double(item) : FLT_MIN;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_min", IDP_DOUBLE);
+                       *softmin = item ? (float)IDP_Double(item) : FLT_MIN;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_DOUBLE);
-                       *softmax= item ? (float)IDP_Double(item) : FLT_MAX;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "soft_max", IDP_DOUBLE);
+                       *softmax = item ? (float)IDP_Double(item) : FLT_MAX;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_DOUBLE);
-                       *step= item ? (float)IDP_Double(item) : 1.0f;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "step", IDP_DOUBLE);
+                       *step = item ? (float)IDP_Double(item) : 1.0f;
 
-                       item= IDP_GetPropertyTypeFromGroup(idp_ui, "precision", IDP_DOUBLE);
-                       *precision= item ? (float)IDP_Double(item) : 3.0f;
+                       item = IDP_GetPropertyTypeFromGroup(idp_ui, "precision", IDP_DOUBLE);
+                       *precision = item ? (float)IDP_Double(item) : 3.0f;
 
                        return;
                }
        }
 
-       if(fprop->range) {
+       if (fprop->range) {
                fprop->range(ptr, &hardmin, &hardmax);
-               *softmin= MAX2(fprop->softmin, hardmin);
-               *softmax= MIN2(fprop->softmax, hardmax);
+               *softmin = MAX2(fprop->softmin, hardmin);
+               *softmax = MIN2(fprop->softmax, hardmax);
        }
        else {
-               *softmin= fprop->softmin;
-               *softmax= fprop->softmax;
+               *softmin = fprop->softmin;
+               *softmax = fprop->softmax;
        }
 
-       *step= fprop->step;
-       *precision= (float)fprop->precision;
+       *step = fprop->step;
+       *precision = (float)fprop->precision;
 }
 
 int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value)
@@ -1057,12 +1057,12 @@ int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value)
 
        RNA_property_float_range(ptr, prop, &min, &max);
 
-       if(*value < min) {
-               *value= min;
+       if (*value < min) {
+               *value = min;
                return -1;
        }
-       else if(*value > max) {
-               *value= max;
+       else if (*value > max) {
+               *value = max;
                return 1;
        }
        else {
@@ -1076,12 +1076,12 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
 
        RNA_property_int_range(ptr, prop, &min, &max);
 
-       if(*value < min) {
-               *value= min;
+       if (*value < min) {
+               *value = min;
                return -1;
        }
-       else if(*value > max) {
-               *value= max;
+       else if (*value > max) {
+               *value = max;
                return 1;
        }
        else {
@@ -1093,26 +1093,26 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
  * '0' used when their is no maximum */
 int RNA_property_string_maxlength(PropertyRNA *prop)
 {
-       StringPropertyRNA *sprop= (StringPropertyRNA*)rna_ensure_property(prop);
+       StringPropertyRNA *sprop = (StringPropertyRNA*)rna_ensure_property(prop);
        return sprop->maxlength;
 }
 
 StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
 {
-       prop= rna_ensure_property(prop);
+       prop = rna_ensure_property(prop);
 
-       if(prop->type == PROP_POINTER) {
-               PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
+       if (prop->type == PROP_POINTER) {
+               PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
 
-               if(pprop->typef)
+               if (pprop->typef)
                        return pprop->typef(ptr);
-               else if(pprop->type)
+               else if (pprop->type)
                        return pprop->type;
        }
-       else if(prop->type == PROP_COLLECTION) {
-               CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
+       else if (prop->type == PROP_COLLECTION) {
+               CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
 
-               if(cprop->item_type)
+               if (cprop->item_type)
                        return cprop->item_type;
        }
        /* ignore other types, RNA_struct_find_nested calls with unchecked props */
@@ -1122,11 +1122,11 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
 
 int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value)
 {
-       prop= rna_ensure_property(prop);
+       prop = rna_ensure_property(prop);
 
-       if(prop->type == PROP_POINTER) {
-               PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
-               if(pprop->poll)
+       if (prop->type == PROP_POINTER) {
+               PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
+               if (pprop->poll)
                        return pprop->poll(ptr, *value);
 
                return 1;
@@ -1149,31 +1149,31 @@ EnumPropertyItem DummyRNA_DEFAULT_items[] = {
 
 void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free)
 {
-       EnumPropertyRNA *eprop= (EnumPropertyRNA*)rna_ensure_property(prop);
+       EnumPropertyRNA *eprop = (EnumPropertyRNA*)rna_ensure_property(prop);
 
-       *free= 0;
+       *free = 0;
 
-       if(eprop->itemf && (C != NULL || (prop->flag & PROP_ENUM_NO_CONTEXT))) {
-               int tot= 0;
+       if (eprop->itemf && (C != NULL || (prop->flag & PROP_ENUM_NO_CONTEXT))) {
+               int tot = 0;
 
                if (prop->flag & PROP_ENUM_NO_CONTEXT)
-                       *item= eprop->itemf(NULL, ptr, prop, free);
+                       *item = eprop->itemf(NULL, ptr, prop, free);
                else
-                       *item= eprop->itemf(C, ptr, prop, free);
+                       *item = eprop->itemf(C, ptr, prop, free);
 
-               if(totitem) {
-                       if(*item) {
-                               for( ; (*item)[tot].identifier; tot++);
+               if (totitem) {
+                       if (*item) {
+                               for ( ; (*item)[tot].identifier; tot++);
                        }
 
-                       *totitem= tot;
+                       *totitem = tot;
                }
 
        }
        else {
-               *item= eprop->item;
-               if(totitem)
-                       *totitem= eprop->totitem;
+               *item = eprop->item;
+               if (totitem)
+                       *totitem = eprop->totitem;
        }
 }
 
@@ -1182,67 +1182,67 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA
        RNA_property_enum_items(C, ptr, prop, item, totitem, free);
 
 #ifdef WITH_INTERNATIONAL
-       if(BLF_translate_iface()) {
+       if (BLF_translate_iface()) {
                int i;
                EnumPropertyItem *nitem;
 
-               if(*free) {
-                       nitem= *item;
+               if (*free) {
+                       nitem = *item;
                } else {
-                       int totitem= 0;
+                       int totitem = 0;
 
                        /* count */
-                       for(i=0; (*item)[i].identifier; i++)
+                       for (i = 0; (*item)[i].identifier; i++)
                                totitem++;
 
-                       nitem= MEM_callocN(sizeof(EnumPropertyItem)*(totitem+1), "enum_items_gettexted");
+                       nitem = MEM_callocN(sizeof(EnumPropertyItem)*(totitem+1), "enum_items_gettexted");
 
-                       for(i=0; (*item)[i].identifier; i++)
-                               nitem[i]= (*item)[i];
+                       for (i = 0; (*item)[i].identifier; i++)
+                               nitem[i] = (*item)[i];
 
-                       *free= 1;
+                       *free = 1;
                }
 
-               for(i=0; nitem[i].identifier; i++) {
-                       if( nitem[i].name ) {
-                               if(prop->translation_context)
+               for (i = 0; nitem[i].identifier; i++) {
+                       if ( nitem[i].name ) {
+                               if (prop->translation_context)
                                        nitem[i].name = BLF_pgettext(prop->translation_context, nitem[i].name);
                                else
                                        nitem[i].name = BLF_gettext(nitem[i].name);
                        }
-                       if( nitem[i].description )
+                       if ( nitem[i].description )
                                nitem[i].description = BLF_gettext(nitem[i].description);
                }
 
-               *item= nitem;
+               *item = nitem;
        }
 #endif
 }
 
 
 int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value)
-{      
+{
        EnumPropertyItem *item, *item_array;
        int free, found;
 
        RNA_property_enum_items(C, ptr, prop, &item_array, NULL, &free);
 
-       if(item_array) {
-               for(item= item_array; item->identifier; item++) {
-                       if(item->identifier[0] && strcmp(item->identifier, identifier)==0) {
+       if (item_array) {
+               for (item = item_array; item->identifier; item++) {
+                       if (item->identifier[0] && strcmp(item->identifier, identifier) == 0) {
                                *value = item->value;
                                break;
                        }
                }
 
-               found= (item->identifier != NULL); /* could be alloc'd, assign before free */
+               found = (item->identifier != NULL); /* could be alloc'd, assign before free */
 
-               if(free) {
+               if (free) {
                        MEM_freeN(item_array);
                }
        }
        else {
-               found= 0;
+               found = 0;
        }
        return found;
 }
@@ -1250,7 +1250,7 @@ int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, con
 int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier)
 {
        for (; item->identifier; item++) {
-               if(item->identifier[0] && item->value==value) {
+               if (item->identifier[0] && item->value == value) {
                        *identifier = item->identifier;
                        return 1;
                }
@@ -1260,20 +1260,20 @@ int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **id
 
 int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **identifier)
 {
-       int index= 0;
+       int index = 0;
        for (; item->identifier; item++) {
-               if(item->identifier[0] && item->value & value) {
+               if (item->identifier[0] && item->value & value) {
                        identifier[index++] = item->identifier;
                }
        }
-       identifier[index]= NULL;
+       identifier[index] = NULL;
        return index;
 }
 
 int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
 {
        for (; item->identifier; item++) {
-               if(item->identifier[0] && item->value==value) {
+               if (item->identifier[0] && item->value == value) {
                        *name = item->name;
                        return 1;
                }
@@ -1284,7 +1284,7 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
 int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description)
 {
        for (; item->identifier; item++) {
-               if(item->identifier[0] && item->value==value) {
+               if (item->identifier[0] && item->value == value) {
                        *description = item->description;
                        return 1;
                }
@@ -1293,14 +1293,14 @@ int RNA_enum_description(EnumPropertyItem *item, const int value, const char **d
 }
 
 int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
-{      
-       EnumPropertyItem *item= NULL;
+{
+       EnumPropertyItem *item = NULL;
        int result, free;
        
        RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
-       if(item) {
-               result= RNA_enum_identifier(item, value, identifier);
-               if(free)
+       if (item) {
+               result = RNA_enum_identifier(item, value, identifier);
+               if (free)
                        MEM_freeN(item);
 
                return result;
@@ -1309,14 +1309,14 @@ int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop
 }
 
 int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name)
-{      
-       EnumPropertyItem *item= NULL;
+{
+       EnumPropertyItem *item = NULL;
        int result, free;
        
        RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
-       if(item) {
-               result= RNA_enum_name(item, value, name);
-               if(free)
+       if (item) {
+               result = RNA_enum_name(item, value, name);
+               if (free)
                        MEM_freeN(item);
                
                return result;
@@ -1326,13 +1326,13 @@ int RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, cons
 
 int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
 {
-       EnumPropertyItem *item= NULL;
+       EnumPropertyItem *item = NULL;
        int result, free;
 
        RNA_property_enum_items(C, ptr, prop, &item, NULL, &free);
-       if(item) {
-               result= RNA_enum_bitflag_identifiers(item, value, identifier);
-               if(free)
+       if (item) {
+               result = RNA_enum_bitflag_identifiers(item, value, identifier);
+               if (free)
                        MEM_freeN(item);
 
                return result;
@@ -1357,11 +1357,11 @@ int RNA_property_ui_icon(PropertyRNA *prop)
 
 int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop)
 {
-       ID *id= ptr->id.data;
+       ID *id = ptr->id.data;
        int flag;
 
-       prop= rna_ensure_property(prop);
-       flag= prop->editable ? prop->editable(ptr) : prop->flag;
+       prop = rna_ensure_property(prop);
+       flag = prop->editable ? prop->editable(ptr) : prop->flag;
        return (flag & PROP_EDITABLE) && (!id || !id->lib || (prop->flag & PROP_LIB_EXCEPTION));
 }
 
@@ -1369,8 +1369,8 @@ int RNA_property_editable_flag(PointerRNA *ptr, PropertyRNA *prop)
 {
        int flag;
 
-       prop= rna_ensure_property(prop);
-       flag= prop->editable ? prop->editable(ptr) : prop->flag;
+       prop = rna_ensure_property(prop);
+       flag = prop->editable ? prop->editable(ptr) : prop->flag;
        return (flag & PROP_EDITABLE);
 }
 
@@ -1380,17 +1380,17 @@ int RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index)
        ID *id;
        int flag;
 
-       prop= rna_ensure_property(prop);
+       prop = rna_ensure_property(prop);
 
-       flag= prop->flag;
+       flag = prop->flag;
        
-       if(prop->editable)
+       if (prop->editable)
                flag &= prop->editable(ptr);
 
        if (prop->itemeditable)
                flag &= prop->itemeditable(ptr, index);
 
-       id= ptr->id.data;
+       id = ptr->id.data;
 
        return (flag & PROP_EDITABLE) && (!id || !id->lib || (prop->flag & PROP_LIB_EXCEPTION));
 }
@@ -1401,9 +1401,9 @@ int RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop)
        if (!id_type_can_have_animdata(ptr->id.data))
                return 0;
        
-       prop= rna_ensure_property(prop);
+       prop = rna_ensure_property(prop);
 
-       if(!(prop->flag & PROP_ANIMATABLE))
+       if (!(prop->flag & PROP_ANIMATABLE))
                return 0;
 
        return (prop->flag & PROP_EDITABLE);
@@ -1421,17 +1421,17 @@ int RNA_property_animated(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop))
  * its slow so dont call in a loop */
 int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
 {
-       char *path= RNA_path_from_ID_to_property(ptr, prop);
-       int ret= 0;
+       char *path = RNA_path_from_ID_to_property(ptr, prop);
+       int ret = 0;
 
-       if(path) {
+       if (path) {
                PointerRNA id_ptr;
                PointerRNA r_ptr;
                PropertyRNA *r_prop;
 
                RNA_id_pointer_create(ptr->id.data, &id_ptr);
                RNA_path_resolve(&id_ptr, path, &r_ptr, &r_prop);
-               ret= (prop == r_prop);
+               ret = (prop == r_prop);
                MEM_freeN(path);
        }
 
@@ -1442,15 +1442,15 @@ int RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
 static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
 {
        int is_rna = (prop->magic == RNA_MAGIC);
-       prop= rna_ensure_property(prop);
+       prop = rna_ensure_property(prop);
 
-       if(is_rna) {
-               if(prop->update) {
+       if (is_rna) {
+               if (prop->update) {
                        /* ideally no context would be needed for update, but there's some
                           parts of the code that need it still, so we have this exception */
-                       if(prop->flag & PROP_CONTEXT_UPDATE) {
-                               if(C) {
-                                       if(prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) {
+                       if (prop->flag & PROP_CONTEXT_UPDATE) {
+                               if (C) {
+                                       if (prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) {
                                                ((ContextPropUpdateFunc)prop->update)(C, ptr, prop);
                                        }
                                        else {
@@ -1461,11 +1461,11 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
                        else
                                prop->update(bmain, scene, ptr);
                }
-               if(prop->noteflag)
+               if (prop->noteflag)
                        WM_main_add_notifier(prop->noteflag, ptr->id.data);
        }
        
-       if(!is_rna || (prop->flag & PROP_IDPROPERTY)) {
+       if (!is_rna || (prop->flag & PROP_IDPROPERTY)) {
                /* WARNING! This is so property drivers update the display!
                 * not especially nice  */
                DAG_id_tag_update(ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
@@ -1530,7 +1530,7 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop)
        if (ELEM(NULL, ptr, prop))
                return;
                
-       prop= rna_ensure_property(prop);
+       prop = rna_ensure_property(prop);
        
        /* we can only handle update calls with no context args for now (makes animsys updates easier) */
        if ((is_rna == 0) || (prop->update == NULL) || (prop->flag & PROP_CONTEXT_UPDATE))
@@ -1568,7 +1568,7 @@ void RNA_property_update_cache_flush(Main *bmain, Scene *scene)
 {
        tRnaUpdateCacheElem *uce;
        
-       // TODO: should we check that bmain and scene are valid? The above stuff doesn't!
+       /* TODO: should we check that bmain and scene are valid? The above stuff doesn't! */
        
        /* execute the cached updates */
        for (uce = rna_updates_cache.first; uce; uce = uce->next) {
@@ -1602,15 +1602,15 @@ void RNA_property_update_cache_free(void)
 
 int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
 {
-       BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+       BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) == 0);
 
-       if((idprop=rna_idproperty_check(&prop, ptr)))
+       if ((idprop = rna_idproperty_check(&prop, ptr)))
                return IDP_Int(idprop);
-       else if(bprop->get)
+       else if (bprop->get)
                return bprop->get(ptr);
        else
                return bprop->defaultvalue;
@@ -1618,52 +1618,52 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
 
 void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
 {
-       BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+       BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) == 0);
 
        /* just incase other values are passed */
-       if(value) value= 1;
+       if (value) value = 1;
 
-       if((idprop=rna_idproperty_check(&prop, ptr))) {
-               IDP_Int(idprop)= value;
+       if ((idprop = rna_idproperty_check(&prop, ptr))) {
+               IDP_Int(idprop) = value;
                rna_idproperty_touch(idprop);
        }
-       else if(bprop->set)
+       else if (bprop->set)
                bprop->set(ptr, value);
-       else if(prop->flag & PROP_EDITABLE) {
+       else if (prop->flag & PROP_EDITABLE) {
                IDPropertyTemplate val = {0};
                IDProperty *group;
 
-               val.i= value;
+               val.i = value;
 
-               group= RNA_struct_idprops(ptr, 1);
-               if(group)
+               group = RNA_struct_idprops(ptr, 1);
+               if (group)
                        IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
        }
 }
 
 void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
 {
-       BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+       BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if((idprop=rna_idproperty_check(&prop, ptr))) {
-               if(prop->arraydimension == 0)
-                       values[0]= RNA_property_boolean_get(ptr, prop);
+       if ((idprop = rna_idproperty_check(&prop, ptr))) {
+               if (prop->arraydimension == 0)
+                       values[0] = RNA_property_boolean_get(ptr, prop);
                else
                        memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len);
        }
-       else if(prop->arraydimension == 0)
-               values[0]= RNA_property_boolean_get(ptr, prop);
-       else if(bprop->getarray)
+       else if (prop->arraydimension == 0)
+               values[0] = RNA_property_boolean_get(ptr, prop);
+       else if (bprop->getarray)
                bprop->getarray(ptr, values);
-       else if(bprop->defaultarray)
+       else if (bprop->defaultarray)
                memcpy(values, bprop->defaultarray, sizeof(int)*prop->totarraylength);
        else
                memset(values, 0, sizeof(int)*prop->totarraylength);
@@ -1672,21 +1672,21 @@ void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *val
 int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
 {
        int tmp[RNA_MAX_ARRAY_LENGTH];
-       int len= rna_ensure_property_array_length(ptr, prop);
+       int len = rna_ensure_property_array_length(ptr, prop);
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if(len <= RNA_MAX_ARRAY_LENGTH) {
+       if (len <= RNA_MAX_ARRAY_LENGTH) {
                RNA_property_boolean_get_array(ptr, prop, tmp);
                return tmp[index];
        }
        else {
                int *tmparray, value;
 
-               tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
+               tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
                RNA_property_boolean_get_array(ptr, prop, tmparray);
-               value= tmparray[index];
+               value = tmparray[index];
                MEM_freeN(tmparray);
 
                return value;
@@ -1695,34 +1695,34 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index
 
 void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
 {
-       BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+       BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if((idprop=rna_idproperty_check(&prop, ptr))) {
-               if(prop->arraydimension == 0)
-                       IDP_Int(idprop)= values[0];
+       if ((idprop = rna_idproperty_check(&prop, ptr))) {
+               if (prop->arraydimension == 0)
+                       IDP_Int(idprop) = values[0];
                else
                        memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
 
                rna_idproperty_touch(idprop);
        }
-       else if(prop->arraydimension == 0)
+       else if (prop->arraydimension == 0)
                RNA_property_boolean_set(ptr, prop, values[0]);
-       else if(bprop->setarray)
+       else if (bprop->setarray)
                bprop->setarray(ptr, values);
-       else if(prop->flag & PROP_EDITABLE) {
+       else if (prop->flag & PROP_EDITABLE) {
                IDPropertyTemplate val = {0};
                IDProperty *group;
 
-               val.array.len= prop->totarraylength;
-               val.array.type= IDP_INT;
+               val.array.len = prop->totarraylength;
+               val.array.type = IDP_INT;
 
-               group= RNA_struct_idprops(ptr, 1);
-               if(group) {
-                       idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
+               group = RNA_struct_idprops(ptr, 1);
+               if (group) {
+                       idprop = IDP_New(IDP_ARRAY, &val, prop->identifier);
                        IDP_AddToGroup(group, idprop);
                        memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
                }
@@ -1732,22 +1732,22 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in
 void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
 {
        int tmp[RNA_MAX_ARRAY_LENGTH];
-       int len= rna_ensure_property_array_length(ptr, prop);
+       int len = rna_ensure_property_array_length(ptr, prop);
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if(len <= RNA_MAX_ARRAY_LENGTH) {
+       if (len <= RNA_MAX_ARRAY_LENGTH) {
                RNA_property_boolean_get_array(ptr, prop, tmp);
-               tmp[index]= value;
+               tmp[index] = value;
                RNA_property_boolean_set_array(ptr, prop, tmp);
        }
        else {
                int *tmparray;
 
-               tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
+               tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index");
                RNA_property_boolean_get_array(ptr, prop, tmparray);
-               tmparray[index]= value;
+               tmparray[index] = value;
                RNA_property_boolean_set_array(ptr, prop, tmparray);
                MEM_freeN(tmparray);
        }
@@ -1755,7 +1755,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde
 
 int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
 {
-       BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+       BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) == 0);
@@ -1765,14 +1765,14 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
 
 void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values)
 {
-       BoolPropertyRNA *bprop= (BoolPropertyRNA*)prop;
+       BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
        
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if(prop->arraydimension == 0)
-               values[0]= bprop->defaultvalue;
-       else if(bprop->defaultarray)
+       if (prop->arraydimension == 0)
+               values[0] = bprop->defaultvalue;
+       else if (bprop->defaultarray)
                memcpy(values, bprop->defaultarray, sizeof(int)*prop->totarraylength);
        else
                memset(values, 0, sizeof(int)*prop->totarraylength);
@@ -1781,21 +1781,21 @@ void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA
 int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
 {
        int tmp[RNA_MAX_ARRAY_LENGTH];
-       int len= rna_ensure_property_array_length(ptr, prop);
+       int len = rna_ensure_property_array_length(ptr, prop);
 
        BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if(len <= RNA_MAX_ARRAY_LENGTH) {
+       if (len <= RNA_MAX_ARRAY_LENGTH) {
                RNA_property_boolean_get_default_array(ptr, prop, tmp);
                return tmp[index];
        }
        else {
                int *tmparray, value;
 
-               tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_default_index");
+               tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_default_index");
                RNA_property_boolean_get_default_array(ptr, prop, tmparray);
-               value= tmparray[index];
+               value = tmparray[index];
                MEM_freeN(tmparray);
 
                return value;
@@ -1804,15 +1804,15 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i
 
 int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+       IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_INT);
        BLI_assert(RNA_property_array_check(prop) == 0);
 
-       if((idprop=rna_idproperty_check(&prop, ptr)))
+       if ((idprop = rna_idproperty_check(&prop, ptr)))
                return IDP_Int(idprop);
-       else if(iprop->get)
+       else if (iprop->get)
                return iprop->get(ptr);
        else
                return iprop->defaultvalue;
@@ -1820,7 +1820,7 @@ int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
 
 void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+       IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_INT);
@@ -1828,43 +1828,43 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
        /* useful to check on bad values but set function should clamp */
        /* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */
 
-       if((idprop=rna_idproperty_check(&prop, ptr))) {
-               IDP_Int(idprop)= value;
+       if ((idprop = rna_idproperty_check(&prop, ptr))) {
+               IDP_Int(idprop) = value;
                rna_idproperty_touch(idprop);
        }
-       else if(iprop->set)
+       else if (iprop->set)
                iprop->set(ptr, value);
-       else if(prop->flag & PROP_EDITABLE) {
+       else if (prop->flag & PROP_EDITABLE) {
                IDPropertyTemplate val = {0};
                IDProperty *group;
 
-               val.i= value;
+               val.i = value;
 
-               group= RNA_struct_idprops(ptr, 1);
-               if(group)
+               group = RNA_struct_idprops(ptr, 1);
+               if (group)
                        IDP_AddToGroup(group, IDP_New(IDP_INT, &val, prop->identifier));
        }
 }
 
 void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+       IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_INT);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if((idprop=rna_idproperty_check(&prop, ptr))) {
-               if(prop->arraydimension == 0)
-                       values[0]= RNA_property_int_get(ptr, prop);
+       if ((idprop = rna_idproperty_check(&prop, ptr))) {
+               if (prop->arraydimension == 0)
+                       values[0] = RNA_property_int_get(ptr, prop);
                else
                        memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len);
        }
-       else if(prop->arraydimension == 0)
-               values[0]= RNA_property_int_get(ptr, prop);
-       else if(iprop->getarray)
+       else if (prop->arraydimension == 0)
+               values[0] = RNA_property_int_get(ptr, prop);
+       else if (iprop->getarray)
                iprop->getarray(ptr, values);
-       else if(iprop->defaultarray)
+       else if (iprop->defaultarray)
                memcpy(values, iprop->defaultarray, sizeof(int)*prop->totarraylength);
        else
                memset(values, 0, sizeof(int)*prop->totarraylength);
@@ -1872,36 +1872,36 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
 
 void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2])
 {
-       const int array_len= RNA_property_array_length(ptr, prop);
+       const int array_len = RNA_property_array_length(ptr, prop);
 
-       if(array_len <= 0) {
-               values[0]= 0;
-               values[1]= 0;
+       if (array_len <= 0) {
+               values[0] = 0;
+               values[1] = 0;
        }
        else if (array_len == 1) {
                RNA_property_int_get_array(ptr, prop, values);
-               values[1]= values[0];
+               values[1] = values[0];
        }
        else {
                int arr_stack[32];
                int *arr;
                int i;
 
-               if(array_len > 32) {
-                       arr= MEM_mallocN(sizeof(int) * array_len, "RNA_property_int_get_array_range");
+               if (array_len > 32) {
+                       arr = MEM_mallocN(sizeof(int) * array_len, "RNA_property_int_get_array_range");
                }
                else {
-                       arr= arr_stack;
+                       arr = arr_stack;
                }
 
                RNA_property_int_get_array(ptr, prop, arr);
-               values[0]= values[1]= arr[0];
-               for(i= 1; i < array_len; i++) {
-                       values[0]= MIN2(values[0], arr[i]);
-                       values[1]= MAX2(values[1], arr[i]);
+               values[0] = values[1] = arr[0];
+               for (i = 1; i < array_len; i++) {
+                       values[0] = MIN2(values[0], arr[i]);
+                       values[1] = MAX2(values[1], arr[i]);
                }
 
-               if(arr != arr_stack) {
+               if (arr != arr_stack) {
                        MEM_freeN(arr);
                }
        }
@@ -1910,21 +1910,21 @@ void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int va
 int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
 {
        int tmp[RNA_MAX_ARRAY_LENGTH];
-       int len= rna_ensure_property_array_length(ptr, prop);
+       int len = rna_ensure_property_array_length(ptr, prop);
 
        BLI_assert(RNA_property_type(prop) == PROP_INT);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if(len <= RNA_MAX_ARRAY_LENGTH) {
+       if (len <= RNA_MAX_ARRAY_LENGTH) {
                RNA_property_int_get_array(ptr, prop, tmp);
                return tmp[index];
        }
        else {
                int *tmparray, value;
 
-               tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
+               tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
                RNA_property_int_get_array(ptr, prop, tmparray);
-               value= tmparray[index];
+               value = tmparray[index];
                MEM_freeN(tmparray);
 
                return value;
@@ -1933,34 +1933,34 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
 
 void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+       IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
        IDProperty *idprop;
 
        BLI_assert(RNA_property_type(prop) == PROP_INT);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if((idprop=rna_idproperty_check(&prop, ptr))) {
-               if(prop->arraydimension == 0)
-                       IDP_Int(idprop)= values[0];
+       if ((idprop = rna_idproperty_check(&prop, ptr))) {
+               if (prop->arraydimension == 0)
+                       IDP_Int(idprop) = values[0];
                else
                        memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
 
                rna_idproperty_touch(idprop);
        }
-       else if(prop->arraydimension == 0)
+       else if (prop->arraydimension == 0)
                RNA_property_int_set(ptr, prop, values[0]);
-       else if(iprop->setarray)
+       else if (iprop->setarray)
                iprop->setarray(ptr, values);
-       else if(prop->flag & PROP_EDITABLE) {
+       else if (prop->flag & PROP_EDITABLE) {
                IDPropertyTemplate val = {0};
                IDProperty *group;
 
-               val.array.len= prop->totarraylength;
-               val.array.type= IDP_INT;
+               val.array.len = prop->totarraylength;
+               val.array.type = IDP_INT;
 
-               group= RNA_struct_idprops(ptr, 1);
-               if(group) {
-                       idprop= IDP_New(IDP_ARRAY, &val, prop->identifier);
+               group = RNA_struct_idprops(ptr, 1);
+               if (group) {
+                       idprop = IDP_New(IDP_ARRAY, &val, prop->identifier);
                        IDP_AddToGroup(group, idprop);
                        memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
                }
@@ -1970,22 +1970,22 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v
 void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
 {
        int tmp[RNA_MAX_ARRAY_LENGTH];
-       int len= rna_ensure_property_array_length(ptr, prop);
+       int len = rna_ensure_property_array_length(ptr, prop);
 
        BLI_assert(RNA_property_type(prop) == PROP_INT);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if(len <= RNA_MAX_ARRAY_LENGTH) {
+       if (len <= RNA_MAX_ARRAY_LENGTH) {
                RNA_property_int_get_array(ptr, prop, tmp);
-               tmp[index]= value;
+               tmp[index] = value;
                RNA_property_int_set_array(ptr, prop, tmp);
        }
        else {
                int *tmparray;
 
-               tmparray= MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
+               tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index");
                RNA_property_int_get_array(ptr, prop, tmparray);
-               tmparray[index]= value;
+               tmparray[index] = value;
                RNA_property_int_set_array(ptr, prop, tmparray);
                MEM_freeN(tmparray);
        }
@@ -1993,20 +1993,20 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i
 
 int RNA_property_int_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+       IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
        return iprop->defaultvalue;
 }
 
 void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values)
 {
-       IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+       IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
        
        BLI_assert(RNA_property_type(prop) == PROP_INT);
        BLI_assert(RNA_property_array_check(prop) != 0);
 
-       if(prop->arraydimension == 0)
-               values[0]= iprop->defaultvalue;
-       else if(iprop->defaultarray)
+       if (prop->arraydimension == 0)
+               values[0] = iprop->defaultvalue;
+       else if (iprop->defaultarray)
                memcpy(values, iprop->defaultarray, sizeof(int)*prop->totarraylength);
        else
                memset(values, 0, sizeof(int)*prop->totarraylength);
@@