diff options
author | Jacques Lucke <jacques@blender.org> | 2020-09-16 13:23:23 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-09-16 13:23:23 +0300 |
commit | 27a5da4dc3a399e1fe7e88dc8722a891e9cfcf78 (patch) | |
tree | 7ad797f8746a58e527ed301bf7bcab4a389bb687 /source/blender/makesrna/RNA_define.h | |
parent | d376aea61840587eddcf75386b804673e5593d60 (diff) |
Cleanup: use uint8_t for various flags in curves
Previously, it was kind of a mess. In different places it was using `char`, `short` and `int`.
The changed properties are flags that are operated upon using bit operations. Therefore, the integer type should be unsigned. Since we only use 2 bits of these flags, `uint8_t` is large enough.
Especially note the change I had to make in `RNA_define.h` to make this work.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8844
Diffstat (limited to 'source/blender/makesrna/RNA_define.h')
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index ee1a3fdd539..de8e13875a6 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -509,7 +509,8 @@ int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *ide 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) + (strcmp(_str, "int") == 0 || strcmp(_str, "short") == 0 || strcmp(_str, "char") == 0 || \ + strcmp(_str, "uchar") == 0 || strcmp(_str, "ushort") == 0) #define IS_DNATYPE_BOOLEAN_COMPAT(_str) \ (IS_DNATYPE_INT_COMPAT(_str) || strcmp(_str, "int64_t") == 0 || strcmp(_str, "uint64_t") == 0) |