[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40640] trunk/blender/source/blender/ makesrna/intern: use __func__ rather than function names in rna prints, some were incorrect.

Campbell Barton ideasman42 at gmail.com
Wed Sep 28 07:20:15 CEST 2011


Revision: 40640
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40640
Author:   campbellbarton
Date:     2011-09-28 05:20:14 +0000 (Wed, 28 Sep 2011)
Log Message:
-----------
use __func__ rather than function names in rna prints, some were incorrect.
also replace use of strlen() where checking first char is enough.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_access.c
    trunk/blender/source/blender/makesrna/intern/rna_animation.c
    trunk/blender/source/blender/makesrna/intern/rna_define.c
    trunk/blender/source/blender/makesrna/intern/rna_fcurve.c
    trunk/blender/source/blender/makesrna/intern/rna_text.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c	2011-09-28 02:02:57 UTC (rev 40639)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2011-09-28 05:20:14 UTC (rev 40640)
@@ -1111,7 +1111,7 @@
 		return 1;
 	}
 
-	printf("RNA_property_pointer_poll %s: is not a pointer property.\n", prop->identifier);
+	printf("%s %s: is not a pointer property.\n", __func__, prop->identifier);
 	return 0;
 }
 
@@ -2511,7 +2511,7 @@
 			IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, (char*)prop->identifier));
 	}
 	else
-		printf("RNA_property_pointer_add %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
+		printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);
 }
 
 void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
@@ -2530,7 +2530,7 @@
 		}
 	}
 	else
-		printf("RNA_property_pointer_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
+		printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);
 }
 
 static void rna_property_collection_get_idp(CollectionPropertyIterator *iter)
@@ -2663,7 +2663,7 @@
 		}
 	}
 	/*else
-		printf("RNA_property_collection_add %s.%s: not implemented for this property.\n", ptr->type->identifier, prop->identifier);*/
+		printf("%s %s.%s: not implemented for this property.\n", __func__, ptr->type->identifier, prop->identifier);*/
 #endif
 
 	if(r_ptr) {
@@ -2722,7 +2722,7 @@
 		return 0;
 	}
 	/*else
-		printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);*/
+		printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);*/
 #endif
 	return 0;
 }
@@ -3999,7 +3999,7 @@
 		return RNA_property_boolean_get(ptr, prop);
 	}
 	else {
-		printf("RNA_boolean_get: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return 0;
 	}
 }
@@ -4011,7 +4011,7 @@
 	if(prop)
 		RNA_property_boolean_set(ptr, prop, value);
 	else
