forked from bblanchon/ArduinoJson
Fixed warning "unused variable" with GCC 4.4 (issue #912)
This commit is contained in:
@ -4,6 +4,7 @@ ArduinoJson: change log
|
|||||||
HEAD
|
HEAD
|
||||||
----
|
----
|
||||||
|
|
||||||
|
* Fixed warning "unused variable" with GCC 4.4 (issue #912)
|
||||||
* Added a clear error message for `StaticJsonBuffer` and `DynamicJsonBuffer`
|
* Added a clear error message for `StaticJsonBuffer` and `DynamicJsonBuffer`
|
||||||
|
|
||||||
v6.9.0 (2019-02-26)
|
v6.9.0 (2019-02-26)
|
||||||
|
@ -98,12 +98,8 @@ struct FloatTraits<T, 8 /*64bits*/> {
|
|||||||
// we use this function to workaround platforms with single precision literals
|
// we use this function to workaround platforms with single precision literals
|
||||||
// (for example, when -fsingle-precision-constant is passed to GCC)
|
// (for example, when -fsingle-precision-constant is passed to GCC)
|
||||||
static T forge(uint32_t msb, uint32_t lsb) {
|
static T forge(uint32_t msb, uint32_t lsb) {
|
||||||
union {
|
uint64_t bits = (uint64_t(msb) << 32) | lsb;
|
||||||
uint64_t integerBits;
|
return *reinterpret_cast<T*>(&bits);
|
||||||
T floatBits;
|
|
||||||
};
|
|
||||||
integerBits = (uint64_t(msb) << 32) | lsb;
|
|
||||||
return floatBits;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -150,12 +146,7 @@ struct FloatTraits<T, 4 /*32bits*/> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static T forge(uint32_t bits) {
|
static T forge(uint32_t bits) {
|
||||||
union {
|
return *reinterpret_cast<T*>(&bits);
|
||||||
uint32_t integerBits;
|
|
||||||
T floatBits;
|
|
||||||
};
|
|
||||||
integerBits = bits;
|
|
||||||
return floatBits;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static T nan() {
|
static T nan() {
|
||||||
|
Reference in New Issue
Block a user