From b4b41215a2e284b3832186045a1a99c541ad31e3 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 2 Nov 2015 18:44:29 -0500 Subject: [PATCH] Revert "C++11: Migrated from strtod to std::stod" This reverts commit db49efd72f65cf7d0470ea6b185ff5e9d24ee203. --- src/Config.cpp | 2 +- src/ISO8601.cpp | 2 +- src/ISO8601.h | 1 - src/Variant.cpp | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index 3da32d102..1bfa69cc6 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -578,7 +578,7 @@ double Config::getReal (const std::string& key) return getReal("urgency.next.coefficient"); if ((*this).find (key) != (*this).end ()) - return std::stod ((*this)[key]); + return strtod ((*this)[key].c_str (), NULL); return 0.0; } diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 3a6e5d60d..0acd8adc9 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -1874,7 +1874,7 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start) Lexer::isSingleCharOperator (n.next ())) { start = original_start + n.cursor (); - double quantity = std::stod (number); + double quantity = strtod (number.c_str (), NULL); // Linear lookup - should instead be logarithmic. double seconds = 1; diff --git a/src/ISO8601.h b/src/ISO8601.h index 4bc3acd37..ddc661914 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -27,7 +27,6 @@ #ifndef INCLUDED_ISO8601 #define INCLUDED_ISO8601 -#include #include #include diff --git a/src/Variant.cpp b/src/Variant.cpp index 6d0434468..515999238 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -25,12 +25,12 @@ //////////////////////////////////////////////////////////////////////////////// #include -#include #include #include #include #include #include +#include #include #include #include @@ -1873,8 +1873,8 @@ void Variant::cast (const enum type new_type) case type_integer: _integer = (int) strtol (_string.c_str (), NULL, (_string.substr (0, 2) == "0x" ? 16 : 10)); break; - case type_real: _real = std::stod (_string); break; - case type_string: break; + case type_real: _real = strtod (_string.c_str (), NULL); break; + case type_string: break; case type_date: { _date = 0;