Author: brunowolff
Date: Wed Mar 19 17:42:03 2008
New Revision: 24846
URL: http://svn.gna.org/viewcvs/wesnoth?rev=24846&view=rev
Log:
Silence gcc 4.3 warnings by adding parens around && clauses near ||.
Modified:
trunk/src/ai_move.cpp
Modified: trunk/src/ai_move.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_move.cpp?rev=24846&r1=24845&r2=24846&view=diff
==============================================================================
--- trunk/src/ai_move.cpp (original)
+++ trunk/src/ai_move.cpp Wed Mar 19 17:42:03 2008
@@ -602,7 +602,7 @@
const int defense =
best->second.defense_modifier(map_.get_terrain(*i));
const double vulnerability =
power_projection(*i,enemy_dstsrc);
- if(best_loc.valid() == false || defense <
best_defense || defense == best_defense && vulnerability < best_vulnerability) {
+ if(best_loc.valid() == false || defense <
best_defense || (defense == best_defense && vulnerability <
best_vulnerability)) {
best_loc = *i;
best_defense = defense;
best_vulnerability = vulnerability;
@@ -635,8 +635,8 @@
for(std::vector<location>::const_iterator i =
best_route.steps.begin(); i != best_route.steps.end() && movement > 0; ++i) {
const double threat = power_projection(*i,enemy_dstsrc);
- if(threat >= double(best->second.hitpoints()) && threat
> power_projection(*i,fullmove_dstsrc) ||
- i >= best_route.steps.end()-2 && unit_at_target !=
units_.end() && current_team().is_enemy(unit_at_target->second.side())) {
+ if((threat >= double(best->second.hitpoints()) &&
threat > power_projection(*i,fullmove_dstsrc)) ||
+ (i >= best_route.steps.end()-2 && unit_at_target !=
units_.end() && current_team().is_enemy(unit_at_target->second.side()))) {
dangerous = true;
break;
}
@@ -695,7 +695,7 @@
const int defense =
un.defense_modifier(map_.get_terrain(i->second));
const double threat =
(power_projection(i->second,enemy_dstsrc)*defense)/100;
- if(best_loc.valid() == false || threat <
maximum<double>(best_threat,max_acceptable_threat) && distance < best_distance)
{
+ if(best_loc.valid() == false || (threat <
maximum<double>(best_threat,max_acceptable_threat) && distance <
best_distance)) {
best_loc = i->second;
best_threat = threat;
best_distance = distance;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits