summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/tinycbor/src/compilersupport_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/tinycbor/src/compilersupport_p.h')
-rw-r--r--src/3rdparty/tinycbor/src/compilersupport_p.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/3rdparty/tinycbor/src/compilersupport_p.h b/src/3rdparty/tinycbor/src/compilersupport_p.h
index d9c8c1f82e..dc4c4cfd8a 100644
--- a/src/3rdparty/tinycbor/src/compilersupport_p.h
+++ b/src/3rdparty/tinycbor/src/compilersupport_p.h
@@ -213,10 +213,11 @@ static inline unsigned short encode_half(double val)
return _cvtss_sh((float)val, 3);
#else
uint64_t v;
+ int sign, exp, mant;
memcpy(&v, &val, sizeof(v));
- int sign = v >> 63 << 15;
- int exp = (v >> 52) & 0x7ff;
- int mant = v << 12 >> 12 >> (53-11); /* keep only the 11 most significant bits of the mantissa */
+ sign = v >> 63 << 15;
+ exp = (v >> 52) & 0x7ff;
+ mant = v << 12 >> 12 >> (53-11); /* keep only the 11 most significant bits of the mantissa */
exp -= 1023;
if (exp == 1024) {
/* infinity or NaN */