Browse Source

modernjson: Fixed compilation with GCC.

main
Tim Quatmann 5 years ago
parent
commit
9cc00a03a2
  1. 8
      resources/3rdparty/modernjson/src/json.hpp

8
resources/3rdparty/modernjson/src/json.hpp

@ -9053,16 +9053,14 @@ Format](http://rfc7159.net/rfc7159)
@return the floating point number @return the floating point number
*/ */
template <typename FloatValueType> storm::RationalNumber str_to_float_t(storm::RationalNumber* /* type */) const {
FloatValueType str_to_float_t(FloatValueType* /* type */) const {
// Use std::strtod to get the position where the number ends. Then parse it as a rational Number // Use std::strtod to get the position where the number ends. Then parse it as a rational Number
char const* strptr = reinterpret_cast<typename string_t::const_pointer>(m_start); char const* strptr = reinterpret_cast<typename string_t::const_pointer>(m_start);
char* end_pos; char* end_pos;
std::strtod(strptr, &end_pos); std::strtod(strptr, &end_pos);
return storm::utility::convertNumber<FloatValueType, std::string>(std::string(strptr, end_pos - strptr)); return storm::utility::convertNumber<storm::RationalNumber, std::string>(std::string(strptr, end_pos - strptr));
} }
template <>
long double str_to_float_t(long double* /* type */) const long double str_to_float_t(long double* /* type */) const
{ {
return std::strtold(reinterpret_cast<typename string_t::const_pointer>(m_start), NULL); return std::strtold(reinterpret_cast<typename string_t::const_pointer>(m_start), NULL);
@ -9080,7 +9078,6 @@ Format](http://rfc7159.net/rfc7159)
@return the floating point number @return the floating point number
*/ */
template <>
double str_to_float_t(double* /* type */) const double str_to_float_t(double* /* type */) const
{ {
return std::strtod(reinterpret_cast<typename string_t::const_pointer>(m_start), NULL); return std::strtod(reinterpret_cast<typename string_t::const_pointer>(m_start), NULL);
@ -9099,7 +9096,6 @@ Format](http://rfc7159.net/rfc7159)
@return the floating point number @return the floating point number
*/ */
template <>
float str_to_float_t(float* /* type */) const float str_to_float_t(float* /* type */) const
{ {
return std::strtof(reinterpret_cast<typename string_t::const_pointer>(m_start), NULL); return std::strtof(reinterpret_cast<typename string_t::const_pointer>(m_start), NULL);

|||||||
100:0
Loading…
Cancel
Save