Skip to content

Commit a7a9210

Browse files
solve clang warning preventing build
1 parent c3aecc6 commit a7a9210

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib_json/json_writer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ std::string valueToString(double value, bool useSpecialFloats, unsigned int prec
143143
int len = -1;
144144

145145
std::stringstream value_ss;
146-
value_ss << std::setprecision( precision ) << value;
146+
value_ss << std::setprecision( (int)precision ) << value;
147147
std::string value_str = value_ss.str();
148148

149149
// Print into the buffer. We need not request the alternative representation
150150
// that always has a decimal point because JSON doesn't distingish the
151151
// concepts of reals and integers.
152152
if (isfinite(value)) {
153-
len = snprintf(buffer, sizeof(buffer), value_str.c_str());
153+
len = snprintf(buffer, sizeof(buffer), (const char*)value_str.c_str());
154154
} else {
155155
// IEEE standard states that NaN values will not compare to themselves
156156
if (value != value) {

0 commit comments

Comments
 (0)