Revision: 23093
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23093
Author:   blendix
Date:     2009-09-09 21:59:52 +0200 (Wed, 09 Sep 2009)

Log Message:
-----------
RNA: fix for last commit, 0 size arrays are not very useful..

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c       
2009-09-09 19:52:10 UTC (rev 23092)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c       
2009-09-09 19:59:52 UTC (rev 23093)
@@ -1679,7 +1679,7 @@
                                BooleanPropertyRNA *bprop= 
(BooleanPropertyRNA*)prop;
                                unsigned int i;
 
-                               if(prop->arraydimension) {
+                               if(prop->arraydimension && 
prop->totarraylength) {
                                        fprintf(f, "static int 
rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, 
prop->totarraylength);
 
                                        for(i=0; i<prop->totarraylength; i++) {
@@ -1699,7 +1699,7 @@
                                IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
                                unsigned int i;
 
-                               if(prop->arraydimension) {
+                               if(prop->arraydimension && 
prop->totarraylength) {
                                        fprintf(f, "static int 
rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, 
prop->totarraylength);
 
                                        for(i=0; i<prop->totarraylength; i++) {
@@ -1719,7 +1719,7 @@
                                FloatPropertyRNA *fprop= 
(FloatPropertyRNA*)prop;
                                unsigned int i;
 
-                               if(prop->arraydimension) {
+                               if(prop->arraydimension && 
prop->totarraylength) {
                                        fprintf(f, "static float 
rna_%s%s_%s_default[%d] = {", srna->identifier, strnest, prop->identifier, 
prop->totarraylength);
 
                                        for(i=0; i<prop->totarraylength; i++) {
@@ -1762,7 +1762,7 @@
                        case PROP_BOOLEAN: {
                                BooleanPropertyRNA *bprop= 
(BooleanPropertyRNA*)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) 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;
                        }
@@ -1775,7 +1775,7 @@
                                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) 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;
                         }
@@ -1789,7 +1789,7 @@
                                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) 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;
                         }


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to