[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40050] trunk/blender/source/blender: - turn RNA_warning into a macro which includes the function name ( was being written in manually but had incorrect func names in places).

Campbell Barton ideasman42 at gmail.com
Fri Sep 9 03:29:55 CEST 2011


Revision: 40050
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40050
Author:   campbellbarton
Date:     2011-09-09 01:29:53 +0000 (Fri, 09 Sep 2011)
Log Message:
-----------
- turn RNA_warning into a macro which includes the function name (was being written in manually but had incorrect func names in places).
- add __func__ define to BLI_utildefines.h for MSVC.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_utildefines.h
    trunk/blender/source/blender/editors/interface/interface_layout.c
    trunk/blender/source/blender/editors/interface/interface_templates.c
    trunk/blender/source/blender/makesrna/RNA_access.h
    trunk/blender/source/blender/makesrna/intern/rna_access.c
    trunk/blender/source/blender/makesrna/intern/rna_ui_api.c
    trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/blenlib/BLI_utildefines.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_utildefines.h	2011-09-09 00:46:00 UTC (rev 40049)
+++ trunk/blender/source/blender/blenlib/BLI_utildefines.h	2011-09-09 01:29:53 UTC (rev 40050)
@@ -176,6 +176,12 @@
 /* useful for debugging */
 #define AT __FILE__ ":" STRINGIFY(__LINE__)
 
+/* so we can use __func__ everywhere */
+#if defined(_MSC_VER)
+#  define __func__ __FUNCTION__
+#endif
+
+
 /* UNUSED macro, for function argument */
 #ifdef __GNUC__
 #  define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))

Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c	2011-09-09 00:46:00 UTC (rev 40049)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c	2011-09-09 01:29:53 UTC (rev 40050)
@@ -630,7 +630,7 @@
 
 	if(!ot) {
 		ui_item_disabled(layout, opname);
-		RNA_warning("uiItemFullO: unknown operator '%s'\n", opname);
+		RNA_warning("unknown operator '%s'", opname);
 		return PointerRNA_NULL;
 	}
 
@@ -737,7 +737,7 @@
 
 	if(!ot || !ot->srna) {
 		ui_item_disabled(layout, opname);
-		RNA_warning("uiItemsFullEnumO: %s '%s'\n", ot ? "unknown operator" : "operator missing srna", opname);
+		RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
 		return;
 	}
 
@@ -815,7 +815,7 @@
 		/* pass */
 	}
 	else {
-		RNA_warning("uiItemEnumO_value: %s.%s not found.\n", RNA_struct_identifier(ptr.type), propname);
+		RNA_warning("%s.%s not found.", RNA_struct_identifier(ptr.type), propname);
 		return;
 	}
 
@@ -844,7 +844,7 @@
 		RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free);
 		if(item==NULL || RNA_enum_value_from_id(item, value_str, &value)==0) {
 			if(free) MEM_freeN(item);
-			RNA_warning("uiItemEnumO_string: %s.%s, enum %s not found.\n", RNA_struct_identifier(ptr.type), propname, value_str);
+			RNA_warning("%s.%s, enum %s not found.", RNA_struct_identifier(ptr.type), propname, value_str);
 			return;
 		}
 
@@ -852,7 +852,7 @@
 			MEM_freeN(item);
 	}
 	else {
-		RNA_warning("uiItemEnumO_string: %s.%s not found.\n", RNA_struct_identifier(ptr.type), propname);
+		RNA_warning("%s.%s not found.", RNA_struct_identifier(ptr.type), propname);
 		return;
 	}
 	
