mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Build
- More missing include files.
This commit is contained in:
parent
08c4d4bdfe
commit
94318a6925
8 changed files with 28 additions and 20 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
#include <text.h>
|
||||
#include <Context.h>
|
||||
#include <Sequence.h>
|
||||
|
@ -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.");
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <Command.h>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
#include <rx.h>
|
||||
#include <Context.h>
|
||||
#include <util.h>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
#include <Duration.h>
|
||||
#include <Context.h>
|
||||
#include <text.h>
|
||||
|
@ -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 <Att>::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.");
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <Context.h>
|
||||
#include <main.h>
|
||||
#include <util.h>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <Date.h>
|
||||
#include <Duration.h>
|
||||
|
@ -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");
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <Color.h>
|
||||
#include <Context.h>
|
||||
#include <text.h>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <stdlib.h>
|
||||
#include <ViewText.h>
|
||||
#include <Duration.h>
|
||||
#include <Context.h>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue