From ff923658c4d9f1492617557148369b34c71ba623 Mon Sep 17 00:00:00 2001 From: Stefano Fiorentino Date: Fri, 12 Feb 2016 21:11:26 +0100 Subject: [PATCH] remove casts to get clang error trying to reply to question raised by Billy Donahue --- src/lib_json/json_writer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index f57a6a2..b1adaa6 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -143,14 +143,14 @@ std::string valueToString(double value, bool useSpecialFloats, unsigned int prec int len = -1; std::stringstream value_ss; - value_ss << std::setprecision( (int)precision ) << value; + value_ss << std::setprecision( precision ) << value; std::string value_str = value_ss.str(); // Print into the buffer. We need not request the alternative representation // that always has a decimal point because JSON doesn't distingish the // concepts of reals and integers. if (isfinite(value)) { - len = snprintf(buffer, sizeof(buffer), (const char*)value_str.c_str()); + len = snprintf(buffer, sizeof(buffer), value_str.c_str()); } else { // IEEE standard states that NaN values will not compare to themselves if (value != value) {