fixed: signed integer overflow is undefined behavior
This commit is contained in:
parent
b20bdb01d9
commit
ba0991de3e
|
@ -87,7 +87,7 @@ static inline fix16_t fix16_from_dbl(double a)
|
|||
#define F16(x) ((fix16_t)(((x) >= 0) ? ((x) * 65536.0 + 0.5) : ((x) * 65536.0 - 0.5)))
|
||||
|
||||
static inline fix16_t fix16_abs(fix16_t x)
|
||||
{ return (x < 0 ? -x : x); }
|
||||
{ return (x < 0 ? -(uint32_t)x : x); }
|
||||
static inline fix16_t fix16_floor(fix16_t x)
|
||||
{ return (x & 0xFFFF0000UL); }
|
||||
static inline fix16_t fix16_ceil(fix16_t x)
|
||||
|
|
Loading…
Reference in New Issue