Author: soliton
Date: Sat May 7 17:11:50 2011
New Revision: 49411
URL: http://svn.gna.org/viewcvs/wesnoth?rev=49411&view=rev
Log:
Recommit "Fixed gcc 4.6 compiler warnings." sans the unit type breakage
Modified:
branches/1.8/changelog
branches/1.8/src/ai/default/attack.cpp
branches/1.8/src/ai/default/move.cpp
branches/1.8/src/ai/testing/aspect_attacks.cpp
branches/1.8/src/ai/testing/ca_default_move_to_targets.cpp
branches/1.8/src/ai/testing/ca_testing_move_to_targets.cpp
branches/1.8/src/controller_base.cpp
branches/1.8/src/game.cpp
branches/1.8/src/gui/widgets/scrollbar_container.cpp
branches/1.8/src/gui/widgets/window.cpp
branches/1.8/src/mapgen_dialog.cpp
branches/1.8/src/marked-up_text.cpp
branches/1.8/src/multiplayer_connect.cpp
branches/1.8/src/sdl_utils.cpp
branches/1.8/src/unit_types.cpp
Modified: branches/1.8/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/changelog?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/changelog (original)
+++ branches/1.8/changelog Sat May 7 17:11:50 2011
@@ -32,6 +32,7 @@
* Fixed graphics corruption with certain version combinations of glibc and
SDL
(bug #17573)
* Fix transparent portraits not supporting image path functions
+ * Fixed: gcc 4.6 compiler warnings.
Version 1.8.5:
* AI:
Modified: branches/1.8/src/ai/default/attack.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/ai/default/attack.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/ai/default/attack.cpp (original)
+++ branches/1.8/src/ai/default/attack.cpp Sat May 7 17:11:50 2011
@@ -352,7 +352,6 @@
double best_kill_prob = 0.0;
unsigned int best_weapon = 0;
- int best_def_weapon = -1;
unsigned best_dir = 0;
for (unsigned n = 0; n != 6; ++n)
@@ -374,7 +373,6 @@
continue;
best_kill_prob = def.hp_dist[0];
best_weapon = i;
- best_def_weapon = bc.get_defender_stats().attack_num;
best_dir = n;
}
}
Modified: branches/1.8/src/ai/default/move.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/ai/default/move.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/ai/default/move.cpp (original)
+++ branches/1.8/src/ai/default/move.cpp Sat May 7 17:11:50 2011
@@ -515,10 +515,8 @@
location best_loc;
int best_defense = 0;
double best_vulnerability = 0.0;
- int best_distance = 0;
for(std::vector<location>::const_iterator i =
locs.begin(); i != locs.end(); ++i) {
- const int distance =
distance_between(*i,best_target->loc);
const int defense =
best->second.defense_modifier(map_.get_terrain(*i));
//FIXME: suokko multiplied by 10 *
get_caution(). ?
const double vulnerability =
power_projection(*i,enemy_dstsrc);
@@ -527,7 +525,6 @@
best_loc = *i;
best_defense = defense;
best_vulnerability = vulnerability;
- best_distance = distance;
}
}
Modified: branches/1.8/src/ai/testing/aspect_attacks.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/ai/testing/aspect_attacks.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/ai/testing/aspect_attacks.cpp (original)
+++ branches/1.8/src/ai/testing/aspect_attacks.cpp Sat May 7 17:11:50 2011
@@ -130,28 +130,10 @@
unit_map &units_ = get_info().units;
std::vector<team> &teams_ = get_info().teams;
- static double best_results[6];
- if(result.empty()) {
- for(int i = 0; i != 6; ++i) {
- best_results[i] = 0.0;
- }
- }
-
const size_t max_positions = 1000;
if(result.size() > max_positions && !cur_analysis.movements.empty()) {
LOG_AI << "cut analysis short with number of positions\n";
return;
- }
-
- const double cur_rating = cur_analysis.movements.empty() ? -1.0 :
- cur_analysis.rating(get_aggression(),*this);
-
- double rating_to_beat = cur_rating;
-
- if(!cur_analysis.movements.empty()) {
- assert(cur_analysis.movements.size() < 6);
- double& best_res =
best_results[cur_analysis.movements.size()-1];
- rating_to_beat = best_res = std::max(best_res,cur_rating);
}
for(size_t i = 0; i != units.size(); ++i) {
Modified: branches/1.8/src/ai/testing/ca_default_move_to_targets.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/ai/testing/ca_default_move_to_targets.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/ai/testing/ca_default_move_to_targets.cpp (original)
+++ branches/1.8/src/ai/testing/ca_default_move_to_targets.cpp Sat May 7
17:11:50 2011
@@ -428,10 +428,8 @@
map_location best_loc;
int best_defense = 0;
double best_vulnerability = 0.0;
- int best_distance = 0;
for(std::vector<map_location>::const_iterator i =
locs.begin(); i != locs.end(); ++i) {
- const int distance =
distance_between(*i,best_target->loc);
const int defense =
best->second.defense_modifier(map_.get_terrain(*i));
//FIXME: suokko multiplied by 10 *
get_caution(). ?
const double vulnerability =
power_projection(*i,enemy_dstsrc);
@@ -440,7 +438,6 @@
best_loc = *i;
best_defense = defense;
best_vulnerability = vulnerability;
- best_distance = distance;
}
}
Modified: branches/1.8/src/ai/testing/ca_testing_move_to_targets.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/ai/testing/ca_testing_move_to_targets.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/ai/testing/ca_testing_move_to_targets.cpp (original)
+++ branches/1.8/src/ai/testing/ca_testing_move_to_targets.cpp Sat May 7
17:11:50 2011
@@ -433,10 +433,8 @@
map_location best_loc;
int best_defense = 0;
double best_vulnerability = 0.0;
- int best_distance = 0;
for(std::vector<map_location>::const_iterator i =
locs.begin(); i != locs.end(); ++i) {
- const int distance =
distance_between(*i,best_target->loc);
const int defense =
best->second.defense_modifier(map_.get_terrain(*i));
//FIXME: suokko multiplied by 10 *
get_caution(). ?
const double vulnerability =
power_projection(*i,enemy_dstsrc);
@@ -445,7 +443,6 @@
best_loc = *i;
best_defense = defense;
best_vulnerability = vulnerability;
- best_distance = distance;
}
}
Modified: branches/1.8/src/controller_base.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/controller_base.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/controller_base.cpp (original)
+++ branches/1.8/src/controller_base.cpp Sat May 7 17:11:50 2011
@@ -98,12 +98,6 @@
int x, y;
Uint8 mouse_flags = SDL_GetMouseState(&x, &y);
if ((mouse_flags & SDL_BUTTON_LEFT) == 0) {
- SDL_Event e;
- e.type = SDL_MOUSEBUTTONUP;
- e.button.state = SDL_RELEASED;
- e.button.button = SDL_BUTTON_LEFT;
- e.button.x = x;
- e.button.y = y;
get_mouse_handler_base().mouse_press(event.button, browse_);
post_mouse_press(event);
}
Modified: branches/1.8/src/game.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/game.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/game.cpp (original)
+++ branches/1.8/src/game.cpp Sat May 7 17:11:50 2011
@@ -826,13 +826,6 @@
try {
//check if all sides are AI and we are using new uploader ->
log these games
- bool all_ai = true;
- foreach (config &s, level.child_range("side")) {
- if( s["controller"] != "ai" ) {
- all_ai = false;
- }
- }
-
recorder.add_log_data("ai_log","ai_label",label);
state_.snapshot = level;
Modified: branches/1.8/src/gui/widgets/scrollbar_container.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/gui/widgets/scrollbar_container.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/gui/widgets/scrollbar_container.cpp (original)
+++ branches/1.8/src/gui/widgets/scrollbar_container.cpp Sat May 7 17:11:50
2011
@@ -1024,8 +1024,6 @@
: vertical_scrollbar_->get_item_position() *
vertical_scrollbar_->get_step_size();
- const tpoint content_size = content_grid_->get_best_size();
-
const tpoint content_origin = tpoint(
content_->get_x() - x_offset,
content_->get_y() - y_offset);
Modified: branches/1.8/src/gui/widgets/window.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/gui/widgets/window.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/gui/widgets/window.cpp (original)
+++ branches/1.8/src/gui/widgets/window.cpp Sat May 7 17:11:50 2011
@@ -946,9 +946,6 @@
twidget* widget = find_at(location, true);
assert(widget);
-
- const SDL_Rect widget_rect = widget->get_rect();
- const SDL_Rect client_rect = get_client_rect();
tooltip_.set_label(tooltip);
const tpoint size = tooltip_.get_best_size();
Modified: branches/1.8/src/mapgen_dialog.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/mapgen_dialog.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/mapgen_dialog.cpp (original)
+++ branches/1.8/src/mapgen_dialog.cpp Sat May 7 17:11:50 2011
@@ -245,7 +245,7 @@
link_castles.set_check(link_castles_);
link_castles.set_location(link_rect);
- for(bool draw = true;; draw = false) {
+ while(true) {
nplayers_ = players_slider.value();
width_ = width_slider.value();
height_ = height_slider.value();
Modified: branches/1.8/src/marked-up_text.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/marked-up_text.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/marked-up_text.cpp (original)
+++ branches/1.8/src/marked-up_text.cpp Sat May 7 17:11:50 2011
@@ -55,7 +55,6 @@
int* font_size,
SDL_Color* colour, int* style)
{
- std::string::const_iterator i_start=i1;
while(i1 != i2) {
switch(*i1) {
case '\\':
Modified: branches/1.8/src/multiplayer_connect.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/multiplayer_connect.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/multiplayer_connect.cpp (original)
+++ branches/1.8/src/multiplayer_connect.cpp Sat May 7 17:11:50 2011
@@ -184,7 +184,6 @@
// Hack: if there is a unit which can recruit, use it as a
leader.
// Necessary to display leader information when loading saves.
- config::const_child_itors side_units = cfg.child_range("unit");
std::string leader_type;
foreach (const config &side_unit, cfg.child_range("unit"))
{
Modified: branches/1.8/src/sdl_utils.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/sdl_utils.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/sdl_utils.cpp (original)
+++ branches/1.8/src/sdl_utils.cpp Sat May 7 17:11:50 2011
@@ -739,8 +739,6 @@
Uint32* beg = lock.pixels();
Uint32* end = beg + nsurf->w*surf->h;
- std::map<Uint32, Uint32>::const_iterator map_rgb_end =
map_rgb.end();
-
while(beg != end) {
Uint8 alpha = (*beg) >> 24;
Modified: branches/1.8/src/unit_types.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/unit_types.cpp?rev=49411&r1=49410&r2=49411&view=diff
==============================================================================
--- branches/1.8/src/unit_types.cpp (original)
+++ branches/1.8/src/unit_types.cpp Sat May 7 17:11:50 2011
@@ -1189,9 +1189,8 @@
*/
}
// we insert an empty unit_type and build it after the copy (for
performance)
- std::pair<unit_type_map::iterator,bool> insertion =
+ //std::pair<unit_type_map::iterator,bool> insertion =
insert(std::pair<const std::string,unit_type>(id,unit_type()));
- unit_type_map::iterator itor = types_.find(id);
// if (!insertion.second)
// TODO: else { warning for multiple units with same id}
LOG_CONFIG << "added " << id << " to unit_type list
(unit_type_data.unit_types)\n";
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits