Package: boinc / 7.14.2+dfsg-3

rrsim_iterator_cppcheck.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: this patch avoid the iterator reuse, fixing cppcheck warnings
--- a/client/rrsim_test.cpp
+++ b/client/rrsim_test.cpp
@@ -184,7 +184,6 @@
     vector<RESULT*> active;
     unsigned int i;
     double x;
-    vector<RESULT*>::iterator it;
     bool rval = false;
 
     if (log_flags.rr_simulation) {
@@ -287,7 +286,9 @@
         int last_active_size = active.size();
         int last_proj_active_size = pbest->active.size();
 
-        // remove *rpbest from active set,
+        {
+        vector<RESULT*>::iterator it;
+	// remove *rpbest from active set,
         // and adjust CPU time left for other results
         //
         it = active.begin();
@@ -301,7 +302,10 @@
                 ++it;
             }
         }
+	}
 
+	{
+        vector<RESULT*>::iterator it;
         // remove *rpbest from its project's active set
         //
         it = pbest->active.begin();
@@ -313,6 +317,7 @@
                 ++it;
             }
         }
+	}
 
         // If project has more results, add one to active set.
         //