-		printf("RNA_boolean_set: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values)
@@ -4021,7 +4021,7 @@
 	if(prop)
 		RNA_property_boolean_get_array(ptr, prop, values);
 	else
-		printf("RNA_boolean_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values)
@@ -4031,7 +4031,7 @@
 	if(prop)
 		RNA_property_boolean_set_array(ptr, prop, values);
 	else
-		printf("RNA_boolean_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 int RNA_int_get(PointerRNA *ptr, const char *name)
@@ -4042,7 +4042,7 @@
 		return RNA_property_int_get(ptr, prop);
 	}
 	else {
-		printf("RNA_int_get: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return 0;
 	}
 }
@@ -4054,7 +4054,7 @@
 	if(prop)
 		RNA_property_int_set(ptr, prop, value);
 	else
-		printf("RNA_int_set: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
@@ -4064,7 +4064,7 @@
 	if(prop)
 		RNA_property_int_get_array(ptr, prop, values);
 	else
-		printf("RNA_int_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
@@ -4074,7 +4074,7 @@
 	if(prop)
 		RNA_property_int_set_array(ptr, prop, values);
 	else
-		printf("RNA_int_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 float RNA_float_get(PointerRNA *ptr, const char *name)
@@ -4085,7 +4085,7 @@
 		return RNA_property_float_get(ptr, prop);
 	}
 	else {
-		printf("RNA_float_get: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return 0;
 	}
 }
@@ -4097,7 +4097,7 @@
 	if(prop)
 		RNA_property_float_set(ptr, prop, value);
 	else
-		printf("RNA_float_set: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
@@ -4107,7 +4107,7 @@
 	if(prop)
 		RNA_property_float_get_array(ptr, prop, values);
 	else
-		printf("RNA_float_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
@@ -4117,7 +4117,7 @@
 	if(prop)
 		RNA_property_float_set_array(ptr, prop, values);
 	else
-		printf("RNA_float_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 int RNA_enum_get(PointerRNA *ptr, const char *name)
@@ -4128,7 +4128,7 @@
 		return RNA_property_enum_get(ptr, prop);
 	}
 	else {
-		printf("RNA_enum_get: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return 0;
 	}
 }
@@ -4140,7 +4140,7 @@
 	if(prop)
 		RNA_property_enum_set(ptr, prop, value);
 	else
-		printf("RNA_enum_set: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id)
@@ -4152,9 +4152,11 @@
 		if(RNA_property_enum_value(NULL, ptr, prop, id, &value))
 			RNA_property_enum_set(ptr, prop, value);
 		else
-			printf("RNA_enum_set_identifier: %s.%s has no enum id '%s'.\n", ptr->type->identifier, name, id);
-	} else
-		printf("RNA_enum_set_identifier: %s.%s not found.\n", ptr->type->identifier, name);
+			printf("%s: %s.%s has no enum id '%s'.\n", __func__, ptr->type->identifier, name, id);
+	}
+	else {
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
+	}
 }
 
 int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname)
@@ -4173,11 +4175,11 @@
 		if(free)
 			MEM_freeN(item);
 
-		printf("RNA_enum_is_equal: %s.%s item %s not found.\n", ptr->type->identifier, name, enumname);
+		printf("%s: %s.%s item %s not found.\n", __func__, ptr->type->identifier, name, enumname);
 		return 0;
 	}
 	else {
-		printf("RNA_enum_is_equal: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return 0;
 	}
 }
@@ -4226,7 +4228,7 @@
 		RNA_property_string_get(ptr, prop, value);
 	}
 	else {
-		printf("RNA_string_get: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		value[0]= '\0';
 	}
 }
@@ -4239,7 +4241,7 @@
 		return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen);
 	}
 	else {
-		printf("RNA_string_get_alloc: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return NULL;
 	}
 }
@@ -4252,7 +4254,7 @@
 		return RNA_property_string_length(ptr, prop);
 	}
 	else {
-		printf("RNA_string_length: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return 0;
 	}
 }
@@ -4264,7 +4266,7 @@
 	if(prop)
 		RNA_property_string_set(ptr, prop, value);
 	else
-		printf("RNA_string_set: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
@@ -4275,7 +4277,7 @@
 		return RNA_property_pointer_get(ptr, prop);
 	}
 	else {
-		printf("RNA_pointer_get: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 
 		return PointerRNA_NULL;
 	}
@@ -4289,7 +4291,7 @@
 		RNA_property_pointer_set(ptr, prop, ptr_value);
 	}
 	else {
-		printf("RNA_pointer_set: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 	}
 }
 
@@ -4300,7 +4302,7 @@
 	if(prop)
 		RNA_property_pointer_add(ptr, prop);
 	else
-		printf("RNA_pointer_set: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter)
@@ -4310,7 +4312,7 @@
 	if(prop)
 		RNA_property_collection_begin(ptr, prop, iter);
 	else
-		printf("RNA_collection_begin: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
@@ -4320,7 +4322,7 @@
 	if(prop)
 		RNA_property_collection_add(ptr, prop, r_value);
 	else
-		printf("RNA_collection_add: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 void RNA_collection_clear(PointerRNA *ptr, const char *name)
@@ -4330,7 +4332,7 @@
 	if(prop)
 		RNA_property_collection_clear(ptr, prop);
 	else
-		printf("RNA_collection_clear: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 }
 
 int RNA_collection_length(PointerRNA *ptr, const char *name)
@@ -4341,7 +4343,7 @@
 		return RNA_property_collection_length(ptr, prop);
 	}
 	else {
-		printf("RNA_collection_length: %s.%s not found.\n", ptr->type->identifier, name);
+		printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
 		return 0;
 	}
 }
@@ -4358,7 +4360,7 @@
 	}
 	else {
 		/* python raises an error */

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list