[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43050] trunk/blender/source/blender/ makesrna/intern/makesrna.c: use __func__ for makesrna. c error prints rather then the function name (no functional changes)

Campbell Barton ideasman42 at gmail.com
Sun Jan 1 10:19:32 CET 2012


Revision: 43050
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43050
Author:   campbellbarton
Date:     2012-01-01 09:19:22 +0000 (Sun, 01 Jan 2012)
Log Message:
-----------
use __func__ for makesrna.c error prints rather then the function name (no functional changes)

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/makesrna.c

Modified: trunk/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/makesrna.c	2012-01-01 08:52:54 UTC (rev 43049)
+++ trunk/blender/source/blender/makesrna/intern/makesrna.c	2012-01-01 09:19:22 UTC (rev 43050)
@@ -484,7 +484,8 @@
 
 	if(!manualfunc) {
 		if(!dp->dnastructname || !dp->dnaname) {
-			fprintf(stderr, "rna_def_property_get_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+			fprintf(stderr, "%s (0): %s.%s has no valid dna info.\n",
+			        __func__, srna->identifier, prop->identifier);
 			DefRNA.error= 1;
 			return NULL;
 		}
@@ -495,7 +496,8 @@
 			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, "rna_def_property_get_func1: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
+						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;
 						return NULL;
 					}
@@ -503,7 +505,8 @@
 			}
 			else if(prop->type == PROP_INT || prop->type == PROP_BOOLEAN || prop->type == PROP_ENUM) {
 				if(IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
-					fprintf(stderr, "rna_def_property_get_func2: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
+					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;
 					return NULL;
 				}
@@ -724,7 +727,8 @@
 	if(!manualfunc) {
 		if(!dp->dnastructname || !dp->dnaname) {
 			if(prop->flag & PROP_EDITABLE) {
-				fprintf(stderr, "rna_def_property_set_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+				fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
+				        __func__, srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 			}
 			return NULL;
@@ -902,7 +906,8 @@
 	if(prop->type == PROP_STRING) {
 		if(!manualfunc) {
 			if(!dp->dnastructname || !dp->dnaname) {
-				fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+				fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
+				        __func__, srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 				return NULL;
 			}
@@ -924,7 +929,8 @@
 	else if(prop->type == PROP_COLLECTION) {
 		if(!manualfunc) {
 			if(prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) {
-				fprintf(stderr, "rna_def_property_length_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+				fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
+				        __func__, srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 				return NULL;
 			}
@@ -959,7 +965,8 @@
 
 	if(!manualfunc) {
 		if(!dp->dnastructname || !dp->dnaname) {
-			fprintf(stderr, "rna_def_property_begin_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
+			fprintf(stderr, "%s: %s.%s has no valid dna info.\n",
+			        __func__, srna->identifier, prop->identifier);
 			DefRNA.error= 1;
 			return NULL;
 		}
@@ -1270,7 +1277,8 @@
 			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, "rna_def_property_funcs: %s.%s, pointer must have a struct type.\n", srna->identifier, prop->identifier);
+				fprintf(stderr, "%s: %s.%s, pointer must have a struct type.\n",
+				        __func__, srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 			}
 			break;
@@ -1298,20 +1306,24 @@
 
 			if(!(prop->flag & PROP_IDPROPERTY)) {
 				if(!cprop->begin) {
-					fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a begin function.\n", srna->identifier, prop->identifier);
+					fprintf(stderr, "%s: %s.%s, collection must have a begin function.\n",
+					        __func__, srna->identifier, prop->identifier);
 					DefRNA.error= 1;
 				}
 				if(!cprop->next) {
-					fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a next function.\n", srna->identifier, prop->identifier);
+					fprintf(stderr, "%s: %s.%s, collection must have a next function.\n",
+					        __func__, srna->identifier, prop->identifier);
 					DefRNA.error= 1;
 				}
 				if(!cprop->get) {
-					fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a get function.\n", srna->identifier, prop->identifier);
+					fprintf(stderr, "%s: %s.%s, collection must have a get function.\n",
+					        __func__, srna->identifier, prop->identifier);
 					DefRNA.error= 1;
 				}
 			}
 			if(!cprop->item_type) {
-				fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a struct type.\n", srna->identifier, prop->identifier);
+				fprintf(stderr, "%s: %s.%s, collection must have a struct type.\n",
+				        __func__, srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 			}
 			break;
@@ -2136,19 +2148,22 @@
 
 					if(prop->flag & PROP_ENUM_FLAG) {
 						if(eprop->defaultvalue & ~totflag) {
-							fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default includes unused bits (%d).\n", srna->identifier, errnest, prop->identifier, 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;
 						}
 					}
 					else {
 						if(!defaultfound) {
-							fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default is not in items.\n", srna->identifier, errnest, prop->identifier);
+							fprintf(stderr, "%s: %s%s.%s, enum default is not in items.\n",
+							        __func__, srna->identifier, errnest, prop->identifier);
 							DefRNA.error= 1;
 						}
 					}
 				}
 				else {
-					fprintf(stderr, "rna_generate_structs: %s%s.%s, enum must have items defined.\n", srna->identifier, errnest, prop->identifier);
+					fprintf(stderr, "%s: %s%s.%s, enum must have items defined.\n",
+					        __func__, srna->identifier, errnest, prop->identifier);
 					DefRNA.error= 1;
 				}
 				break;
@@ -2262,7 +2277,7 @@
 				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;
 				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));
@@ -2276,7 +2291,7 @@
 				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;
 				fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength);
@@ -2299,7 +2314,7 @@
 				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;
 				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));
@@ -2421,7 +2436,8 @@
 	fprintf(f, "\t%s,\n", rna_function_string(srna->idproperties));
 
 	if(srna->reg && !srna->refine) {
-		fprintf(stderr, "rna_generate_struct: %s has a register function, must also have refine function.\n", srna->identifier);
+		fprintf(stderr, "%s: %s has a register function, must also have refine function.\n",
+		        __func__, srna->identifier);
 		DefRNA.error= 1;
 	}
 
@@ -2841,7 +2857,7 @@
 		file = fopen(deffile, "w");
 
 		if(!file) {
-			printf ("Unable to open file: %s\n", deffile);
+			fprintf(stderr, "Unable to open file: %s\n", deffile);
 			status = 1;
 		}
 		else {
@@ -2869,7 +2885,7 @@
 			file = fopen(deffile, "w");
 
 			if(!file) {
-				printf ("Unable to open file: %s\n", deffile);
+				fprintf(stderr, "Unable to open file: %s\n", deffile);
 				status = 1;
 			}
 			else {
@@ -2898,7 +2914,7 @@
 		file = fopen(deffile, "w");
 
 		if(!file) {
-			printf ("Unable to open file: %s\n", deffile);
+			fprintf(stderr, "Unable to open file: %s\n", deffile);
 			status = 1;
 		}
 		else {
@@ -2928,18 +2944,18 @@
 	int totblock, return_status = 0;
 
 	if(argc<2) {
-		printf("Usage: %s outdirectory/\n", argv[0]);
+		fprintf(stderr, "Usage: %s outdirectory/\n", argv[0]);
 		return_status = 1;
 	}
 	else {
-		printf("Running makesrna, program versions %s\n",  RNA_VERSION_DATE);
+		fprintf(stderr, "Running makesrna, program versions %s\n",  RNA_VERSION_DATE);
 		makesrna_path= argv[0];
 		return_status= rna_preprocess(argv[1]);
 	}
 
 	totblock= MEM_get_memory_blocks_in_use();
 	if(totblock!=0) {
-		printf("Error Totblock: %d\n",totblock);
+		fprintf(stderr, "Error Totblock: %d\n",totblock);
 		MEM_set_error_callback(mem_error_cb);
 		MEM_printmemlist();
 	}




More information about the Bf-blender-cvs mailing list