Author: ilor
Date: Tue Jun 23 21:04:35 2009
New Revision: 36367

URL: http://svn.gna.org/viewcvs/wesnoth?rev=36367&view=rev
Log:
kill some VC9 warnings

Modified:
    trunk/src/ai/default/ai.cpp
    trunk/src/attack_prediction.cpp
    trunk/src/generate_report.cpp
    trunk/src/scripting/lua.cpp
    trunk/src/sdl_utils.cpp
    trunk/src/statistics_dialog.cpp
    trunk/src/text.cpp

Modified: trunk/src/ai/default/ai.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/default/ai.cpp?rev=36367&r1=36366&r2=36367&view=diff
==============================================================================
--- trunk/src/ai/default/ai.cpp (original)
+++ trunk/src/ai/default/ai.cpp Tue Jun 23 21:04:35 2009
@@ -599,13 +599,13 @@
        }
 
        float free_slots = 0.0f;
-       const float gold = current_team().gold();
-       const float unit_price = current_team_w().average_recruit_price();
+       const float gold = static_cast<float>(current_team().gold());
+       const float unit_price = 
static_cast<float>(current_team_w().average_recruit_price());
        if (map_.is_keep(leader_loc))
        {
                std::set<map_location> checked_hexes;
                checked_hexes.insert(leader_loc);
-               free_slots = count_free_hexes_in_castle(leader_loc, 
checked_hexes);
+               free_slots = 
static_cast<float>(count_free_hexes_in_castle(leader_loc, checked_hexes));
        } else {
                map_location loc = nearest_keep(leader_loc);
                if (units_.find(loc) == units_.end() && gold/unit_price > 1.0f)

Modified: trunk/src/attack_prediction.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/attack_prediction.cpp?rev=36367&r1=36366&r2=36367&view=diff
==============================================================================
--- trunk/src/attack_prediction.cpp (original)
+++ trunk/src/attack_prediction.cpp Tue Jun 23 21:04:35 2009
@@ -740,7 +740,7 @@
                // becomes less probable since it's now conditional on us not
                // levelling up.  This doesn't apply to the probability of us
                // dying, of course.
-               float scalefactor =
+               double scalefactor =
                        (1 - hp_dist.front() - opp.hp_dist.front()) / (1 - 
hp_dist.front());
                std::vector<double>::iterator i;
                i = hp_dist.begin();

Modified: trunk/src/generate_report.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/generate_report.cpp?rev=36367&r1=36366&r2=36367&view=diff
==============================================================================
--- trunk/src/generate_report.cpp (original)
+++ trunk/src/generate_report.cpp Tue Jun 23 21:04:35 2009
@@ -208,7 +208,7 @@
        case UNIT_MOVES: {
          float movement_frac = 1.0;
                if (u->side() == playing_side) {
-                       movement_frac = u->movement_left() / 
std::max<float>(1.0, u->total_movement());
+                       movement_frac = static_cast<float>(u->movement_left()) 
/ std::max(1.0f, static_cast<float>(u->total_movement()));
                  if (movement_frac > 1.0) movement_frac = 1.0;
          }
 

Modified: trunk/src/scripting/lua.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/scripting/lua.cpp?rev=36367&r1=36366&r2=36367&view=diff
==============================================================================
--- trunk/src/scripting/lua.cpp (original)
+++ trunk/src/scripting/lua.cpp Tue Jun 23 21:04:35 2009
@@ -176,7 +176,7 @@
                        case LUA_TUSERDATA:
                        {
                                if (!lua_getmetatable(L, -1)) 
return_misformed();
-                               bool tstr = lua_rawequal(L, -1, tstring_meta);
+                               bool tstr = lua_rawequal(L, -1, tstring_meta) 
!= 0;
                                lua_pop(L, 1);
                                if (!tstr) return_misformed();
                                v = *static_cast<t_string *>(lua_touserdata(L, 
-1));
@@ -497,7 +497,7 @@
        // Find the corresponding attribute.
        modify_int_attrib("side", u.set_side(value));
        modify_int_attrib("moves", u.set_movement(value));
-       modify_bool_attrib("resting", u.set_resting(value));
+       modify_bool_attrib("resting", u.set_resting(value != 0));
        modify_tstring_attrib("name", u.set_name(value));
        modify_string_attrib("role", u.set_role(value));
        modify_string_attrib("facing", 
u.set_facing(map_location::parse_direction(value)));
@@ -806,7 +806,7 @@
        modify_tstring_attrib("objectives", t.set_objectives(value, true));
        modify_int_attrib("village_gold", t.set_village_gold(value));
        modify_int_attrib("base_income", t.set_base_income(value));
-       modify_bool_attrib("objectives_changed", 
t.set_objectives_changed(value));
+       modify_bool_attrib("objectives_changed", t.set_objectives_changed(value 
!= 0));
        modify_tstring_attrib("user_team_name", t.change_team(t.team_name(), 
value));
        modify_string_attrib("team_name", t.change_team(value, 
t.user_team_name()));
        return 0;

Modified: trunk/src/sdl_utils.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sdl_utils.cpp?rev=36367&r1=36366&r2=36367&view=diff
==============================================================================
--- trunk/src/sdl_utils.cpp (original)
+++ trunk/src/sdl_utils.cpp Tue Jun 23 21:04:35 2009
@@ -408,9 +408,9 @@
                                  g = pix[loc] >> 8;
                                  b = pix[loc] >> 0;
                                  if (a == 0) {
-                                   r = avg_r;
-                                   g = avg_g;
-                                   b = avg_b;
+                                   r = static_cast<Uint8>(avg_r);
+                                   g = static_cast<Uint8>(avg_g);
+                                   b = static_cast<Uint8>(avg_b);
                                  }
                                  rr += r * bilin[loc];
                                  gg += g * bilin[loc];

Modified: trunk/src/statistics_dialog.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/statistics_dialog.cpp?rev=36367&r1=36366&r2=36367&view=diff
==============================================================================
--- trunk/src/statistics_dialog.cpp (original)
+++ trunk/src/statistics_dialog.cpp Tue Jun 23 21:04:35 2009
@@ -190,8 +190,8 @@
 {
        int shift = statistics::stats::decimal_shift;
 
-       int dsa = shift * damage      - expected;
-       int dst = shift * turn_damage - turn_expected;
+       long long dsa = shift * damage      - expected;
+       long long dst = shift * turn_damage - turn_expected;
 
        std::ostringstream str;
        str << header << COLUMN_SEPARATOR

Modified: trunk/src/text.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/text.cpp?rev=36367&r1=36366&r2=36367&view=diff
==============================================================================
--- trunk/src/text.cpp (original)
+++ trunk/src/text.cpp Tue Jun 23 21:04:35 2009
@@ -137,7 +137,7 @@
 
 #if defined(PANGO_VERSION_CHECK)
 #if PANGO_VERSION_CHECK(1,16,0)
-       return (pango_layout_is_ellipsized(layout_) == TRUE);
+       return (pango_layout_is_ellipsized(layout_) != 0);
 #endif
 #endif
        return false;


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to