Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-01-01 13:19:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-01 13:19:22 +0400
commitf01ac19c3c720505b35aca520935845e9c8af862 (patch)
treeab60e10589111dc075f12a069cf0b78f81089935 /source/blender/makesrna/intern/makesrna.c
parentc99975e24fe550e46c57639a1f236b89c4745a02 (diff)
use __func__ for makesrna.c error prints rather then the function name (no functional changes)
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c66
1 files changed, 41 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 90e68058d36..e0771dbedb7 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -484,7 +484,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
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 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
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 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
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 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
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 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
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 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA
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 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *
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 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
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 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
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 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
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 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
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 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
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 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
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 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f)
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 @@ static int rna_preprocess(const char *outfile)
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 @@ static int rna_preprocess(const char *outfile)
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 @@ static int rna_preprocess(const char *outfile)
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 main(int argc, char **argv)
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();
}