aboutsummaryrefslogtreecommitdiff
path: root/lib/builtins/fp_fixuint_impl.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/builtins/fp_fixuint_impl.inc')
-rw-r--r--lib/builtins/fp_fixuint_impl.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/builtins/fp_fixuint_impl.inc b/lib/builtins/fp_fixuint_impl.inc
index 5fefab0e2d8a..d68ccf27a79c 100644
--- a/lib/builtins/fp_fixuint_impl.inc
+++ b/lib/builtins/fp_fixuint_impl.inc
@@ -14,7 +14,7 @@
#include "fp_lib.h"
-static inline fixuint_t __fixuint(fp_t a) {
+static __inline fixuint_t __fixuint(fp_t a) {
// Break a into sign, exponent, significand
const rep_t aRep = toRep(a);
const rep_t aAbs = aRep & absMask;
@@ -27,7 +27,7 @@ static inline fixuint_t __fixuint(fp_t a) {
return 0;
// If the value is too large for the integer type, saturate.
- if ((unsigned)exponent > sizeof(fixuint_t) * CHAR_BIT)
+ if ((unsigned)exponent >= sizeof(fixuint_t) * CHAR_BIT)
return ~(fixuint_t)0;
// If 0 <= exponent < significandBits, right shift to get the result.