← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~qcumber-some/widelands/cppcheck_prefix_plusplus into lp:widelands

 

Jens Beyer (Qcumber-some) has proposed merging lp:~qcumber-some/widelands/cppcheck_prefix_plusplus into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #986611 in widelands: "Issues reported by cppcheck"
  https://bugs.launchpad.net/widelands/+bug/986611

For more details, see:
https://code.launchpad.net/~qcumber-some/widelands/cppcheck_prefix_plusplus/+merge/114484

Suggested by cppcheck 1.55 - some prefix ++ operators.

Should be pretty safe as far as I can tell.
-- 
https://code.launchpad.net/~qcumber-some/widelands/cppcheck_prefix_plusplus/+merge/114484
Your team Widelands Developers is requested to review the proposed merge of lp:~qcumber-some/widelands/cppcheck_prefix_plusplus into lp:widelands.
=== modified file 'src/economy/test/test_routing.cc'
--- src/economy/test/test_routing.cc	2012-04-06 19:26:17 +0000
+++ src/economy/test/test_routing.cc	2012-07-11 18:30:39 +0000
@@ -136,10 +136,10 @@
 					chain_begin_found = false;
 					if (*i == *j) {
 						chain_begin_found = true;
-						j++;
+						++j;
 					}
 				} else {
-					j++;
+					++j;
 					if (j == n.end()) {
 						return true;
 					}

=== modified file 'src/editor/tools/editor_draw_tool.cc'
--- src/editor/tools/editor_draw_tool.cc	2012-06-08 22:33:16 +0000
+++ src/editor/tools/editor_draw_tool.cc	2012-07-11 18:30:39 +0000
@@ -44,7 +44,7 @@
 	for
 		(std::list<Editor_Tool_Action *>::iterator i = args.draw_actions.begin();
 	        i != args.draw_actions.end();
-	        i++)
+	        ++i)
 	{
 		(*i)->tool.handle_click
 			(static_cast<Editor_Tool::Tool_Index>((*i)->i),
@@ -60,7 +60,7 @@
 	for
 		(std::list<Editor_Tool_Action *>::reverse_iterator i = args.draw_actions.rbegin();
 	        i != args.draw_actions.rend();
-	        i++)
+	        ++i)
 	{
 		(*i)->tool.handle_undo
 		(static_cast<Editor_Tool::Tool_Index>((*i)->i),

=== modified file 'src/editor/tools/editor_place_bob_tool.cc'
--- src/editor/tools/editor_place_bob_tool.cc	2012-02-21 13:52:14 +0000
+++ src/editor/tools/editor_place_bob_tool.cc	2012-07-11 18:30:39 +0000
@@ -63,7 +63,7 @@
 					bob->remove(egbase); //  There is already a bob. Remove it.
 				descr.create(egbase, 0, mr.location());
 			}
-			i++;
+			++i;
 		} while (mr.advance(map));
 		return mr.radius() + 2;
 	} else
@@ -92,7 +92,7 @@
 			} else if (Bob * const bob = mr.location().field->get_first_bob()) {
 				bob->remove(egbase);
 			}
-			i++;
+			++i;
 		} while (mr.advance(map));
 		return mr.radius() + 2;
 	} else

=== modified file 'src/editor/tools/editor_place_immovable_tool.cc'
--- src/editor/tools/editor_place_immovable_tool.cc	2012-02-21 13:52:14 +0000
+++ src/editor/tools/editor_place_immovable_tool.cc	2012-07-11 18:30:39 +0000
@@ -69,7 +69,7 @@
 			        and
 			        mr.location().field->nodecaps() & Widelands::MOVECAPS_WALK)
 				egbase.create_immovable(mr.location(), *i, 0);
-			i++;
+			++i;
 		} while (mr.advance(map));
 	}
 	return radius + 2;
@@ -99,7 +99,7 @@
 		if (!i->empty())
 			egbase.create_immovable(mr.location(), *i, 0);
 
-		i++;
+		++i;
 	} while (mr.advance(map));
 	return radius + 2;
 }

=== modified file 'src/editor/tools/editor_set_resources_tool.cc'
--- src/editor/tools/editor_set_resources_tool.cc	2012-06-08 22:33:16 +0000
+++ src/editor/tools/editor_set_resources_tool.cc	2012-07-11 18:30:39 +0000
@@ -130,8 +130,8 @@
 			map.recalc_for_field_area
 			(Widelands::Area<Widelands::FCoords>(mr.location(), 0));
 		}
-		ir++;
-		it++;
+		++ir;
+		++it;
 	} while (mr.advance(map));
 	args.orgRes.clear();
 	args.orgResT.clear();

=== modified file 'src/editor/tools/editor_set_terrain_tool.cc'
--- src/editor/tools/editor_set_terrain_tool.cc	2012-06-08 22:33:16 +0000
+++ src/editor/tools/editor_set_terrain_tool.cc	2012-07-11 18:30:39 +0000
@@ -61,7 +61,7 @@
 		do {
 			max = std::max
 			      (max, map.change_terrain(mr.location(), *i));
-			i++;
+			++i;
 		} while (mr.advance(map));
 	}
 	return radius + max;
@@ -89,7 +89,7 @@
 		do {
 			max = std::max
 			      (max, map.change_terrain(mr.location(), *i));
-			i++;
+			++i;
 		} while (mr.advance(map));
 		return radius + max;
 	} else return radius;

=== modified file 'src/scripting/scripting.cc'
--- src/scripting/scripting.cc	2012-02-15 21:25:34 +0000
+++ src/scripting/scripting.cc	2012-07-11 18:30:39 +0000
@@ -249,7 +249,7 @@
 
 	for
 		(filenameset_t::iterator i = scripting_files.begin();
-		 i != scripting_files.end(); i++)
+		 i != scripting_files.end(); ++i)
 	{
 		if (m_filename_to_short(*i) or not m_is_lua_file(*i))
 			continue;

=== modified file 'src/wui/waresdisplay.cc'
--- src/wui/waresdisplay.cc	2012-06-25 14:22:58 +0000
+++ src/wui/waresdisplay.cc	2012-07-11 18:30:39 +0000
@@ -397,7 +397,7 @@
 	Widelands::Tribe_Descr::WaresOrder order = m_tribe.wares_order();
 
 	for (i = order.begin(); i != order.end(); i++)
-		for (j = i->begin(); j != i->end(); j++)
+		for (j = i->begin(); j != i->end(); ++j)
 			if ((c = m_map->find(*j)) != m_map->end()) {
 				//  draw a background
 				const PictureID picid =