mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 06:37:20 +02:00
Build
- Enabled compiler warnings, which were off. Yikes. - Fixed all compiler warnings on OSX.
This commit is contained in:
parent
36e24fa1fb
commit
0260aff441
40 changed files with 121 additions and 82 deletions
|
@ -32,5 +32,5 @@ set (commands_SRCS Command.cpp Command.h
|
|||
add_library (commands STATIC ${commands_SRCS})
|
||||
|
||||
set (CMAKE_BUILD_TYPE debug)
|
||||
set (CMAKE_C_FLAGS_DEBUG "-ggdb3")
|
||||
set (CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3 -Wall")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall")
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdAppend::CmdAppend ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdAppend::execute (const std::string& command_line, std::string& output)
|
||||
int CmdAppend::execute (const std::string&, std::string& output)
|
||||
{
|
||||
if (!context.task.has ("description"))
|
||||
throw std::string ("Additional text must be provided.");
|
||||
|
|
|
@ -45,7 +45,7 @@ CmdCompletionCommands::CmdCompletionCommands ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionCommands::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionCommands::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Get a list of all commands.
|
||||
std::vector <std::string> commands;
|
||||
|
@ -81,7 +81,7 @@ CmdZshCommands::CmdZshCommands ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdZshCommands::execute (const std::string& command_line, std::string& output)
|
||||
int CmdZshCommands::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Get a list of all commands.
|
||||
std::vector <std::string> commands;
|
||||
|
|
|
@ -43,7 +43,7 @@ CmdCount::CmdCount ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCount::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCount::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Scan the pending tasks, applying any filter.
|
||||
std::vector <Task> tasks;
|
||||
|
|
|
@ -51,7 +51,7 @@ CmdCustom::CmdCustom (
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCustom::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCustom::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
@ -120,7 +120,7 @@ int CmdCustom::execute (const std::string& command_line, std::string& output)
|
|||
|
||||
// Sort the tasks.
|
||||
std::vector <int> sequence;
|
||||
for (int i = 0; i < tasks.size (); ++i)
|
||||
for (unsigned int i = 0; i < tasks.size (); ++i)
|
||||
sequence.push_back (i);
|
||||
|
||||
sort_tasks (tasks, sequence, reportSort);
|
||||
|
@ -140,7 +140,7 @@ int CmdCustom::execute (const std::string& command_line, std::string& output)
|
|||
view.intraColorOdd (alternate);
|
||||
|
||||
// Add the columns and labels.
|
||||
for (int i = 0; i < columns.size (); ++i)
|
||||
for (unsigned int i = 0; i < columns.size (); ++i)
|
||||
{
|
||||
Column* c = Column::factory (columns[i], _keyword);
|
||||
c->setLabel (labels[i]);
|
||||
|
@ -179,10 +179,10 @@ int CmdCustom::execute (const std::string& command_line, std::string& output)
|
|||
<< tasks.size ()
|
||||
<< (tasks.size () == 1 ? " task" : " tasks");
|
||||
|
||||
if (maxrows && maxrows < tasks.size ())
|
||||
if (maxrows && maxrows < (int)tasks.size ())
|
||||
out << ", " << maxrows << " shown";
|
||||
|
||||
if (maxlines && maxlines < tasks.size ())
|
||||
if (maxlines && maxlines < (int)tasks.size ())
|
||||
out << ", truncated to " << maxlines - table_header << " lines";
|
||||
|
||||
out << "\n";
|
||||
|
|
|
@ -63,7 +63,7 @@ CmdDiagnostics::CmdDiagnostics ()
|
|||
//
|
||||
// Although this will change over time, initially this command will answer the
|
||||
// kind of questions we always have to ask whenever something is wrong.
|
||||
int CmdDiagnostics::execute (const std::string& command_line, std::string& output)
|
||||
int CmdDiagnostics::execute (const std::string&, std::string& output)
|
||||
{
|
||||
Color bold ("bold");
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ CmdEdit::CmdEdit ()
|
|||
// Introducing the Silver Bullet. This feature is the catch-all fixative for
|
||||
// various other ills. This is like opening up the hood and going in with a
|
||||
// wrench. To be used sparingly.
|
||||
int CmdEdit::execute (const std::string& command_line, std::string& output)
|
||||
int CmdEdit::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ CmdExec::CmdExec ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdExec::execute (const std::string& command_line, std::string& output)
|
||||
int CmdExec::execute (const std::string& command_line, std::string&)
|
||||
{
|
||||
return system (command_line.c_str ());
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdHelp::CmdHelp ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHelp::execute (const std::string& command_line, std::string& output)
|
||||
int CmdHelp::execute (const std::string&, std::string& output)
|
||||
{
|
||||
ViewText view;
|
||||
view.width (context.getWidth ());
|
||||
|
|
|
@ -46,7 +46,7 @@ CmdHistoryMonthly::CmdHistoryMonthly ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHistoryMonthly::execute (const std::string& command_line, std::string& output)
|
||||
int CmdHistoryMonthly::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
@ -202,7 +202,7 @@ CmdHistoryAnnual::CmdHistoryAnnual ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHistoryAnnual::execute (const std::string& command_line, std::string& output)
|
||||
int CmdHistoryAnnual::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
@ -355,7 +355,7 @@ CmdGHistoryMonthly::CmdGHistoryMonthly ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdGHistoryMonthly::execute (const std::string& command_line, std::string& output)
|
||||
int CmdGHistoryMonthly::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
@ -551,7 +551,7 @@ CmdGHistoryAnnual::CmdGHistoryAnnual ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdGHistoryAnnual::execute (const std::string& command_line, std::string& output)
|
||||
int CmdGHistoryAnnual::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::map <time_t, int> groups; // Represents any month with data
|
||||
|
|
|
@ -45,7 +45,7 @@ CmdIDs::CmdIDs ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdIDs::execute (const std::string& command_line, std::string& output)
|
||||
int CmdIDs::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Scan the pending tasks, applying any filter.
|
||||
std::vector <Task> tasks;
|
||||
|
@ -78,7 +78,7 @@ CmdCompletionIds::CmdCompletionIds ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionIds::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionIds::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
@ -116,7 +116,7 @@ CmdZshCompletionIds::CmdZshCompletionIds ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdZshCompletionIds::execute (const std::string& command_line, std::string& output)
|
||||
int CmdZshCompletionIds::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
|
|
@ -47,7 +47,7 @@ CmdInfo::CmdInfo ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdInfo::execute (const std::string& command_line, std::string& output)
|
||||
int CmdInfo::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ CmdInstall::CmdInstall ()
|
|||
// Generate UUID
|
||||
// Call the "install" function once, store results in rc:
|
||||
// extension.<uuid>=<JSON>
|
||||
int CmdInstall::execute (const std::string& commandLine, std::string& output)
|
||||
int CmdInstall::execute (const std::string&, std::string&)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ CmdLogo::CmdLogo ()
|
|||
// Generate UUID
|
||||
// Call the "install" function once, store results in rc:
|
||||
// extension.<uuid>=<JSON>
|
||||
int CmdLogo::execute (const std::string& commandLine, std::string& output)
|
||||
int CmdLogo::execute (const std::string&, std::string& output)
|
||||
{
|
||||
static const char* data[] =
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdPrepend::CmdPrepend ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdPrepend::execute (const std::string& command_line, std::string& output)
|
||||
int CmdPrepend::execute (const std::string&, std::string& output)
|
||||
{
|
||||
if (!context.task.has ("description"))
|
||||
throw std::string ("Additional text must be provided.");
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdProjects::CmdProjects ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdProjects::execute (const std::string& command_line, std::string& output)
|
||||
int CmdProjects::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
@ -142,7 +142,7 @@ CmdCompletionProjects::CmdCompletionProjects ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionProjects::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionProjects::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
|
|
@ -45,7 +45,7 @@ CmdShell::CmdShell ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdShell::execute (const std::string& command_line, std::string& output)
|
||||
int CmdShell::execute (const std::string&, std::string&)
|
||||
{
|
||||
// Display some kind of welcome message.
|
||||
Color bold (Color::nocolor, Color::nocolor, false, true, false);
|
||||
|
|
|
@ -50,7 +50,7 @@ CmdShow::CmdShow ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdShow::execute (const std::string& command_line, std::string& output)
|
||||
int CmdShow::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
|
|
@ -49,7 +49,7 @@ CmdStatistics::CmdStatistics ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdStatistics::execute (const std::string& command_line, std::string& output)
|
||||
int CmdStatistics::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
|
|
@ -46,7 +46,7 @@ CmdTags::CmdTags ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdTags::execute (const std::string& command_line, std::string& output)
|
||||
int CmdTags::execute (const std::string&, std::string& output)
|
||||
{
|
||||
int rc = 0;
|
||||
std::stringstream out;
|
||||
|
@ -131,7 +131,7 @@ CmdCompletionTags::CmdCompletionTags ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionTags::execute (const std::string& command_line, std::string& output)
|
||||
int CmdCompletionTags::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
|
|
@ -44,7 +44,7 @@ CmdUrgency::CmdUrgency ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdUrgency::execute (const std::string& command_line, std::string& output)
|
||||
int CmdUrgency::execute (const std::string&, std::string& output)
|
||||
{
|
||||
// Get all the tasks.
|
||||
std::vector <Task> tasks;
|
||||
|
|
|
@ -46,7 +46,7 @@ CmdVersion::CmdVersion ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdVersion::execute (const std::string& command_line, std::string& output)
|
||||
int CmdVersion::execute (const std::string&, std::string& output)
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
|
@ -129,7 +129,7 @@ CmdCompletionVersion::CmdCompletionVersion ()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdCompletionVersion::execute (
|
||||
const std::string& command_line,
|
||||
const std::string&,
|
||||
std::string& output)
|
||||
{
|
||||
#ifdef HAVE_COMMIT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue