Recurrence: Converted from strtol to std::stoi

This commit is contained in:
Paul Beckingham 2015-11-01 21:54:29 -05:00
parent 8db04b8ec1
commit 368df43583

View file

@ -240,7 +240,7 @@ ISO8601d getNextRecurrence (ISO8601d& current, std::string& period)
else if (Lexer::isDigit (period[0]) && else if (Lexer::isDigit (period[0]) &&
period[period.length () - 1] == 'm') period[period.length () - 1] == 'm')
{ {
int increment = strtol (period.substr (0, period.length () - 1).c_str (), NULL, 10); int increment = std::stoi (period.substr (0, period.length () - 1));
m += increment; m += increment;
while (m > 12) while (m > 12)
@ -259,7 +259,7 @@ ISO8601d getNextRecurrence (ISO8601d& current, std::string& period)
Lexer::isAllDigits (period.substr (1, period.length () - 2)) && Lexer::isAllDigits (period.substr (1, period.length () - 2)) &&
period[period.length () - 1] == 'M') period[period.length () - 1] == 'M')
{ {
int increment = strtol (period.substr (0, period.length () - 1).c_str (), NULL, 10); int increment = std::stoi (period.substr (0, period.length () - 1));
m += increment; m += increment;
while (m > 12) while (m > 12)
@ -292,7 +292,7 @@ ISO8601d getNextRecurrence (ISO8601d& current, std::string& period)
else if (Lexer::isDigit (period[0]) && period[period.length () - 1] == 'q') else if (Lexer::isDigit (period[0]) && period[period.length () - 1] == 'q')
{ {
int increment = strtol (period.substr (0, period.length () - 1).c_str (), NULL, 10); int increment = std::stoi (period.substr (0, period.length () - 1));
m += 3 * increment; m += 3 * increment;
while (m > 12) while (m > 12)
@ -384,7 +384,7 @@ void updateRecurrenceMask (Task& task)
if (uuid != "" && if (uuid != "" &&
context.tdb2.get (uuid, parent)) context.tdb2.get (uuid, parent))
{ {
unsigned int index = strtol (task.get ("imask").c_str (), NULL, 10); unsigned int index = std::stoi (task.get ("imask"));
std::string mask = parent.get ("mask"); std::string mask = parent.get ("mask");
if (mask.length () > index) if (mask.length () > index)
{ {