From 808e54dd22ee1cacdd70edc8c8fa7f3c6cdd0189 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 11 Oct 2015 10:44:36 +0200 Subject: [PATCH] cppcheck: fix some reports vbox.h:356] -> [vbox.h:357]: (warning) Opposite conditions in nested 'if' blocks lead to a dead code block. [vbox.h:416]: (style) Statements following return, break, continue, goto or throw will never be executed. [vbox.h:420]: (style) Statements following return, break, continue, goto or throw will never be executed. --- vbox.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vbox.h b/vbox.h index 6d69d5e..f4fbb7b 100644 --- a/vbox.h +++ b/vbox.h @@ -354,7 +354,6 @@ void VM::throttle() cerr << "INFO: Number of cores: " << n_cpus << endl; if (aid.project_preferences) { - if (!aid.project_preferences) return; double max_vm_cpu_pct = 100.0; if (parse_double(aid.project_preferences, "", max_vm_cpu_pct)) { @@ -412,12 +411,12 @@ bool VM::is_status(string status) output = buffer; if (output.find("VMState=\"" + status + "\"") != string::npos) { - return true; boinc_end_critical_section(); + return true; } else { - return false; boinc_end_critical_section(); + return false; } }