C++11: Migrated from strtod to std::stod

This commit is contained in:
Paul Beckingham 2015-11-01 19:44:15 -05:00
parent abc988476d
commit db49efd72f
4 changed files with 6 additions and 5 deletions

View file

@ -578,7 +578,7 @@ double Config::getReal (const std::string& key)
return getReal("urgency.next.coefficient");
if ((*this).find (key) != (*this).end ())
return strtod ((*this)[key].c_str (), NULL);
return std::stod ((*this)[key]);
return 0.0;
}

View file

@ -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 = strtod (number.c_str (), NULL);
double quantity = std::stod (number);
// Linear lookup - should instead be logarithmic.
double seconds = 1;

View file

@ -27,6 +27,7 @@
#ifndef INCLUDED_ISO8601
#define INCLUDED_ISO8601
#include <string>
#include <Nibbler.h>
#include <time.h>

View file

@ -25,12 +25,12 @@
////////////////////////////////////////////////////////////////////////////////
#include <cmake.h>
#include <Variant.h>
#include <sstream>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <Variant.h>
#include <ISO8601.h>
#include <Lexer.h>
#include <RX.h>
@ -1873,7 +1873,7 @@ 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 = strtod (_string.c_str (), NULL); break;
case type_real: _real = std::stod (_string); break;
case type_string: break;
case type_date:
{