diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-09 05:29:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-09 05:29:53 +0400 |
commit | a59ba9a519c076aad17e00442e3fc0ad6bf26284 (patch) | |
tree | f2eddeb85c33b39b5ce3768194cf5978fa6ac098 /source/blender/makesrna | |
parent | ae7401751c126dfd0373d6f16b71d0311c1c2ea2 (diff) |
- 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.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 5da125bb440..7d013d01e72 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -974,7 +974,11 @@ int RNA_function_call_direct_va_lookup(struct bContext *C, struct ReportList *re short RNA_type_to_ID_code(StructRNA *type); StructRNA *ID_code_to_RNA_type(short idcode); -void RNA_warning(const char *format, ...) + +/* macro which inserts the function name */ +#define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args) + +void _RNA_warning(const char *format, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 1, 2))) #endif diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index e7d0c5cdec2..ea23fea0c2c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -5374,7 +5374,8 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i return 0; } -void RNA_warning(const char *format, ...) +/* use RNA_warning macro which includes __func__ suffix */ +void _RNA_warning(const char *format, ...) { va_list args; diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index d4ac9880290..92c93f41dfc 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -46,7 +46,7 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, int flag= 0; if(!prop) { - RNA_warning("rna_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; } |