diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-31 07:12:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-31 07:12:20 +0300 |
commit | 55934366521da478ad8f4674152c00742c2f5f1e (patch) | |
tree | 52413cd412034e70536d885dac6f69d8c0cbea68 /source/blender/makesrna/RNA_define.h | |
parent | a8406439938d3eb405c144a50d87100f48f77c7e (diff) |
Continue from my commit r33952, which disallowed floats to be wrapped as ints.
this missed some cases, now also disallow ints to be wrapped as floats.
This commit also exposed a number of cases where ints/floats were incorrectly wrapped.
Bugs like [#25416] wont slip through the cracks anymore.
Diffstat (limited to 'source/blender/makesrna/RNA_define.h')
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index f97187d6e15..3a8e2e4f80e 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -197,6 +197,12 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA void RNA_def_property_free_pointers(PropertyRNA *prop); int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *identifier); +/* utilities */ +const char *RNA_property_typename(PropertyType type); +#define IS_DNATYPE_FLOAT_COMPAT(_str) (strcmp(_str, "float") == 0 || strcmp(_str, "double") == 0) +#define IS_DNATYPE_INT_COMPAT(_str) (strcmp(_str, "int") == 0 || strcmp(_str, "short") == 0 || strcmp(_str, "char") == 0) + + #ifdef __cplusplus } #endif |