fix platform dependant scope errors as described in the Coding Standards

(http://www.wesnoth.org/wiki/CodingStandards#Respect_for_loop_scoping_of_different_platforms)
This commit is contained in:
Patrick Parker 2006-12-14 04:19:09 +00:00
parent 5e3822fbfa
commit 2a884c6744
3 changed files with 10 additions and 8 deletions

View file

@ -1709,7 +1709,7 @@ bool clear_shroud_unit(const gamemap& map,
clear_shroud_loc(map,teams[team],loc,&cleared_locations);
//remove all redundant location, if on this location is unit, sighed event is called twice
unique(cleared_locations.begin(),cleared_locations.end());
std::unique(cleared_locations.begin(),cleared_locations.end());
for(std::vector<gamemap::location>::const_iterator it =
cleared_locations.begin(); it != cleared_locations.end(); ++it) {

View file

@ -580,20 +580,20 @@ bool config::matches(const config &filter) const
}
//now, match the kids
for(all_children_iterator i = filter.ordered_begin(); i != filter.ordered_end(); ++i) {
if(*(*i).first == "not") continue;
child_list interesting_children = get_children(*(*i).first);
for(all_children_iterator i2 = filter.ordered_begin(); i2 != filter.ordered_end(); ++i2) {
if(*(*i2).first == "not") continue;
child_list interesting_children = get_children(*(*i2).first);
bool found = false;
for(child_list::iterator j = interesting_children.begin(); j != interesting_children.end(); ++j) {
if((*j)->matches(*(*i).second)) {
for(child_list::iterator j2 = interesting_children.begin(); j2 != interesting_children.end(); ++j2) {
if((*j2)->matches(*(*i2).second)) {
found = true;
}
}
if(!found) return false;
}
child_list negative_children = filter.get_children("not");
for(child_list::iterator j = negative_children.begin() ; j != negative_children.end() ; j++) {
if(matches(**j)) return false;
for(child_list::iterator j3 = negative_children.begin() ; j3 != negative_children.end() ; j3++) {
if(matches(**j3)) return false;
}
return true;
}

View file

@ -11,6 +11,8 @@
See the COPYING file for more details.
*/
#include "global.hpp"
#include <cstdlib>
#include "display.hpp"