File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 114
114
#define JSONCPP_DEPRECATED (message )
115
115
#endif // if !defined(JSONCPP_DEPRECATED)
116
116
117
+ #if __GNUC__ >= 6
118
+ # define JSON_USE_INT64_DOUBLE_CONVERSION 1
119
+ #endif
120
+
117
121
namespace Json {
118
122
typedef int Int;
119
123
typedef unsigned int UInt;
Original file line number Diff line number Diff line change @@ -784,7 +784,8 @@ float Value::asFloat() const {
784
784
#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
785
785
return static_cast <float >(value_.uint_ );
786
786
#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
787
- return integerToDouble (value_.uint_ );
787
+ // This can fail (silently?) if the value is bigger than MAX_FLOAT.
788
+ return static_cast <float >(integerToDouble (value_.uint_ ));
788
789
#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
789
790
case realValue:
790
791
return static_cast <float >(value_.real_ );
You can’t perform that action at this time.
0 commit comments