[Widelands-cvs] SF.net SVN: widelands: [3187] trunk/src
Status: Beta
Brought to you by:
sirver
From: <si...@us...> - 2008-04-21 17:08:25
|
Revision: 3187 http://widelands.svn.sourceforge.net/widelands/?rev=3187&view=rev Author: sigra Date: 2008-04-21 10:08:13 -0700 (Mon, 21 Apr 2008) Log Message: ----------- Fix warnings from GCC 4.3.0. Modified Paths: -------------- trunk/src/basic_fileread.h trunk/src/bitinbuffer.h trunk/src/bob.h trunk/src/computer_player.cc trunk/src/editor/ui_menus/editor_main_menu_new_map.cc trunk/src/editor/ui_menus/trigger_building_option_menu.cc trunk/src/editor_game_base.cc trunk/src/field.h trunk/src/fieldaction.cc trunk/src/filesystem/unzip.cc trunk/src/filesystem/zip_filesystem.cc trunk/src/game.cc trunk/src/game_cmd_queue_data_packet.cc trunk/src/item_ware_descr.h trunk/src/journal.h trunk/src/player.cc trunk/src/production_program.cc trunk/src/rendertarget.cc trunk/src/trainingsite.cc trunk/src/trigger/trigger_conditional.cc trunk/src/ui/ui_basic/ui_button.cc trunk/src/ui/ui_basic/ui_checkbox.cc trunk/src/ui/ui_basic/ui_multilinetextarea.h trunk/src/ui/ui_basic/ui_table.h trunk/src/ui/ui_basic/ui_window.cc trunk/src/waresdisplay.cc trunk/src/widelands_map_bobdata_data_packet.cc trunk/src/wlapplication.cc trunk/src/wlapplication.h trunk/src/worker.cc Modified: trunk/src/basic_fileread.h =================================================================== --- trunk/src/basic_fileread.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/basic_fileread.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -110,7 +110,7 @@ Pos i = pos.isNull() ? filepos : pos; if (i >= length) throw File_Boundary_Exceeded(); char * const result = data + i; - for (char * p = result; *p; ++p, ++i); + for (char * p = result; *p; ++p, ++i) {} ++i; // beyond the null if (i > length) throw File_Boundary_Exceeded(); if (pos.isNull()) filepos = i; Modified: trunk/src/bitinbuffer.h =================================================================== --- trunk/src/bitinbuffer.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/bitinbuffer.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -38,7 +38,7 @@ size_t GetPos () const throw () {return fr.GetPos ();} uint8_t get() { if (mask == 0x00) {buffer = fr.Unsigned8(); mask = 0xff;} - uint8_t const result = buffer >> 8 - Size; + uint8_t const result = buffer >> (8 - Size); buffer <<= Size; mask <<= Size; assert(result < (1 << Size)); Modified: trunk/src/bob.h =================================================================== --- trunk/src/bob.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/bob.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -203,7 +203,9 @@ const EncodeData& get_default_encodedata() const {return m_default_encodedata;} - const Tribe_Descr * const get_owner_tribe() const throw () {return m_owner_tribe;} + Tribe_Descr const * get_owner_tribe() const throw () { + return m_owner_tribe; + } static Descr *create_from_dir (const char *name, Modified: trunk/src/computer_player.cc =================================================================== --- trunk/src/computer_player.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/computer_player.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -751,9 +751,9 @@ if (dynamic_cast<Flag const *>(imm) or - dynamic_cast<Road const *>(imm) - && - fse.field->get_caps() & BUILDCAPS_FLAG) + (dynamic_cast<Road const *>(imm) + && + fse.field->get_caps() & BUILDCAPS_FLAG)) field->preferred=true; for (uint32_t i = 0;i < immovables.size(); ++i) { @@ -835,9 +835,9 @@ if (dynamic_cast<Flag const *>(imm) or - dynamic_cast<Road const *>(imm) - && - fse.field->get_caps() & BUILDCAPS_FLAG) + (dynamic_cast<Road const *>(imm) + && + fse.field->get_caps() & BUILDCAPS_FLAG)) field->preferred=true; for (uint32_t i = 0; i < immovables.size(); ++i) { Modified: trunk/src/editor/ui_menus/editor_main_menu_new_map.cc =================================================================== --- trunk/src/editor/ui_menus/editor_main_menu_new_map.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/editor/ui_menus/editor_main_menu_new_map.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -60,8 +60,8 @@ int32_t posy = offsy; { Widelands::Extent const map_extent = parent->egbase().map().extent(); - for (m_w = 0; Widelands::MAP_DIMENSIONS[m_w] < map_extent.w; ++m_w); - for (m_h = 0; Widelands::MAP_DIMENSIONS[m_h] < map_extent.h; ++m_h); + for (m_w = 0; Widelands::MAP_DIMENSIONS[m_w] < map_extent.w; ++m_w) {} + for (m_h = 0; Widelands::MAP_DIMENSIONS[m_h] < map_extent.h; ++m_h) {} } snprintf (buffer, sizeof(buffer), _("Width: %u"), Widelands::MAP_DIMENSIONS[m_w]); Modified: trunk/src/editor/ui_menus/trigger_building_option_menu.cc =================================================================== --- trunk/src/editor/ui_menus/trigger_building_option_menu.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/editor/ui_menus/trigger_building_option_menu.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -174,7 +174,7 @@ " ", Align_Left), m_decrease_y_100 (this, - get_inner_w() - button_width >> 1, + (get_inner_w() - button_width) >> 1, m_label_coords.get_y() + m_label_coords.get_h(), button_size, 0, Modified: trunk/src/editor_game_base.cc =================================================================== --- trunk/src/editor_game_base.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/editor_game_base.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -309,6 +309,7 @@ if (const Military_Influence value = plr->military_influence(index)) + { if (value > highest_military_influence) { highest_military_influence = value; best_player = p; @@ -317,6 +318,7 @@ best_player = neutral_when_competing_influence ? 0 : player_area.player_number; } + } } } if (best_player != player_area.player_number) { @@ -814,7 +816,7 @@ Player::Field & player_field = (&first_player_field)[i]; if (1 < player_field .vision - | + or 1 < (&first_player_field)[neighbour_i].vision) { player_field.roads &= ~mask; Modified: trunk/src/field.h =================================================================== --- trunk/src/field.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/field.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -225,7 +225,7 @@ void set_border(const bool b) throw () { owner_info_and_selections = - owner_info_and_selections & ~Border_Bitmask | b << Border_Bit; + (owner_info_and_selections & ~Border_Bitmask) | (b << Border_Bit); } uint8_t get_buildhelp_overlay_index() const {return buildhelp_overlay_index;} Modified: trunk/src/fieldaction.cc =================================================================== --- trunk/src/fieldaction.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/fieldaction.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -726,7 +726,7 @@ { okdialog(); Widelands::Editor_Game_Base & egbase = m_iabase->egbase(); - if (upcast(Widelands::Flag, flag, m_field.field->get_immovable())) + if (upcast(Widelands::Flag, flag, m_field.field->get_immovable())) { if (Building * const building = flag->get_building()) { if (building->get_playercaps() & (1 << Building::PCap_Bulldoze)) show_bulldoze_confirm(m_iabase, building, flag); @@ -737,6 +737,7 @@ flag->remove(&egbase); m_iabase->need_complete_redraw(); } + } } Modified: trunk/src/filesystem/unzip.cc =================================================================== --- trunk/src/filesystem/unzip.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/filesystem/unzip.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -603,10 +603,10 @@ // we check the magic - if (err == UNZ_OK) + if (err == UNZ_OK) { if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uMagic) != UNZ_OK) err = UNZ_ERRNO; - else if (uMagic!=0x02014b50) + } else if (uMagic!=0x02014b50) err = UNZ_BADZIPFILE; if @@ -736,7 +736,7 @@ file_info.size_file_extra < extraFieldBufferSize ? file_info.size_file_extra : extraFieldBufferSize; - if (lSeek) + if (lSeek) { if (ZSEEK(s->z_filefunc, s->filestream, lSeek, ZLIB_FILEFUNC_SEEK_CUR) == @@ -744,6 +744,7 @@ lSeek = 0; else err = UNZ_ERRNO; + } if (file_info.size_file_extra > 0 && extraFieldBufferSize > 0 and @@ -764,13 +765,13 @@ } else uSizeRead = commentBufferSize; - if (lSeek != 0) + if (lSeek != 0) { if (ZSEEK(s->z_filefunc, s->filestream, lSeek, ZLIB_FILEFUNC_SEEK_CUR) == 0) lSeek = 0; - else + } else err = UNZ_ERRNO; if (file_info.size_file_comment > 0 && commentBufferSize > 0) if @@ -1018,11 +1019,12 @@ return UNZ_ERRNO; - if (err == UNZ_OK) + if (err == UNZ_OK) { if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uMagic) != UNZ_OK) err = UNZ_ERRNO; else if (uMagic != 0x04034b50) err = UNZ_BADZIPFILE; + } if (unzlocal_getShort(&s->z_filefunc, s->filestream, &uData) != UNZ_OK) err = UNZ_ERRNO; @@ -1901,11 +1903,11 @@ year -= 80; return static_cast<uLong> - ((ptm->tm_mday + 32 * (ptm->tm_mon + 1) + 512 * year) << 16) + ((ptm->tm_mday + 32 * (ptm->tm_mon + 1) + 512 * year) << 16) | - ptm->tm_sec / 2 + - 32 * ptm->tm_min + - 2048 * static_cast<uLong>(ptm->tm_hour); + (ptm->tm_sec / 2 + + 32 * ptm->tm_min + + 2048 * static_cast<uLong>(ptm->tm_hour)); } Modified: trunk/src/filesystem/zip_filesystem.cc =================================================================== --- trunk/src/filesystem/zip_filesystem.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/filesystem/zip_filesystem.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -450,5 +450,5 @@ } void ZipFilesystem::Rename(std::string const &, std::string const &) { - assert (false and "rename inside zip FS is not implemented yet"); + throw wexception("rename inside zip FS is not implemented yet"); } Modified: trunk/src/game.cc =================================================================== --- trunk/src/game.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/game.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -344,9 +344,7 @@ * argument defines if this is a single player game (true) * or networked (false) */ -bool Game::run_load_game(const bool is_splayer, std::string filename) { - assert(is_splayer); // TODO: net game saving not supported - +bool Game::run_load_game(bool, std::string filename) { if (filename.empty()) { Fullscreen_Menu_LoadGame ssg(*this); if (ssg.run() > 0) Modified: trunk/src/game_cmd_queue_data_packet.cc =================================================================== --- trunk/src/game_cmd_queue_data_packet.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/game_cmd_queue_data_packet.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -132,7 +132,8 @@ if (upcast(GameLogicCommand, cmd, it.cmd)) { // The id (aka command type) - assert(0 < cmd->get_id() < 0x8000); + assert(0 < cmd->get_id()); + assert (cmd->get_id() < 0x8000); fw.Unsigned16(cmd->get_id()); // Serial number Modified: trunk/src/item_ware_descr.h =================================================================== --- trunk/src/item_ware_descr.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/item_ware_descr.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -56,7 +56,7 @@ virtual ~Item_Ware_Descr() {}; /// \return index to ware's icon inside picture stack - const uint32_t get_icon() const throw () {return m_icon;} + uint32_t get_icon() const throw () {return m_icon;} /// \return ware's unique name const std::string & name() const throw () {return m_name;} Modified: trunk/src/journal.h =================================================================== --- trunk/src/journal.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/journal.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -91,7 +91,7 @@ * Returns the position in the playback file * \return byte offset into the playback file, used with file reading */ - const int32_t get_playback_offset() {return m_playbackstream.tellg();} + int32_t get_playback_offset() {return m_playbackstream.tellg();} void write(int8_t v); void write(uint8_t v); Modified: trunk/src/player.cc =================================================================== --- trunk/src/player.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/player.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -184,12 +184,13 @@ Flag & Player::force_flag(FCoords const c) { log("Forcing flag at (%i, %i)\n", c.x, c.y); Map const & map = egbase().map(); - if (BaseImmovable * const immovable = c.field->get_immovable()) + if (BaseImmovable * const immovable = c.field->get_immovable()) { if (upcast(Flag, existing_flag, immovable)) { if (&existing_flag->owner() == this) return *existing_flag; } else if (not dynamic_cast<Road const *>(immovable)) // A road is OK. immovable->remove(&egbase()); // Make room for the flag. + } MapRegion<Area<FCoords> > mr(map, Area<FCoords>(c, 1)); do if (upcast(Flag, flag, mr.location().field->get_immovable())) flag->remove(&egbase()); // Remove all flags that are too close. Modified: trunk/src/production_program.cc =================================================================== --- trunk/src/production_program.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/production_program.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -226,10 +226,10 @@ if (endp && *endp) throw wexception("Bad area '%s'", cmd[2].c_str()); act.iparam2=strtol(cmd[3].c_str(), &endp, 0); - if (endp && *endp || act.iparam2 > 100) + if ((endp && *endp) || act.iparam2 > 100) throw wexception("Bad maximum amount: '%s'", cmd[3].c_str()); act.iparam3=strtol(cmd[4].c_str(), &endp, 0); - if (endp && *endp || act.iparam3 > 100) + if ((endp && *endp) || act.iparam3 > 100) throw wexception ("Bad chance after maximum amount is empty: '%s'", cmd[4].c_str()); Modified: trunk/src/rendertarget.cc =================================================================== --- trunk/src/rendertarget.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/rendertarget.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -558,27 +558,27 @@ and r_owner_number == f_owner_number and - (tr_owner_number == f_owner_number + ((tr_owner_number == f_owner_number) xor - br_owner_number == f_owner_number)) + (br_owner_number == f_owner_number))) drawanim(middle(f_pos, r_pos), anim, 0, &owner); if ((f_vision | bl_vision) and bl_owner_number == f_owner_number and - (l_owner_number == f_owner_number + ((l_owner_number == f_owner_number) xor - br_owner_number == f_owner_number)) + (br_owner_number == f_owner_number))) drawanim(middle(f_pos, bl_pos), anim, 0, &owner); if ((f_vision | br_vision) and br_owner_number == f_owner_number and - (r_owner_number == f_owner_number + ((r_owner_number == f_owner_number) xor - bl_owner_number == f_owner_number)) + (bl_owner_number == f_owner_number))) drawanim(middle(f_pos, br_pos), anim, 0, &owner); } @@ -943,23 +943,23 @@ if (r_owner_number == f_owner_number and - (tr_owner_number == f_owner_number + ((tr_owner_number == f_owner_number) xor - br_owner_number == f_owner_number)) + (br_owner_number == f_owner_number))) drawanim(middle(f_pos, r_pos), anim, 0, &owner); if (bl_owner_number == f_owner_number and - (l_owner_number == f_owner_number + ((l_owner_number == f_owner_number) xor - br_owner_number == f_owner_number)) + (br_owner_number == f_owner_number))) drawanim(middle(f_pos, bl_pos), anim, 0, &owner); if (br_owner_number == f_owner_number and - (r_owner_number == f_owner_number + ((r_owner_number == f_owner_number) xor - bl_owner_number == f_owner_number)) + (bl_owner_number == f_owner_number))) drawanim(middle(f_pos, br_pos), anim, 0, &owner); } Modified: trunk/src/trainingsite.cc =================================================================== --- trunk/src/trainingsite.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/trainingsite.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -339,7 +339,13 @@ * we only need to update the request structure. */ void TrainingSite::request_soldier_callback - (Game * g, Request * rq, Ware_Index, Worker * w, void * data) + (Game * g, +#ifndef NDEBUG + Request * rq, +#else + Request *, +#endif + Ware_Index, Worker * w, void * data) { TrainingSite* const tsite = static_cast<TrainingSite *>(data); Soldier* s = dynamic_cast<Soldier*>(w); Modified: trunk/src/trigger/trigger_conditional.cc =================================================================== --- trunk/src/trigger/trigger_conditional.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/trigger/trigger_conditional.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -262,7 +262,7 @@ : TriggerConditional_Binary(l, r) {} bool TriggerXOR::do_eval(bool const t1, bool const t2) const { - return t1 && !t2 || !t1 && t2; + return (t1 && !t2) || (!t1 && t2); } TriggerNOT::TriggerNOT(TriggerConditional & cond) Modified: trunk/src/ui/ui_basic/ui_button.cc =================================================================== --- trunk/src/ui/ui_basic/ui_button.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/ui/ui_basic/ui_button.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -144,8 +144,8 @@ // is that -1 >> 1 is -1 but -1 / 2 is 0). dst->blit (Point - (get_w() - static_cast<int32_t>(cpw) >> 1, - get_h() - static_cast<int32_t>(cph) >> 1), + ((get_w() - static_cast<int32_t>(cpw)) >> 1, + (get_h() - static_cast<int32_t>(cph)) >> 1), m_enabled ? m_pic_custom : m_pic_custom_disabled); } else if (m_title.length()) { // otherwise draw title string centered g_fh->draw_string Modified: trunk/src/ui/ui_basic/ui_checkbox.cc =================================================================== --- trunk/src/ui/ui_basic/ui_checkbox.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/ui/ui_basic/ui_checkbox.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -88,7 +88,7 @@ * Args: on true if the checkbox should be checked */ void Statebox::set_state(bool const on) { - if (on xor m_flags & Is_Checked) { + if (on xor (m_flags & Is_Checked)) { set_flags(Is_Checked, on); changed .call (); changedto .call (on); Modified: trunk/src/ui/ui_basic/ui_multilinetextarea.h =================================================================== --- trunk/src/ui/ui_basic/ui_multilinetextarea.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/ui/ui_basic/ui_multilinetextarea.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -74,7 +74,7 @@ bool handle_mousepress (Uint8 btn, int32_t x, int32_t y); const char * get_font_name() {return m_fontname.c_str();} - const int32_t get_font_size() {return m_fontsize;} + int32_t get_font_size() {return m_fontsize;} RGBColor & get_font_clr () {return m_fcolor;} private: Modified: trunk/src/ui/ui_basic/ui_table.h =================================================================== --- trunk/src/ui/ui_basic/ui_table.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/ui/ui_basic/ui_table.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -265,11 +265,13 @@ const Entry * operator[](const uint32_t i) const throw () {return static_cast<const Entry *>(Base::operator[](i));} - static const Entry * const get(const Entry_Record & er) - {return static_cast<const Entry *>(er.entry());} + static Entry const * get(const Entry_Record & er) { + return static_cast<Entry const *>(er.entry()); + } - const Entry * const get_selected() const - {return static_cast<const Entry *>(Base::get_selected());} + Entry const * get_selected() const { + return static_cast<Entry const *>(Base::get_selected()); + } }; template <typename Entry> struct Table<Entry * const> : public Table<void *> { @@ -289,11 +291,13 @@ Entry * operator[](const uint32_t i) const throw () {return static_cast<Entry *>(Base::operator[](i));} - static Entry * const get(const Entry_Record & er) - {return static_cast<Entry *>(er.entry());} + static Entry * get(Entry_Record const & er) { + return static_cast<Entry *>(er.entry()); + } - Entry * const get_selected() const - {return static_cast<Entry *>(Base::get_selected());} + Entry * get_selected() const { + return static_cast<Entry *>(Base::get_selected()); + } }; template <typename Entry> struct Table<const Entry &> : public Table<void *> { Modified: trunk/src/ui/ui_basic/ui_window.cc =================================================================== --- trunk/src/ui/ui_basic/ui_window.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/ui/ui_basic/ui_window.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -553,7 +553,7 @@ new_left -= VT_B_PIXMAP_THICKNESS; _drag_start_win_x -= VT_B_PIXMAP_THICKNESS; // avoid jumping } - if (not _is_minimal) // Minimal windows can not be bottom-docked. + if (not _is_minimal) { // minimal windows can not be bottom-docked if (new_top == max_y_minus_h) { if (not _docked_bottom) { dock_bottom(); @@ -567,6 +567,7 @@ new_top -= BT_B_PIXMAP_THICKNESS; _drag_start_win_y -= BT_B_PIXMAP_THICKNESS; // avoid jumping } + } } } set_pos(Point(new_left, new_top)); Modified: trunk/src/waresdisplay.cc =================================================================== --- trunk/src/waresdisplay.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/waresdisplay.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -54,7 +54,7 @@ assert(m_warelists.size()); Widelands::Ware_Index const index = - x < 0 | y < 0 ? + x < 0 or y < 0 ? Widelands::Ware_Index::Null() : Widelands::Ware_Index Modified: trunk/src/widelands_map_bobdata_data_packet.cc =================================================================== --- trunk/src/widelands_map_bobdata_data_packet.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/widelands_map_bobdata_data_packet.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -271,13 +271,14 @@ trans : 0; { - bool has_route = fr.Unsigned8(); - if (i < old_stacksize && state.route) + bool const has_route = fr.Unsigned8(); + if (i < old_stacksize && state.route) { if (!has_route) { delete state.route; state.route = 0; // in case we get an exception further down } else state.route->clear(); + } if (has_route) { Route * const route = Modified: trunk/src/wlapplication.cc =================================================================== --- trunk/src/wlapplication.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/wlapplication.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -204,8 +204,7 @@ * * \todo Return a reference - the return value is always valid anyway */ -WLApplication * const WLApplication::get(const int argc, const char **argv) -{ +WLApplication * WLApplication::get(int const argc, char const * * argv) { if (the_singleton==0) { the_singleton=new WLApplication(argc, argv); } @@ -333,8 +332,7 @@ * * \todo Catch Journalfile_error */ -const bool WLApplication::poll_event(SDL_Event *ev, const bool throttle) -{ +bool WLApplication::poll_event(SDL_Event *ev, const bool throttle) { bool haveevent=false; restart: @@ -560,8 +558,7 @@ * Return the current time, in milliseconds * \todo Use our internally defined time type */ -const int32_t WLApplication::get_time() -{ +int32_t WLApplication::get_time() { Uint32 time; time=SDL_GetTicks(); @@ -653,8 +650,7 @@ * Read the config file, parse the commandline and give all other internal * parameters sensible default values */ -const bool WLApplication::init_settings() -{ +bool WLApplication::init_settings() { Section *s=0; //create a journal so that handle_commandline_parameters can open the journal files @@ -717,8 +713,7 @@ * * \return true if there were no fatal errors that prevent the game from running */ -const bool WLApplication::init_hardware() -{ +bool WLApplication::init_hardware() { Uint32 sdl_flags=0; Section *s = g_options.pull_section("global"); Modified: trunk/src/wlapplication.h =================================================================== --- trunk/src/wlapplication.h 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/wlapplication.h 2008-04-21 17:08:13 UTC (rev 3187) @@ -146,15 +146,15 @@ */ struct WLApplication { - static WLApplication * const get(const int argc=0, const char **argv=0); + static WLApplication * get(int const argc = 0, char const * * argv = 0); ~WLApplication(); void run(); /// \warning true if an external entity wants us to quit - const bool should_die() {return m_should_die;} + bool should_die() {return m_should_die;} - const int32_t get_time(); + int32_t get_time(); /// Get the state of the current KeyBoard Button /// \warning This function doesn't check for dumbness @@ -213,12 +213,12 @@ protected: WLApplication(const int argc, const char **argv); - const bool poll_event(SDL_Event *ev, const bool throttle); + bool poll_event(SDL_Event *ev, const bool throttle); - const bool init_settings(); + bool init_settings(); void shutdown_settings(); - const bool init_hardware(); + bool init_hardware(); void shutdown_hardware(); void parse_commandline(const int argc, const char **argv); Modified: trunk/src/worker.cc =================================================================== --- trunk/src/worker.cc 2008-04-21 12:28:05 UTC (rev 3186) +++ trunk/src/worker.cc 2008-04-21 17:08:13 UTC (rev 3187) @@ -508,11 +508,12 @@ FindNodeAnd functor; functor.add(FindNodeSize(static_cast<FindNodeSize::Size>(action->iparam2))); - if (action->sparam1.size()) + if (action->sparam1.size()) { if (action->iparam4) functor.add(FindNodeResourceBreedable(w->get_resource(action->sparam1.c_str()))); else functor.add(FindNodeResource(w->get_resource(action->sparam1.c_str()))); + } if (action->iparam3) functor.add(FindNodeSpace(get_location(g))); @@ -2300,13 +2301,13 @@ // is center a mountain piece? bool is_center_mountain = - world.terrain_descr(owner_area.field->terrain_d()).get_is() - & - TERRAIN_MOUNTAIN + (world.terrain_descr(owner_area.field->terrain_d()).get_is() + & + TERRAIN_MOUNTAIN) | - world.terrain_descr(owner_area.field->terrain_r()).get_is() - & - TERRAIN_MOUNTAIN; + (world.terrain_descr(owner_area.field->terrain_r()).get_is() + & + TERRAIN_MOUNTAIN); // Only run towards fields that are on a mountain (or not) // depending on position of center bool is_target_mountain; @@ -2317,13 +2318,13 @@ target = map.get_fcoords(list[g->logic_rand() % list.size()]); is_target_mountain = - world.terrain_descr(target.field->terrain_d()).get_is() - & - TERRAIN_MOUNTAIN + (world.terrain_descr(target.field->terrain_d()).get_is() + & + TERRAIN_MOUNTAIN) | - world.terrain_descr(target.field->terrain_r()).get_is() - & - TERRAIN_MOUNTAIN; + (world.terrain_descr(target.field->terrain_r()).get_is() + & + TERRAIN_MOUNTAIN); if (i==0) i=list.size(); --i; --n; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |