[Widelands-cvs] SF.net SVN: widelands: [2761] trunk/src
Status: Beta
Brought to you by:
sirver
From: <be...@us...> - 2007-09-21 22:08:03
|
Revision: 2761 http://widelands.svn.sourceforge.net/widelands/?rev=2761&view=rev Author: bedouin Date: 2007-09-21 14:53:21 -0700 (Fri, 21 Sep 2007) Log Message: ----------- - change all "unsigned {char,short,int,long}" to uint{8|16|32|32}_t - change all "u{char,short,int,long}" (from types.h) to uint{8|16|32|32}_t - remove types.h Modified Paths: -------------- trunk/src/animation.cc trunk/src/animation.h trunk/src/animation_gfx.h trunk/src/areawatcher.cc trunk/src/areawatcher.h trunk/src/attack_controller.cc trunk/src/attack_controller.h trunk/src/battle.cc trunk/src/battle.h trunk/src/bob.cc trunk/src/bob.h trunk/src/building.cc trunk/src/building.h trunk/src/building_statistics_menu.cc trunk/src/building_statistics_menu.h trunk/src/building_ui.cc trunk/src/campvis.cc trunk/src/campvis.h trunk/src/carrier.cc trunk/src/cmd_queue.h trunk/src/computer_player.cc trunk/src/computer_player.h trunk/src/constructionsite.cc trunk/src/constructionsite.h trunk/src/critter_bob.cc trunk/src/critter_bob.h trunk/src/critter_bob_program.h trunk/src/editor/editorinteractive.cc trunk/src/editor/tools/editor_increase_resources_tool.cc trunk/src/editor/tools/editor_noise_height_tool.cc trunk/src/editor/tools/editor_set_starting_pos_tool.cc trunk/src/editor/ui_menus/editor_event_menu.cc trunk/src/editor/ui_menus/editor_event_menu.h trunk/src/editor/ui_menus/editor_event_menu_edit_eventchain.cc trunk/src/editor/ui_menus/editor_event_menu_edit_eventchain.h trunk/src/editor/ui_menus/editor_event_menu_edit_trigger_conditional.cc trunk/src/editor/ui_menus/editor_event_menu_edit_trigger_conditional.h trunk/src/editor/ui_menus/editor_event_menu_new_event.cc trunk/src/editor/ui_menus/editor_event_menu_new_event.h trunk/src/editor/ui_menus/editor_event_menu_new_trigger.cc trunk/src/editor/ui_menus/editor_event_menu_new_trigger.h trunk/src/editor/ui_menus/editor_main_menu_load_map.cc trunk/src/editor/ui_menus/editor_main_menu_load_map.h trunk/src/editor/ui_menus/editor_main_menu_new_map.h trunk/src/editor/ui_menus/editor_main_menu_save_map.cc trunk/src/editor/ui_menus/editor_main_menu_save_map.h trunk/src/editor/ui_menus/editor_objectives_menu.cc trunk/src/editor/ui_menus/editor_objectives_menu.h trunk/src/editor/ui_menus/editor_player_menu.cc trunk/src/editor/ui_menus/editor_player_menu.h trunk/src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.cc trunk/src/editor/ui_menus/editor_player_menu_allowed_buildings_menu.h trunk/src/editor/ui_menus/editor_tool_change_resources_options_menu.cc trunk/src/editor/ui_menus/editor_tool_options_menu.cc trunk/src/editor/ui_menus/editor_tool_options_menu.h trunk/src/editor/ui_menus/editor_tool_place_bob_options_menu.cc trunk/src/editor/ui_menus/editor_tool_place_immovable_options_menu.cc trunk/src/editor/ui_menus/editor_tool_set_terrain_options_menu.cc trunk/src/editor/ui_menus/editor_tool_set_terrain_options_menu.h trunk/src/editor/ui_menus/editor_toolsize_menu.cc trunk/src/editor/ui_menus/editor_variables_menu.cc trunk/src/editor/ui_menus/editor_variables_menu.h trunk/src/editor/ui_menus/event_message_box_option_menu.cc trunk/src/editor/ui_menus/event_message_box_option_menu.h trunk/src/editor/ui_menus/trigger_building_option_menu.h trunk/src/editor_game_base.cc trunk/src/editor_game_base.h trunk/src/encyclopedia_window.cc trunk/src/encyclopedia_window.h trunk/src/events/event.cc trunk/src/events/event.h trunk/src/events/event_chain.cc trunk/src/events/event_chain.h trunk/src/events/event_factory.cc trunk/src/events/event_factory.h trunk/src/events/event_message_box.cc trunk/src/field.h trunk/src/fieldaction.cc trunk/src/fileread.h trunk/src/filesystem/disk_filesystem.cc trunk/src/filesystem/disk_filesystem.h trunk/src/filesystem/filesystem.cc trunk/src/filesystem/filesystem.h trunk/src/filesystem/layered_filesystem.cc trunk/src/filesystem/layered_filesystem.h trunk/src/filesystem/zip_filesystem.cc trunk/src/filesystem/zip_filesystem.h trunk/src/filewrite.cc trunk/src/font_handler.cc trunk/src/font_handler.h trunk/src/font_loader.cc trunk/src/game.cc trunk/src/game.h trunk/src/game_chat_menu.cc trunk/src/game_cmd_queue_data_packet.cc trunk/src/game_debug_ui.cc trunk/src/game_interactive_player_data_packet.cc trunk/src/game_main_menu.h trunk/src/game_main_menu_load_game.cc trunk/src/game_main_menu_load_game.h trunk/src/game_main_menu_save_game.cc trunk/src/game_main_menu_save_game.h trunk/src/game_objectives_menu.cc trunk/src/game_objectives_menu.h trunk/src/game_options_menu.h trunk/src/game_options_sound_menu.cc trunk/src/game_options_sound_menu.h trunk/src/game_player_economies_data_packet.cc trunk/src/game_player_info_data_packet.cc trunk/src/game_preload_data_packet.h trunk/src/game_server_connection.cc trunk/src/game_server_connection.h trunk/src/game_server_proto.h trunk/src/game_server_proto_packet.h trunk/src/game_server_proto_packet_chatmessage.cc trunk/src/game_server_proto_packet_chatmessage.h trunk/src/game_server_proto_packet_connect.cc trunk/src/game_server_proto_packet_connect.h trunk/src/game_server_proto_packet_getroominfo.cc trunk/src/game_server_proto_packet_getroominfo.h trunk/src/game_server_proto_packet_getuserinfo.cc trunk/src/game_server_proto_packet_getuserinfo.h trunk/src/game_server_proto_packet_hello.cc trunk/src/game_server_proto_packet_hello.h trunk/src/game_server_proto_packet_ping.cc trunk/src/game_server_proto_packet_ping.h trunk/src/game_server_proto_packet_userentered.cc trunk/src/game_server_proto_packet_userentered.h trunk/src/game_tips.cc trunk/src/game_tips.h trunk/src/general_statistics_menu.cc trunk/src/geometry.h trunk/src/graphic.cc trunk/src/graphic.h trunk/src/helper.cc trunk/src/immovable.cc trunk/src/immovable.h trunk/src/immovable_program.h trunk/src/instances.cc trunk/src/instances.h trunk/src/interactive_base.cc trunk/src/interactive_base.h trunk/src/interactive_player.cc trunk/src/interactive_player.h trunk/src/interactive_spectator.cc trunk/src/item_ware_descr.h trunk/src/journal.cc trunk/src/journal.h trunk/src/journal_exceptions.cc trunk/src/journal_exceptions.h trunk/src/machdep.h trunk/src/map.cc trunk/src/map.h trunk/src/map_event_manager.cc trunk/src/map_eventchain_manager.cc trunk/src/map_objective_manager.cc trunk/src/map_trigger_manager.cc trunk/src/map_variable_manager.cc trunk/src/maphollowregion.cc trunk/src/maphollowregion.h trunk/src/maptriangleregion.cc trunk/src/maptriangleregion.h trunk/src/mapview.cc trunk/src/mapview.h trunk/src/mapviewpixelfunctions.cc trunk/src/mapviewpixelfunctions.h trunk/src/md5.cc trunk/src/md5.h trunk/src/militarysite.cc trunk/src/militarysite.h trunk/src/minimap.cc trunk/src/minimap.h trunk/src/network.cc trunk/src/network.h trunk/src/network_buffer.cc trunk/src/network_buffer.h trunk/src/network_ggz.cc trunk/src/network_ggz.h trunk/src/network_lan_promotion.cc trunk/src/network_lan_promotion.h trunk/src/network_system.h trunk/src/overlay_manager.cc trunk/src/overlay_manager.h trunk/src/player.cc trunk/src/player.h trunk/src/playercommand.h trunk/src/playerdescrgroup.cc trunk/src/playerdescrgroup.h trunk/src/production_program.cc trunk/src/production_program.h trunk/src/productionsite.cc trunk/src/productionsite.h trunk/src/profile.cc trunk/src/profile.h trunk/src/queue_cmd_factory.cc trunk/src/queue_cmd_factory.h trunk/src/random.cc trunk/src/random.h trunk/src/render.cc trunk/src/rendertarget.cc trunk/src/rendertarget.h trunk/src/replay.cc trunk/src/replay.h trunk/src/rgbcolor.h trunk/src/s2map.cc trunk/src/s2map.h trunk/src/soldier.cc trunk/src/soldier.h trunk/src/sound/sound_handler.cc trunk/src/sound/sound_handler.h trunk/src/stock_menu.cc trunk/src/stock_menu.h trunk/src/streamwrite.cc trunk/src/surface.cc trunk/src/surface.h trunk/src/terrain.h trunk/src/text_parser.cc trunk/src/texture.cc trunk/src/texture.h trunk/src/trackptr.h trunk/src/trainingsite.cc trunk/src/trainingsite.h trunk/src/transport.cc trunk/src/transport.h trunk/src/transport_draw.cc trunk/src/tribe.cc trunk/src/tribe.h trunk/src/tribedata.h trunk/src/trigger/trigger.cc trunk/src/trigger/trigger.h trunk/src/trigger/trigger_building.cc trunk/src/trigger/trigger_building.h trunk/src/trigger/trigger_conditional.cc trunk/src/trigger/trigger_factory.cc trunk/src/trigger/trigger_factory.h trunk/src/trigger/trigger_time.h trunk/src/ui/ui_basic/ui_box.cc trunk/src/ui/ui_basic/ui_box.h trunk/src/ui/ui_basic/ui_button.cc trunk/src/ui/ui_basic/ui_button.h trunk/src/ui/ui_basic/ui_checkbox.cc trunk/src/ui/ui_basic/ui_checkbox.h trunk/src/ui/ui_basic/ui_editbox.cc trunk/src/ui/ui_basic/ui_editbox.h trunk/src/ui/ui_basic/ui_icongrid.cc trunk/src/ui/ui_basic/ui_icongrid.h trunk/src/ui/ui_basic/ui_listselect.cc trunk/src/ui/ui_basic/ui_listselect.h trunk/src/ui/ui_basic/ui_multilineeditbox.cc trunk/src/ui/ui_basic/ui_multilineeditbox.h trunk/src/ui/ui_basic/ui_multilinetextarea.cc trunk/src/ui/ui_basic/ui_multilinetextarea.h trunk/src/ui/ui_basic/ui_panel.cc trunk/src/ui/ui_basic/ui_panel.h trunk/src/ui/ui_basic/ui_progressbar.cc trunk/src/ui/ui_basic/ui_progressbar.h trunk/src/ui/ui_basic/ui_progresswindow.cc trunk/src/ui/ui_basic/ui_progresswindow.h trunk/src/ui/ui_basic/ui_radiobutton.cc trunk/src/ui/ui_basic/ui_radiobutton.h trunk/src/ui/ui_basic/ui_scrollbar.cc trunk/src/ui/ui_basic/ui_scrollbar.h trunk/src/ui/ui_basic/ui_slider.cc trunk/src/ui/ui_basic/ui_slider.h trunk/src/ui/ui_basic/ui_table.cc trunk/src/ui/ui_basic/ui_table.h trunk/src/ui/ui_basic/ui_tabpanel.cc trunk/src/ui/ui_basic/ui_tabpanel.h trunk/src/ui/ui_basic/ui_textarea.cc trunk/src/ui/ui_basic/ui_textarea.h trunk/src/ui/ui_basic/ui_window.cc trunk/src/ui/ui_basic/ui_window.h trunk/src/ui/ui_fs_menus/fullscreen_menu_base.h trunk/src/ui/ui_fs_menus/fullscreen_menu_campaign_select.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_campaign_select.h trunk/src/ui/ui_fs_menus/fullscreen_menu_inet_lobby.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_launchgame.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_loadgame.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_loadgame.h trunk/src/ui/ui_fs_menus/fullscreen_menu_loadreplay.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_loadreplay.h trunk/src/ui/ui_fs_menus/fullscreen_menu_mapselect.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_mapselect.h trunk/src/ui/ui_fs_menus/fullscreen_menu_netsetup.cc trunk/src/ui/ui_fs_menus/fullscreen_menu_netsetup.h trunk/src/ui/ui_fs_menus/fullscreen_menu_options.cc trunk/src/ware_statistics_menu.cc trunk/src/warehouse.cc trunk/src/warehouse.h trunk/src/warelist.cc trunk/src/waresdisplay.cc trunk/src/waresdisplay.h trunk/src/watchwindow.cc trunk/src/wexception.h trunk/src/widelands_map_attack_controller_data_packet.cc trunk/src/widelands_map_bob_data_packet.cc trunk/src/widelands_map_bobdata_data_packet.cc trunk/src/widelands_map_building_data_packet.cc trunk/src/widelands_map_buildingdata_data_packet.cc trunk/src/widelands_map_data_packet_ids.h trunk/src/widelands_map_elemental_data_packet.h trunk/src/widelands_map_event_chain_data_packet.cc trunk/src/widelands_map_extradata_data_packet.cc trunk/src/widelands_map_flag_data_packet.cc trunk/src/widelands_map_flagdata_data_packet.cc trunk/src/widelands_map_heights_data_packet.cc trunk/src/widelands_map_immovable_data_packet.cc trunk/src/widelands_map_immovabledata_data_packet.cc trunk/src/widelands_map_map_object_loader.cc trunk/src/widelands_map_map_object_loader.h trunk/src/widelands_map_map_object_saver.cc trunk/src/widelands_map_map_object_saver.h trunk/src/widelands_map_owned_fields_data_packet.cc trunk/src/widelands_map_players_view_data_packet.cc trunk/src/widelands_map_resources_data_packet.cc trunk/src/widelands_map_road_data_packet.cc trunk/src/widelands_map_roaddata_data_packet.cc trunk/src/widelands_map_terrain_data_packet.cc trunk/src/widelands_map_ware_data_packet.cc trunk/src/widelands_map_waredata_data_packet.cc trunk/src/wlapplication.cc trunk/src/workarea_info.h trunk/src/worker.cc trunk/src/worker.h trunk/src/worker_descr.h trunk/src/worker_program.cc trunk/src/worker_program.h trunk/src/world.cc trunk/src/world.h trunk/src/worlddata.h trunk/src/wui_plot_area.cc trunk/src/wui_plot_area.h Removed Paths: ------------- trunk/src/types.h Modified: trunk/src/animation.cc =================================================================== --- trunk/src/animation.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/animation.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -22,6 +22,7 @@ #include "bob.h" #include "constants.h" #include "profile.h" +#include <stdint.h> #include "sound/sound_handler.h" #include "wexception.h" @@ -148,10 +149,10 @@ * \param picnametempl a template for the picture names * \param encdefaults default values for player colors, see \ref EncodeData */ -uint AnimationManager::get(const char *directory, Section *s, const char *picnametempl, +uint32_t AnimationManager::get(const char *directory, Section *s, const char *picnametempl, const EncodeData *encdefaults) { - uint id; + uint32_t id; AnimationData* ad; m_animations.push_back(AnimationData()); @@ -221,7 +222,7 @@ Return the number of animations. =============== */ -uint AnimationManager::get_nranimations() const +uint32_t AnimationManager::get_nranimations() const { return m_animations.size(); } @@ -235,7 +236,7 @@ Returns 0 if the animation doesn't exist. =============== */ -const AnimationData* AnimationManager::get_animation(uint id) const +const AnimationData* AnimationManager::get_animation(uint32_t id) const { if (!id || id > m_animations.size()) return 0; @@ -251,12 +252,12 @@ * \par animation The animation to check. * \par framenumber The framenumber currently on display. * - * \note uint animation is an ID number that starts at 1, not a vector index that starts at 0 ! + * \note uint32_t animation is an ID number that starts at 1, not a vector index that starts at 0 ! * * \sa AnimationManager::get * \sa RenderTargetImpl::drawanim */ -void AnimationManager::trigger_soundfx(uint animation, uint framenumber, uint stereo_position) +void AnimationManager::trigger_soundfx(uint32_t animation, uint32_t framenumber, uint32_t stereo_position) { return; //temporarily disabled #fweber 30jan2006 @@ -285,12 +286,12 @@ =============== */ DirAnimations::DirAnimations -(const uint dir1, - const uint dir2, - const uint dir3, - const uint dir4, - const uint dir5, - const uint dir6) +(const uint32_t dir1, + const uint32_t dir2, + const uint32_t dir3, + const uint32_t dir4, + const uint32_t dir5, + const uint32_t dir6) { m_animations[0] = dir1; m_animations[1] = dir2; Modified: trunk/src/animation.h =================================================================== --- trunk/src/animation.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/animation.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -24,6 +24,7 @@ #include "instances.h" #include "rgbcolor.h" +#include <stdint.h> #include <string> #include <vector> #include <map> @@ -41,14 +42,14 @@ }; struct AnimationData { - uint frametime; + uint32_t frametime; Point hotspot; EncodeData encdata; std::string picnametempl; /** mapping of soundeffect name to frame number, indexed by frame number * \sa AnimationManager::trigger_sfx */ - std::map<uint, std::string> sfx_cues; + std::map<uint32_t, std::string> sfx_cues; }; /** @@ -66,13 +67,13 @@ ~AnimationManager(); void flush(); - uint get(const char *directory, Section *s, const char *picnametempl = 0, + uint32_t get(const char *directory, Section *s, const char *picnametempl = 0, const EncodeData *encdefaults = 0); // for use by the graphics subsystem - uint get_nranimations() const; - const AnimationData* get_animation(uint id) const; - void trigger_soundfx(uint animation, uint framenumber, uint stereo_position); + uint32_t get_nranimations() const; + const AnimationData* get_animation(uint32_t id) const; + void trigger_soundfx(uint32_t animation, uint32_t framenumber, uint32_t stereo_position); private: std::vector<AnimationData> m_animations; @@ -85,23 +86,23 @@ */ struct DirAnimations { DirAnimations - (const uint dir1 = 0, - const uint dir2 = 0, - const uint dir3 = 0, - const uint dir4 = 0, - const uint dir5 = 0, - const uint dir6 = 0); + (const uint32_t dir1 = 0, + const uint32_t dir2 = 0, + const uint32_t dir3 = 0, + const uint32_t dir4 = 0, + const uint32_t dir5 = 0, + const uint32_t dir6 = 0); ~DirAnimations(); void parse(Map_Object_Descr* b, const char *directory, Profile *prof, const char *sectnametempl, Section *defaults = 0, const EncodeData *encdefaults = 0); - uint get_animation(const int dir) const throw () + uint32_t get_animation(const int dir) const throw () {return m_animations[dir - 1];} private: - uint m_animations[6]; + uint32_t m_animations[6]; }; extern AnimationManager g_anim; Modified: trunk/src/animation_gfx.h =================================================================== --- trunk/src/animation_gfx.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/animation_gfx.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -21,6 +21,7 @@ #define included_animation_gfx_h #include "player.h" +#include <stdint.h> struct Surface; @@ -47,7 +48,7 @@ } private: - void encode(uchar plyr, const RGBColor*); + void encode(uint8_t plyr, const RGBColor*); Frames * m_plrframes; EncodeData m_encodedata; Modified: trunk/src/areawatcher.cc =================================================================== --- trunk/src/areawatcher.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/areawatcher.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -23,7 +23,7 @@ #include "player.h" -void AreaWatcher::act(Game * game, uint) +void AreaWatcher::act(Game * game, uint32_t) {game->player(player_number).remove_areawatcher(*this); remove(game);} Modified: trunk/src/areawatcher.h =================================================================== --- trunk/src/areawatcher.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/areawatcher.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -22,6 +22,7 @@ #include "instances.h" #include "player_area.h" +#include <stdint.h> struct AreaWatcher_Descr; @@ -40,7 +41,7 @@ AreaWatcher(const Player_Area<>); virtual int get_type() const throw () {return AREAWATCHER;} static AreaWatcher & create(Editor_Game_Base &, const Player_Area<>); - virtual void act(Game *, uint data); + virtual void act(Game *, uint32_t data); }; #endif Modified: trunk/src/attack_controller.cc =================================================================== --- trunk/src/attack_controller.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/attack_controller.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -65,10 +65,10 @@ } } -uint getMaxAttackSoldiers +uint32_t getMaxAttackSoldiers (const Editor_Game_Base & eg, const Flag & flag, const Player_Number player) { - uint maxAttackSoldiers = 0; + uint32_t maxAttackSoldiers = 0; std::set<OPtr<MilitarySite> > militarySites; getCloseMilitarySites(eg, flag, player, militarySites); @@ -112,7 +112,7 @@ } //Methods inherited by BaseImmovable -void AttackController::act (Game* game, uint) { +void AttackController::act (Game* game, uint32_t) { schedule_act(game, 10000); // Check every 10sec if the battle is deadlocked } @@ -128,7 +128,7 @@ } //end inherited -void AttackController::launchAttack(uint nrAttackers) { +void AttackController::launchAttack(uint32_t nrAttackers) { launchAllSoldiers(true, nrAttackers); //always try to launch two more defenders than attackers if (!launchAllSoldiers(false, nrAttackers+2)) { @@ -157,8 +157,8 @@ ++it) { MilitarySite* ms = OPtr<MilitarySite>(*it).get(&egbase()); - uint soldiersOfMs = ms->nr_attack_soldiers(); - const uint nrLaunch = (max > -1 and (soldiersOfMs > static_cast<uint>(max)) ? static_cast<uint>(max) : soldiersOfMs); + uint32_t soldiersOfMs = ms->nr_attack_soldiers(); + const uint32_t nrLaunch = (max > -1 and (soldiersOfMs > static_cast<uint32_t>(max)) ? static_cast<uint32_t>(max) : soldiersOfMs); if (nrLaunch == 0) continue; launchedSoldier = true; @@ -177,11 +177,11 @@ void AttackController::launchSoldiersOfMilitarySite (MilitarySite* militarySite, - uint nrLaunch, + uint32_t nrLaunch, bool attackers) { assert(nrLaunch); - uint launched = 0; + uint32_t launched = 0; const std::vector<Soldier *> & soldiers = militarySite->get_soldiers(); std::vector<Soldier *>::const_iterator soldiers_end = soldiers.end(); @@ -248,7 +248,7 @@ void AttackController::soldierWon(Soldier* soldier) { - uint idx = getBattleSoldierIndex(soldier); + uint32_t idx = getBattleSoldierIndex(soldier); involvedSoldiers[idx].fighting = false; if (opponentsLeft(soldier)) { @@ -264,7 +264,7 @@ dynamic_cast<MilitarySite *>(flag->get_building())) { // There are defending soldiers left in the building. - if (const uint n = ms->nr_not_marked_soldiers()) { + if (const uint32_t n = ms->nr_not_marked_soldiers()) { launchSoldiersOfMilitarySite(ms, n, false); return; } @@ -289,7 +289,7 @@ building.destroy(&egbase()); } - for (uint i=0;i<involvedSoldiers.size();i++) { + for (uint32_t i=0;i<involvedSoldiers.size();i++) { //involvedSoldiers[i].soldier->set_economy(0); involvedSoldiers[i].soldier->set_location(involvedSoldiers[i].origin); involvedSoldiers[i].soldier->send_signal(dynamic_cast<Game*>(&egbase()), "return_home"); @@ -301,16 +301,16 @@ bool AttackController::startBattle(Soldier* soldier, bool isArrived) { - uint s1Index = getBattleSoldierIndex(soldier); + uint32_t s1Index = getBattleSoldierIndex(soldier); involvedSoldiers[s1Index].arrived = isArrived; - for (uint i=0;i<involvedSoldiers.size();i++) { + for (uint32_t i=0;i<involvedSoldiers.size();i++) { if (involvedSoldiers[i].arrived && !involvedSoldiers[i].fighting && (involvedSoldiers[i].attacker != involvedSoldiers[s1Index].attacker)) { involvedSoldiers[i].fighting = true; involvedSoldiers[s1Index].fighting = true; Battle* battle = egbase().create_battle(); - uint rnd = dynamic_cast<Game*>(&egbase())->logic_rand() % 11; + uint32_t rnd = dynamic_cast<Game*>(&egbase())->logic_rand() % 11; if (rnd <= 5) battle->soldiers(involvedSoldiers[i].soldier, involvedSoldiers[s1Index].soldier); else @@ -326,17 +326,17 @@ bool AttackController::opponentsLeft(Soldier* soldier) { - uint idx = getBattleSoldierIndex(soldier); - for (uint i=0;i<involvedSoldiers.size();i++) { + uint32_t idx = getBattleSoldierIndex(soldier); + for (uint32_t i=0;i<involvedSoldiers.size();i++) { if (involvedSoldiers[i].attacker != involvedSoldiers[idx].attacker) return true; } return false; } -uint AttackController::getBattleSoldierIndex(Soldier* soldier) +uint32_t AttackController::getBattleSoldierIndex(Soldier* soldier) { - for (uint i=0;i<involvedSoldiers.size();i++) { + for (uint32_t i=0;i<involvedSoldiers.size();i++) { if (involvedSoldiers[i].soldier == soldier) return i; } @@ -345,7 +345,7 @@ void AttackController::removeSoldier(Soldier* soldier) { - uint idx = getBattleSoldierIndex(soldier); + uint32_t idx = getBattleSoldierIndex(soldier); involvedSoldiers[idx].battleGround = Coords::Null(); if (idx < (involvedSoldiers.size()-1)) { involvedSoldiers[idx] = involvedSoldiers[involvedSoldiers.size() -1]; @@ -355,7 +355,7 @@ bool AttackController::battleGroundOccupied(Coords coords) { - for (uint i=0;i<involvedSoldiers.size();i++) { + for (uint32_t i=0;i<involvedSoldiers.size();i++) { if (involvedSoldiers[i].battleGround == coords) { return true; } @@ -382,7 +382,7 @@ CheckStepDefault step(battleSoldier->soldier->get_movecaps()); - for (uint i=0;i<20;i++) { + for (uint32_t i=0;i<20;i++) { map->get_neighbour(prevCoords, walkDir[walkDirIndex], &newCoords); if (step.allowed(map, prevCoords, newCoords, walkDir[walkDirIndex], CheckStep::stepNormal)) { @@ -425,11 +425,11 @@ ctrl->totallyLaunched = fr.Unsigned32(); ctrl->attackedMsEmpty = fr.Unsigned8(); - uint numBs = fr.Unsigned32(); + uint32_t numBs = fr.Unsigned32(); - for (uint j = 0; j < numBs; ++j) { - uint soldier = fr.Unsigned32(); - uint origin = fr.Unsigned32(); + for (uint32_t j = 0; j < numBs; ++j) { + uint32_t soldier = fr.Unsigned32(); + uint32_t origin = fr.Unsigned32(); Coords battleGround; try { @@ -469,8 +469,8 @@ soldiers.push_back(bsd); } - uint numInMs = fr.Unsigned32(); - for (uint j = 0; j < numInMs; ++j) + uint32_t numInMs = fr.Unsigned32(); + for (uint32_t j = 0; j < numInMs; ++j) militarySites.push_back(fr.Unsigned32()); } @@ -484,7 +484,7 @@ ctrl->flag = dynamic_cast<Flag*>(mol().get_object_by_file_index(flag)); assert(ctrl->flag); - for (uint j = 0; j < soldiers.size(); ++j) { + for (uint32_t j = 0; j < soldiers.size(); ++j) { const BattleSoldierData& bsd = soldiers[j]; BattleSoldier& bs = ctrl->involvedSoldiers[j]; @@ -496,7 +496,7 @@ bs.soldier->set_attack_ctrl(ctrl); } - for (uint j = 0; j < militarySites.size(); ++j) { + for (uint32_t j = 0; j < militarySites.size(); ++j) { MilitarySite* ms = dynamic_cast<MilitarySite*> (mol().get_object_by_file_index(militarySites[j])); @@ -528,7 +528,7 @@ //write battle soldier structure of involved soldiers fw.Unsigned32(involvedSoldiers.size()); - for (uint j = 0; j < involvedSoldiers.size(); ++j) { + for (uint32_t j = 0; j < involvedSoldiers.size(); ++j) { BattleSoldier bs = involvedSoldiers[j]; fw.Unsigned32(mos->get_object_file_index(bs.soldier)); Modified: trunk/src/attack_controller.h =================================================================== --- trunk/src/attack_controller.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/attack_controller.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -26,6 +26,7 @@ #include "widelands.h" #include <set> +#include <stdint.h> #include <vector> class Editor_Game_Base; @@ -36,7 +37,7 @@ class Widelands_Map_Attack_Controller_Data_Packet; -uint getMaxAttackSoldiers(const Editor_Game_Base &, const Flag &, const Player_Number); +uint32_t getMaxAttackSoldiers(const Editor_Game_Base &, const Flag &, const Player_Number); struct AttackController : public BaseImmovable { friend class Widelands_Map_Attack_Controller_Data_Packet; @@ -44,14 +45,14 @@ AttackController(Editor_Game_Base* eg, Flag* flag, int attacker, int defender); AttackController(Editor_Game_Base &); ~AttackController(); - void launchAttack(uint nrAttackers); + void launchAttack(uint32_t nrAttackers); //Methods inherited by BaseImmovable virtual int get_type () const throw () {return ATTACKCONTROLLER;} virtual int get_size () const throw () {return SMALL;} virtual bool get_passable() const throw () {return false;} virtual void draw (const Editor_Game_Base &, RenderTarget &, const FCoords, const Point) {} - virtual void act (Game*, uint); + virtual void act (Game*, uint32_t); virtual void init(Editor_Game_Base*); virtual void cleanup (Editor_Game_Base*); //end inherited @@ -79,12 +80,12 @@ void calcBattleGround(BattleSoldier*, int); bool launchAllSoldiers(bool attackers, int nrLaunch); - void launchSoldiersOfMilitarySite(MilitarySite* militarySite, uint nrLaunch, bool attackers); + void launchSoldiersOfMilitarySite(MilitarySite* militarySite, uint32_t nrLaunch, bool attackers); bool moveToBattle(Soldier* soldier, MilitarySite* militarySite, bool attackers); bool startBattle(Soldier*, bool); void removeSoldier(Soldier*); - uint getBattleSoldierIndex(Soldier*); + uint32_t getBattleSoldierIndex(Soldier*); bool opponentsLeft(Soldier* soldier); std::vector<BattleSoldier> involvedSoldiers; @@ -94,7 +95,7 @@ int attackingPlayer; int defendingPlayer; - uint totallyLaunched; + uint32_t totallyLaunched; bool attackedMsEmpty; Flag* flag; Editor_Game_Base* m_egbase; @@ -106,13 +107,13 @@ virtual void load_pointers(); struct BattleSoldierData { - uint soldier; - uint origin; + uint32_t soldier; + uint32_t origin; }; - uint flag; + uint32_t flag; std::vector<BattleSoldierData> soldiers; - std::vector<uint> militarySites; + std::vector<uint32_t> militarySites; }; public: Modified: trunk/src/battle.cc =================================================================== --- trunk/src/battle.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/battle.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -92,7 +92,7 @@ } -void Battle::act (Game * g, uint) +void Battle::act (Game * g, uint32_t) { log ("Battle::act\n"); @@ -135,15 +135,15 @@ // Put attack animation //attacker->start_animation(g, "attack", 1000); - uint hit = g->logic_rand() % 100; + uint32_t hit = g->logic_rand() % 100; log (" hit=%d ", hit); //FIXME: correct implementaion if (hit > defender->get_evade()) { - uint attack = attacker->get_min_attack() + + uint32_t attack = attacker->get_min_attack() + (g->logic_rand() % (attacker->get_max_attack() - attacker->get_min_attack() -1)); - uint defend = defender->get_defense(); + uint32_t defend = defender->get_defense(); defend = (attack * defend) / 100; log (" attack(%d)=%d ", attacker->get_serial(), attack); Modified: trunk/src/battle.h =================================================================== --- trunk/src/battle.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/battle.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -22,6 +22,7 @@ #include "immovable.h" #include "soldier.h" +#include <stdint.h> struct Battle : public BaseImmovable { @@ -42,7 +43,7 @@ void init (Editor_Game_Base*, Soldier*, Soldier*); void soldiers (Soldier*, Soldier*); virtual void cleanup (Editor_Game_Base*); - virtual void act (Game*, uint); + virtual void act (Game*, uint32_t); private: Soldier* m_first; @@ -56,8 +57,8 @@ virtual void load(FileRead&); virtual void load_pointers(); - uint m_first; - uint m_second; + uint32_t m_first; + uint32_t m_second; }; public: Modified: trunk/src/bob.cc =================================================================== --- trunk/src/bob.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/bob.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -40,7 +40,7 @@ * * \returns radius (in fields) of area that the bob can see */ -uint Bob::Descr::vision_range() const +uint32_t Bob::Descr::vision_range() const { if (m_owner_tribe) return m_owner_tribe->get_bob_vision_range(); @@ -77,7 +77,7 @@ global= prof->get_safe_section("global"); while (global->get_next_string("attrib", &string)) { - uint attrib = get_attribute_id(string); + uint32_t attrib = get_attribute_id(string); if (attrib < Map_Object::HIGHEST_FIXED_ATTRIBUTE) throw wexception("Bad attribute '%s'", string); @@ -268,7 +268,7 @@ * * Change to the next task if necessary. */ -void Bob::act(Game* g, uint data) +void Bob::act(Game* g, uint32_t data) { if (!m_stack.size()) { assert(m_sched_init_task); @@ -313,7 +313,7 @@ m_in_act = true; for (;;) { - uint origactid; + uint32_t origactid; origactid = m_actid; @@ -403,7 +403,7 @@ * Schedule a new act for the current task. All other pending acts are * cancelled. */ -void Bob::schedule_act(Game* g, uint tdelta) +void Bob::schedule_act(Game* g, uint32_t tdelta) { Map_Object::schedule_act(g, tdelta, ++m_actid); } @@ -501,7 +501,7 @@ m_signal = sig; - for (uint i = 0; i < m_stack.size(); i++) { + for (uint32_t i = 0; i < m_stack.size(); i++) { State* state = &m_stack[i]; if (state->task->mask) { @@ -561,7 +561,7 @@ * * This task always succeeds unless interrupted. */ -void Bob::start_task_idle(Game* g, uint anim, int timeout) +void Bob::start_task_idle(Game* g, uint32_t anim, int timeout) { State* state; @@ -911,7 +911,7 @@ /** * Set a looping animation, starting now. */ -void Bob::set_animation(Editor_Game_Base* g, uint anim) +void Bob::set_animation(Editor_Game_Base* g, uint32_t anim) { m_anim = anim; m_animstart = g->get_gametime(); @@ -928,7 +928,7 @@ * \note Returns a negative value when we can't walk into the requested * direction. */ -int Bob::start_walk(Game *g, WalkingDir dir, uint a, bool force) +int Bob::start_walk(Game *g, WalkingDir dir, uint32_t a, bool force) { FCoords newf; @@ -938,7 +938,7 @@ // // The somewhat crazy check involving MOVECAPS_SWIM should allow swimming objects to // temporarily land. - const uint movecaps = get_movecaps(); + const uint32_t movecaps = get_movecaps(); if (not force @@ -1049,7 +1049,7 @@ molog("Stack size: %i\n", m_stack.size()); - for (uint i=0; i<m_stack.size(); i++) { + for (uint32_t i=0; i<m_stack.size(); i++) { molog("Stack dump %i/%i\n", i+1, m_stack.size()); molog("* task->name: %s\n", m_stack[i].task->name); Modified: trunk/src/bob.h =================================================================== --- trunk/src/bob.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/bob.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -23,6 +23,7 @@ #include "animation.h" #include <cassert> +#include <stdint.h> /// \todo (Antonio Trueba#1#): Get rid of forward declarations (cleanup of other headers needed) class Map; @@ -116,7 +117,7 @@ Profile *prof, Tribe_Descr* tribe); - uint vision_range() const; + uint32_t vision_range() const; protected: virtual Bob * create_object() const = 0; @@ -132,19 +133,19 @@ MO_DESCR(Descr); - uint get_current_anim() const {return m_anim;} + uint32_t get_current_anim() const {return m_anim;} int get_animstart() const {return m_animstart;} virtual int get_type() const throw () {return BOB;} virtual Type get_bob_type() const throw () = 0; - virtual uint get_movecaps() const throw () {return 0;} + virtual uint32_t get_movecaps() const throw () {return 0;} const std::string & name() const throw () {return descr().name();} virtual void init(Editor_Game_Base*); virtual void cleanup(Editor_Game_Base*); - virtual void act(Game*, uint data); + virtual void act(Game*, uint32_t data); void schedule_destroy(Game* g); - void schedule_act(Game* g, uint tdelta); + void schedule_act(Game* g, uint32_t tdelta); void skip_act(); void force_skip_act(); Point calc_drawpos(const Editor_Game_Base &, const Point) const; @@ -155,7 +156,7 @@ Bob * get_next_bob() const throw () {return m_linknext;} bool is_world_bob() const throw () {return descr().is_world_bob();} - uint vision_range() const {return descr().vision_range();} + uint32_t vision_range() const {return descr().vision_range();} virtual void draw(const Editor_Game_Base &, RenderTarget &, const Point) const; @@ -167,7 +168,7 @@ // default tasks void reset_tasks(Game*); void send_signal(Game*, std::string sig); - void start_task_idle(Game*, uint anim, int timeout); + void start_task_idle(Game*, uint32_t anim, int timeout); bool start_task_movepath(Game*, const Coords dest, const int persist, const DirAnimations &, @@ -209,8 +210,8 @@ virtual void init_auto_task(Game*) {}; // low level animation and walking handling - void set_animation(Editor_Game_Base* g, uint anim); - int start_walk(Game* g, WalkingDir dir, uint anim, bool force = false); + void set_animation(Editor_Game_Base* g, uint32_t anim); + int start_walk(Game* g, WalkingDir dir, uint32_t anim, bool force = false); /** * Call this from your task_act() function that was scheduled after @@ -243,8 +244,8 @@ FCoords m_position; // where are we right now? Bob * m_linknext; // next object on this field Bob * * m_linkpprev; - uint m_actid; // CMD_ACT counter, used to eliminate spurious act()s - uint m_anim; + uint32_t m_actid; // CMD_ACT counter, used to eliminate spurious act()s + uint32_t m_anim; int m_animstart; ///< gametime when the animation was started WalkingDir m_walking; int m_walkstart; ///< start time (used for interpolation) Modified: trunk/src/building.cc =================================================================== --- trunk/src/building.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/building.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -78,7 +78,7 @@ Building_Descr::~Building_Descr() { free(m_buildicon_fname); - for (uint i=0; i<m_enhances_to.size(); i++) + for (uint32_t i=0; i<m_enhances_to.size(); i++) free(m_enhances_to[i]); } @@ -217,7 +217,7 @@ * * \return the radius (in number of fields) of the conquered area. */ -uint Building_Descr::get_conquers() const +uint32_t Building_Descr::get_conquers() const { return 0; } @@ -227,7 +227,7 @@ * \return the radius (in number of fields) of the area seen by this * building. */ -uint Building_Descr::vision_range() const throw() +uint32_t Building_Descr::vision_range() const throw() { if (m_vision_range > 0) return m_vision_range; @@ -404,8 +404,8 @@ By default, all buildable buildings can be bulldozed. =============== */ -uint Building::get_playercaps() const throw () { - uint caps = 0; +uint32_t Building::get_playercaps() const throw () { + uint32_t caps = 0; if (descr().get_buildable() or descr().get_enhanced_building()) caps |= 1 << PCap_Bulldoze; if (descr().get_stopable()) caps |= 1 << PCap_Stopable; @@ -421,7 +421,7 @@ Start the given animation =============== */ -void Building::start_animation(Editor_Game_Base* g, uint anim) +void Building::start_animation(Editor_Game_Base* g, uint32_t anim) { m_anim = anim; m_animstart = g->get_gametime(); @@ -550,7 +550,7 @@ (the building UI, messages, etc..) =============== */ -uint Building::get_ui_anim() const {return descr().get_ui_anim();} +uint32_t Building::get_ui_anim() const {return descr().get_ui_anim();} /* @@ -622,7 +622,7 @@ } // Check time and queue - uint time = g->get_gametime(); + uint32_t time = g->get_gametime(); if (!m_leave_queue.size()) { @@ -646,9 +646,9 @@ Advance the leave queue. =============== */ -void Building::act(Game* g, uint data) +void Building::act(Game* g, uint32_t data) { - uint time = g->get_gametime(); + uint32_t time = g->get_gametime(); if (static_cast<int>(time - m_leave_time) >= 0) { @@ -740,7 +740,7 @@ const FCoords, const Point pos) { - const uint dpyflags = game.get_iabase()->get_display_flags(); + const uint32_t dpyflags = game.get_iabase()->get_display_flags(); if (dpyflags & Interactive_Base::dfShowCensus) { Modified: trunk/src/building.h =================================================================== --- trunk/src/building.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/building.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -26,6 +26,7 @@ #include "widelands.h" +#include <stdint.h> #include <string> #include <vector> @@ -68,10 +69,10 @@ inline bool get_buildable() const {return m_buildable;} inline bool get_enhanced_building() const {return m_enhanced_building;} const BuildCost & get_buildcost() const throw () {return m_buildcost;} - inline uint get_buildicon() const {return m_buildicon;} + inline uint32_t get_buildicon() const {return m_buildicon;} int get_size() const throw () {return m_size;} inline bool get_ismine() const {return m_mine;} - virtual uint get_ui_anim() const throw () {return get_animation("idle");} + virtual uint32_t get_ui_anim() const throw () {return get_animation("idle");} inline bool get_stopable() const {return m_stopable;} const std::string & get_stop_icon() const throw () {return m_stop_icon;} @@ -91,8 +92,8 @@ const EncodeData* encdata); virtual void load_graphics(); - virtual uint get_conquers() const; - virtual uint vision_range() const throw (); + virtual uint32_t get_conquers() const; + virtual uint32_t vision_range() const throw (); const Tribe_Descr & tribe() const throw () {return m_tribe;} __attribute__ ((deprecated)) const Tribe_Descr * get_tribe() const throw () {return &m_tribe;} @@ -113,14 +114,14 @@ std::string m_descname; // descriptive name for GUI bool m_buildable; // the player can build this himself BuildCost m_buildcost; - uint m_buildicon; // if buildable: picture in the build dialog + uint32_t m_buildicon; // if buildable: picture in the build dialog char* m_buildicon_fname; // filename for this icon int m_size; // size of the building bool m_mine; std::vector<char*> m_enhances_to; // building to enhance to or 0 bool m_enhanced_building; // if it is one, it is bulldozable BuildingHints m_hints; // hints (knowledge) for computer players - uint m_vision_range; // for migration, 0 is the default, meaning get_conquers() + 4 + uint32_t m_vision_range; // for migration, 0 is the default, meaning get_conquers() + 4 public: static Building_Descr* create_from_dir @@ -161,10 +162,10 @@ virtual int get_type () const throw (); virtual int get_size () const throw (); virtual bool get_passable() const throw (); - virtual uint get_ui_anim () const; + virtual uint32_t get_ui_anim () const; virtual Flag* get_base_flag(); - virtual uint get_playercaps() const throw (); + virtual uint32_t get_playercaps() const throw (); virtual Coords get_position() const throw () {return m_position;} const std::string & name () const throw () {return descr().name ();} @@ -185,8 +186,8 @@ virtual bool get_building_work(Game* g, Worker* w, bool success) __attribute__ ((noreturn)); bool leave_check_and_wait(Game* g, Worker* w); - uint get_conquers() const throw () {return descr().get_conquers();} - virtual uint vision_range() const throw () {return descr().vision_range();} + uint32_t get_conquers() const throw () {return descr().get_conquers();} + virtual uint32_t vision_range() const throw () {return descr().vision_range();} const std::string & get_stop_icon () const throw () {return descr().get_stop_icon();} @@ -208,12 +209,12 @@ void log_general_info(Editor_Game_Base* egbase); // Use on military and training sites - virtual void drop_soldier(uint) {}; + virtual void drop_soldier(uint32_t) {}; virtual void soldier_capacity_up () {} virtual void soldier_capacity_down () {} // Use on training sites only - virtual void change_train_priority(uint, int) {}; + virtual void change_train_priority(uint32_t, int) {}; virtual void switch_train_mode () {}; /// Testing stuff @@ -228,11 +229,11 @@ void remove_worker(Worker *); protected: - void start_animation(Editor_Game_Base* g, uint anim); + void start_animation(Editor_Game_Base* g, uint32_t anim); virtual void init(Editor_Game_Base* g); virtual void cleanup(Editor_Game_Base* g); - virtual void act(Game* g, uint data); + virtual void act(Game* g, uint32_t data); virtual void draw (const Editor_Game_Base &, RenderTarget &, const FCoords, const Point); @@ -246,12 +247,12 @@ Coords m_position; Flag* m_flag; - uint m_anim; + uint32_t m_anim; int m_animstart; typedef std::vector<Object_Ptr> Leave_Queue; Leave_Queue m_leave_queue; // FIFO queue of workers leaving the building - uint m_leave_time; // when to wake the next one from leave queue + uint32_t m_leave_time; // when to wake the next one from leave queue Object_Ptr m_leave_allow; // worker that is allowed to leave now bool m_stop; Modified: trunk/src/building_statistics_menu.cc =================================================================== --- trunk/src/building_statistics_menu.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/building_statistics_menu.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -326,7 +326,7 @@ /* * The table has been selected */ -void Building_Statistics_Menu::table_changed(uint) {update();} +void Building_Statistics_Menu::table_changed(uint32_t) {update();} /* * Update table @@ -349,11 +349,11 @@ const std::vector< Player::Building_Stats >& vec = m_parent->get_player()->get_building_statistics(i); // walk all entries, add new ones if needed - UI::Table<const uintptr_t>::Entry_Record * te = 0; - const uint table_size = m_table.size(); - for (uint l = 0; l < table_size; ++l) { - UI::Table<const uintptr_t>::Entry_Record & er = m_table.get_record(l); - if (UI::Table<const uintptr_t>::get(er) == i) { + UI::Table<const intptr_t>::Entry_Record * te = 0; + const uint32_t table_size = m_table.size(); + for (uint32_t l = 0; l < table_size; ++l) { + UI::Table<const intptr_t>::Entry_Record & er = m_table.get_record(l); + if (UI::Table<const intptr_t>::get(er) == i) { te = &er; break; } @@ -366,12 +366,12 @@ te = &m_table.add(i, building.get_buildicon()); } - uint nr_owned = 0; - uint nr_build = 0; - uint total_prod = 0; + uint32_t nr_owned = 0; + uint32_t nr_build = 0; + uint32_t total_prod = 0; const ProductionSite_Descr * const productionsite = dynamic_cast<const ProductionSite_Descr *>(&building); - for (uint l = 0; l < vec.size(); ++l) { + for (uint32_t l = 0; l < vec.size(); ++l) { if (vec[l].is_constructionsite) ++nr_build; else { ++nr_owned; @@ -402,7 +402,7 @@ // Product if (productionsite and nr_owned) { - const uint percent = static_cast<uint> + const uint32_t percent = static_cast<uint32_t> (static_cast<float>(total_prod) / static_cast<float>(nr_owned)); snprintf(buffer, sizeof(buffer), "%i", percent); if (is_selected) { Modified: trunk/src/building_statistics_menu.h =================================================================== --- trunk/src/building_statistics_menu.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/building_statistics_menu.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -20,6 +20,7 @@ #ifndef __S__BUILDING_STATISTICS_MENU_H #define __S__BUILDING_STATISTICS_MENU_H +#include <stdint.h> #include "ui_table.h" #include "ui_unique_window.h" @@ -46,18 +47,18 @@ }; Interactive_Player* m_parent; - UI::Table<const uintptr_t> m_table; + UI::Table<const intptr_t> m_table; UI::Progress_Bar* m_progbar; UI::Textarea* m_owned, *m_build; - uint m_anim; - uint m_lastupdate; - uint m_end_of_table_y; + uint32_t m_anim; + uint32_t m_lastupdate; + uint32_t m_end_of_table_y; UI::IDButton<Building_Statistics_Menu, Jump_Targets> * m_btn[6]; int m_last_building_index; void clicked_help(); void clicked_jump(Jump_Targets); - void table_changed(uint); + void table_changed(uint32_t); void update(); int validate_pointer(int*, int); }; Modified: trunk/src/building_ui.cc =================================================================== --- trunk/src/building_ui.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/building_ui.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -34,6 +34,7 @@ #include "maphollowregion.h" #include "militarysite.h" #include "soldier.h" +#include <stdint.h> #include "trainingsite.h" #include "tribe.h" #include "warehouse.h" @@ -285,7 +286,7 @@ }; public: - WaresQueueDisplay(UI::Panel* parent, int x, int y, uint maxw, WaresQueue* queue, Game* g); + WaresQueueDisplay(UI::Panel* parent, int x, int y, uint32_t maxw, WaresQueue* queue, Game* g); ~WaresQueueDisplay(); virtual void think(); @@ -296,14 +297,14 @@ private: WaresQueue * m_queue; - uint m_max_width; - uint m_icon; //< Index to ware's picture - uint m_fade_mask; //< Mask to show faded version of icons - uint m_pic_background; + uint32_t m_max_width; + uint32_t m_icon; //< Index to ware's picture + uint32_t m_fade_mask; //< Mask to show faded version of icons + uint32_t m_pic_background; - uint m_cache_size; - uint m_cache_filled; - uint m_display_size; + uint32_t m_cache_size; + uint32_t m_cache_filled; + uint32_t m_display_size; }; @@ -315,7 +316,7 @@ =============== */ WaresQueueDisplay::WaresQueueDisplay -(UI::Panel * parent, int x, int y, uint maxw, WaresQueue* queue, Game *) +(UI::Panel * parent, int x, int y, uint32_t maxw, WaresQueue* queue, Game *) : UI::Panel(parent, x, y, 0, Height), m_queue(queue), @@ -384,10 +385,10 @@ */ void WaresQueueDisplay::think() { - if (static_cast<uint>(m_queue->get_size()) != m_cache_size) + if (static_cast<uint32_t>(m_queue->get_size()) != m_cache_size) recalc_size(); - if (static_cast<uint>(m_queue->get_filled()) != m_cache_filled) + if (static_cast<uint32_t>(m_queue->get_filled()) != m_cache_filled) update(0, 0, get_w(), get_h()); } @@ -419,7 +420,7 @@ compile_assert(0 <= BG_ContinueCellX); compile_assert(0 <= BG_CellX); - for (uint cells = 0; cells < m_display_size; ++cells, x += CellWidth) { + for (uint32_t cells = 0; cells < m_display_size; ++cells, x += CellWidth) { dst->blitrect (Point(x, 0), m_pic_background, @@ -495,7 +496,7 @@ void toggle_workarea(); void act_start_stop(); void act_enhance(const Building_Descr::Index); - void act_drop_soldier(uint); + void act_drop_soldier(uint32_t); void act_change_soldier_capacity(int); private: @@ -507,10 +508,10 @@ UI::Button<Building_Window> * m_toggle_workarea; // capabilities that were last used in setting up the caps panel - uint m_capscache; + uint32_t m_capscache; Overlay_Manager::Job_Id m_workarea_job_id; - unsigned int workarea_cumulative_picid[NUMBER_OF_WORKAREA_PICS]; + uint32_t workarea_cumulative_picid[NUMBER_OF_WORKAREA_PICS]; }; @@ -574,7 +575,7 @@ */ void Building_Window::draw(RenderTarget* dst) { - uint anim = get_building()->get_ui_anim(); + uint32_t anim = get_building()->get_ui_anim(); dst->drawanim(Point(get_inner_w() / 2, get_inner_h() / 2), anim, 0, 0); @@ -769,7 +770,7 @@ Callback for bulldozing request =============== */ -void Building_Window::act_drop_soldier(uint serial) { +void Building_Window::act_drop_soldier(uint32_t serial) { Game* g = m_player->get_game(); if (m_building && (serial > 0)) @@ -886,7 +887,7 @@ box->add_space(8); // Add the wares queue - for (uint i = 0; i < cs->get_nrwaresqueues(); i++) + for (uint32_t i = 0; i < cs->get_nrwaresqueues(); i++) { WaresQueueDisplay* wqd = new WaresQueueDisplay(box, 0, 0, get_w(), cs->get_waresqueue(i), parent->get_game()); @@ -1208,11 +1209,11 @@ * fill list() */ void ProductionSite_Window_ListWorkerWindow::fill_list() { - const uint m_last_select = m_ls->selection_index(); + const uint32_t m_last_select = m_ls->selection_index(); m_ls->clear(); std::vector<Worker*>* workers=m_ps->get_workers(); - uint i; + uint32_t i; for (i=0; i<workers->size(); i++) { Worker* worker = (*workers)[i]; m_ls->add(worker->descname().c_str(), worker, worker->get_menu_pic()); @@ -1245,7 +1246,7 @@ m_experience->set_text(buffer); // Get the descriptive name of the ongoing upgrade - uint index = worker.get_tribe()->get_safe_worker_index( + uint32_t index = worker.get_tribe()->get_safe_worker_index( worker.get_becomes()); const Worker_Descr *descr = worker.get_tribe()->get_worker_descr( index); @@ -1438,7 +1439,7 @@ // Add the wares queue std::vector<WaresQueue*>* warequeues=ps->get_warequeues(); - for (uint i = 0; i < warequeues->size(); i++) { + for (uint32_t i = 0; i < warequeues->size(); i++) { create_ware_queue_panel (box, ps, (*warequeues)[i]); } @@ -1658,14 +1659,14 @@ char buf[200]; if (soldiers.size() < m_table->size()) m_table->clear(); - for (uint i = 0; i < soldiers.size(); ++i) { + for (uint32_t i = 0; i < soldiers.size(); ++i) { Soldier & s = *soldiers[i] ; UI::Table<Soldier &>::Entry_Record * er = m_table->find(s); if (not er) er = &m_table->add(s); - const uint hl = s.get_hp_level (), mhl = s.get_max_hp_level (); - const uint al = s.get_attack_level (), mal = s.get_max_attack_level (); - const uint dl = s.get_defense_level(), mdl = s.get_max_defense_level(); - const uint el = s.get_evade_level (), mel = s.get_max_evade_level (); + const uint32_t hl = s.get_hp_level (), mhl = s.get_max_hp_level (); + const uint32_t al = s.get_attack_level (), mal = s.get_max_attack_level (); + const uint32_t dl = s.get_defense_level(), mdl = s.get_max_defense_level(); + const uint32_t el = s.get_evade_level (), mel = s.get_max_evade_level (); er->set_string(0, s.name().c_str()); sprintf(buf, "%i / %i", hl, mhl); er->set_string(1, buf); @@ -2117,14 +2118,14 @@ char buffer[200]; if (soldiers.size() != m_table->size()) m_table->clear(); - for (uint i = 0; i < soldiers.size(); ++i) { + for (uint32_t i = 0; i < soldiers.size(); ++i) { Soldier & s = *soldiers[i] ; UI::Table<Soldier &>::Entry_Record * er = m_table->find(s); if (not er) er = &m_table->add(s); - const uint hl = s.get_hp_level (), mhl = s.get_max_hp_level (); - const uint al = s.get_attack_level (), mal = s.get_max_attack_level (); - const uint dl = s.get_defense_level(), mdl = s.get_max_defense_level(); - const uint el = s.get_evade_level (), mel = s.get_max_evade_level (); + const uint32_t hl = s.get_hp_level (), mhl = s.get_max_hp_level (); + const uint32_t al = s.get_attack_level (), mal = s.get_max_attack_level (); + const uint32_t dl = s.get_defense_level(), mdl = s.get_max_defense_level(); + const uint32_t el = s.get_evade_level (), mel = s.get_max_evade_level (); er->set_string(0, s.name().c_str()); snprintf(buffer, sizeof(buffer), "%i / %i", hl, mhl); er->set_string(1, buffer); Modified: trunk/src/campvis.cc =================================================================== --- trunk/src/campvis.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/campvis.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -133,7 +133,7 @@ * 2 = make campaign map visible * 3 = make campaign map invisible */ -void Campaign_visiblity_save::set_visiblity(std::string entry, uint vcase) +void Campaign_visiblity_save::set_visiblity(std::string entry, uint32_t vcase) { std::string savepath = get_path(); Profile campvis(savepath.c_str()); Modified: trunk/src/campvis.h =================================================================== --- trunk/src/campvis.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/campvis.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -20,12 +20,12 @@ #ifndef __CAMPVIS_H #define __CAMPVIS_H -#include "types.h" +#include <stdint.h> #include <string> struct Campaign_visiblity_save { std::string get_path(); - void set_visiblity(std::string, uint); + void set_visiblity(std::string, uint32_t); private: void make_campvis(std::string); Modified: trunk/src/carrier.cc =================================================================== --- trunk/src/carrier.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/carrier.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -19,6 +19,7 @@ #include "carrier.h" #include "game.h" +#include <stdint.h> #include "wexception.h" @@ -462,7 +463,7 @@ void Carrier::find_pending_item(Game* g) { Road* road = (Road*)get_location(g); - uint haveitembits = 0; + uint32_t haveitembits = 0; assert(m_acked_ware < 0); Modified: trunk/src/cmd_queue.h =================================================================== --- trunk/src/cmd_queue.h 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/cmd_queue.h 2007-09-21 21:53:21 UTC (rev 2761) @@ -23,6 +23,7 @@ #include "queue_cmd_ids.h" #include <queue> +#include <stdint.h> class Editor_Game_Base; class Widelands_Map_Map_Object_Saver; @@ -123,7 +124,7 @@ * independent of details of the priority_queue implementation. */ int category; - unsigned long serial; + uint32_t serial; bool operator< (const cmditem& c) const { @@ -148,7 +149,7 @@ private: Game * m_game; std::priority_queue<cmditem> m_cmds; - unsigned long nextserial; + uint32_t nextserial; }; #endif // __S__CMD_QUEUE_H Modified: trunk/src/computer_player.cc =================================================================== --- trunk/src/computer_player.cc 2007-09-21 18:46:36 UTC (rev 2760) +++ trunk/src/computer_player.cc 2007-09-21 21:53:21 UTC (rev 2761) @@ -40,7 +40,7 @@ class CheckStepRoadAI : public CheckStep { public: - CheckStepRoadAI(Player* pl, uchar mc, bool oe) + CheckStepRoadAI(Player* pl, uint8_t mc, bool oe) : player(pl), movecaps(mc), openend(oe) {} @@ -52,7 +52,7 @@ //private: Player * player; - uchar movecaps; + uint8_t movecaps; bool openend; }; @@ -514,12 +514,12 @@ if (j->cnt_built+j->cnt_under_construction==0) prio+=2; - for (unsigned int k=0; k<j->inputs.size(); k++) { + for (uint32_t k=0; k<j->inputs.size(); k++) { prio+=8*wares[j->inputs[k]].producers; prio-=4*wares[j->inputs[k]].consumers; } - for (unsigned int k=0; k<j->outputs.size(); k++) { + for (uint32_t k=0; k<j->outputs.size(); k++) { prio-=12*wares[j->outputs[k]].producers; prio+=8*wares[j->outputs[k]].consumers; prio+=4*wares[j->outputs[k]].preciousness; @@ -706,7 +706,7 @@ field->preferred=true; } - for (unsigned int i=0;i<immovables.size();i++) { + for (uint32_t i=0;i<immovables.size();i++) { const BaseImmovable & base_immovable = *immovables[i].object; if (dynamic_cast<const Flag *>(&base_immovable)) field->reachable=true; @@ -807,7 +807,7 @@ field->preferred=true; } - for (unsigned int i=0;i<immovables.size();i++) { + for (uint32_t i=0;i<immovables.size();i++) { if (immovables[i].object->get_type()==BaseImmovable::FLAG) field->reachable=true; @@ -869,10 +869,10 @@ productionsites.back().site=static_cast<ProductionSite*>(b); productionsites.back().bo=&bo; - for (unsigned int i=0;i<bo.outputs.size();i++) + for (uint32_t i=0;i<bo.outputs.size();i++) ++wares[bo.outputs[i]].producers; - for (unsigned int i=0;i<bo.inputs.size();i++) + for (uint32_t i=0;i<bo.inputs.size();i++) wares[bo.inputs[i]].consumers++; } } @@ -899,10 +899,10 @@ break; } - for (unsigned int i=0;i<bo.outputs.size();i++) + for (uint32_t i=0;i<bo.outputs.size();i++) wares[bo.outputs[i]].producers--; - for (unsigned int i=0;i<bo.inputs.size();i++) + for (uint32_t i=0;i<bo.inputs.size();i++) wares[bo.inputs[i]].consumers--; } } @@ -1007,7 +1007,7 @@ { std::priority_queue<NearFlag> queue; std::vector<NearFlag> nearflags; - unsigned int i; + uint32_t i; queue.push (NearFlag(flag, 0, 0)); Map & map = game().map(); @@ -1123,12 +1123,12 @@ bool CheckStepRoadAI::allowed (Map * map, FCoords, FCoords end, int, StepId id) const { - uchar endcaps = player->get_buildcaps(end); + uint8_t endcaps = player->get_buildcaps(end); // Calculate cost and passability if (!(endcaps & movecaps)) { return false; - //uchar startcaps = player->get_buildcaps(start); + //uint8_t startcaps = player->get_buildcaps(start); //if (!((endcaps & MOVECAPS_WALK) && (startcaps & movecaps & MOVECAPS_SWIM)... [truncated message content] |