diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-29 15:49:39 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-29 15:49:39 +0400 |
commit | 9e05f6571f824bd4a99bb4fe5af5ec15688a9649 (patch) | |
tree | 258cb4a162bdcad89b4cdbf5d5f86ad352ebd999 /source/blender/editors/animation/anim_draw.c | |
parent | e99801dc706b7ff4cea0656e408c20835638dd6b (diff) |
Make sure bool will always have the same size in C and C++
There were an issues with data structures defined in headers
and being used by both C and C++ on systems with stdbool
unavailable.
This happened because bool in this case will be defined as
unsigned int, which is 4 bytes. But C++'s bool is only 1
byte and this lead to alignment issues.
Now bool is always 1 byte, also made sure there's no situation
like bool foo = BitField & BitFlag, which could give overflow
issues. Use (BitField & BitFlag) != 0 instead.
Fixes #35553: Compositor broken (Backdrop & Preview)
Diffstat (limited to 'source/blender/editors/animation/anim_draw.c')
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 12acc85e443..2e580a57a01 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -399,9 +399,9 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short rest static short bezt_unit_mapping_apply(KeyframeEditData *ked, BezTriple *bezt) { /* mapping factor is stored in f1, flags are stored in i1 */ - const bool only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS); - const bool sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS); - const bool skip_knot = (ked->i1 & ANIM_UNITCONV_SKIPKNOTS); + const bool only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS) != 0; + const bool sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS) != 0; + const bool skip_knot = (ked->i1 & ANIM_UNITCONV_SKIPKNOTS) != 0; float fac = ked->f1; /* adjust BezTriple handles only if allowed to */ |