mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
C++11: Migrated from strtod to std::stod
This commit is contained in:
parent
abc988476d
commit
db49efd72f
4 changed files with 6 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#ifndef INCLUDED_ISO8601
|
||||
#define INCLUDED_ISO8601
|
||||
|
||||
#include <string>
|
||||
#include <Nibbler.h>
|
||||
#include <time.h>
|
||||
|
||||
|
|
|
@ -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,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 = strtod (_string.c_str (), NULL); break;
|
||||
case type_string: break;
|
||||
case type_real: _real = std::stod (_string); break;
|
||||
case type_string: break;
|
||||
case type_date:
|
||||
{
|
||||
_date = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue