Skip to contentSkip to conversation

softfloat: Fix warn about implicit conversion from int to int8_t

PATCH Applied Pranith Kumar 3 participants 3 messages Aug 10, 2016 – Aug 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 softfloat: Fix warn about implicit conversion from int to int8_t

Change the flag type to 'uint8_t' to fix the implicit conversion error.

---
 fpu/softfloat-specialize.h | 2 +-
 include/fpu/softfloat.h    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
fpu/softfloat-specialize.h +1 -1
index 43d0890..f5aed72 100644
@@ -197,7 +197,7 @@ float128 float128_default_nan(float_status *status)
 | should be simply `float_exception_flags |= flags;'.
 *----------------------------------------------------------------------------*/
 
-void float_raise(int8_t flags, float_status *status)
+void float_raise(uint8_t flags, float_status *status)
 {
     status->float_exception_flags |= flags;
 }
include/fpu/softfloat.h +2 -2
index 0e57ee5..1bde349 100644
@@ -198,7 +198,7 @@ enum {
 typedef struct float_status {
     signed char float_detect_tininess;
     signed char float_rounding_mode;
-    signed char float_exception_flags;
+    uint8_t     float_exception_flags;
     signed char floatx80_rounding_precision;
     /* should denormalised results go to zero and set the inexact flag? */
     flag flush_to_zero;
@@ -274,7 +274,7 @@ static inline flag get_default_nan_mode(float_status *status)
 | Routine to raise any or all of the software IEC/IEEE floating-point
 | exception flags.
 *----------------------------------------------------------------------------*/
-void float_raise(int8_t flags, float_status *status);
+void float_raise(uint8_t flags, float_status *status);
 
 /*----------------------------------------------------------------------------
 | If `a' is denormal and we are in flush-to-zero mode then set the
Signature · 1 line
2.9.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 35 lines · Pranith Kumar

Change the flag type to 'uint8_t' to fix the implicit conversion error.

---
 fpu/softfloat-specialize.h | 2 +-
 include/fpu/softfloat.h    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
fpu/softfloat-specialize.h +1 -1
index 43d0890..f5aed72 100644
@@ -197,7 +197,7 @@ float128 float128_default_nan(float_status *status)
 | should be simply `float_exception_flags |= flags;'.
 *----------------------------------------------------------------------------*/
 
-void float_raise(int8_t flags, float_status *status)
+void float_raise(uint8_t flags, float_status *status)
 {
     status->float_exception_flags |= flags;
 }
include/fpu/softfloat.h +1 -1
index 0e57ee5..1bde349 100644
@@ -198,7 +198,7 @@ enum {
 typedef struct float_status {
     signed char float_detect_tininess;
     signed char float_rounding_mode;
-    signed char float_exception_flags;
+    uint8_t     float_exception_flags;
     signed char floatx80_rounding_precision;
     /* should denormalised results go to zero and set the inexact flag? */
     flag flush_to_zero;

include/fpu/softfloat.h static inline flag get_default_nan_mode(float_status *status) · line 280

Quoted 8 lines
include/fpu/softfloat.h +1 -1
@@ -274,7 +274,7 @@ static inline flag get_default_nan_mode(float_status *status)
 | Routine to raise any or all of the software IEC/IEEE floating-point
 | exception flags.
 *----------------------------------------------------------------------------*/
-void float_raise(int8_t flags, float_status *status);
+void float_raise(uint8_t flags, float_status *status);
 
 /*----------------------------------------------------------------------------
 | If `a' is denormal and we are in flush-to-zero mode then set the
Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net