mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-06 00:31:10 +01:00
remove casts to get clang error
trying to reply to question raised by Billy Donahue
This commit is contained in:
parent
a7a9210ff5
commit
ff923658c4
@ -143,14 +143,14 @@ std::string valueToString(double value, bool useSpecialFloats, unsigned int prec
|
|||||||
int len = -1;
|
int len = -1;
|
||||||
|
|
||||||
std::stringstream value_ss;
|
std::stringstream value_ss;
|
||||||
value_ss << std::setprecision( (int)precision ) << value;
|
value_ss << std::setprecision( precision ) << value;
|
||||||
std::string value_str = value_ss.str();
|
std::string value_str = value_ss.str();
|
||||||
|
|
||||||
// Print into the buffer. We need not request the alternative representation
|
// Print into the buffer. We need not request the alternative representation
|
||||||
// that always has a decimal point because JSON doesn't distingish the
|
// that always has a decimal point because JSON doesn't distingish the
|
||||||
// concepts of reals and integers.
|
// concepts of reals and integers.
|
||||||
if (isfinite(value)) {
|
if (isfinite(value)) {
|
||||||
len = snprintf(buffer, sizeof(buffer), (const char*)value_str.c_str());
|
len = snprintf(buffer, sizeof(buffer), value_str.c_str());
|
||||||
} else {
|
} else {
|
||||||
// IEEE standard states that NaN values will not compare to themselves
|
// IEEE standard states that NaN values will not compare to themselves
|
||||||
if (value != value) {
|
if (value != value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user