From 0260aff441076f496753542d6b557a86a54dd46f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 28 May 2011 23:59:43 -0400 Subject: [PATCH] Build - Enabled compiler warnings, which were off. Yikes. - Fixed all compiler warnings on OSX. --- CMakeLists.txt | 1 + src/API.cpp | 6 +++++- src/Arguments.cpp | 4 ++-- src/Att.cpp | 2 ++ src/CMakeLists.txt | 5 +++-- src/JSON.cpp | 1 - src/TDB.cpp | 2 -- src/Variant.cpp | 34 +++++++++++++++++++++++++++++++++ src/Variant.h | 3 +-- src/ViewTask.cpp | 24 +++++++++++------------ src/ViewText.cpp | 22 ++++++++++----------- src/columns/CMakeLists.txt | 4 ++-- src/columns/ColTags.cpp | 2 +- src/columns/ColUUID.cpp | 2 +- src/columns/Column.cpp | 8 ++++---- src/command.cpp | 6 +++--- src/commands/CMakeLists.txt | 4 ++-- src/commands/CmdAppend.cpp | 2 +- src/commands/CmdCommands.cpp | 4 ++-- src/commands/CmdCount.cpp | 2 +- src/commands/CmdCustom.cpp | 10 +++++----- src/commands/CmdDiagnostics.cpp | 2 +- src/commands/CmdEdit.cpp | 2 +- src/commands/CmdExec.cpp | 2 +- src/commands/CmdHelp.cpp | 2 +- src/commands/CmdHistory.cpp | 8 ++++---- src/commands/CmdIDs.cpp | 6 +++--- src/commands/CmdInfo.cpp | 2 +- src/commands/CmdInstall.cpp | 2 +- src/commands/CmdLogo.cpp | 2 +- src/commands/CmdPrepend.cpp | 2 +- src/commands/CmdProjects.cpp | 4 ++-- src/commands/CmdShell.cpp | 2 +- src/commands/CmdShow.cpp | 2 +- src/commands/CmdStatistics.cpp | 2 +- src/commands/CmdTags.cpp | 4 ++-- src/commands/CmdUrgency.cpp | 2 +- src/commands/CmdVersion.cpp | 4 ++-- src/feedback.cpp | 4 +++- src/sort.cpp | 1 - 40 files changed, 121 insertions(+), 82 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3aafcc4d..0d667098c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ endif (LUA51_FOUND) check_function_exists (random HAVE_RANDOM) check_function_exists (srandom HAVE_SRANDOM) + # Some systems include uuid automatically (OS X), others need the includes/library check_function_exists (uuid_unparse_lower HAVE_UUID) if (NOT HAVE_UUID) diff --git a/src/API.cpp b/src/API.cpp index 6772d93ba..43e77a045 100644 --- a/src/API.cpp +++ b/src/API.cpp @@ -83,7 +83,7 @@ static int api_task_debug_message (lua_State* L) //////////////////////////////////////////////////////////////////////////////// // Causes the shell or interactive mode task to exit. Ordinarily this does not // occur. -static int api_task_exit (lua_State* L) +static int api_task_exit (lua_State*) { // TODO Is this the correct exception? How does the shell handle this? std::cout << "Exiting." << std::endl; @@ -105,6 +105,8 @@ static int api_task_get (lua_State* L) // TODO Error! lua_pushstring (L, ""); } + + return 0; } //////////////////////////////////////////////////////////////////////////////// @@ -123,6 +125,8 @@ static int api_task_set (lua_State* L) // TODO Error! lua_pushstring (L, ""); } + + return 0; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/Arguments.cpp b/src/Arguments.cpp index c2d259d46..e31bb2aef 100644 --- a/src/Arguments.cpp +++ b/src/Arguments.cpp @@ -286,7 +286,7 @@ void Arguments::extract_sequence (std::vector & sequence) std::vector kill; bool terminated = false; - for (int i = 0; i < this->size (); ++i) + for (unsigned int i = 0; i < this->size (); ++i) { if (!terminated) { @@ -358,7 +358,7 @@ void Arguments::extract_sequence (std::vector & sequence) } // Now remove args in the kill list. - for (int k = 0; k < kill.size (); ++k) + for (unsigned int k = 0; k < kill.size (); ++k) this->erase (this->begin () + kill[k]); } diff --git a/src/Att.cpp b/src/Att.cpp index 9ca88cb98..80b59b8da 100644 --- a/src/Att.cpp +++ b/src/Att.cpp @@ -606,7 +606,9 @@ bool Att::match (const Att& other) const bool case_sensitive = context.config.getBoolean ("search.case.sensitive"); // Are regular expressions being used in place of string comparison? +#ifdef FEATURE_REGEX bool regex = context.config.getBoolean ("regex"); +#endif // If there are no mods, just perform a straight compare on value. if (mMod == "") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 94241b0ab..34e9102e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,5 +65,6 @@ set_property (TARGET task_executable PROPERTY OUTPUT_NAME "task") install (TARGETS task_executable DESTINATION ${TASK_BINDIR}) 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") + diff --git a/src/JSON.cpp b/src/JSON.cpp index 91a70ab8e..e9f57cff6 100644 --- a/src/JSON.cpp +++ b/src/JSON.cpp @@ -91,7 +91,6 @@ std::string json::string::dump () //////////////////////////////////////////////////////////////////////////////// json::number* json::number::parse (Nibbler& nibbler) { - int i; double d; if (nibbler.getNumber (d)) { diff --git a/src/TDB.cpp b/src/TDB.cpp index d0a10e701..831f3b44f 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -299,8 +299,6 @@ int TDB::loadPending (std::vector & tasks, Filter& filter) { // TODO Add hidden attribute indicating source? Task task (line); - - Task::status status = task.getStatus (); task.id = mId++; mPending.push_back (task); diff --git a/src/Variant.cpp b/src/Variant.cpp index e6b0ee629..1000f647e 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -51,6 +51,7 @@ Variant::Variant (const Variant& other) case v_string: mString = other.mString; break; case v_date: mDate = other.mDate; break; case v_duration: mDuration = other.mDuration; break; + case v_unknown: break; } } @@ -147,6 +148,9 @@ Variant& Variant::operator<= (const Variant& other) case v_duration: mBool = (time_t)mDuration <= (time_t)other.mDuration ? true : false; break; + + case v_unknown: + break; } mType = v_boolean; @@ -184,6 +188,9 @@ Variant& Variant::operator>= (const Variant& other) case v_duration: mBool = (time_t)mDuration >= (time_t)other.mDuration ? true : false; break; + + case v_unknown: + break; } mType = v_boolean; @@ -221,6 +228,9 @@ Variant& Variant::operator== (const Variant& other) case v_duration: mBool = mDuration == other.mDuration ? true : false; break; + + case v_unknown: + break; } mType = v_boolean; @@ -258,6 +268,9 @@ Variant& Variant::operator!= (const Variant& other) case v_duration: mBool = mDuration != other.mDuration ? true : false; break; + + case v_unknown: + break; } mType = v_boolean; @@ -292,6 +305,9 @@ Variant& Variant::operator^ (const Variant& other) case v_duration: throw std::string ("Cannot perform exponentiation on duration types"); break; + + case v_unknown: + break; } return *this; @@ -335,6 +351,9 @@ Variant& Variant::operator- (const Variant& other) // TODO Missing operator -= //mDuration -= other.mDuration; break; + + case v_unknown: + break; } return *this; @@ -370,6 +389,9 @@ Variant& Variant::operator+ (const Variant& other) // TODO operator+ missing //mDuration += other.mDuration; break; + + case v_unknown: + break; } return *this; @@ -403,6 +425,9 @@ Variant& Variant::operator* (const Variant& other) case v_duration: throw std::string ("Cannot perform multiplication on duration types"); break; + + case v_unknown: + break; } return *this; @@ -436,6 +461,9 @@ Variant& Variant::operator/ (const Variant& other) case v_duration: throw std::string ("Cannot perform division on duration types"); break; + + case v_unknown: + break; } return *this; @@ -472,6 +500,9 @@ Variant& Variant::operator< (const Variant& other) case v_duration: mBool = mDuration < other.mDuration ? true : false; break; + + case v_unknown: + break; } mType = v_boolean; @@ -509,6 +540,9 @@ Variant& Variant::operator> (const Variant& other) case v_duration: mBool = mDuration > other.mDuration ? true : false; break; + + case v_unknown: + break; } mType = v_boolean; diff --git a/src/Variant.h b/src/Variant.h index 88b51c7c1..d222d4118 100644 --- a/src/Variant.h +++ b/src/Variant.h @@ -44,8 +44,7 @@ public: v_double = 8, v_string = 16, v_date = 32, - v_duration = 64, - v_other = 128 + v_duration = 64 }; Variant (); diff --git a/src/ViewTask.cpp b/src/ViewTask.cpp index f1d15eb0d..31164f768 100644 --- a/src/ViewTask.cpp +++ b/src/ViewTask.cpp @@ -114,12 +114,12 @@ std::string ViewTask::render (std::vector & data, std::vector & seque int global_min = utf8_length ((*i)->getLabel ()); int global_ideal = global_min; - for (int s = 0; s < sequence.size (); ++s) + for (unsigned int s = 0; s < sequence.size (); ++s) { - if (s >= _truncate_lines && _truncate_lines != 0) + if ((int)s >= _truncate_lines && _truncate_lines != 0) break; - if (s >= _truncate_rows && _truncate_rows != 0) + if ((int)s >= _truncate_rows && _truncate_rows != 0) break; // Determine minimum and ideal width for this column. @@ -175,7 +175,7 @@ std::string ViewTask::render (std::vector & data, std::vector & seque while (overage && needed) { needed = false; - for (int i = 0; i < _columns.size () && overage; ++i) + for (unsigned int i = 0; i < _columns.size () && overage; ++i) { if (widths[i] < ideal[i]) { @@ -188,9 +188,9 @@ std::string ViewTask::render (std::vector & data, std::vector & seque } // Compose column headers. - int max_lines = 0; + unsigned int max_lines = 0; std::vector > headers; - for (int c = 0; c < _columns.size (); ++c) + for (unsigned int c = 0; c < _columns.size (); ++c) { headers.push_back (std::vector ()); _columns[c]->renderHeader (headers[c], widths[c], _header); @@ -213,11 +213,11 @@ std::string ViewTask::render (std::vector & data, std::vector & seque std::string intra_odd = context.color () ? _intra_odd.colorize (intra) : intra; std::string intra_even = context.color () ? _intra_even.colorize (intra) : intra; - for (int i = 0; i < max_lines; ++i) + for (unsigned int i = 0; i < max_lines; ++i) { out += left_margin + extra; - for (int c = 0; c < _columns.size (); ++c) + for (unsigned int c = 0; c < _columns.size (); ++c) { if (c) out += intra; @@ -243,7 +243,7 @@ std::string ViewTask::render (std::vector & data, std::vector & seque _rows = 0; std::vector > cells; std::vector ::iterator s; - for (int s = 0; s < sequence.size (); ++s) + for (unsigned int s = 0; s < sequence.size (); ++s) { max_lines = 0; @@ -260,7 +260,7 @@ std::string ViewTask::render (std::vector & data, std::vector & seque row_color.blend (rule_color); } - for (int c = 0; c < _columns.size (); ++c) + for (unsigned int c = 0; c < _columns.size (); ++c) { cells.push_back (std::vector ()); _columns[c]->render (cells[c], data[sequence[s]], widths[c], row_color); @@ -269,11 +269,11 @@ std::string ViewTask::render (std::vector & data, std::vector & seque max_lines = cells[c].size (); } - for (int i = 0; i < max_lines; ++i) + for (unsigned int i = 0; i < max_lines; ++i) { out += left_margin + (odd ? extra_odd : extra_even); - for (int c = 0; c < _columns.size (); ++c) + for (unsigned int c = 0; c < _columns.size (); ++c) { if (c) { diff --git a/src/ViewText.cpp b/src/ViewText.cpp index a805ebda7..ea588fa80 100644 --- a/src/ViewText.cpp +++ b/src/ViewText.cpp @@ -110,13 +110,13 @@ std::string ViewText::render () // Determine minimal, ideal column widths. std::vector minimal; std::vector ideal; - for (int col = 0; col < _columns.size (); ++col) + for (unsigned int col = 0; col < _columns.size (); ++col) { // Headers factor in to width calculations. int global_min = utf8_length (_columns[col]->getLabel ()); int global_ideal = global_min; - for (int row = 0; row < _data.size (); ++row) + for (unsigned int row = 0; row < _data.size (); ++row) { // Determine minimum and ideal width for this column. int min; @@ -162,7 +162,7 @@ std::string ViewText::render () // Spread 'overage' among columns where width[i] < ideal[i] while (overage) { - for (int i = 0; i < _columns.size () && overage; ++i) + for (unsigned int i = 0; i < _columns.size () && overage; ++i) { if (widths[i] < ideal[i]) { @@ -174,9 +174,9 @@ std::string ViewText::render () } // Compose column headers. - int max_lines = 0; + unsigned int max_lines = 0; std::vector > headers; - for (int c = 0; c < _columns.size (); ++c) + for (unsigned int c = 0; c < _columns.size (); ++c) { headers.push_back (std::vector ()); _columns[c]->renderHeader (headers[c], widths[c], _header); @@ -199,11 +199,11 @@ std::string ViewText::render () std::string intra_odd = context.color () ? _intra_odd.colorize (intra) : intra; std::string intra_even = context.color () ? _intra_even.colorize (intra) : intra; - for (int i = 0; i < max_lines; ++i) + for (unsigned int i = 0; i < max_lines; ++i) { out += left_margin + extra; - for (int c = 0; c < _columns.size (); ++c) + for (unsigned int c = 0; c < _columns.size (); ++c) { if (c) out += intra; @@ -228,7 +228,7 @@ std::string ViewText::render () // Compose, render columns, in sequence. _rows = 0; std::vector > cells; - for (int row = 0; row < _data.size (); ++row) + for (unsigned int row = 0; row < _data.size (); ++row) { max_lines = 0; @@ -241,7 +241,7 @@ std::string ViewText::render () // therefore there are only cell colors, not intra colors. Color cell_color; - for (int col = 0; col < _columns.size (); ++col) + for (unsigned int col = 0; col < _columns.size (); ++col) { if (context.color ()) { @@ -256,11 +256,11 @@ std::string ViewText::render () max_lines = cells[col].size (); } - for (int i = 0; i < max_lines; ++i) + for (unsigned int i = 0; i < max_lines; ++i) { out += left_margin + (odd ? extra_odd : extra_even); - for (int col = 0; col < _columns.size (); ++col) + for (unsigned int col = 0; col < _columns.size (); ++col) { if (col) { diff --git a/src/columns/CMakeLists.txt b/src/columns/CMakeLists.txt index 38b6aa68a..9f1b29ac9 100644 --- a/src/columns/CMakeLists.txt +++ b/src/columns/CMakeLists.txt @@ -28,5 +28,5 @@ set (columns_SRCS Column.cpp Column.h add_library (columns STATIC ${columns_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") diff --git a/src/columns/ColTags.cpp b/src/columns/ColTags.cpp index d2cd62ccf..240bab840 100644 --- a/src/columns/ColTags.cpp +++ b/src/columns/ColTags.cpp @@ -75,7 +75,7 @@ void ColumnTags::measure (Task& task, int& minimum, int& maximum) split (all, tags, ','); std::vector ::iterator i; for (i = all.begin (); i != all.end (); ++i) - if (i->length () > minimum) + if ((int)i->length () > minimum) minimum = i->length () + 1; } } diff --git a/src/columns/ColUUID.cpp b/src/columns/ColUUID.cpp index 08bc3f5c2..f7029b797 100644 --- a/src/columns/ColUUID.cpp +++ b/src/columns/ColUUID.cpp @@ -47,7 +47,7 @@ ColumnUUID::~ColumnUUID () //////////////////////////////////////////////////////////////////////////////// // Set the minimum and maximum widths for the value. -void ColumnUUID::measure (Task& task, int& minimum, int& maximum) +void ColumnUUID::measure (Task&, int& minimum, int& maximum) { if (_style == "default") minimum = maximum = 36; else if (_style == "short") minimum = maximum = 8; diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index e1c87c9a2..9fcc32391 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -174,25 +174,25 @@ void Column::renderHeader ( } //////////////////////////////////////////////////////////////////////////////// -void Column::measure (const std::string& value, int& minimum, int& maximum) +void Column::measure (const std::string&, int&, int&) { throw std::string ("Virtual method Column::measure not overriden."); } //////////////////////////////////////////////////////////////////////////////// -void Column::measure (Task& task, int& minimum, int& maximum) +void Column::measure (Task&, int&, int&) { throw std::string ("Virtual method Column::measure not overriden."); } //////////////////////////////////////////////////////////////////////////////// -void Column::render (std::vector & lines, const std::string& value, int width, Color& color) +void Column::render (std::vector &, const std::string&, int, Color&) { throw std::string ("Virtual method Column::render not overriden."); } //////////////////////////////////////////////////////////////////////////////// -void Column::render (std::vector & lines, Task& task, int width, Color& color) +void Column::render (std::vector &, Task&, int, Color&) { throw std::string ("Virtual method Column::render not overriden."); } diff --git a/src/command.cpp b/src/command.cpp index c2dc06a76..3ad0116c2 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -280,7 +280,7 @@ void handleUndo () } //////////////////////////////////////////////////////////////////////////////// -void handleMerge (std::string& outs) +void handleMerge (std::string&) { std::string file = trim (context.task.get ("description")); std::string pushfile = ""; @@ -337,7 +337,7 @@ void handleMerge (std::string& outs) //////////////////////////////////////////////////////////////////////////////// // Transfers the local data (from rc.location.data) to the remote path. Because // this is potentially on another machine, no checking can be performed. -void handlePush (std::string& outs) +void handlePush (std::string&) { std::string file = trim (context.task.get ("description")); @@ -387,7 +387,7 @@ void handlePush (std::string& outs) } //////////////////////////////////////////////////////////////////////////////// -void handlePull (std::string& outs) +void handlePull (std::string&) { std::string file = trim (context.task.get ("description")); diff --git a/src/commands/CMakeLists.txt b/src/commands/CMakeLists.txt index a4cf38ca5..0bd97ef35 100644 --- a/src/commands/CMakeLists.txt +++ b/src/commands/CMakeLists.txt @@ -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") diff --git a/src/commands/CmdAppend.cpp b/src/commands/CmdAppend.cpp index 96d95f3b0..9cb9ee6f7 100644 --- a/src/commands/CmdAppend.cpp +++ b/src/commands/CmdAppend.cpp @@ -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."); diff --git a/src/commands/CmdCommands.cpp b/src/commands/CmdCommands.cpp index c5d877c40..20c8ddf0e 100644 --- a/src/commands/CmdCommands.cpp +++ b/src/commands/CmdCommands.cpp @@ -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 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 commands; diff --git a/src/commands/CmdCount.cpp b/src/commands/CmdCount.cpp index f4130449a..7db6751d5 100644 --- a/src/commands/CmdCount.cpp +++ b/src/commands/CmdCount.cpp @@ -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 tasks; diff --git a/src/commands/CmdCustom.cpp b/src/commands/CmdCustom.cpp index be0cbb40a..d3f7a753e 100644 --- a/src/commands/CmdCustom.cpp +++ b/src/commands/CmdCustom.cpp @@ -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 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"; diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index f2bb52751..280388562 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -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"); diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index cd3130a96..c2651488f 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -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; diff --git a/src/commands/CmdExec.cpp b/src/commands/CmdExec.cpp index 7124de103..505026960 100644 --- a/src/commands/CmdExec.cpp +++ b/src/commands/CmdExec.cpp @@ -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 ()); } diff --git a/src/commands/CmdHelp.cpp b/src/commands/CmdHelp.cpp index 768d00464..820c947e7 100644 --- a/src/commands/CmdHelp.cpp +++ b/src/commands/CmdHelp.cpp @@ -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 ()); diff --git a/src/commands/CmdHistory.cpp b/src/commands/CmdHistory.cpp index 6698e0038..27e50a01b 100644 --- a/src/commands/CmdHistory.cpp +++ b/src/commands/CmdHistory.cpp @@ -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 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 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 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 groups; // Represents any month with data diff --git a/src/commands/CmdIDs.cpp b/src/commands/CmdIDs.cpp index e4e8510f7..2f59191fb 100644 --- a/src/commands/CmdIDs.cpp +++ b/src/commands/CmdIDs.cpp @@ -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 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 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 tasks; context.tdb.lock (context.config.getBoolean ("locking")); diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index 31fa19503..5e49ca72d 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -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; diff --git a/src/commands/CmdInstall.cpp b/src/commands/CmdInstall.cpp index 7f8f2e3b8..ae716fd95 100644 --- a/src/commands/CmdInstall.cpp +++ b/src/commands/CmdInstall.cpp @@ -47,7 +47,7 @@ CmdInstall::CmdInstall () // Generate UUID // Call the "install" function once, store results in rc: // extension.= -int CmdInstall::execute (const std::string& commandLine, std::string& output) +int CmdInstall::execute (const std::string&, std::string&) { return 1; } diff --git a/src/commands/CmdLogo.cpp b/src/commands/CmdLogo.cpp index 0cdc18e4a..cb02de2b5 100644 --- a/src/commands/CmdLogo.cpp +++ b/src/commands/CmdLogo.cpp @@ -47,7 +47,7 @@ CmdLogo::CmdLogo () // Generate UUID // Call the "install" function once, store results in rc: // extension.= -int CmdLogo::execute (const std::string& commandLine, std::string& output) +int CmdLogo::execute (const std::string&, std::string& output) { static const char* data[] = { diff --git a/src/commands/CmdPrepend.cpp b/src/commands/CmdPrepend.cpp index b16575c37..9fbb4ed2a 100644 --- a/src/commands/CmdPrepend.cpp +++ b/src/commands/CmdPrepend.cpp @@ -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."); diff --git a/src/commands/CmdProjects.cpp b/src/commands/CmdProjects.cpp index 684e667e4..80b9cd895 100644 --- a/src/commands/CmdProjects.cpp +++ b/src/commands/CmdProjects.cpp @@ -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 tasks; context.tdb.lock (context.config.getBoolean ("locking")); diff --git a/src/commands/CmdShell.cpp b/src/commands/CmdShell.cpp index aa4c9ac7f..a2f7d091e 100644 --- a/src/commands/CmdShell.cpp +++ b/src/commands/CmdShell.cpp @@ -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); diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index d539398e8..2ae4194be 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -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; diff --git a/src/commands/CmdStatistics.cpp b/src/commands/CmdStatistics.cpp index 24564cddc..6ae7b98e8 100644 --- a/src/commands/CmdStatistics.cpp +++ b/src/commands/CmdStatistics.cpp @@ -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; diff --git a/src/commands/CmdTags.cpp b/src/commands/CmdTags.cpp index d402a7917..198cda331 100644 --- a/src/commands/CmdTags.cpp +++ b/src/commands/CmdTags.cpp @@ -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 tasks; context.tdb.lock (context.config.getBoolean ("locking")); diff --git a/src/commands/CmdUrgency.cpp b/src/commands/CmdUrgency.cpp index b41e2466d..be8aacd83 100644 --- a/src/commands/CmdUrgency.cpp +++ b/src/commands/CmdUrgency.cpp @@ -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 tasks; diff --git a/src/commands/CmdVersion.cpp b/src/commands/CmdVersion.cpp index f0f78f52c..51569a697 100644 --- a/src/commands/CmdVersion.cpp +++ b/src/commands/CmdVersion.cpp @@ -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 diff --git a/src/feedback.cpp b/src/feedback.cpp index fc90a8d43..572ec257c 100644 --- a/src/feedback.cpp +++ b/src/feedback.cpp @@ -291,8 +291,10 @@ std::string renderAttribute (const std::string& name, const std::string& value) //////////////////////////////////////////////////////////////////////////////// // TODO Implement all the post-command feedback here. This includes project // completion percentages, "3 tasks modified", all warnings, and so on. -std::string feedback (const Task& before, const Task& after) +std::string feedback (const Task&, const Task&) { + + return ""; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/sort.cpp b/src/sort.cpp index 84f77a673..d97fd17c3 100644 --- a/src/sort.cpp +++ b/src/sort.cpp @@ -67,7 +67,6 @@ void sort_tasks ( // Essentially a static implementation of a dynamic operator<. static bool sort_compare (int left, int right) { - int result; std::string field; bool ascending;