From 27a5da4dc3a399e1fe7e88dc8722a891e9cfcf78 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Wed, 16 Sep 2020 12:23:23 +0200 Subject: 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 --- source/blender/makesdna/DNA_curve_types.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 2ae9ba13177..8d5b5602c2e 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -113,9 +113,9 @@ typedef struct BezTriple { char ipo; /** H1, h2: the handle type of the two handles. */ - char h1, h2; + uint8_t h1, h2; /** F1, f2, f3: used for selection status. */ - char f1, f2, f3; + uint8_t f1, f2, f3; /** Hide: used to indicate whether BezTriple is hidden (3D), * type of keyframe (eBezTriple_KeyframeType). */ @@ -143,7 +143,9 @@ typedef struct BPoint { /** Used for softbody goal weight. */ float weight; /** F1: selection status, hide: is point hidden or not. */ - short f1, hide; + uint8_t f1; + char _pad1[1]; + short hide; /** User-set radius per point for beveling etc. */ float radius; char _pad[4]; -- cgit v1.2.3