From 94318a69257ea2d33c09625efd1953978fdce9c0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 28 May 2011 18:15:56 -0400 Subject: [PATCH] Build - More missing include files. --- src/Sequence.cpp | 7 ++++--- src/commands/CmdCommands.cpp | 1 + src/commands/CmdDiagnostics.cpp | 1 + src/commands/CmdEdit.cpp | 29 +++++++++++++++-------------- src/commands/CmdIDs.cpp | 1 + src/commands/CmdInfo.cpp | 3 ++- src/commands/CmdShell.cpp | 1 + src/commands/CmdStatistics.cpp | 5 +++-- 8 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 949e4d5ff..f87c2cc67 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -95,7 +96,7 @@ void Sequence::parse (const std::string& input) if (! validId (range[0])) throw std::string ("Invalid ID in sequence."); - int id = atoi (range[0].c_str ()); + int id = strtol (range[0].c_str (), NULL, 10); this->push_back (id); } break; @@ -106,8 +107,8 @@ void Sequence::parse (const std::string& input) ! validId (range[1])) throw std::string ("Invalid ID in range."); - int low = atoi (range[0].c_str ()); - int high = atoi (range[1].c_str ()); + int low = strtol (range[0].c_str (), NULL, 10); + int high = strtol (range[1].c_str (), NULL, 10); if (low > high) throw std::string ("Inverted sequence range high-low."); diff --git a/src/commands/CmdCommands.cpp b/src/commands/CmdCommands.cpp index ab3ad1a2e..c5d877c40 100644 --- a/src/commands/CmdCommands.cpp +++ b/src/commands/CmdCommands.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index 7d0c05883..e7f987d03 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 861dfb4e2..cd3130a96 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -135,7 +136,7 @@ std::string CmdEdit::formatDate ( std::string value = task.get (attribute); if (value.length ()) { - Date dt (::atoi (value.c_str ())); + Date dt (strtol (value.c_str (), NULL, 10)); value = dt.toString (context.config.get ("dateformat")); } @@ -206,7 +207,7 @@ std::string CmdEdit::formatTask (Task task) std::vector ::iterator anno; for (anno = annotations.begin (); anno != annotations.end (); ++anno) { - Date dt (::atoi (anno->name ().substr (11).c_str ())); + Date dt (strtol (anno->name ().substr (11).c_str (), NULL, 10)); before << " Annotation: " << dt.toString (context.config.get ("dateformat.annotation")) << " -- " << anno->value () << "\n"; } @@ -291,9 +292,9 @@ void CmdEdit::parseTask (Task& task, const std::string& after) value = findDate (after, "\n Created:"); if (value != "") { - Date edited (::atoi (value.c_str ())); + Date edited (strtol (value.c_str (), NULL, 10)); - Date original (::atoi (task.get ("entry").c_str ())); + Date original (strtol (task.get ("entry").c_str (), NULL, 10)); if (!original.sameDay (edited)) { context.footnote ("Creation date modified."); @@ -307,11 +308,11 @@ void CmdEdit::parseTask (Task& task, const std::string& after) value = findDate (after, "\n Started:"); if (value != "") { - Date edited (::atoi (value.c_str ())); + Date edited (strtol (value.c_str (), NULL, 10)); if (task.get ("start") != "") { - Date original (::atoi (task.get ("start").c_str ())); + Date original (strtol (task.get ("start").c_str (), NULL, 10)); if (!original.sameDay (edited)) { context.footnote ("Start date modified."); @@ -337,11 +338,11 @@ void CmdEdit::parseTask (Task& task, const std::string& after) value = findDate (after, "\n Ended:"); if (value != "") { - Date edited (::atoi (value.c_str ())); + Date edited (strtol (value.c_str (), NULL, 10)); if (task.get ("end") != "") { - Date original (::atoi (task.get ("end").c_str ())); + Date original (strtol (task.get ("end").c_str (), NULL, 10)); if (!original.sameDay (edited)) { context.footnote ("Done date modified."); @@ -365,11 +366,11 @@ void CmdEdit::parseTask (Task& task, const std::string& after) value = findDate (after, "\n Due:"); if (value != "") { - Date edited (::atoi (value.c_str ())); + Date edited (strtol (value.c_str (), NULL, 10)); if (task.get ("due") != "") { - Date original (::atoi (task.get ("due").c_str ())); + Date original (strtol (task.get ("due").c_str (), NULL, 10)); if (!original.sameDay (edited)) { context.footnote ("Due date modified."); @@ -403,11 +404,11 @@ void CmdEdit::parseTask (Task& task, const std::string& after) value = findDate (after, "\n Until:"); if (value != "") { - Date edited (::atoi (value.c_str ())); + Date edited (strtol (value.c_str (), NULL, 10)); if (task.get ("until") != "") { - Date original (::atoi (task.get ("until").c_str ())); + Date original (strtol (task.get ("until").c_str (), NULL, 10)); if (!original.sameDay (edited)) { context.footnote ("Until date modified."); @@ -465,11 +466,11 @@ void CmdEdit::parseTask (Task& task, const std::string& after) value = findDate (after, "\n Wait until:"); if (value != "") { - Date edited (::atoi (value.c_str ())); + Date edited (strtol (value.c_str (), NULL, 10)); if (task.get ("wait") != "") { - Date original (::atoi (task.get ("wait").c_str ())); + Date original (strtol (task.get ("wait").c_str (), NULL, 10)); if (!original.sameDay (edited)) { context.footnote ("Wait date modified."); diff --git a/src/commands/CmdIDs.cpp b/src/commands/CmdIDs.cpp index 0b55ed213..e4e8510f7 100644 --- a/src/commands/CmdIDs.cpp +++ b/src/commands/CmdIDs.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index 38f3cc2f9..31fa19503 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -174,7 +175,7 @@ int CmdInfo::execute (const std::string& command_line, std::string& output) row = view.addRow (); view.set (row, 0, "Recur until"); - Date dt (stdtol (task->get ("until").c_str (), NULL, 10)); + Date dt (strtol (task->get ("until").c_str (), NULL, 10)); std::string format = context.config.get ("reportdateformat"); if (format == "") format = context.config.get ("dateformat"); diff --git a/src/commands/CmdShell.cpp b/src/commands/CmdShell.cpp index 15d9040b2..aa4c9ac7f 100644 --- a/src/commands/CmdShell.cpp +++ b/src/commands/CmdShell.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include diff --git a/src/commands/CmdStatistics.cpp b/src/commands/CmdStatistics.cpp index a0cf38cd6..24564cddc 100644 --- a/src/commands/CmdStatistics.cpp +++ b/src/commands/CmdStatistics.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -108,13 +109,13 @@ int CmdStatistics::execute (const std::string& command_line, std::string& output if (it->getStatus () == Task::recurring) ++recurringT; if (it->getStatus () == Task::waiting) ++waitingT; - time_t entry = atoi (it->get ("entry").c_str ()); + time_t entry = strtol (it->get ("entry").c_str (), NULL, 10); if (entry < earliest) earliest = entry; if (entry > latest) latest = entry; if (it->getStatus () == Task::completed) { - time_t end = atoi (it->get ("end").c_str ()); + time_t end = strtol (it->get ("end").c_str (), NULL, 10); daysPending += (end - entry) / 86400.0; }