Skip to content

Commit 33e9ddf

Browse files
Fix -Wunused-but-set-variable warnings (clang)
1 parent 1b619ea commit 33e9ddf

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

lib/cli/clicommand.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,16 @@ void CLICommand::ShowCommands(int argc, char **argv, po::options_description *vi
228228
typedef std::map<std::vector<String>, CLICommand::Ptr>::value_type CLIKeyValue;
229229

230230
std::vector<String> best_match;
231-
int arg_begin = 0;
232231
CLICommand::Ptr command;
233232

234233
for (const CLIKeyValue& kv : GetRegistry()) {
235234
const std::vector<String>& vname = kv.first;
236235

237-
arg_begin = 0;
238-
239236
std::vector<String>::size_type i;
240237
int k;
241238
for (i = 0, k = 1; i < vname.size() && k < argc; i++, k++) {
242239
if (strcmp(argv[k], "--no-stack-rlimit") == 0 || strcmp(argv[k], "--autocomplete") == 0 || strcmp(argv[k], "--scm") == 0) {
243240
i--;
244-
arg_begin++;
245241
continue;
246242
}
247243

lib/config/configitem.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,9 @@ bool ConfigItem::CommitNewItems(const ActivationContext::Ptr& context, WorkQueue
444444
<< "Committing " << total << " new items.";
445445
#endif /* I2_DEBUG */
446446

447+
#ifdef I2_DEBUG
447448
int itemsCount {0};
449+
#endif /* I2_DEBUG */
448450

449451
for (auto& type : Type::GetConfigTypesSortedByLoadDependencies()) {
450452
std::atomic<int> committed_items(0);
@@ -475,9 +477,9 @@ bool ConfigItem::CommitNewItems(const ActivationContext::Ptr& context, WorkQueue
475477
}
476478
}
477479

480+
#ifdef I2_DEBUG
478481
itemsCount += committed_items;
479482

480-
#ifdef I2_DEBUG
481483
if (committed_items > 0)
482484
Log(LogDebug, "configitem")
483485
<< "Committed " << committed_items << " items of type '" << type->GetName() << "'.";

lib/remote/apilistener-filesync.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ void ApiListener::SyncLocalZoneDir(const Zone::Ptr& zone) const
104104

105105
Utility::MkDirP(productionZonesDir, 0700);
106106

107-
// Copy content and add additional meta data.
108-
size_t numBytes = 0;
109-
110107
/* Note: We cannot simply copy directories here.
111108
*
112109
* Zone directories are registered from everywhere and we already
@@ -131,8 +128,6 @@ void ApiListener::SyncLocalZoneDir(const Zone::Ptr& zone) const
131128

132129
fp << content;
133130
fp.close();
134-
135-
numBytes += content.GetLength();
136131
}
137132
}
138133

0 commit comments

Comments
 (0)