From 690d9493f0069f78d482e254e9a61914b6f73dfb Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 29 Mar 2015 18:03:36 -0400 Subject: [PATCH] Build: Resolve some more compiler warnings --- src/CLI.cpp | 3 --- src/Context.cpp | 27 --------------------------- src/Duration.cpp | 1 - src/commands/CmdConfig.cpp | 1 - src/commands/CmdInfo.cpp | 2 -- test/json.t.cpp | 4 ++-- test/lexer.t.cpp | 2 +- 7 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/CLI.cpp b/src/CLI.cpp index 036345e5e..c355a77ee 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -349,7 +349,6 @@ void CLI::initialize (int argc, const char** argv) _terminated = false; _original_args.push_back (argv[0]); - bool terminated = false; for (int i = 1; i < argc; ++i) { if (isTerminator (argv[i])) @@ -1384,8 +1383,6 @@ void CLI::findIDs () { if (a->hasTag ("FILTER")) { - bool found = false; - // IDs have a limited character set. std::string raw = a->attribute ("raw"); if (raw.find_first_not_of ("0123456789,-") == std::string::npos) diff --git a/src/Context.cpp b/src/Context.cpp index 78e769dac..6f095d24e 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -65,33 +65,6 @@ static const char* modifierNames[] = #define NUM_MODIFIER_NAMES (sizeof (modifierNames) / sizeof (modifierNames[0])) -static const char* attributeNames[] = -{ - "depends", - "description", - "due", - "end", - "entry", - "id", - "imask", - "mask", - "modified", - "parent", - "priority", - "project", - "recur", - "scheduled", - "start", - "status", - "tags", - "until", - "urgency", - "uuid", - "wait" -}; - -#define NUM_ATTRIBUTE_NAMES (sizeof (attributeNames) / sizeof (attributeNames[0])) - //////////////////////////////////////////////////////////////////////////////// Context::Context () : rc_file ("~/.taskrc") diff --git a/src/Duration.cpp b/src/Duration.cpp index b8a7f2802..a61d2fdaf 100644 --- a/src/Duration.cpp +++ b/src/Duration.cpp @@ -319,7 +319,6 @@ bool Duration::parse (const std::string& input, std::string::size_type& start) start = original_start + n.cursor (); // Linear lookup - should be logarithmic. - double seconds = 1; for (unsigned int i = 0; i < NUM_DURATIONS; i++) { if (durations[i].unit == unit && diff --git a/src/commands/CmdConfig.cpp b/src/commands/CmdConfig.cpp index 8f7fcf802..66d841930 100644 --- a/src/commands/CmdConfig.cpp +++ b/src/commands/CmdConfig.cpp @@ -163,7 +163,6 @@ int CmdConfig::execute (std::string& output) if (words.size ()) { bool confirmation = context.config.getBoolean ("confirmation"); - bool change = false; bool found = false; std::string name = words[0]; diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index 8121dd168..5f5b4747a 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -39,8 +39,6 @@ extern Context context; -static const float epsilon = 0.000001; - //////////////////////////////////////////////////////////////////////////////// CmdInfo::CmdInfo () { diff --git a/test/json.t.cpp b/test/json.t.cpp index 6addffedd..e44e7d3bf 100644 --- a/test/json.t.cpp +++ b/test/json.t.cpp @@ -113,7 +113,7 @@ int main (int argc, char** argv) unsetenv ("TASKRC"); // Positive tests. - for (int i = 0; i < NUM_POSITIVE_TESTS; ++i) + for (unsigned int i = 0; i < NUM_POSITIVE_TESTS; ++i) { try { @@ -131,7 +131,7 @@ int main (int argc, char** argv) } // Negative tests. - for (int i = 0; i < NUM_NEGATIVE_TESTS; ++i) + for (unsigned int i = 0; i < NUM_NEGATIVE_TESTS; ++i) { try { diff --git a/test/lexer.t.cpp b/test/lexer.t.cpp index 646db7dc7..af5dfca41 100644 --- a/test/lexer.t.cpp +++ b/test/lexer.t.cpp @@ -377,7 +377,7 @@ int main (int argc, char** argv) }; #define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0])) - for (int i = 0; i < NUM_TESTS; i++) + for (unsigned int i = 0; i < NUM_TESTS; i++) { // The isolated test puts the input string directly into the Lexer. Lexer isolated (lexerTests[i].input);