@@ -1059,7 +1059,7 @@
 
 	if(!prop) {
 		ui_item_disabled(layout, propname);
-		RNA_warning("uiItemR: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 
@@ -1072,7 +1072,7 @@
 
 	if(!prop || RNA_property_type(prop) != PROP_ENUM) {
 		ui_item_disabled(layout, propname);
-		RNA_warning("uiItemEnumR: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 
@@ -1087,7 +1087,7 @@
 
 	if(!prop || RNA_property_type(prop) != PROP_ENUM) {
 		ui_item_disabled(layout, propname);
-		RNA_warning("uiItemEnumR_string: enum property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("enum property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 
@@ -1096,7 +1096,7 @@
 	if(!RNA_enum_value_from_id(item, value, &ivalue)) {
 		if(free) MEM_freeN(item);
 		ui_item_disabled(layout, propname);
-		RNA_warning("uiItemEnumR: enum property value not found: %s\n", value);
+		RNA_warning("enum property value not found: %s", value);
 		return;
 	}
 
@@ -1121,12 +1121,12 @@
 
 	if(!prop) {
 		ui_item_disabled(layout, propname);
-		RNA_warning("uiItemsEnumR: enum property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("enum property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 
 	if(RNA_property_type(prop) != PROP_ENUM) {
-		RNA_warning("uiItemsEnumR: not an enum property: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("not an enum property: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 	else {
@@ -1314,13 +1314,13 @@
 	prop= RNA_struct_find_property(ptr, propname);
 
 	if(!prop) {
-		RNA_warning("uiItemPointerR: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 	
 	type= RNA_property_type(prop);
 	if(!ELEM(type, PROP_POINTER, PROP_STRING)) {
-		RNA_warning("uiItemPointerR: property %s must be a pointer or string.\n", propname);
+		RNA_warning("property %s must be a pointer or string.", propname);
 		return;
 	}
 
@@ -1328,11 +1328,11 @@
 
 
 	if(!searchprop) {
-		RNA_warning("uiItemPointerR: search collection property not found: %s.%s\n", RNA_struct_identifier(ptr->type), searchpropname);
+		RNA_warning("search collection property not found: %s.%s", RNA_struct_identifier(ptr->type), searchpropname);
 		return;
 	}
 	else if (RNA_property_type(searchprop) != PROP_COLLECTION) {
-		RNA_warning("uiItemPointerR: search collection property is not a collection type: %s.%s\n", RNA_struct_identifier(ptr->type), searchpropname);
+		RNA_warning("search collection property is not a collection type: %s.%s", RNA_struct_identifier(ptr->type), searchpropname);
 		return;
 	}
 
@@ -1417,7 +1417,7 @@
 	mt= WM_menutype_find(menuname, FALSE);
 
 	if(mt==NULL) {
-		RNA_warning("uiItemM: not found %s\n", menuname);
+		RNA_warning("not found %s", menuname);
 		return;
 	}
 
@@ -1537,12 +1537,12 @@
 
 	if(!ot) {
 		ui_item_disabled(layout, opname);
-		RNA_warning("uiItemMenuEnumO: unknown operator '%s'\n", opname);
+		RNA_warning("unknown operator '%s'", opname);
 		return;
 	}
 	if(!ot->srna) {
 		ui_item_disabled(layout, opname);
-		RNA_warning("uiItemMenuEnumO: operator missing srna '%s'\n", opname);
+		RNA_warning("operator missing srna '%s'", opname);
 		return;
 	}
 
@@ -1575,7 +1575,7 @@
 	prop= RNA_struct_find_property(ptr, propname);
 	if(!prop) {
 		ui_item_disabled(layout, propname);
-		RNA_warning("uiItemMenuEnumR: property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2011-09-09 00:46:00 UTC (rev 40049)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2011-09-09 01:29:53 UTC (rev 40050)
@@ -245,7 +245,7 @@
 	switch(event) {
 		case UI_ID_BROWSE:
 		case UI_ID_PIN:
-			RNA_warning("warning, id event %d shouldnt come here\n", event);
+			RNA_warning("warning, id event %d shouldnt come here", event);
 			break;
 		case UI_ID_OPEN:
 		case UI_ID_ADD_NEW:
@@ -488,7 +488,7 @@
 	prop= RNA_struct_find_property(ptr, propname);
 
 	if(!prop || RNA_property_type(prop) != PROP_POINTER) {
-		RNA_warning("uiTemplateID: pointer property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("pointer property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 
@@ -549,11 +549,11 @@
 	propType= RNA_struct_find_property(ptr, proptypename);
 
 	if (!propID || RNA_property_type(propID) != PROP_POINTER) {
-		RNA_warning("uiTemplateAnyID: pointer property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("pointer property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 	if (!propType || RNA_property_type(propType) != PROP_ENUM) { 
-		RNA_warning("uiTemplateAnyID: pointer-type property not found: %s.%s\n", RNA_struct_identifier(ptr->type), proptypename);
+		RNA_warning("pointer-type property not found: %s.%s", RNA_struct_identifier(ptr->type), proptypename);
 		return;
 	}
 	
@@ -592,7 +592,7 @@
 	/* check that properties are valid */
 	propPath= RNA_struct_find_property(ptr, propname);
 	if (!propPath || RNA_property_type(propPath) != PROP_STRING) {
-		RNA_warning("uiTemplatePathBuilder: path property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("path property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 	
@@ -855,7 +855,7 @@
 
 	/* verify we have valid data */
 	if(!RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
-		RNA_warning("uiTemplateModifier: Expected modifier on object.\n");
+		RNA_warning("Expected modifier on object.");
 		return NULL;
 	}
 
@@ -863,7 +863,7 @@
 	md= ptr->data;
 
 	if(!ob || !(GS(ob->id.name) == ID_OB)) {
-		RNA_warning("uiTemplateModifier: Expected modifier on object.\n");
+		RNA_warning("expected modifier on object.");
 		return NULL;
 	}
 	
@@ -1084,7 +1084,7 @@
 
 	/* verify we have valid data */
 	if(!RNA_struct_is_a(ptr->type, &RNA_Constraint)) {
-		RNA_warning("uiTemplateConstraint: Expected constraint on object.\n");
+		RNA_warning("Expected constraint on object.");
 		return NULL;
 	}
 
@@ -1092,7 +1092,7 @@
 	con= ptr->data;
 
 	if(!ob || !(GS(ob->id.name) == ID_OB)) {
-		RNA_warning("uiTemplateConstraint: Expected constraint on object.\n");
+		RNA_warning("Expected constraint on object.");
 		return NULL;
 	}
 	
@@ -1138,7 +1138,7 @@
 	PointerRNA texture_ptr;
 
 	if(id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
-		RNA_warning("uiTemplatePreview: Expected ID of type material, texture, lamp or world.\n");
+		RNA_warning("expected ID of type material, texture, lamp or world.");
 		return;
 	}
 
@@ -1844,12 +1844,14 @@
 	PointerRNA cptr;
 
 	if(!prop) {
-		RNA_warning("uiTemplateCurveMapping: curve property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("curve property not found: %s.%s",
+		            RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 
 	if(RNA_property_type(prop) != PROP_POINTER) {
-		RNA_warning("uiTemplateCurveMapping: curve is not a pointer: %s.%s\n", RNA_struct_identifier(ptr->type), propname);
+		RNA_warning("curve is not a pointer: %s.%s",
+		            RNA_struct_identifier(ptr->type), propname);
 		return;
 	}
 
@@ -1879,7 +1881,7 @@
 	float softmin, softmax, step, precision;
 	
 	if (!prop) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list