diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-31 18:25:07 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-31 18:25:07 +0400 |
commit | 3a4c317b877c3c5c061808d2aa8a437fe30d5eee (patch) | |
tree | 8944621f407c08228bcb8cb59149766961efbe0a /source/blender/blenlib | |
parent | ba7e37c2b6ea87c08dac697257360edcea2ae8f4 (diff) |
Fix UI translation partly missing in scons builds (reported by Leon Cheung and Gabriel Gazzán on ML, and lockal on IRC, thanks).
The problem is that, when HAVE__BOOL is not defined (as it is the case in scons currently), BLI_utildefines.h defines bool as a standard type. Was using signed char, which makes eg "bool foo = 1024" be false (overflow)! Especially nasty when using bitflags (think we have been lucky to not have worse bugs because of that)!
So changed fallback bool type to unsigned int.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 43b1e7871cd..983fc421d46 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -45,7 +45,11 @@ # ifdef __cplusplus typedef bool _BLI_Bool; # else -# define _BLI_Bool signed char +/* using char here may cause nasty tricky bugs, e.g. + * bool do_translate = RNA_property_flag(prop) & PROP_STRING_PY_TRANSLATE; + * as PROP_STRING_PY_TRANSLATE is farther than 8th bit, do_translate would be always false! + */ +# define _BLI_Bool unsigned int # endif # else # define _BLI_Bool _Bool |