From a9f92a0e36db00ccb79019e59579d4f64f5f88a1 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 18 May 2010 16:53:47 +0200 Subject: [PATCH] Changed: #825 Remove all warning when compiling Ryzom on Linux --- code/nel/include/nel/georges/load_form.h | 8 +- code/nel/include/nel/misc/stream.h | 4 +- code/nel/src/misc/bitmap_png.cpp | 2 +- code/nel/src/pacs/global_retriever.cpp | 6 +- code/nel/src/pacs/local_retriever.cpp | 6 +- code/nel/src/pacs/primitive_world_image.cpp | 2 +- .../server/src/admin_modules/aes_module.cpp | 6 +- .../server/src/ai_service/ai_bot_fauna.cpp | 2 +- .../server/src/ai_service/ai_bot_npc.cpp | 22 ++-- .../server/src/ai_service/ai_entity_matrix.h | 4 +- .../src/ai_service/ai_entity_physical.h | 2 +- .../ai_service/ai_generic_fight_helpers.cpp | 2 +- code/ryzom/server/src/ai_service/ai_grp.cpp | 4 +- code/ryzom/server/src/ai_service/ai_grp.h | 4 +- .../server/src/ai_service/ai_grp_fauna.cpp | 4 +- .../server/src/ai_service/ai_grp_npc.cpp | 2 +- .../server/src/ai_service/ai_instance.cpp | 2 +- .../server/src/ai_service/ai_outpost.cpp | 2 +- .../ryzom/server/src/ai_service/ai_player.cpp | 6 +- .../server/src/ai_service/ai_profile_npc.cpp | 20 +-- .../server/src/ai_service/ai_script_comp.cpp | 2 +- .../ryzom/server/src/ai_service/ais_actions.h | 2 +- .../server/src/ai_service/child_container.h | 2 +- code/ryzom/server/src/ai_service/commands.cpp | 4 +- .../ryzom/server/src/ai_service/continent.cpp | 22 ++-- .../server/src/ai_service/continent_inline.h | 8 +- .../src/ai_service/generic_logic_action.cpp | 20 +-- .../server/src/ai_service/knapsack_solver.cpp | 26 ++-- code/ryzom/server/src/ai_service/messages.cpp | 2 +- code/ryzom/server/src/ai_service/nf_grp.cpp | 2 +- .../server/src/ai_service/nf_grp_npc.cpp | 4 +- code/ryzom/server/src/ai_service/nf_helpers.h | 6 +- .../src/ai_service/nf_state_instance.cpp | 24 ++-- .../server/src/ai_service/path_behaviors.cpp | 4 +- .../server/src/ai_service/script_compiler.cpp | 2 +- .../server/src/ai_service/script_parser.lex | 6 +- .../server/src/ai_service/script_parser.yacc | 22 ++-- .../ryzom/server/src/ai_service/script_vm.cpp | 4 +- code/ryzom/server/src/ai_service/sheets.cpp | 6 +- code/ryzom/server/src/ai_service/states.h | 2 +- .../ryzom/server/src/ai_share/16x16_layer.cpp | 2 +- code/ryzom/server/src/ai_share/ai_actions.h | 10 +- .../src/ai_share/ai_alias_description_node.h | 2 +- .../server/src/ai_share/ai_event_report.h | 2 +- code/ryzom/server/src/ai_share/ai_share.h | 4 +- code/ryzom/server/src/ai_share/world_map.cpp | 12 +- code/ryzom/server/src/ai_share/world_map.h | 2 +- .../src/backup_service/backup_file_access.cpp | 2 +- .../src/backup_service/backup_service.cpp | 4 +- .../server/src/backup_service/commands.cpp | 6 +- .../src/backup_service/web_connection.cpp | 2 +- .../src/entities_game_service/admin.cpp | 16 +-- .../building_manager/building_manager.cpp | 6 +- .../building_manager/building_physical.cpp | 4 +- .../building_physical_inline.h | 4 +- .../building_manager/building_unit_test.cpp | 10 +- .../building_manager/room_instance.cpp | 2 +- .../creature_manager/creature.cpp | 10 +- .../creature_manager/creature_manager.cpp | 4 +- .../creature_manager/creature_manager.h | 2 +- .../creature_manager/harvestable.cpp | 6 +- .../creature_manager/special_trade_list.h | 2 +- .../src/entities_game_service/deposit.h | 2 +- .../egs_sheets/egs_static_brick.cpp | 12 +- .../egs_sheets/egs_static_brick.h | 4 +- .../egs_sheets/egs_static_emot.h | 2 +- .../egs_sheets/egs_static_encyclo.cpp | 6 +- .../egs_sheets/egs_static_game_item.cpp | 10 +- .../egs_sheets/egs_static_game_item.h | 4 +- .../egs_sheets/egs_static_game_sheet.h | 4 +- .../egs_sheets/egs_static_text_emotes.h | 2 +- .../entities_game_service.cpp | 10 +- .../entity_manager/entity_base.cpp | 2 +- .../entity_manager/entity_base.h | 2 +- .../entity_manager/entity_callbacks.cpp | 4 +- .../entity_structure/statistic.cpp | 2 +- .../far_position_stack.h | 2 +- .../game_item_manager/game_item.h | 4 +- .../guild_manager/guild.cpp | 12 +- .../guild_manager/guild_char_proxy.cpp | 2 +- .../guild_manager/guild_commands.cpp | 2 +- .../guild_manager/guild_manager.cpp | 8 +- .../entities_game_service/inventory_updater.h | 6 +- .../mission_manager/mission_action.cpp | 2 +- .../mission_base_behaviour.cpp | 4 +- .../mission_manager/mission_manager.cpp | 16 +-- .../mission_manager/mission_parser.cpp | 4 +- .../mission_manager/mission_queue.cpp | 2 +- .../mission_manager/mission_queue_manager.cpp | 4 +- .../mission_manager/mission_queue_manager.h | 4 +- .../mission_manager/mission_step_misc.cpp | 2 +- .../mission_manager/mission_step_talk.cpp | 2 +- .../outpost_manager/outpost.cpp | 6 +- .../outpost_manager/outpost_manager.cpp | 8 +- .../phrase_manager/aura_effect.cpp | 2 +- .../phrase_manager/bounce_effect.cpp | 4 +- .../combat_action_ai_effect.cpp | 2 +- .../phrase_manager/combat_action_disarm.cpp | 2 +- .../phrase_manager/combat_action_dot.cpp | 2 +- .../phrase_manager/combat_phrase.cpp | 24 ++-- .../phrase_manager/damage_aura_effect.cpp | 2 +- .../phrase_manager/faber_action.cpp | 12 +- .../phrase_manager/faber_phrase.cpp | 8 +- .../phrase_manager/fg_prospection_phrase.cpp | 2 +- .../magic_action_affect_stat.cpp | 2 +- .../magic_action_ai_damage_aura.cpp | 4 +- .../phrase_manager/magic_action_ai_dot.cpp | 4 +- .../phrase_manager/magic_action_ai_effect.cpp | 4 +- .../phrase_manager/magic_action_ai_hot.cpp | 4 +- .../magic_action_ai_mass_dispel.cpp | 4 +- .../phrase_manager/magic_action_attack.cpp | 4 +- .../phrase_manager/magic_action_disarm.cpp | 4 +- .../phrase_manager/magic_action_dot.cpp | 2 +- .../phrase_manager/magic_action_heal.cpp | 4 +- .../magic_action_negative_effect.cpp | 2 +- .../phrase_manager/magic_phrase.cpp | 16 +-- .../phrase_manager/magic_phrase.h | 2 +- .../phrase_manager/phrase_manager.cpp | 8 +- .../phrase_manager/phrase_manager.h | 2 +- .../phrase_utilities_functions.cpp | 4 +- .../redirect_attacks_effect.cpp | 4 +- .../phrase_manager/special_power_phrase.cpp | 4 +- .../player_manager/action_distance_checker.h | 2 +- .../player_manager/cdb.h | 2 +- .../player_manager/cdb_branch.cpp | 6 +- .../player_manager/character.cpp | 116 +++++++++--------- .../player_manager/character_encyclopedia.cpp | 2 +- .../player_manager/character_inlines.h | 2 +- .../character_inventory_manipulation.cpp | 10 +- .../known_and_memorized_phrases.cpp | 10 +- .../player_manager/player.cpp | 2 +- .../player_manager/player_manager.cpp | 2 +- .../player_manager/player_manager.h | 2 +- .../player_manager/powers_and_auras.cpp | 2 +- .../position_flag_manager.cpp | 2 +- .../primitives_parser.cpp | 2 +- .../progression/progression_pve.cpp | 24 ++-- .../progression/progression_pve.h | 12 +- .../progression/progression_pvp.cpp | 4 +- .../pvp_manager/pvp_challenge.cpp | 12 +- .../pvp_faction_reward_manager/totem_base.h | 2 +- .../pvp_manager/pvp_manager.cpp | 2 +- .../pvp_manager/pvp_manager_2.cpp | 6 +- .../shop_type/character_shopping_list.cpp | 8 +- .../shop_type/dynamic_items.cpp | 2 +- .../shop_type/items_for_sale.h | 2 +- .../shop_type/shop_type_manager.cpp | 2 +- .../src/entities_game_service/stat_db.cpp | 4 +- .../team_manager/reward_sharing.cpp | 2 +- .../team_manager/team.cpp | 8 +- .../team_manager/team_manager.cpp | 2 +- .../entities_game_service/zone_manager.cpp | 16 +-- .../src/entities_game_service/zone_manager.h | 2 +- .../src/frontend_service/client_host.cpp | 2 +- .../frontend_service/distance_prioritizer.cpp | 8 +- .../frontend_service/distance_prioritizer.h | 2 +- .../src/frontend_service/fe_receive_sub.cpp | 4 +- .../src/frontend_service/fe_receive_task.h | 2 +- .../src/frontend_service/frontend_service.cpp | 4 +- .../gateway_fes_transport.cpp | 2 +- .../src/frontend_service/impulse_encoder.cpp | 4 +- .../src/frontend_service/module_manager.cpp | 2 +- .../src/frontend_service/packet_history.cpp | 2 +- .../frontend_service/processing_spreader.cpp | 2 +- .../src/frontend_service/property_history.cpp | 2 +- .../frontend_service/selection_generator.cpp | 2 +- .../src/gameplay_module_lib/module_core.cpp | 2 +- .../src/gameplay_module_lib/module_core.h | 2 +- .../src/gameplay_module_lib/module_parent.h | 2 +- .../server/src/gpm_service/gpm_utilities.h | 2 +- .../ryzom/server/src/gpm_service/messages.cpp | 2 +- .../server/src/gpm_service/move_checker.cpp | 6 +- .../server/src/gpm_service/patat_grid.cpp | 8 +- .../gpm_service/world_position_manager.cpp | 10 +- .../src/input_output_service/chat_manager.cpp | 2 +- .../input_output_service/string_manager.cpp | 4 +- .../string_manager_parser.cpp | 22 ++-- .../server/src/logger_service/log_storage.h | 10 +- .../src/logger_service/logger_service.cpp | 32 ++--- .../src/mail_forum_service/hof_generator.cpp | 8 +- .../mail_forum_service/mail_forum_service.cpp | 2 +- .../server/src/mirror_service/data_set_ms.h | 2 +- .../src/mirror_service/mirror_service.cpp | 4 +- .../src/mirror_service/ms_automaton.cpp | 2 +- .../server/src/monitor_service/client.cpp | 22 ++-- .../ryzom/server/src/pd_lib/db_delta_file.cpp | 2 +- .../src/pd_lib/db_description_parser.cpp | 18 +-- code/ryzom/server/src/pd_lib/pd_messages.cpp | 4 +- code/ryzom/server/src/pd_lib/pd_messages.h | 14 +-- .../ryzom/server/src/pd_lib/pd_server_utils.h | 8 +- .../server/src/pd_lib/pds_table_buffer.h | 4 +- .../persistant_data_service/pds_attribute.cpp | 16 +-- .../persistant_data_service/pds_database.cpp | 2 +- .../pds_table_inline.h | 2 +- .../ryzom/server/src/server_share/bmp4image.h | 4 +- .../src/server_share/handy_commands.cpp | 8 +- .../server/src/server_share/light_ig_loader.h | 2 +- .../src/server_share/msg_brick_service.h | 4 +- .../server/src/server_share/mysql_wrapper.cpp | 14 +-- .../server_share/npc_description_messages.cpp | 4 +- .../server/src/server_share/primitive_cfg.cpp | 2 +- .../server/src/server_share/r2_vision.cpp | 44 +++---- .../database_mapping.cpp | 80 ++++++------ .../shard_unifier_service/entity_locator.cpp | 2 +- .../shard_unifier_service/name_manager.cpp | 8 +- .../nel_database_mapping.cpp | 8 +- .../server/src/tick_service/tick_service.cpp | 4 +- 207 files changed, 698 insertions(+), 698 deletions(-) diff --git a/code/nel/include/nel/georges/load_form.h b/code/nel/include/nel/georges/load_form.h index b0767cade..7252cfe63 100644 --- a/code/nel/include/nel/georges/load_form.h +++ b/code/nel/include/nel/georges/load_form.h @@ -726,8 +726,8 @@ void loadForm2(const std::vector &sheetFilters, const std::string & { uint dicIndex; // add a new dictionnary entry - dicIndex = dictionnary.size(); - dictionnaryIndex.insert(std::make_pair(filename, dictionnary.size())); + dicIndex = (uint)dictionnary.size(); + dictionnaryIndex.insert(std::make_pair(filename, (NLMISC::TSStringId)dictionnary.size())); dictionnary.push_back(filename); // add the dependency index @@ -793,7 +793,7 @@ void loadForm2(const std::vector &sheetFilters, const std::string & ofile.serialCont(dictionnary); // write the dependencies data - uint32 depSize = dependencies.size(); + uint32 depSize = (uint32)dependencies.size(); ofile.serial(depSize); std::map >::iterator first(dependencies.begin()), last(dependencies.end()); for (; first != last; ++first) @@ -811,7 +811,7 @@ void loadForm2(const std::vector &sheetFilters, const std::string & ofile.seek(endBlockSize, NLMISC::IStream::begin); // write the sheet data - uint32 nbEntries = sheetIds.size(); + uint32 nbEntries = (uint32)sheetIds.size(); uint32 ver = T::getVersion (); ofile.serial (nbEntries); ofile.serial (ver); diff --git a/code/nel/include/nel/misc/stream.h b/code/nel/include/nel/misc/stream.h index a0fdc63d9..e17d91380 100644 --- a/code/nel/include/nel/misc/stream.h +++ b/code/nel/include/nel/misc/stream.h @@ -1504,7 +1504,7 @@ private: } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); __iterator it= cont.begin(); @@ -1667,7 +1667,7 @@ private: } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); __iterator it= cont.begin(); diff --git a/code/nel/src/misc/bitmap_png.cpp b/code/nel/src/misc/bitmap_png.cpp index a73e161ce..852f10586 100644 --- a/code/nel/src/misc/bitmap_png.cpp +++ b/code/nel/src/misc/bitmap_png.cpp @@ -147,7 +147,7 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f ) // read rest of file, and get additional chunks in info_ptr png_read_end(png_ptr, info_ptr); - uint32 dstChannels, firstChannel, lastChannel; + uint32 dstChannels = 0, firstChannel = 0, lastChannel = 0; if (iColorType == PNG_COLOR_TYPE_RGBA || iColorType == PNG_COLOR_TYPE_RGB || iColorType == PNG_COLOR_TYPE_PALETTE) { diff --git a/code/nel/src/pacs/global_retriever.cpp b/code/nel/src/pacs/global_retriever.cpp index 9e32295d6..737547b6e 100644 --- a/code/nel/src/pacs/global_retriever.cpp +++ b/code/nel/src/pacs/global_retriever.cpp @@ -206,7 +206,7 @@ void NLPACS::CGlobalRetriever::check() const } if (chain.getRight()>=(sint)retriever.getSurfaces().size() || - chain.getRight()<=CChain::getDummyBorderChainId() && !CChain::isBorderChainId(chain.getRight())) + (chain.getRight()<=CChain::getDummyBorderChainId() && !CChain::isBorderChainId(chain.getRight()))) { nlwarning("retriever %d, chain %d: reference on right surface is not valid", instance.getRetrieverId(), j); } @@ -313,7 +313,7 @@ void NLPACS::CGlobalRetriever::getBorders(const CAABBox &sbox, std::vector::iterator it; snapped = false; for (it=selection.begin(); it!=selection.end(); ++it) @@ -1483,7 +1483,7 @@ float NLPACS::CLocalRetriever::getHeight(const NLPACS::ULocalPosition &position) CVector pos = position.Estimation; CVector posh = pos+CVector(0.0f, 0.0f, 1.0f); float bestDist = 1.0e10f; - CVector best; + CVector best(0.0f, 0.0f, 0.0f); vector::iterator it; for (it=selection.begin(); it!=selection.end(); ++it) { @@ -1580,7 +1580,7 @@ float NLPACS::CLocalRetriever::getInteriorHeightAround(const ULocalPosition &pos CVector pos = position.Estimation; CVector posh = pos+CVector(0.0f, 0.0f, 1.0f); float bestDist = 1.0e10f; - CVector best; + CVector best(0.0f, 0.0f, 0.0f); vector::iterator it; for (it=selection.begin(); it!=selection.end(); ++it) { diff --git a/code/nel/src/pacs/primitive_world_image.cpp b/code/nel/src/pacs/primitive_world_image.cpp index 4a6f8b4d3..de25305e7 100644 --- a/code/nel/src/pacs/primitive_world_image.cpp +++ b/code/nel/src/pacs/primitive_world_image.cpp @@ -1183,7 +1183,7 @@ void CPrimitiveWorldImage::reaction (CPrimitiveWorldImage& second, const CCollis collisionPosition+=_Speed*desc.ContactTime; // Calc new speed - CVectorD newSpeed; + CVectorD newSpeed(0.0, 0.0, 0.0); // Obstacle ? if (collision) diff --git a/code/ryzom/server/src/admin_modules/aes_module.cpp b/code/ryzom/server/src/admin_modules/aes_module.cpp index 60b678f8d..67cc2231e 100644 --- a/code/ryzom/server/src/admin_modules/aes_module.cpp +++ b/code/ryzom/server/src/admin_modules/aes_module.cpp @@ -809,7 +809,7 @@ namespace ADMIN // read the text from the file - note that the number of bytes read may be less than the // number of bytes requested because we've opened the file in text mode and not binary mode - uint32 bytesRead= fread(&txt[0],1,fileSize,f); + uint32 bytesRead= (uint32)fread(&txt[0],1,fileSize,f); txt.resize(bytesRead); fclose(f); @@ -833,7 +833,7 @@ namespace ADMIN // read the text from the file - note that the number of bytes read may be less than the // number of bytes requested because we've opened the file in text mode and not binary mode - uint32 bytesRead= fread(&txt[0],1,fileSize,f); + uint32 bytesRead= (uint32)fread(&txt[0],1,fileSize,f); txt.resize(bytesRead); fclose(f); @@ -859,7 +859,7 @@ namespace ADMIN // read the text from the file - note that the number of bytes read may be less than the // number of bytes requested because we've opened the file in text mode and not binary mode - uint32 bytesRead= fread(&txt[0],1,fileSize,f); + uint32 bytesRead= (uint32)fread(&txt[0],1,fileSize,f); txt.resize(bytesRead); fclose(f); diff --git a/code/ryzom/server/src/ai_service/ai_bot_fauna.cpp b/code/ryzom/server/src/ai_service/ai_bot_fauna.cpp index f9f3d7d13..f6663e440 100644 --- a/code/ryzom/server/src/ai_service/ai_bot_fauna.cpp +++ b/code/ryzom/server/src/ai_service/ai_bot_fauna.cpp @@ -919,7 +919,7 @@ void CMovementMagnet::getNewDestination(RYAI_MAP_CRUNCH::CWorldPosition const& a { // first, try to take the same way as another bot of the group with the same comportment. CCont &bots = _BotFauna.spawnGrp().bots(); - uint32 nbBots=bots.size(); + uint32 nbBots=(uint32)bots.size(); float bestScore=0.f; CAIVector bestDest; diff --git a/code/ryzom/server/src/ai_service/ai_bot_npc.cpp b/code/ryzom/server/src/ai_service/ai_bot_npc.cpp index 4e4cad856..36010c068 100644 --- a/code/ryzom/server/src/ai_service/ai_bot_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_bot_npc.cpp @@ -496,7 +496,7 @@ void CBotNpc::calcSpawnPos(RYAI_MAP_CRUNCH::CWorldMap const& worldMap) std::vector const& posList = state->shape().getGeometry(); do { - const uint32 a=CAIS::rand16(posList.size()); + const uint32 a=CAIS::rand16((uint32)posList.size()); const uint32 b=(a+1)%posList.size(); const double weight=CAIS::frand(); _StartPos.setXY(posList[a].toAIVector()+(posList[b].toAIVector()-posList[a].toAIVector())*weight); @@ -973,7 +973,7 @@ void CBotNpc::setColours(std::string input) if (NLMISC::nlstricmp(colour,colourNames[i][j])==0) { // found an entry so add to the results vector - results.push_back(i); + results.push_back((uint32)i); done=true; } } @@ -1003,7 +1003,7 @@ void CBotNpc::setColours(std::string input) { // upper body colour generator.srand(seed+975*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorArms(val); _Sheet->setColorHands(val); _Sheet->setColorBody(val); @@ -1012,7 +1012,7 @@ void CBotNpc::setColours(std::string input) { // lower body colour generator.srand(seed+977*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorLegs(val); _Sheet->setColorFeets(val); } @@ -1020,49 +1020,49 @@ void CBotNpc::setColours(std::string input) { // hair colour, mapped to head generator.srand(seed+976*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorHead(val); } else if ( NLMISC::nlstricmp(keyword,"CHEAD")==0) { // head color generator.srand(seed+979*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorHead(val); } else if ( NLMISC::nlstricmp(keyword,"CARMS")==0) { // arms color generator.srand(seed+981*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorArms(val); } else if ( NLMISC::nlstricmp(keyword,"CHANDS")==0) { // arms color generator.srand(seed+983*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorHands(val); } else if ( NLMISC::nlstricmp(keyword,"CBODY")==0) { // arms color generator.srand(seed+985*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorBody(val); } else if ( NLMISC::nlstricmp(keyword,"CLEGS")==0) { // arms color generator.srand(seed+987*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorLegs(val); } else if ( NLMISC::nlstricmp(keyword,"CFEETS")==0) { // arms color generator.srand(seed+989*0x10000); - uint8 val = (uint8)results[generator.rand(results.size()-1)]; + uint8 val = (uint8)results[generator.rand((uint16)results.size()-1)]; _Sheet->setColorFeets(val); } } diff --git a/code/ryzom/server/src/ai_service/ai_entity_matrix.h b/code/ryzom/server/src/ai_service/ai_entity_matrix.h index 74746cbae..484cfcef7 100644 --- a/code/ryzom/server/src/ai_service/ai_entity_matrix.h +++ b/code/ryzom/server/src/ai_service/ai_entity_matrix.h @@ -583,7 +583,7 @@ inline const CAIEntityMatrixIteratorTblRandom::iterator CAIEntityMatrixIteratorT inline uint32 CAIEntityMatrixIteratorTblRandom::size() const { - return _tbl.size(); + return (uint32)_tbl.size(); } @@ -631,7 +631,7 @@ inline const CAIEntityMatrixIteratorTblLinear::iterator CAIEntityMatrixIteratorT inline uint32 CAIEntityMatrixIteratorTblLinear::size() const { - return _tbl.size(); + return (uint32)_tbl.size(); } diff --git a/code/ryzom/server/src/ai_service/ai_entity_physical.h b/code/ryzom/server/src/ai_service/ai_entity_physical.h index 458c84cc9..340568656 100644 --- a/code/ryzom/server/src/ai_service/ai_entity_physical.h +++ b/code/ryzom/server/src/ai_service/ai_entity_physical.h @@ -305,7 +305,7 @@ public: //@{ virtual void addHealer(IAIEntityPhysicalHealer* healer) { _Healers.insert(healer); if (healer) healer->healerAdded(this); } virtual void delHealer(IAIEntityPhysicalHealer* healer) { _Healers.erase(healer); if (healer) healer->healerRemoved(this); } - virtual int getHealerCount() { return _Healers.size(); } + virtual int getHealerCount() { return (int)_Healers.size(); } //@} static int _PlayerVisibilityDistance; diff --git a/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp b/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp index 5f7801020..3e166ddaa 100644 --- a/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp +++ b/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp @@ -81,7 +81,7 @@ static bool s_attack(CAIEntityPhysical const& target, float const& dist, if (action->SelfAction() == self) phraseList.push_back(action); } - uint32 const size = phraseList.size(); + uint32 const size = (uint32)phraseList.size(); if (size>0) { nlassert(target.getRyzomType()!=debugCheckedType); diff --git a/code/ryzom/server/src/ai_service/ai_grp.cpp b/code/ryzom/server/src/ai_service/ai_grp.cpp index 79d24d69c..55a4beddd 100644 --- a/code/ryzom/server/src/ai_service/ai_grp.cpp +++ b/code/ryzom/server/src/ai_service/ai_grp.cpp @@ -334,7 +334,7 @@ void CSpawnGroup::incSpawnedBot(CBot& spawnBot) { #if !FINAL_VERSION uint32 botIndex = spawnBot.getChildIndex(); - for (uint32 i=_BotsToRespawn.size(); i--; ) + for (uint32 i=(uint32)_BotsToRespawn.size(); i--; ) { if (_BotsToRespawn[i].getBotIndex()==botIndex) { @@ -344,7 +344,7 @@ void CSpawnGroup::incSpawnedBot(CBot& spawnBot) _BotsToRespawn.pop_back(); } } - for (uint32 i=_BotsToDespawn.size(); i--; ) + for (uint32 i=(uint32)_BotsToDespawn.size(); i--; ) { if (_BotsToDespawn[i].getBotIndex()==botIndex) { diff --git a/code/ryzom/server/src/ai_service/ai_grp.h b/code/ryzom/server/src/ai_service/ai_grp.h index 6a5082c32..00c8e3c6a 100644 --- a/code/ryzom/server/src/ai_service/ai_grp.h +++ b/code/ryzom/server/src/ai_service/ai_grp.h @@ -135,9 +135,9 @@ public: uint32 nbSpawnedBot() const { return _NbSpawnedBot; } - uint32 nbBotToRespawn() const { return _BotsToRespawn.size(); } + uint32 nbBotToRespawn() const { return (uint32)_BotsToRespawn.size(); } - uint32 nbBotToDespawn() const { return _BotsToDespawn.size(); } + uint32 nbBotToDespawn() const { return (uint32)_BotsToDespawn.size(); } bool isGroupAlive(uint32 const nbMoreKilledBot = 0) const; diff --git a/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp b/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp index 4ddacdce2..6b51313cf 100644 --- a/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp +++ b/code/ryzom/server/src/ai_service/ai_grp_fauna.cpp @@ -1008,7 +1008,7 @@ void CGrpFauna::setCyles(std::string const& cycles) { if (curCycle==~0) { - curCycle = _Cycles.size(); + curCycle = (uint32)_Cycles.size(); _Cycles.push_back(Cycle()); } Cycle& CycleRef = _Cycles[curCycle]; @@ -1067,7 +1067,7 @@ void CGrpFauna::allocateBots() CPopulation* pop = *(it); uint count=0; - for (sint j=pop->size()-1;j>=0;j--) + for (sint j=(sint)pop->size()-1;j>=0;j--) count+=(*pop)[j].getBotCount(getCountMultiplierFlag()); if (count>maxPopulation) diff --git a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp index 2433db7dd..e434ed1c9 100644 --- a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp @@ -103,7 +103,7 @@ void CSpawnGroupNpc::resetSlowUpdateCycle() // Find the lowest bucket vector::iterator it = std::min_element(_SlowUpdateBuckets.begin(), _SlowUpdateBuckets.end()); // Assign it to the group - _SlowUpdateCycle = it - _SlowUpdateBuckets.begin(); + _SlowUpdateCycle = (uint32)(it - _SlowUpdateBuckets.begin()); // Fill the bucket with the group *it += bots().size(); } diff --git a/code/ryzom/server/src/ai_service/ai_instance.cpp b/code/ryzom/server/src/ai_service/ai_instance.cpp index d4215aeae..0d40f4128 100644 --- a/code/ryzom/server/src/ai_service/ai_instance.cpp +++ b/code/ryzom/server/src/ai_service/ai_instance.cpp @@ -94,7 +94,7 @@ void CAIInstance::updateZoneTrigger(CBotPlayer* player) FOREACH(it, CCont, _Managers) { std::string name = it->getName(); - uint32 size = name.size(); + uint32 size = (uint32)name.size(); const uint32 extensionSize = 13; // strlen(".zone_trigger"); if (size >= 13 && name.substr(size - extensionSize, extensionSize) == ".zone_trigger" ) { diff --git a/code/ryzom/server/src/ai_service/ai_outpost.cpp b/code/ryzom/server/src/ai_service/ai_outpost.cpp index 4081a9486..5c6f3af6b 100644 --- a/code/ryzom/server/src/ai_service/ai_outpost.cpp +++ b/code/ryzom/server/src/ai_service/ai_outpost.cpp @@ -837,7 +837,7 @@ void COutpost::createSquad(CGroupDesc const* groupDesc, COu // FOREACH(itState, CCont, stateMachine->states()) for (size_t i=0; icstStates().size(); ++i) { - CAIState* state = stateMachine->cstStates()[i]; + CAIState* state = stateMachine->cstStates()[(uint32)i]; if (state->getName()==initialStateName) initialState = state; } diff --git a/code/ryzom/server/src/ai_service/ai_player.cpp b/code/ryzom/server/src/ai_service/ai_player.cpp index d7ea15bd4..260531657 100644 --- a/code/ryzom/server/src/ai_service/ai_player.cpp +++ b/code/ryzom/server/src/ai_service/ai_player.cpp @@ -217,7 +217,7 @@ bool CBotPlayer::isAggressive() const void CBotPlayer::addAggroer(TDataSetRow const& row) { #if !FINAL_VERSION - for (sint32 i=_AggroerList.size()-1;i>=0;i--) + for (sint32 i=(sint32)_AggroerList.size()-1;i>=0;i--) nlassert(_AggroerList[i]!=row); #endif _AggroerList.push_back(row); @@ -225,7 +225,7 @@ void CBotPlayer::addAggroer(TDataSetRow const& row) void CBotPlayer::removeAggroer(TDataSetRow const& row) { - for (sint32 i=_AggroerList.size()-1;i>=0;i--) + for (sint32 i=(sint32)_AggroerList.size()-1;i>=0;i--) { if (_AggroerList[i]==row) { @@ -407,7 +407,7 @@ void CManagerPlayer::getTeamIds(std::vector& teamIds) void CBotPlayer::forgotAggroForAggroer() { - for (sint32 i=_AggroerList.size()-1; i>=0; --i) + for (sint32 i=(sint32)_AggroerList.size()-1; i>=0; --i) { CAIEntityPhysical* const phys = CAIS::instance().getEntityPhysical(_AggroerList[i]); if (!phys) diff --git a/code/ryzom/server/src/ai_service/ai_profile_npc.cpp b/code/ryzom/server/src/ai_service/ai_profile_npc.cpp index 7c4824dcc..6ead1f837 100644 --- a/code/ryzom/server/src/ai_service/ai_profile_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_profile_npc.cpp @@ -946,7 +946,7 @@ void CGrpProfileGuard::updateProfile(uint ticksSinceLastUpdate) static uint32 s_maxBotsVisible = 0; static double s_maxBotsVisionTime = 0.0; - uint32 numBotsVisible = GuardVision.bots().size(); + uint32 numBotsVisible = (uint32)GuardVision.bots().size(); double deltaVisionTime = CTime::ticksToSecond(endVisionTime-startVisionTime); bool bTellUs = false; if( s_maxBotsVisible < numBotsVisible ) @@ -1443,7 +1443,7 @@ void CGrpProfileGoToPoint::calcRatios() if (_Shape!=SHAPE_RECTANGLE) return; - const uint32 nbbots=_NpcList.size(); + const uint32 nbbots=(uint32)_NpcList.size(); _NbRange = (uint32) sqrt(_Ratio*nbbots); if (_NbRange==0) @@ -1922,7 +1922,7 @@ void CGrpProfileFollowRoute::calcRatios () if (_Shape!=SHAPE_RECTANGLE) return; - const uint32 nbbots=_NpcList.size(); + const uint32 nbbots=(uint32)_NpcList.size(); _NbRange = (uint32) sqrt(_Ratio*nbbots); if (_NbRange==0) @@ -2574,8 +2574,8 @@ void CGrpProfileWander::updateProfile(uint ticksSinceLastUpdate) if (!_DestinationReachedAll) { - uint32 npcSize = pgrp.bots().size(); - uint32 reachedSize = _NpcDestinationReached.size(); + uint32 npcSize = (uint32)pgrp.bots().size(); + uint32 reachedSize = (uint32)_NpcDestinationReached.size(); if (reachedSize!= npcSize) { _NpcDestinationReached.resize(npcSize); @@ -2600,7 +2600,7 @@ void CGrpProfileWander::updateProfile(uint ticksSinceLastUpdate) if (!vision.players().empty()) { // there are some player near, look at one if it is not behin us - uint index = CAIS::rand16(vision.players().size()); + uint index = CAIS::rand16((uint32)vision.players().size()); CAngle angle(CAngle::pi()); while (index < vision.players().size() && !target) @@ -2619,7 +2619,7 @@ void CGrpProfileWander::updateProfile(uint ticksSinceLastUpdate) if (!target && !vision.bots().empty()) { // there are some bots near, look at one if it is not behin us - uint index = CAIS::rand16(vision.bots().size()); + uint index = CAIS::rand16((uint32)vision.bots().size()); CAngle angle(CAngle::pi()); while (index < vision.bots().size() && !target) @@ -2726,7 +2726,7 @@ void CGrpProfileWander::updateProfile(uint ticksSinceLastUpdate) pgrp.processStateEvent(pgrp.mgr().EventDestinationReachedFirst); } - uint32 first=0, last=_NpcDestinationReached.size(); + uint32 first=0, last=(uint32)_NpcDestinationReached.size(); for ( ; first != last && _NpcDestinationReached[first]; ++first) {} if (first == last) @@ -2912,7 +2912,7 @@ void CGrpProfileWanderNoPrim::updateProfile(uint ticksSinceLastUpdate) if (!vision.players().empty()) { // there are some player near, look at one if it is not behin us - uint index = CAIS::rand16(vision.players().size()); + uint index = CAIS::rand16((uint32)vision.players().size()); CAngle angle(CAngle::pi()); while (index < vision.players().size() && !target) @@ -2931,7 +2931,7 @@ void CGrpProfileWanderNoPrim::updateProfile(uint ticksSinceLastUpdate) if (!target && !vision.bots().empty()) { // there are some bots near, look at one if it is not behin us - uint index = CAIS::rand16(vision.bots().size()); + uint index = CAIS::rand16((uint32)vision.bots().size()); CAngle angle(CAngle::pi()); while (index < vision.bots().size() && !target) diff --git a/code/ryzom/server/src/ai_service/ai_script_comp.cpp b/code/ryzom/server/src/ai_service/ai_script_comp.cpp index 91c747926..9acf6c20a 100644 --- a/code/ryzom/server/src/ai_service/ai_script_comp.cpp +++ b/code/ryzom/server/src/ai_service/ai_script_comp.cpp @@ -989,7 +989,7 @@ public: vector params; explodeSubStrings(inStr, params, -1); - const uint32 nbSubScript=params.size(); + const uint32 nbSubScript=(uint32)params.size(); std::vector > scriptComps; try diff --git a/code/ryzom/server/src/ai_service/ais_actions.h b/code/ryzom/server/src/ai_service/ais_actions.h index 59630b912..80f18ad03 100644 --- a/code/ryzom/server/src/ai_service/ais_actions.h +++ b/code/ryzom/server/src/ai_service/ais_actions.h @@ -282,7 +282,7 @@ public: static uint size() { if (!initialised()) init(); - return Stack.size(); + return (uint)Stack.size(); } static void pop() diff --git a/code/ryzom/server/src/ai_service/child_container.h b/code/ryzom/server/src/ai_service/child_container.h index 54835d912..657f822b3 100644 --- a/code/ryzom/server/src/ai_service/child_container.h +++ b/code/ryzom/server/src/ai_service/child_container.h @@ -463,7 +463,7 @@ uint32 CCont::getFirstFreeChild() if (!_Childs[index]) break; } - return index; + return (uint32)index; } template diff --git a/code/ryzom/server/src/ai_service/commands.cpp b/code/ryzom/server/src/ai_service/commands.cpp index 95aac8129..64e4142a3 100644 --- a/code/ryzom/server/src/ai_service/commands.cpp +++ b/code/ryzom/server/src/ai_service/commands.cpp @@ -823,7 +823,7 @@ public: fb->setModifier (_value, nrjIndex); return; } - fb->setModifier (_value, _index); + fb->setModifier (_value, (uint32)_index); } virtual void doOnCellZone(CCellZone *cz) const @@ -2874,7 +2874,7 @@ static int const MULTI_LINE_FORMATER_maxn = 78; void MULTI_LINE_FORMATER::pushTitle(std::vector& container, std::string const& text) { int const maxn = MULTI_LINE_FORMATER_maxn; - int n = maxn - text.length() - 4; + int n = maxn - (int)text.length() - 4; container.push_back(" _/"); container.back() += text; container.back() += "\\" + std::string(n, '_'); diff --git a/code/ryzom/server/src/ai_service/continent.cpp b/code/ryzom/server/src/ai_service/continent.cpp index 4d98f2e3b..e839cad2b 100644 --- a/code/ryzom/server/src/ai_service/continent.cpp +++ b/code/ryzom/server/src/ai_service/continent.cpp @@ -800,7 +800,7 @@ bool CContinent::spawn() // Spawn regions for (size_t i=0; i<_Regions.size(); ++i) { - CRegion* region = _Regions[i]; + CRegion* region = _Regions[(uint32)i]; if (!region) continue; region->spawn(); @@ -808,7 +808,7 @@ bool CContinent::spawn() // Spawn outposts for (size_t i=0; i<_Outposts.size(); ++i) { - COutpost* outpost = _Outposts[i]; + COutpost* outpost = _Outposts[(uint32)i]; if (!outpost) continue; outpost->spawn(); @@ -822,7 +822,7 @@ bool CContinent::despawn() // Despawn regions for (size_t i=0; i<_Regions.size(); ++i) { - CRegion* region = _Regions[i]; + CRegion* region = _Regions[(uint32)i]; if (!region) continue; region->despawn(); @@ -830,7 +830,7 @@ bool CContinent::despawn() // Despawn outposts for (size_t i=0; i<_Outposts.size(); ++i) { - COutpost* outpost = _Outposts[i]; + COutpost* outpost = _Outposts[(uint32)i]; if (!outpost) continue; outpost->despawn(); @@ -1113,7 +1113,7 @@ bool CRegion::spawn() // Spawn cellzones for (size_t j=0; j<_CellZones.size(); ++j) { - CCellZone* cellZone = _CellZones[j]; + CCellZone* cellZone = _CellZones[(uint32)j]; if (!cellZone) continue; cellZone->spawn(); @@ -1127,7 +1127,7 @@ bool CRegion::despawn() // Despawn cellzones for (size_t j=0; j<_CellZones.size(); ++j) { - CCellZone* cellZone = _CellZones[j]; + CCellZone* cellZone = _CellZones[(uint32)j]; if (!cellZone) continue; cellZone->despawn(); @@ -1760,7 +1760,7 @@ const CFaunaZone *CCellZone::lookupFaunaZone(const CPropertySet &activity, TASta } } if (candidates.size()>0) - return candidates[CAIS::rand16(candidates.size())]; + return candidates[CAIS::rand16((uint32)candidates.size())]; return NULL; } @@ -1868,7 +1868,7 @@ const CNpcZone *CCellZone::lookupNpcZone(const CPropertySet &activity, size_t re } if (candidates.size()>0) - return candidates[CAIS::rand16(candidates.size())]; + return candidates[CAIS::rand16((uint32)candidates.size())]; // warning only once { @@ -2099,7 +2099,7 @@ const CNpcZone *CCellZone::lookupNpcZoneScorer (std::vector cells, const } if (candidates.size()>0) - return candidates[CAIS::rand16(candidates.size())]; + return candidates[CAIS::rand16((uint32)candidates.size())]; return NULL; } @@ -2108,7 +2108,7 @@ bool CCellZone::spawn() // Spawn families for (size_t k=0; k<_Families.size(); ++k) { - CFamilyBehavior* familyBehavior = _Families[k]; + CFamilyBehavior* familyBehavior = _Families[(uint32)k]; if (!familyBehavior) continue; familyBehavior->spawn(); @@ -2122,7 +2122,7 @@ bool CCellZone::despawn() // Despawn families for (size_t k=0; k<_Families.size(); ++k) { - CFamilyBehavior* familyBehavior = _Families[k]; + CFamilyBehavior* familyBehavior = _Families[(uint32)k]; if (!familyBehavior) continue; familyBehavior->despawn(); diff --git a/code/ryzom/server/src/ai_service/continent_inline.h b/code/ryzom/server/src/ai_service/continent_inline.h index b15848af5..e38493b23 100644 --- a/code/ryzom/server/src/ai_service/continent_inline.h +++ b/code/ryzom/server/src/ai_service/continent_inline.h @@ -339,9 +339,9 @@ inline CNpcZone* CCell::npcZone(size_t index) { if (index<_NpcZonePlaces.size()) - return _NpcZonePlaces[index]; + return _NpcZonePlaces[(uint32)index]; else - return _NpcZoneShapes[index]; + return _NpcZoneShapes[(uint32)index]; } inline @@ -455,7 +455,7 @@ bool CGroupDesc::setSheet(std::string const& sheetName) { for (size_t i=0; i<_MultiLevelSheetCount; ++i) { - char letter = (i/4) + 'b'; + char letter = char(i/4) + 'b'; char number = (i%4) + '1'; std::string sheetNameLevel = sheetName+letter+number; // Compute sheet id @@ -1240,7 +1240,7 @@ void CBotDesc::setSheet(std::string const& sheetName) { for (size_t i=0; i<_MultiLevelSheetCount; ++i) { - char letter = (i/4) + 'b'; + char letter = char(i/4) + 'b'; char number = (i%4) + '1'; std::string sheetNameLevel = sheetName+letter+number; // Compute sheet id diff --git a/code/ryzom/server/src/ai_service/generic_logic_action.cpp b/code/ryzom/server/src/ai_service/generic_logic_action.cpp index 8bf904312..f69d539ad 100644 --- a/code/ryzom/server/src/ai_service/generic_logic_action.cpp +++ b/code/ryzom/server/src/ai_service/generic_logic_action.cpp @@ -195,7 +195,7 @@ public: nlwarning("begin_state failed because state list is empty"); return false; } - uint i=CAIS::rand16(_states.size()); + uint i=CAIS::rand16((uint32)_states.size()); entity->getDebugHistory()->addHistory("GRP State Change: %s => %s", entity->getState()->getAliasNode()->fullName().c_str(), @@ -458,7 +458,7 @@ public: bool result=true; - const uint32 nbActions=_subActions.size(); + const uint32 nbActions=(uint32)_subActions.size(); for (uint32 i=0;isetNextPunctualState(_states[CAIS::rand16(_states.size())]); + entity->setNextPunctualState(_states[CAIS::rand16((uint32)_states.size())]); entity->getDebugHistory()->addHistory("GRP BeginPunctual State: %s", entity->getNextPunctualState()->getAliasNode()->fullName().c_str()); return true; @@ -587,7 +587,7 @@ public: nlwarning("random_select failed because sub-action list is empty"); return false; } - _subActions[CAIS::rand16(_subActions.size())]->executeAction(entity,event); + _subActions[CAIS::rand16((uint32)_subActions.size())]->executeAction(entity,event); return true; } @@ -1193,7 +1193,7 @@ static CGroup* findGroup(const std::string& groupName,CStateMachine *stateMachin { CGroup *igroup=NULL; // Check if theres a group with the good name in the same stateMachine (and only one). - for (sint32 grpIndex=grps.size()-1;grpIndex>=0;grpIndex--) + for (sint32 grpIndex=(sint32)grps.size()-1;grpIndex>=0;grpIndex--) { if (grps[grpIndex]->getManager().getStateMachine()!=stateMachine) continue; @@ -1376,7 +1376,7 @@ public: { CGroup *igroup=NULL; // Check if theres a group with the good name in the same stateMachine (and only one). - for (sint32 grpIndex=grps.size()-1;grpIndex>=0;grpIndex--) + for (sint32 grpIndex=(sint32)grps.size()-1;grpIndex>=0;grpIndex--) { if (grps[grpIndex]->getManager().getStateMachine()!=stateMachine) continue; @@ -1822,7 +1822,7 @@ public: // r2 mode groupename:botname if (_R2) { - uint first(0), last(_Groups.size()); + uint first = 0, last = (uint)_Groups.size(); for (; first != last; ++first) { CGroup *grp = _Groups[first]; @@ -2165,7 +2165,7 @@ public: { // this line treated first ... in case we bomb out in one of the if(...) { ... return; } cases - uint32 nbArgs = args.size(); + uint32 nbArgs = (uint32)args.size(); if (nbArgs==0) { nlwarning("switch_actions (%s) need an argument !", eventNode->fullName().c_str()); @@ -2943,7 +2943,7 @@ public: if(cstring=="DSS_") { _Id=true; - NLMISC::CSString tmp = NLMISC::CSString (_Sentence).right(_Sentence.length()-4); + NLMISC::CSString tmp = NLMISC::CSString (_Sentence).right((unsigned int)_Sentence.length()-4); NLMISC::CSString tmp2 = tmp.strtok(" ",false,false,false,false); _ScenarioId = atoi(tmp2.c_str()); _Sentence = tmp; @@ -3021,7 +3021,7 @@ public: else { float val; - uint32 size=_Vars.size(),i=0; + uint32 size=(uint32)_Vars.size(),i=0; std::vector values; for(;i=0) { @@ -149,7 +149,7 @@ void CKnapsackSolver::optimizeAddCheck() void CKnapsackSolver::optimizeFullAddCheck() { H_AUTO(CKnapsackSolver_optimizeFullAddCheck); - int i = size()-1; + int i = (int)size()-1; float w = _WMax - _WBest; while (i>=0) { @@ -168,7 +168,7 @@ void CKnapsackSolver::optimizeFullAddCheck() void CKnapsackSolver::optimizeFastAddCheck() { H_AUTO(CKnapsackSolver_optimizeFastAddCheck); - int i = size()-1; + int i = (int)size()-1; float w = _WMax - _WBest; while (i>=0) { @@ -192,7 +192,7 @@ void CKnapsackSolver::optimizeFullSingleReplace() { optimizeFullAddCheck(); H_AUTO(CKnapsackSolver_optimizeFullSingleReplace); - int i = size()-1; + int i = (int)size()-1; while (i>=0) { // For each not taken ith element @@ -202,7 +202,7 @@ void CKnapsackSolver::optimizeFullSingleReplace() float v = value(i); int worst = i; // Find the worst element that ith element can replace - int j = size()-1; + int j = (int)size()-1; while (j>=0) { if (i!=j && _Take[j] && w<=weight(j) && v>value(j)) @@ -239,7 +239,7 @@ void CKnapsackSolver::optimizeSingleReplace() if (_VBest > vBest) return; H_AUTO(CKnapsackSolver_optimizeSingleReplace); - int i = size()-1; + int i = (int)size()-1; while (i>=0) { // For each not taken ith element @@ -249,7 +249,7 @@ void CKnapsackSolver::optimizeSingleReplace() float v = value(i); int worst = i; // Find the worst element that ith element can replace - int j = size()-1; + int j = (int)size()-1; while (j>=0) { if (i!=j && _Take[j] && w<=weight(j) && v>value(j)) @@ -286,7 +286,7 @@ void CKnapsackSolver::optimizeFastSingleReplace() if (_VBest > vBest) return; H_AUTO(CKnapsackSolver_optimizeFastSingleReplace); - int i = size()-1; + int i = (int)size()-1; while (i>=0) { // For each not taken ith element @@ -296,7 +296,7 @@ void CKnapsackSolver::optimizeFastSingleReplace() float v = value(i); int worst = i; // Find the worst element that ith element can replace - int j = size()-1; + int j = (int)size()-1; while (j>=0) { if (i!=j && _Take[j] && w<=weight(j) && v>value(j)) @@ -334,7 +334,7 @@ void CKnapsackSolver::optimizeVeryFastSingleReplace() if (_VBest > vBest) return; H_AUTO(CKnapsackSolver_optimizeVeryFastSingleReplace); - int i = size()-1; + int i = (int)size()-1; while (i>=0) { // For each not taken ith element @@ -344,7 +344,7 @@ void CKnapsackSolver::optimizeVeryFastSingleReplace() float v = value(i); int worst = i; // Find the worst element that ith element can replace - int j = size()-1; + int j = (int)size()-1; while (j>=0) { if (i!=j && _Take[j] && w<=weight(j) && v>value(j)) @@ -377,7 +377,7 @@ void CKnapsackSolver::optimizeTakeAll() H_AUTO(CKnapsackSolver_optimizeTakeAll); _WBest = 0; _VBest = 0; - int i = size()-1; + int i = (int)size()-1; while (i>=0) { _Take[i] = true; diff --git a/code/ryzom/server/src/ai_service/messages.cpp b/code/ryzom/server/src/ai_service/messages.cpp index 0a97451c9..64730a1b7 100644 --- a/code/ryzom/server/src/ai_service/messages.cpp +++ b/code/ryzom/server/src/ai_service/messages.cpp @@ -785,7 +785,7 @@ void CAIAskForInfosOnEntityImp::callback (const std::string &name, NLNET::TServi void CChangeActionFlagMsgImp::callback (const std::string &name, NLNET::TServiceId id) { - const uint32 size = Entities.size(); + const uint32 size = (uint32)Entities.size(); nlassert( size == ActionFlags.size() && size == Values.size()); for (uint32 i = 0 ; i < size ; ++i) diff --git a/code/ryzom/server/src/ai_service/nf_grp.cpp b/code/ryzom/server/src/ai_service/nf_grp.cpp index 01d0b5d19..66efb2896 100644 --- a/code/ryzom/server/src/ai_service/nf_grp.cpp +++ b/code/ryzom/server/src/ai_service/nf_grp.cpp @@ -928,7 +928,7 @@ void getGroupTemplateWithFlags_sss_s(CStateInstance* entity, CScriptStack& stack return; } - CGroupDesc const* groupDesc = groupDescs[CAIS::rand16(groupDescs.size())]; + CGroupDesc const* groupDesc = groupDescs[CAIS::rand16((uint32)groupDescs.size())]; stack.push(groupDesc->getFullName()); return; } diff --git a/code/ryzom/server/src/ai_service/nf_grp_npc.cpp b/code/ryzom/server/src/ai_service/nf_grp_npc.cpp index d0f9328ba..a106d757d 100644 --- a/code/ryzom/server/src/ai_service/nf_grp_npc.cpp +++ b/code/ryzom/server/src/ai_service/nf_grp_npc.cpp @@ -2109,7 +2109,7 @@ void npcSay_css_(CStateInstance* entity, CScriptStack& stack) if(prefix=="DSS_") { - NLMISC::CSString phrase = NLMISC::CSString (text).right(text.length()-4); + NLMISC::CSString phrase = NLMISC::CSString (text).right((unsigned int)text.length()-4); NLMISC::CSString idStr = phrase.strtok(" ",false,false,false,false); uint32 scenarioId = atoi(idStr.c_str()); forwardToDss(spawnBot->dataSetRow(), CChatGroup::say, phrase, scenarioId); @@ -2118,7 +2118,7 @@ void npcSay_css_(CStateInstance* entity, CScriptStack& stack) if (prefix=="RAW ") { - NLMISC::CSString phrase = NLMISC::CSString (text).right(text.length()-4); + NLMISC::CSString phrase = NLMISC::CSString (text).right((unsigned int)text.length()-4); npcChatToChannelSentence(spawnBot->dataSetRow(),CChatGroup::say, phrase); return; } diff --git a/code/ryzom/server/src/ai_service/nf_helpers.h b/code/ryzom/server/src/ai_service/nf_helpers.h index 20e180ad2..7e5733de2 100644 --- a/code/ryzom/server/src/ai_service/nf_helpers.h +++ b/code/ryzom/server/src/ai_service/nf_helpers.h @@ -135,8 +135,8 @@ public: void doOnFamily(CFamilyBehavior* fb) const { - float value = fb->getModifier(_IndexSrc); - fb->setModifier(value, _IndexDest); + float value = fb->getModifier((uint32)_IndexSrc); + fb->setModifier(value, (uint32)_IndexDest); } void doOnCellZone(CCellZone* cz) const { } @@ -167,7 +167,7 @@ public: fb->setModifier (_value, nrjIndex); return; } - fb->setModifier (_value, _index); + fb->setModifier (_value, (uint32)_index); } void doOnCellZone(CCellZone *cz) const { } diff --git a/code/ryzom/server/src/ai_service/nf_state_instance.cpp b/code/ryzom/server/src/ai_service/nf_state_instance.cpp index f042297ec..c52acc7d8 100644 --- a/code/ryzom/server/src/ai_service/nf_state_instance.cpp +++ b/code/ryzom/server/src/ai_service/nf_state_instance.cpp @@ -68,15 +68,15 @@ void setEvent_f_(CStateInstance* entity, CScriptStack& stack) if (IsRingShard.get()) { - if ( entity->isUserEventBlocked( eventIndex) ) { return; } // Do not allow uservent recursion on ring shard - entity->blockUserEvent(eventIndex); + if ( entity->isUserEventBlocked( (uint32)eventIndex) ) { return; } // Do not allow uservent recursion on ring shard + entity->blockUserEvent((uint32)eventIndex); } entity->processStateEvent(entity->getPersistentStateInstance()->getEventContainer().EventUserEvent[eventIndex]); if (IsRingShard.get()) { - entity->unblockUserEvent(eventIndex); + entity->unblockUserEvent((uint32)eventIndex); } } @@ -118,7 +118,7 @@ void setTimer_ff_(CStateInstance* si, CScriptStack& stack) nlassert(false); } - si->timerUser(timerId).set(deltaTime); + si->timerUser((uint)timerId).set((uint32)deltaTime); } //---------------------------------------------------------------------------- @@ -183,7 +183,7 @@ void timerSetRyzomDaytime_fff_(CStateInstance* si, CScriptStack& stack) return; } - si->timerUser(timerId).set(timeTicks); + si->timerUser((uint)timerId).set((uint32)timeTicks); } //---------------------------------------------------------------------------- @@ -222,7 +222,7 @@ void timerIsEnabled_f_f(CStateInstance* si, CScriptStack& stack) return; } - float isEnabled = si->timerUser(timerId).isEnabled(); + float isEnabled = si->timerUser((uint)timerId).isEnabled(); stack.push(isEnabled); } @@ -262,7 +262,7 @@ void timerIsSuspended_f_f(CStateInstance* si, CScriptStack& stack) return; } - float isSuspended = si->timerUser(timerId).isSuspended(); + float isSuspended = si->timerUser((uint)timerId).isSuspended(); stack.push(isSuspended); } @@ -301,7 +301,7 @@ void timerSuspend_f_(CStateInstance* si, CScriptStack& stack) return; } - si->timerUser(timerId).suspend(); + si->timerUser((uint)timerId).suspend(); } //---------------------------------------------------------------------------- @@ -339,7 +339,7 @@ void timerDisable_f_(CStateInstance* si, CScriptStack& stack) return; } - si->timerUser(timerId).disable(); + si->timerUser((uint)timerId).disable(); } //---------------------------------------------------------------------------- @@ -377,7 +377,7 @@ void timerResume_f_(CStateInstance* si, CScriptStack& stack) return; } - si->timerUser(timerId).resume(); + si->timerUser((uint)timerId).resume(); } //---------------------------------------------------------------------------- @@ -423,12 +423,12 @@ void timerAdd_ff_(CStateInstance* si, CScriptStack& stack) if (dt > 0) { uint32 dt2 = static_cast(dt); - si->timerUser(timerId).add(dt2); + si->timerUser((uint)timerId).add(dt2); } else { uint32 dt2 = static_cast(-dt); - si->timerUser(timerId).sub(dt2); + si->timerUser((uint)timerId).sub(dt2); } } diff --git a/code/ryzom/server/src/ai_service/path_behaviors.cpp b/code/ryzom/server/src/ai_service/path_behaviors.cpp index d1cc10442..e5b872899 100644 --- a/code/ryzom/server/src/ai_service/path_behaviors.cpp +++ b/code/ryzom/server/src/ai_service/path_behaviors.cpp @@ -698,7 +698,7 @@ bool CPathCont::getPathForSource(CPathPosition& pathPos, RYAI_MAP_CRUNCH::CWorld if (topoItFind!=topoItEnd) { - pathPos._Index = topoItFind-topoItBegin; + pathPos._Index = (uint)(topoItFind-topoItBegin); pathPos._Path = *it; return true; } @@ -834,7 +834,7 @@ RYAI_MAP_CRUNCH::CTopology::TTopologyRef const& CPathPosition::getNextTopology() bool CPathPosition::isFinished() const { - uint32 size = _Path->topologiesPath().size(); + uint32 size = (uint32)_Path->topologiesPath().size(); return (size==0 || _Index==size-1); } diff --git a/code/ryzom/server/src/ai_service/script_compiler.cpp b/code/ryzom/server/src/ai_service/script_compiler.cpp index 3d2bd9a78..d13819ca4 100644 --- a/code/ryzom/server/src/ai_service/script_compiler.cpp +++ b/code/ryzom/server/src/ai_service/script_compiler.cpp @@ -2168,7 +2168,7 @@ bool compileExternalScript (const char *filename, const char *outputFilename) string content; char buffer[512]; int read; - while ((read = fread (buffer, 1, sizeof(buffer)-1, file)) == sizeof(buffer)-1) + while ((read = (int)fread (buffer, 1, sizeof(buffer)-1, file)) == sizeof(buffer)-1) { buffer[read] = 0; content += buffer; diff --git a/code/ryzom/server/src/ai_service/script_parser.lex b/code/ryzom/server/src/ai_service/script_parser.lex index 5ae428543..ccddc5a62 100644 --- a/code/ryzom/server/src/ai_service/script_parser.lex +++ b/code/ryzom/server/src/ai_service/script_parser.lex @@ -48,7 +48,7 @@ size_t makeStringId (const char *str) void addSignature (char *dest, char s) { - uint size = strlen (dest); + uint size = (uint)strlen (dest); if (size+1 < (uint)(AICOMP_MAX_SIGNATURE)) { dest[size] = s; @@ -58,8 +58,8 @@ void addSignature (char *dest, char s) void addSignature (char *dest, char *src) { - uint size0 = strlen (dest); - uint size1 = strlen (src); + uint size0 = (uint)strlen (dest); + uint size1 = (uint)strlen (src); if (size0+size1+1 < (uint)(AICOMP_MAX_SIGNATURE)) strcat (dest, src); } diff --git a/code/ryzom/server/src/ai_service/script_parser.yacc b/code/ryzom/server/src/ai_service/script_parser.yacc index 98f439ba4..52a39e7e6 100644 --- a/code/ryzom/server/src/ai_service/script_parser.yacc +++ b/code/ryzom/server/src/ai_service/script_parser.yacc @@ -58,7 +58,7 @@ bool aiCompile (std::vector &dest, const char *script, const char *scrip aiLine = 1; aiErrorCount = 0; aiInputScript = script; - aiInputScriptLength = strlen (script); + aiInputScriptLength = (uint)strlen (script); strcpy (aiFile, scriptName); aiRoot = NULL; @@ -189,7 +189,7 @@ uint getChildrenByteCodeSize (const list * > *l) list * >::const_iterator ite = l->begin(); while (ite != l->end()) { - size += (*ite)->size (); + size += (uint)(*ite)->size (); ite++; } return size; @@ -229,7 +229,7 @@ uint getChildrenByteCodeSize (const map *l) map::const_iterator ite = l->begin (); while (ite != l->end ()) { - size += ite->second->ByteCode->size(); + size += (uint)ite->second->ByteCode->size(); ite ++; } return size; @@ -528,22 +528,22 @@ statement: openStatement { $$ = $1; } openStatement: TOKEN_IF TOKEN_LP condition TOKEN_RP statement { - int sizeToJump = $5.ByteCode->size() + 1; // 1 jump instruction to escape + int sizeToJump = (int)$5.ByteCode->size() + 1; // 1 jump instruction to escape NODE4 ($$, $3, CScriptVM::JE, sizeToJump, $5); } | TOKEN_IF TOKEN_LP condition statement {ERROR_DETECTED ($$, "missing ')' at the end of the if condition");} | TOKEN_IF condition TOKEN_RP statement {ERROR_DETECTED ($$, "missing '(' at the begining of the if condition");} | TOKEN_IF TOKEN_LP condition TOKEN_RP closedStatement TOKEN_ELSE openStatement { - int sizeToJump0 = $5.ByteCode->size() + 3; // 2 jump instructions to escape - int sizeToJump1 = $7.ByteCode->size() + 1; // 1 jump instruction to escape + int sizeToJump0 = (int)$5.ByteCode->size() + 3; // 2 jump instructions to escape + int sizeToJump1 = (int)$7.ByteCode->size() + 1; // 1 jump instruction to escape NODE7 ($$, $3, CScriptVM::JE, sizeToJump0, $5, CScriptVM::JUMP, sizeToJump1, $7); } | TOKEN_IF TOKEN_LP condition closedStatement TOKEN_ELSE openStatement { ERROR_DETECTED ($$, "missing ')' at the end of the if condition");} | TOKEN_IF condition TOKEN_RP closedStatement TOKEN_ELSE openStatement { ERROR_DETECTED ($$, "missing '(' at the begining of the if condition");} | TOKEN_WHILE TOKEN_LP condition TOKEN_RP openStatement { - int sizeToJump0 = $5.ByteCode->size() + 3; // 2 jump instructions to escape + int sizeToJump0 = (int)$5.ByteCode->size() + 3; // 2 jump instructions to escape int sizeToJump1 = -(int)$5.ByteCode->size() - 3 - (int)$3.ByteCode->size(); // 1 jump instruction to escape NODE6 ($$, $3, CScriptVM::JE, sizeToJump0, $5, CScriptVM::JUMP, sizeToJump1); } @@ -552,15 +552,15 @@ openStatement: TOKEN_IF TOKEN_LP condition TOKEN_RP statement closedStatement:TOKEN_IF TOKEN_LP condition TOKEN_RP closedStatement TOKEN_ELSE closedStatement { - int sizeToJump0 = $5.ByteCode->size() + 3; // 2 jump instructions to escape - int sizeToJump1 = $7.ByteCode->size() + 1; // 1 jump instruction to escape + int sizeToJump0 = (int)$5.ByteCode->size() + 3; // 2 jump instructions to escape + int sizeToJump1 = (int)$7.ByteCode->size() + 1; // 1 jump instruction to escape NODE7 ($$, $3, CScriptVM::JE, sizeToJump0, $5, CScriptVM::JUMP, sizeToJump1, $7); } | TOKEN_IF TOKEN_LP condition closedStatement TOKEN_ELSE closedStatement { ERROR_DETECTED ($$, "missing ')' at the end of the if condition");} | TOKEN_IF condition TOKEN_RP closedStatement TOKEN_ELSE closedStatement { ERROR_DETECTED ($$, "missing '(' at the end of the if condition");} | TOKEN_WHILE TOKEN_LP condition TOKEN_RP closedStatement { - int sizeToJump0 = $5.ByteCode->size() + 3; // 2 jump instructions to escape + int sizeToJump0 = (int)$5.ByteCode->size() + 3; // 2 jump instructions to escape int sizeToJump1 = -(int)$5.ByteCode->size() - 3 - (int)$3.ByteCode->size(); // 1 jump instruction to escape NODE6 ($$, $3, CScriptVM::JE, sizeToJump0, $5, CScriptVM::JUMP, sizeToJump1); } @@ -697,7 +697,7 @@ switch: TOKEN_SWITCH TOKEN_LP expression TOKEN_RP TOKEN_LA cases TOKEN_RA addNode ($$, _case->Case); addNode ($$, sizeToJump); - sizeToJump += _case->ByteCode->size (); + sizeToJump += (uint)_case->ByteCode->size (); sizeToJump += 1; // One for the RET sizeToJump -= 1; // One for the case key sizeToJump -= 1; // One for the offset diff --git a/code/ryzom/server/src/ai_service/script_vm.cpp b/code/ryzom/server/src/ai_service/script_vm.cpp index 32b62b6eb..6755ba881 100644 --- a/code/ryzom/server/src/ai_service/script_vm.cpp +++ b/code/ryzom/server/src/ai_service/script_vm.cpp @@ -913,7 +913,7 @@ void CScriptVM::interpretCode( IScriptContext* const sc = stack.top(); stack.pop(); string const& funcName = CStringMapper::unmap(*((TStringId*)&opcodes[++index])); - int mode = opcodes[++index]; + int mode = (int)opcodes[++index]; string const& inParamsSig = CStringMapper::unmap(*((TStringId*)&opcodes[++index])); string const& outParamsSig = CStringMapper::unmap(*((TStringId*)&opcodes[++index])); if (sc) @@ -949,7 +949,7 @@ void CScriptVM::interpretCode( continue; case RAND: { - const size_t randIndex=rand32(opcodes[index+1]); // rand(RANDCOUNT) + const size_t randIndex=rand32((uint32)opcodes[index+1]); // rand(RANDCOUNT) index+=3; // pass RAND + RANDCOUNT + 1 stack.push((int)(index+opcodes[index])); // push the absolute address for RET. diff --git a/code/ryzom/server/src/ai_service/sheets.cpp b/code/ryzom/server/src/ai_service/sheets.cpp index 9ba72b2f5..5b417b83f 100644 --- a/code/ryzom/server/src/ai_service/sheets.cpp +++ b/code/ryzom/server/src/ai_service/sheets.cpp @@ -167,7 +167,7 @@ void AISHEETS::CActionList::serial(NLMISC::IStream& s) } else { - uint32 nbSheet = _Actions.size(); + uint32 nbSheet = (uint32)_Actions.size(); s.serial(nbSheet); for (uint32 i=0; i::iterator it = _NameToGroupIndex.find(groupIndexName); if (it==_NameToGroupIndex.end()) { - uint32 groupIndex = _NameToGroupIndex.size(); + uint32 groupIndex = (uint32)_NameToGroupIndex.size(); _NameToGroupIndex.insert(make_pair(groupIndexName, groupIndex)); #if !FINAL_VERSION nldebug("GroupIndex Entry: %s %d", groupIndexName.c_str(), groupIndex); diff --git a/code/ryzom/server/src/ai_service/states.h b/code/ryzom/server/src/ai_service/states.h index 5d6b2eb93..98e4044ba 100644 --- a/code/ryzom/server/src/ai_service/states.h +++ b/code/ryzom/server/src/ai_service/states.h @@ -116,7 +116,7 @@ public: bool hasPoints () const { return _Geometry.size()!=0; } // accessors for path & patat geometry - whichever of the 2 exists - uint32 numPoints() { return _Geometry.size(); } + uint32 numPoints() { return (uint32)_Geometry.size(); } const TPosition *point(uint32 idx) { return idx<_Geometry.size()? &_Geometry[idx]: NULL; } const std::vector &getGeometry() const { return _Geometry; } diff --git a/code/ryzom/server/src/ai_share/16x16_layer.cpp b/code/ryzom/server/src/ai_share/16x16_layer.cpp index 8a309d964..3c0ee6188 100644 --- a/code/ryzom/server/src/ai_share/16x16_layer.cpp +++ b/code/ryzom/server/src/ai_share/16x16_layer.cpp @@ -105,7 +105,7 @@ I16x16Layer *I16x16Layer::compress(I16x16Layer *layer, sint32 blank) ++((*it).second); } - uint msize = count.size(); + uint msize = (uint)count.size(); if (msize == 1) { diff --git a/code/ryzom/server/src/ai_share/ai_actions.h b/code/ryzom/server/src/ai_share/ai_actions.h index d4682fada..6fb9f0a1d 100644 --- a/code/ryzom/server/src/ai_share/ai_actions.h +++ b/code/ryzom/server/src/ai_share/ai_actions.h @@ -267,7 +267,7 @@ public: if (index>=data.size()) { nlwarning("Unexpected end of input data in serialFromString()"); - index=data.size()+1; + index=(uint)data.size()+1; return CArg(); } } @@ -279,7 +279,7 @@ public: if (index>data.size()) { nlwarning("Unexpected end of input data in serialFromString()"); - index=data.size()+1; + index=(uint)data.size()+1; return CArg(); } return CArg(bool(data[index] == 1)); @@ -289,7 +289,7 @@ public: if (index>data.size()) { nlwarning("Unexpected end of input data in serialFromString()"); - index=data.size()+1; + index=(uint)data.size()+1; return CArg(); } return CArg(((sint32 *)&data[index])[-1]); @@ -299,7 +299,7 @@ public: if (index>data.size()) { nlwarning("Unexpected end of input data in serialFromString()"); - index=data.size()+1; + index=(uint)data.size()+1; return CArg(); } return CArg(((float *)&data[index])[-1]); @@ -315,7 +315,7 @@ public: break; } nlwarning("Unexpected type in serialFromString()"); - index=data.size()+1; + index=(uint)data.size()+1; return CArg(); } diff --git a/code/ryzom/server/src/ai_share/ai_alias_description_node.h b/code/ryzom/server/src/ai_share/ai_alias_description_node.h index 2c76c7f55..364ad8a57 100644 --- a/code/ryzom/server/src/ai_share/ai_alias_description_node.h +++ b/code/ryzom/server/src/ai_share/ai_alias_description_node.h @@ -113,7 +113,7 @@ public: const NLMISC::CSmartPtr &getParent () const { return _parent; } // tree parse and search routines - uint32 getChildCount () const { nlassert(this!=NULL); return _children.size(); } + uint32 getChildCount () const { nlassert(this!=NULL); return (uint32)_children.size(); } CAIAliasDescriptionNode * const &getChild (uint32 idx) const { return _children[idx]; } const CAIAliasDescriptionNode *lookupAlias (uint32 alias) const { diff --git a/code/ryzom/server/src/ai_share/ai_event_report.h b/code/ryzom/server/src/ai_share/ai_event_report.h index 1492613c6..4bc158eb4 100644 --- a/code/ryzom/server/src/ai_share/ai_event_report.h +++ b/code/ryzom/server/src/ai_share/ai_event_report.h @@ -82,7 +82,7 @@ struct CAiEventReport inline void addDelta(AI_EVENT_REPORT::TAIReportStat stat, sint32 delta) { - const uint size = AffectedStats.size(); + const uint size = (uint)AffectedStats.size(); for (uint i = 0; i < size; ++i) { if (AffectedStats[i] == stat) diff --git a/code/ryzom/server/src/ai_share/ai_share.h b/code/ryzom/server/src/ai_share/ai_share.h index 02ceb9ca4..194f67446 100644 --- a/code/ryzom/server/src/ai_share/ai_share.h +++ b/code/ryzom/server/src/ai_share/ai_share.h @@ -86,7 +86,7 @@ namespace AI_SHARE keyword=input.substr(i,k-i); // find the end of the tail text - for (k=input.size();k>j && isWhiteSpace(input[k-1]);) --k; // k points to character after end of tail text + for (k=(uint)input.size();k>j && isWhiteSpace(input[k-1]);) --k; // k points to character after end of tail text // find start of tail text do { ++j; } while(jj && isWhiteSpace(input[i-1]);) --i; // i points to character after end of tail text + for (i=(uint)input.size();i>j && isWhiteSpace(input[i-1]);) --i; // i points to character after end of tail text // find start of tail text do { ++j; } while(j(startTopo, father)); @@ -1550,7 +1550,7 @@ bool CWorldMap::findAStarPath(CWorldPosition const& start, CWorldPosition const& visited.erase(itv); } // Create a new node for that cell - child = nodes.size(); + child = (uint)nodes.size(); nodes.push_back(CAStarHeapNode(next, father, distance, true)); // Compute h(n) as an euclidian distance heuristic float heuristic = (endPoint-next.getCstTopologyNode().Position).norm(); @@ -1625,7 +1625,7 @@ bool CWorldMap::findAStarPath(const CTopology::TTopologyId &start, const CTopolo CAStarHeapNode hnode(startTopo,0xffffffff,0.0f,true); nodes.push_back(hnode); - uint father = nodes.size()-1; + uint father = (uint)nodes.size()-1; // add current to visited nodes visited.insert(make_pair(startTopo, father)); @@ -1682,7 +1682,7 @@ bool CWorldMap::findAStarPath(const CTopology::TTopologyId &start, const CTopolo if (itv == visited.end()) { // if node is not open nor closed, create an entry - child = nodes.size(); + child = (uint)nodes.size(); nodes.push_back(cnode); } else @@ -1759,7 +1759,7 @@ bool CWorldMap::findInsideAStarPath(CWorldPosition const& start, CWorldPosition // Create a heap node for the start point and push it in the node list nodes.push_back(CInsideAStarHeapNode(startNode, 0xffffffff, CDirection(), 0.f, true)); // Take it as first father - uint father = nodes.size()-1; + uint father = (uint)nodes.size()-1; // Add start node to visited nodes (father holds start node index for the moment) visited.insert(make_pair(startNode, father)); @@ -1841,7 +1841,7 @@ bool CWorldMap::findInsideAStarPath(CWorldPosition const& start, CWorldPosition // Else create a new node else { - child = nodes.size(); + child = (uint)nodes.size(); nodes.push_back(CInsideAStarHeapNode(next, father, dir, distance, true)); } // Compute h(n) as an euclidian distance heuristic diff --git a/code/ryzom/server/src/ai_share/world_map.h b/code/ryzom/server/src/ai_share/world_map.h index 012c22f2b..68ef0f3ad 100644 --- a/code/ryzom/server/src/ai_share/world_map.h +++ b/code/ryzom/server/src/ai_share/world_map.h @@ -3588,7 +3588,7 @@ CWorldPosition CWorldMap::getWorldPosition(CMapPosition const& mapPos, TLevel le std::sort(slots.begin(), slots.end()); // get heightest slot - level = slots.size()-1 - level; + level = (RYAI_MAP_CRUNCH::TLevel)(slots.size()-1) - level; // if slot exists, return it or invalid position return (level < 0 && level >= (sint)slots.size()) ? CWorldPosition() : CWorldPosition(cell, mapPos, CSlot(slots[level]&3)); diff --git a/code/ryzom/server/src/backup_service/backup_file_access.cpp b/code/ryzom/server/src/backup_service/backup_file_access.cpp index 7276fbb02..770521afe 100644 --- a/code/ryzom/server/src/backup_service/backup_file_access.cpp +++ b/code/ryzom/server/src/backup_service/backup_file_access.cpp @@ -368,7 +368,7 @@ IFileAccess::TReturnCode CWriteFile::execute(CFileAccessManager& manager) try { - f.serialBuffer(&(Data[0]), Data.size()); + f.serialBuffer(&(Data[0]), (uint)Data.size()); fileSaved = true; if (VerboseLog) diff --git a/code/ryzom/server/src/backup_service/backup_service.cpp b/code/ryzom/server/src/backup_service/backup_service.cpp index 2c69761dc..3e8c38762 100644 --- a/code/ryzom/server/src/backup_service/backup_service.cpp +++ b/code/ryzom/server/src/backup_service/backup_service.cpp @@ -568,7 +568,7 @@ static void cbAppend( CMessage& msgin, const std::string &serviceName, NLNET::TS std::string append = inMsg.Append+'\n'; uint8* data = (uint8*)(const_cast(append.c_str())); - uint dataSize = append.size(); + uint dataSize = (uint)append.size(); CWriteFile* access = new CWriteFile(inMsg.FileName, serviceId, 0, data, dataSize); @@ -822,7 +822,7 @@ void CDirectoryRateStat::display(NLMISC::CLog& log) TDirectoryMap::iterator first = _DirectoryMap.begin(), last = _DirectoryMap.end(); for (; first != last; ++first) if ((*first).first.size() > pathsize) - pathsize = (*first).first.size(); + pathsize = (uint)(*first).first.size(); NLMISC::TTime limit = NLMISC::CTime::getLocalTime()-60*1000; diff --git a/code/ryzom/server/src/backup_service/commands.cpp b/code/ryzom/server/src/backup_service/commands.cpp index 09fa86ae2..ce1125893 100644 --- a/code/ryzom/server/src/backup_service/commands.cpp +++ b/code/ryzom/server/src/backup_service/commands.cpp @@ -263,7 +263,7 @@ static void base64Decode(std::vector& buffer, const std::string& encoded) base64Revert[base64Table[i]] = i; } - uint sz = encoded.size(); + uint sz = (uint)encoded.size(); uint inbits = 0; uint bitbuffer = 0; for (i=0; i buffer; base64Decode(buffer, encoded); - f.serialBuffer(&(buffer[0]), buffer.size()); + f.serialBuffer(&(buffer[0]), (uint)buffer.size()); f.close(); return true; diff --git a/code/ryzom/server/src/backup_service/web_connection.cpp b/code/ryzom/server/src/backup_service/web_connection.cpp index 1e9b22b73..9fa0ab477 100644 --- a/code/ryzom/server/src/backup_service/web_connection.cpp +++ b/code/ryzom/server/src/backup_service/web_connection.cpp @@ -262,7 +262,7 @@ void cbGetSaveList(CMemStream &msgin, TSockId host) { std::sort(incrementalDirectories.begin(), incrementalDirectories.end()); - for (i=incrementalDirectories.size()-1; (sint)i>=0; --i) + for (i=(uint)incrementalDirectories.size()-1; (sint)i>=0; --i) { string p = CPath::standardizePath(incrementalDirectories[i], true); // avoid double / inside path diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index 469e0ad69..7f3421a86 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -375,7 +375,7 @@ CAdminCommand * findAdminCommand(const string & name) { H_AUTO(findAdminCommand); - const uint nbCommands = AdminCommands.size(); + const uint nbCommands = (uint)AdminCommands.size(); for (uint i = 0; i < nbCommands; i++) { if (name == AdminCommands[i].Name) @@ -438,7 +438,7 @@ static void loadCommandsPrivileges(const string & fileName, bool init) } // reset privileges with default value - const uint nbCommands = AdminCommands.size(); + const uint nbCommands = (uint)AdminCommands.size(); for (uint i = 0; i < nbCommands; i++) { AdminCommands[i].Priv = DefaultPriv; @@ -1664,7 +1664,7 @@ NLMISC_COMMAND (learnAllBricks, "Specified player learns all possible bricks for const CStaticRolemasterPhrase *phrase = CSheets::getSRolemasterPhrase(phrases[i]); if(phrase != NULL) { - const uint size = phrase->Bricks.size(); + const uint size = (uint)phrase->Bricks.size(); for ( uint j = 0; j < size ; ++j) { c->addKnownBrick( phrase->Bricks[j] ); @@ -1740,7 +1740,7 @@ NLMISC_COMMAND (learnAllRolemasterBricks, "Specified player learns all possible const CStaticRolemasterPhrase *phrase = CSheets::getSRolemasterPhrase(phrases[i]); if(phrase != NULL) { - const uint size = phrase->Bricks.size(); + const uint size = (uint)phrase->Bricks.size(); for ( uint j = 0; j < size ; ++j) { c->addKnownBrick( phrase->Bricks[j] ); @@ -2106,7 +2106,7 @@ NLMISC_CATEGORISED_COMMAND(pdr,listPDRFiles,"list files in the current directory std::vector files; NLMISC::CPath::getPathContent(".",false,false,true,files); - for (uint32 i=files.size();i--;) + for (uint32 i=(uint32)files.size();i--;) { if (!NLMISC::testWildCard(files[i],"*.xml") && !NLMISC::testWildCard(files[i],"*.pdr")) { @@ -3429,7 +3429,7 @@ NLMISC_COMMAND( dssTarget, "target a mob and send information to dss( /b dssTarg msgout.serial(alias); //mob targeted msgout.serial(entityRowId); //datasetrow - uint32 args_size = args.size() - 1; + uint32 args_size = (uint32)args.size() - 1; uint32 i = 0; msgout.serial(args_size); for ( ; i != args_size ; ++i) @@ -5299,7 +5299,7 @@ NLMISC_COMMAND(eventNpcGroupScript, "executes a script on an event npc group", " uint32 instanceNumber = e->getInstanceNumber(); - uint32 nbString = args.size(); + uint32 nbString = (uint32)args.size(); CMessage msgout("EVENT_NPC_GROUP_SCRIPT"); uint32 messageVersion = 1; @@ -5361,7 +5361,7 @@ NLMISC_COMMAND(eventSetNpcGroupAggroRange, "changes the aggro range of a npc gro args2.push_back(args[0]); args2.push_back(NLMISC::toString("()setAggro(%f, 0);", atof(args[1].c_str()))); - uint32 nbString = args2.size(); + uint32 nbString = (uint32)args2.size(); CMessage msgout("EVENT_NPC_GROUP_SCRIPT"); uint32 messageVersion = 1; diff --git a/code/ryzom/server/src/entities_game_service/building_manager/building_manager.cpp b/code/ryzom/server/src/entities_game_service/building_manager/building_manager.cpp index e0a62336e..7525a8c08 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/building_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/building_manager.cpp @@ -393,7 +393,7 @@ void CBuildingManager::addTriggerRequest( const TDataSetRow & rowId, sint32 trig request.Session = 0; CTriggerRequestEntry entry; - const uint destCount = trigger.Destinations.size(); + const uint destCount = (uint)trigger.Destinations.size(); for ( uint i = 0; i < destCount; i++ ) { entry.Destination = trigger.Destinations[i]; @@ -477,7 +477,7 @@ void CBuildingManager::fillTriggerPage(const NLMISC::CEntityId & eId, uint16 cli uint end = start + MaxEntryPerLiftPage; if ( end >= request.Entries.size() ) { - end = request.Entries.size(); + end = (uint)request.Entries.size(); // user->_PropertyDatabase.setProp( "ASCENSOR:HAS_NEXT",0 ); CBankAccessor_PLR::getASCENSOR().setHAS_NEXT(user->_PropertyDatabase, false); } @@ -723,7 +723,7 @@ void CBuildingManager::triggerTeleport(CCharacter * user, uint16 index) // check if sessions mactch between user and system uint16 session = 0; - const uint16 destCount = (*it).second.Entries.size(); + const uint16 destCount = (uint16)(*it).second.Entries.size(); IDestination * currentDest = NULL; for ( uint i = 0; i < destCount; i++ ) { diff --git a/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp b/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp index f2f100432..289875292 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/building_physical.cpp @@ -357,7 +357,7 @@ bool CBuildingPhysicalGuild::isUserAllowed(CCharacter * user, uint16 ownerId, ui //---------------------------------------------------------------------------- uint16 CBuildingPhysicalGuild::getOwnerCount() { - return _Guilds.size(); + return (uint16)_Guilds.size(); } //---------------------------------------------------------------------------- @@ -523,7 +523,7 @@ bool CBuildingPhysicalPlayer::isUserAllowed(CCharacter * user, uint16 ownerId, u //---------------------------------------------------------------------------- uint16 CBuildingPhysicalPlayer::getOwnerCount() { - return _Players.size(); + return (uint16)_Players.size(); } //---------------------------------------------------------------------------- diff --git a/code/ryzom/server/src/entities_game_service/building_manager/building_physical_inline.h b/code/ryzom/server/src/entities_game_service/building_manager/building_physical_inline.h index 91fba8547..744848d8b 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/building_physical_inline.h +++ b/code/ryzom/server/src/entities_game_service/building_manager/building_physical_inline.h @@ -116,7 +116,7 @@ void CBuildingPhysicalGuild::addGuild( uint32 guildId ) _StateCounter++; _Guilds.push_back( guildId ); // add an instance cell to each room for this guild - const uint size = _Rooms.size(); + const uint size = (uint)_Rooms.size(); for ( uint i = 0; i < size; i++ ) { _Rooms[i].Cells.push_back( 0 ); @@ -175,7 +175,7 @@ inline void CBuildingPhysicalPlayer::addPlayer( const NLMISC::CEntityId & userId _StateCounter++; _Players.push_back( userId ); // add an instance cell to each room for this player - const uint size = _Rooms.size(); + const uint size = (uint)_Rooms.size(); for ( uint i = 0; i < size; i++ ) { _Rooms[i].Cells.push_back( 0 ); diff --git a/code/ryzom/server/src/entities_game_service/building_manager/building_unit_test.cpp b/code/ryzom/server/src/entities_game_service/building_manager/building_unit_test.cpp index 52a686053..b02babe18 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/building_unit_test.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/building_unit_test.cpp @@ -151,7 +151,7 @@ void CBuildingTest::timerCallback(CTimer * timer) nlinfo("*** BuildingUnitTest *** callback count %u", _Count); } - const uint randomNumber = (uint) RandomGenerator.rand( TestCharacters.size()-1 ); + const uint randomNumber = (uint) RandomGenerator.rand( (uint16)TestCharacters.size()-1 ); for (uint i = 0; i < _Simultaneous; i++) { checkIntegrity(); @@ -172,7 +172,7 @@ IDestination * CBuildingTest::getRandomDestination() IDestination * dest = NULL; do { - sint32 randomNumber = RandomGenerator.rand( bm->_Triggers.size()-1 ); + sint32 randomNumber = RandomGenerator.rand( (uint16)bm->_Triggers.size()-1 ); CHashMap::iterator itTrigger = bm->_Triggers.begin(); for (sint32 i = 0; i < randomNumber; i++) { @@ -189,7 +189,7 @@ IDestination * CBuildingTest::getRandomDestination() continue; } - randomNumber = RandomGenerator.rand( trigger.Destinations.size()-1 ); + randomNumber = RandomGenerator.rand( (uint16)trigger.Destinations.size()-1 ); dest = trigger.Destinations[randomNumber]; } while ( !dest ); @@ -419,7 +419,7 @@ bool CBuildingTest::changeRoom(uint charIndex) { nlassert(++nbLoops <= maxLoops); - newRoomIndex = (uint16) RandomGenerator.rand( rooms.size()-1 ); + newRoomIndex = (uint16) RandomGenerator.rand( (uint16)rooms.size()-1 ); if (newRoomIndex >= rooms.size()) newRoomIndex = 0; @@ -656,7 +656,7 @@ NLMISC_COMMAND (testBuildingManager, "(debug) Unit test for building manager", if (FakeCharacters.size() < nbChars) { - for (uint i = FakeCharacters.size(); i < nbChars; i++) + for (uint i = (uint)FakeCharacters.size(); i < nbChars; i++) { CEntityId id = createFakeCharacter( firstPlayerId+i, toString("fake%u", i), EGSPD::CPeople::Fyros, GSGENDER::female ); if (id == CEntityId::Unknown) diff --git a/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp b/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp index 05670bd2c..8b5ad1a86 100644 --- a/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp +++ b/code/ryzom/server/src/entities_game_service/building_manager/room_instance.cpp @@ -184,7 +184,7 @@ bool IRoomInstance::create( IBuildingPhysical * building, uint16 roomIdx,uint16 // spawn the bots const CRoomTemplate & templ = building->getTemplate()->Rooms[roomIdx]; - const uint size = templ.Bots.size(); + const uint size = (uint)templ.Bots.size(); _Bots.reserve( size ); for ( uint i = 0; i < size; i++ ) { diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/creature.cpp b/code/ryzom/server/src/entities_game_service/creature_manager/creature.cpp index f6558a32d..ed3283c3c 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/creature.cpp +++ b/code/ryzom/server/src/entities_game_service/creature_manager/creature.cpp @@ -1414,7 +1414,7 @@ void CCreature::setBotDescription( const CGenNpcDescMsgImp& description ) else if ( NLMISC::strlwr(result[0]) == "altar" ) { // nlinfo("OPString: %s", optionalPropertiesString.c_str()); - uint32 nbAltarParams = result.size(); + uint32 nbAltarParams = (uint32)result.size(); for( uint32 i = 1; i < nbAltarParams; ++i ) { // nlinfo("OPSResult: %s", result[i].c_str()); @@ -1619,7 +1619,7 @@ CGameItemPtr CCreature::getNpcItem( const NLMISC::CSheetId &sheet, uint16 qualit { const std::vector< CGameItemPtr > & item = CStaticItems::getStaticItems(); - const uint nbItems = item.size(); + const uint nbItems = (uint)item.size(); for (uint i = 0 ; i < nbItems ; ++i) { if ( item[i] != NULL && item[i]->getSheetId() == sheet && item[i]->quality() == quality ) @@ -1633,7 +1633,7 @@ CGameItemPtr CCreature::getNpcItem( const NLMISC::CSheetId &sheet, uint16 qualit { const std::vector< CGameItemPtr > & items = CGameItemManager::getNpcSpecificItems(); - const uint nbItems = items.size(); + const uint nbItems = (uint)items.size(); for (uint i = 0 ; i < nbItems ; ++i) { if ( items[i] != NULL && items[i]->getSheetId() == sheet ) @@ -2223,7 +2223,7 @@ void CCreature::displayShopSelectors( NLMISC::CLog& log ) //------------------------------------------------------------------------------ bool CCreature::checkFactionAttackable(const CEntityId &playerId) const { - const uint size = _FactionAttackableAbove.size(); + const uint size = (uint)_FactionAttackableAbove.size(); for (uint i = 0 ; i < size ; ++i) { // if player has one of specified fame above 0 he can attack this creature @@ -2232,7 +2232,7 @@ bool CCreature::checkFactionAttackable(const CEntityId &playerId) const return true; } - const uint size2 = _FactionAttackableBelow.size(); + const uint size2 = (uint)_FactionAttackableBelow.size(); for (uint i = 0 ; i < size2 ; ++i) { // if player has one of specified fame above 0 he can attack this creature diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp b/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp index 2017e200c..ebeb904a5 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp @@ -202,12 +202,12 @@ void CChangeCreatureHPImp::callback(const string &, NLNET::TServiceId sid) { H_AUTO(CChangeCreatureHPImp); - uint16 size = Entities.size(); + uint16 size = (uint16)Entities.size(); if (Entities.size() != DeltaHp.size() ) { nlwarning("Entities.size() != DeltaHp.size()"); - size = min(Entities.size(),DeltaHp.size()); + size = (uint16)min(Entities.size(),DeltaHp.size()); } // for each creature, change HP diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.h b/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.h index bb5dd0e93..e4e96b3ad 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.h +++ b/code/ryzom/server/src/entities_game_service/creature_manager/creature_manager.h @@ -119,7 +119,7 @@ public: ~CCreatureManager(); /// Get Number of creaturein manager - uint32 getNumberCreature() { return _Creatures.size(); } + uint32 getNumberCreature() { return (uint32)_Creatures.size(); } /// Get a reference on creature in manager const TMapCreatures& getCreature() { return _Creatures; } diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.cpp b/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.cpp index 407139efc..177f3c195 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.cpp +++ b/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.cpp @@ -125,7 +125,7 @@ bool CHarvestable::writeMpInfos() invTemp->enterMode(TEMP_INV_MODE::Quarter); uint validMps = 0; - uint nbMp = _Mps.size(); + uint nbMp = (uint)_Mps.size(); // Count number of valid mps if (nbMp > INVENTORIES::NbTempInvSlots) @@ -241,7 +241,7 @@ void CHarvestable::setMps( const vector& mps ) TRMQuantityVariable quantityVariable = (TRMQuantityVariable)mps[rmIndices[RMUTotalQuantity][0]].quantityVariable(); const float totalQuarteringQuantityAverage = *QuarteringQuantityByVariable[quantityVariable]; // if a creature is in RMTotalQuantity mode, all the RMs have the same quantityVariable() shared for all const uint MinFilledSlots = 1; - uint rndNbSlotsToFill = MinFilledSlots + RandomGenerator.rand( rmIndices[RMUTotalQuantity].size() - MinFilledSlots ); + uint rndNbSlotsToFill = MinFilledSlots + RandomGenerator.rand( (uint16)rmIndices[RMUTotalQuantity].size() - MinFilledSlots ); float quantityAveragePerFilledSlot = totalQuarteringQuantityAverage / ((float)rndNbSlotsToFill); bool limitTo10PctFromAverage = ((quantityVariable >= RMQVBossBegin) && (quantityVariable <= RMQVBossEnd)); uint intQuantityAveragePerFilledSlot = (uint)quantityAveragePerFilledSlot; @@ -251,7 +251,7 @@ void CHarvestable::setMps( const vector& mps ) for ( uint i=0; i!=rndNbSlotsToFill; ++i ) { // Select a random slot - uint iLastSlotIndex = rmIndices[RMUTotalQuantity].size() - 1; + uint iLastSlotIndex = (uint)rmIndices[RMUTotalQuantity].size() - 1; uint iSlotIndex = RandomGenerator.rand( iLastSlotIndex ); // index in rmIndices[RMUCraft] uint iSlot = rmIndices[RMUTotalQuantity][iSlotIndex]; // index in mps diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/special_trade_list.h b/code/ryzom/server/src/entities_game_service/creature_manager/special_trade_list.h index 1a20c8fde..455b71219 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/special_trade_list.h +++ b/code/ryzom/server/src/entities_game_service/creature_manager/special_trade_list.h @@ -101,7 +101,7 @@ public: { if(!_Content) return 0; - return _Content->SoldItems.size(); + return (uint)_Content->SoldItems.size(); } void getSoldItem(uint idx,NLMISC::CSheetId & sheet, uint16 & level, float & factor) diff --git a/code/ryzom/server/src/entities_game_service/deposit.h b/code/ryzom/server/src/entities_game_service/deposit.h index 5ae5482d6..909876c68 100644 --- a/code/ryzom/server/src/entities_game_service/deposit.h +++ b/code/ryzom/server/src/entities_game_service/deposit.h @@ -237,7 +237,7 @@ public: const std::string& name() const { return _Name; } /// Return the number of MPS in the deposit - uint getContentSize() const { return _RawMaterials.size(); } + uint getContentSize() const { return (uint)_RawMaterials.size(); } /// Return the MPS const std::vector& getContents() const { return _RawMaterials; } diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp index b3c947c7e..8b8103b65 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp @@ -130,7 +130,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) // Params Params.clear(); - size = StringParams.size(); + size = (uint16)StringParams.size(); for (uint i = 0 ; i < size ; ++i) { addParam(StringParams[i], Params); @@ -232,7 +232,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) // mandatory set::const_iterator it = MandatoryFamilies.begin(); set::const_iterator itEnd = MandatoryFamilies.end(); - uint16 size = MandatoryFamilies.size(); + uint16 size = (uint16)MandatoryFamilies.size(); f.serial(size); for ( ; it != itEnd ; ++it) { @@ -243,7 +243,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) // optional it = OptionalFamilies.begin(); itEnd = OptionalFamilies.end(); - size = OptionalFamilies.size(); + size = (uint16)OptionalFamilies.size(); f.serial(size); for ( ; it != itEnd ; ++it) @@ -255,7 +255,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) // credit it = CreditFamilies.begin(); itEnd = CreditFamilies.end(); - size = CreditFamilies.size(); + size = (uint16)CreditFamilies.size(); f.serial(size); for ( ; it != itEnd ; ++it) @@ -271,7 +271,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) } // skills - size = Skills.size(); + size = (uint16)Skills.size(); f.serial(size); for (uint i = 0 ; i < size ; ++i ) { @@ -490,7 +490,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS } // Parse Params Params.clear(); - const uint size = StringParams.size(); + const uint size = (uint)StringParams.size(); for (uint i = 0 ; i < size ; ++i) { addParam(StringParams[i], Params); diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.h b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.h index 91d00856a..e5884f127 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.h +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.h @@ -247,14 +247,14 @@ public: } else { - uint8 size = NeededMps.size(); + uint8 size = (uint8)NeededMps.size(); f.serial(size); for (uint8 i = 0; i < size ; ++i) { f.serial( NeededMps[i] ); } - size = NeededMpsFormula.size(); + size = (uint8)NeededMpsFormula.size(); f.serial(size); for (uint8 i = 0; i < size ; ++i) { diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_emot.h b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_emot.h index 3fedd386b..3bfec7a93 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_emot.h +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_emot.h @@ -51,7 +51,7 @@ public: { std::map::const_iterator it = _AnimIdMap.find(animId); if (it!=_AnimIdMap.end()) - return it->second; + return (uint16)it->second; return (uint16)~0; } diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_encyclo.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_encyclo.cpp index b8b2b7d33..4123d327f 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_encyclo.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_encyclo.cpp @@ -229,7 +229,7 @@ const CStaticEncycloThema * CStaticEncyclo::getThemaForm( const NLMISC::CSheetId uint32 CStaticEncyclo::getNbAlbum () const { - return _OrderedAlbums.size(); + return (uint32)_OrderedAlbums.size(); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -245,7 +245,7 @@ const CStaticEncycloAlbum * CStaticEncyclo::getAlbum ( uint32 nAlbumNb ) const uint32 CStaticEncyclo::getNbThema ( uint32 nAlbumNb ) const { nlassert(nAlbumNb < _OrderedAlbums.size()); - return _OrderedAlbums[nAlbumNb].ThemaSheets.size(); + return (uint32)_OrderedAlbums[nAlbumNb].ThemaSheets.size(); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -318,7 +318,7 @@ void CStaticEncyclo::getRiteInfos( string& rite, uint32& nAlbum, uint32& nThema, if( rite == (*itTh).second.Rite ) { nThema = (*itTh).second.ThemaNumber; - taskCount = (*itTh).second.Tasks.size(); + taskCount = (uint32)(*itTh).second.Tasks.size(); themaSheet = (*itTh).first; break; } diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp index 8d651ef55..a6ab68cca 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.cpp @@ -124,7 +124,7 @@ void CConsumable::serial(class NLMISC::IStream &f) f.serial(familyName); if (FamiliesFromName.find(familyName) == FamiliesFromName.end()) { - Family = FamiliesFromIndex.size(); + Family = (uint16)FamiliesFromIndex.size(); FamiliesFromName.insert( make_pair(familyName, Family) ); FamiliesFromIndex.push_back(familyName); } @@ -135,7 +135,7 @@ void CConsumable::serial(class NLMISC::IStream &f) // Params Params.clear(); - uint size = StringParams.size(); + uint size = (uint)StringParams.size(); for (uint i = 0 ; i < size ; ++i) { addParam(StringParams[i], Params); @@ -981,7 +981,7 @@ void loadCosmetics( NLGEORGES::UFormElm &root, CStaticItem *item, const NLMISC: nlwarning(" Can't load the VPValue from sheet name in sheet %s", sheetId.toString().c_str() ); else { - sint i = pos - 1; + sint i = (sint)pos - 1; for(; i >= 0; i-- ) { if ( !isdigit( name[i] ) ) @@ -1059,7 +1059,7 @@ void loadConsumable( NLGEORGES::UFormElm &root, CStaticItem *item, const NLMISC if (CConsumable::FamiliesFromName.find(familyName) == CConsumable::FamiliesFromName.end()) { - const uint16 index = CConsumable::FamiliesFromIndex.size(); + const uint16 index = (uint16)CConsumable::FamiliesFromIndex.size(); CConsumable::FamiliesFromName.insert( make_pair(familyName, index) ); CConsumable::FamiliesFromIndex.push_back(familyName); item->ConsumableItem->Family= index; @@ -1120,7 +1120,7 @@ void loadConsumable( NLGEORGES::UFormElm &root, CStaticItem *item, const NLMISC } // Parse Params item->ConsumableItem->Params.clear(); - const uint size = item->ConsumableItem->StringParams.size(); + const uint size = (uint)item->ConsumableItem->StringParams.size(); for (uint i = 0 ; i < size ; ++i) { addParam(item->ConsumableItem->StringParams[i], item->ConsumableItem->Params); diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h index 9bd83f609..1acb910c5 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_item.h @@ -680,7 +680,7 @@ public: f.serial( (uint32&)getGroup() ); // The number never changes // Parameters - uint8 size = MpFaberParameters.size(); + uint8 size = (uint8)MpFaberParameters.size(); f.serial( size ); for( uint i = 0; i < size; ++i ) { @@ -695,7 +695,7 @@ public: const RM_GROUP::TRMGroup& getGroup() const { return _RMGroupsByFamily[Family]; } /// Return the number of raw material group slots. The actual number of groups is the number of non-empty slots. - static uint nbRmGroupSlots() { return _RMGroupNames.size(); } + static uint nbRmGroupSlots() { return (uint)_RMGroupNames.size(); } /// Return the name of a raw material group. Precondition: group < nbRmGroupSlots() static const std::string& rmGroupToString( const RM_GROUP::TRMGroup& group ) { return _RMGroupNames[group]; } diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.h b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.h index cf67588db..d64f9c94e 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.h +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_game_sheet.h @@ -536,7 +536,7 @@ public: virtual float getRegen(size_t index) const { return _Regen[index]; } virtual SMirrorEquipment const& getItems(size_t index) const { return _Items[index]; } virtual std::string getLootTable(uint i) const { if (i<_LootTables.size()) return _LootTables[i]; else return ""; } - virtual uint getLootTableCount() const { return _LootTables.size(); } + virtual uint getLootTableCount() const { return (uint)_LootTables.size(); } virtual uint8 getMeleeReachValue() const { return _MeleeReachValue; } virtual bool getDodgeAsDefense() const { return _DodgeAsDefense; } @@ -1145,7 +1145,7 @@ public : } else { - uint16 size = ChildSkills.size(); + uint16 size = (uint16)ChildSkills.size(); f.serial( size ); for( std::vector::iterator it = ChildSkills.begin(); it != ChildSkills.end(); ++it ) { diff --git a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_text_emotes.h b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_text_emotes.h index 9dfe380cf..00a323281 100644 --- a/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_text_emotes.h +++ b/code/ryzom/server/src/entities_game_service/egs_sheets/egs_static_text_emotes.h @@ -116,7 +116,7 @@ public: { std::map::const_iterator it = _EmoteIdMap.find(emoteId); if (it!=_EmoteIdMap.end()) - return it->second; + return (uint16)it->second; return (uint16)~0; } MBEHAV::EBehaviour getEmoteBehav(const std::string& emoteId) const; diff --git a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp index 003e07d35..c7f51539a 100644 --- a/code/ryzom/server/src/entities_game_service/entities_game_service.cpp +++ b/code/ryzom/server/src/entities_game_service/entities_game_service.cpp @@ -1624,7 +1624,7 @@ NLMISC_COMMAND(loadAndReSaveCharacters,"load and resave the complete set of play playerIds.insert( account ); } - uint32 size= playerIds.size(); + uint32 size= (uint32)playerIds.size(); uint32 i = 0; for( set::iterator it=playerIds.begin(); it != playerIds.end(); ++i, ++it ) { @@ -1697,7 +1697,7 @@ NLMISC_COMMAND(loadCharacterNames,"load all character save games and extract nam } // iterate over files - uint32 numFiles= files.size(); + uint32 numFiles= (uint32)files.size(); uint32 i=0; for (TFilesMap::iterator it=files.begin(); it!=files.end(); ++it, ++i) { @@ -4879,8 +4879,8 @@ NLMISC_COMMAND(displayBricksInDb,"display the bricks in DB for given player","

::const_iterator it2 = bricksKnown.begin(); set::const_iterator it2End = bricksKnown.end(); - uint16 size1 = bricksInDb.size(); - uint16 size2 = bricksKnown.size(); + uint16 size1 = (uint16)bricksInDb.size(); + uint16 size2 = (uint16)bricksKnown.size(); bool ok = true; @@ -5612,7 +5612,7 @@ NLMISC_COMMAND(execScript, "Execute a script file (.cmd)","") string script; script.resize(iFile.getFileSize()); - iFile.serialBuffer((uint8 *)&script[0], script.size()); + iFile.serialBuffer((uint8 *)&script[0], (uint)script.size()); vector scriptLines; diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp index 374879654..00794a0d5 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.cpp @@ -2358,7 +2358,7 @@ bool CEntityBase::canEntityDefend() return false; const uint8 size = sizeof(ForbidDefenseEffects) / sizeof(EFFECT_FAMILIES::TEffectFamily); - const uint8 nbEffects = _SEffects.size(); + const uint8 nbEffects = (uint8)_SEffects.size(); // look for forbidden effects for (uint i = 0; i < nbEffects; ++i ) diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h index 453ab6490..cd341b61a 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_base.h @@ -791,7 +791,7 @@ public: virtual void stopAllLinks(float factorOnSurvivalTime = 1.0f); /// get current number of links cast by this entity - inline uint8 getNbLinks() const { return _SEffectLinks.size(); } + inline uint8 getNbLinks() const { return (uint8)_SEffectLinks.size(); } /** * look for a particular effect. diff --git a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp index 2c98d2969..4fa1a3980 100644 --- a/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp +++ b/code/ryzom/server/src/entities_game_service/entity_manager/entity_callbacks.cpp @@ -1242,7 +1242,7 @@ void sendCharactersSummary( CPlayer *player, bool AllAutorized, uint32 bitfieldO player->getCharactersSummary( chars ); if (bitfieldOwnerOfActiveAnimSession != 0) { - for ( uint i=0, len=chars.size(); i!=len; ++i ) + for ( uint i=0, len=(uint)chars.size(); i!=len; ++i ) { chars[i].InRingSession = ((bitfieldOwnerOfActiveAnimSession & (1 << i)) != 0); } @@ -1250,7 +1250,7 @@ void sendCharactersSummary( CPlayer *player, bool AllAutorized, uint32 bitfieldO if (bitfieldOwnerOfEditSession != 0) { - for ( uint i=0, len=chars.size(); i!=len; ++i ) + for ( uint i=0, len=(uint)chars.size(); i!=len; ++i ) { chars[i].HasEditSession = ((bitfieldOwnerOfEditSession & (1 << i)) != 0); } diff --git a/code/ryzom/server/src/entities_game_service/entity_structure/statistic.cpp b/code/ryzom/server/src/entities_game_service/entity_structure/statistic.cpp index 73d90a9ed..5e04639e8 100644 --- a/code/ryzom/server/src/entities_game_service/entity_structure/statistic.cpp +++ b/code/ryzom/server/src/entities_game_service/entity_structure/statistic.cpp @@ -358,7 +358,7 @@ double CSkills::getMaxXPToGain(SKILLS::ESkills &skill) static CSheetId sheet("skills.skill_tree"); const CStaticSkillsTree * skillsTree = CSheets::getSkillsTreeForm( sheet ); nlassert( skillsTree ); - const uint size = _Skills.size(); + const uint size = (uint)_Skills.size(); double xp = 0.0f; for ( uint i = 0; i < size; ++i ) diff --git a/code/ryzom/server/src/entities_game_service/far_position_stack.h b/code/ryzom/server/src/entities_game_service/far_position_stack.h index 392b36652..ddc7eba4a 100644 --- a/code/ryzom/server/src/entities_game_service/far_position_stack.h +++ b/code/ryzom/server/src/entities_game_service/far_position_stack.h @@ -44,7 +44,7 @@ public: bool empty() const { return _Vec.empty(); } /// Return the number of elements in the stack - uint size() const { return _Vec.size(); } + uint size() const { return (uint)_Vec.size(); } /// Return the latest pushed position (no bound check) const T& top() const { return _Vec.back(); } diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h index 37e1bf6cd..ac950096b 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h @@ -988,7 +988,7 @@ inline CGameItemVector::~CGameItemVector() inline uint32 CGameItemVector::size() const { - return _Data.size()<getPlaces().size(); + uint size = (uint)_ModuleCore->getPlaces().size(); for ( uint i = 0; i < size; i++ ) { const CPlace * place = CZoneManager::getInstance().getPlaceFromId( _ModuleCore->getPlaces()[i] ); diff --git a/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp b/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp index f34a174a2..82de2fde4 100644 --- a/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp +++ b/code/ryzom/server/src/entities_game_service/guild_manager/guild_commands.cpp @@ -481,7 +481,7 @@ NLMISC_COMMAND( importGuildFile, "Import a guild file into the server", "getInvalidNames().size(); + const uint size = (uint)CEntityIdTranslator::getInstance()->getInvalidNames().size(); string nameStr = CEntityIdTranslator::getInstance()->getRegisterableString( name ); string descriptionStr = CEntityIdTranslator::getInstance()->getRegisterableString( description ); for (uint i = 0; i < CEntityIdTranslator::getInstance()->getInvalidNames().size(); i++) diff --git a/code/ryzom/server/src/entities_game_service/inventory_updater.h b/code/ryzom/server/src/entities_game_service/inventory_updater.h index d6d65ad45..13529a484 100644 --- a/code/ryzom/server/src/entities_game_service/inventory_updater.h +++ b/code/ryzom/server/src/entities_game_service/inventory_updater.h @@ -285,7 +285,7 @@ void CInventoryUpdater::resetItem( TInventoryId inv if ( itemUpdate.IUMode != CItemUpdate::IUAll ) { // Cancel any additional IUOneProp updates - cancelAllUpdatesFromIndex( itu - _ItemUpdates[invId].begin() + 1, invId, slotIndex ); + cancelAllUpdatesFromIndex( (uint)(itu - _ItemUpdates[invId].begin() + 1), invId, slotIndex ); } // Overwrite any previous IUAll, IUReset, IUOneProp, IUInfoVersion itemUpdate.IUMode = CItemUpdate::IUReset; @@ -328,7 +328,7 @@ void CInventoryUpdater::setItemProps( TInventoryId if ( itemUpdate.IUMode != CItemUpdate::IUAll ) { // Cancel any additional IUOneProp updates - cancelAllUpdatesFromIndexExcept( itu - _ItemUpdates[invId].begin() + 1, invId, itemSlot.getSlotIndex(), CItemUpdate::IUInfoVersion ); + cancelAllUpdatesFromIndexExcept( (uint)(itu - _ItemUpdates[invId].begin() + 1), invId, itemSlot.getSlotIndex(), CItemUpdate::IUInfoVersion ); } // Overwrite previous IUAll, IUReset, or first IUOneProp itemUpdate.IUMode = CItemUpdate::IUAll; @@ -488,7 +488,7 @@ bool CInventoryUpdater::fillAllUpdates( NLMISC::CBi hasContentToSend = true; // Number field - uint32 nbChanges = _ItemUpdates[invId].size(); + uint32 nbChanges = (uint32)_ItemUpdates[invId].size(); if ( nbChanges < INVENTORIES::LowNumberBound ) { destStream.serial( nbChanges, INVENTORIES::LowNumberBits ); diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp index 40ed197c1..0de14d121 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_action.cpp @@ -1647,7 +1647,7 @@ class CMissionActionRecvMoney : public IMissionAction std::vector entities; instance->getEntities(entities); - uint amount = _Amount / entities.size(); + uint amount = _Amount / (uint)entities.size(); if ( amount == 0 || _Amount % entities.size() ) amount++; for ( uint i = 0; i < entities.size(); i++ ) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp index b0f7bfc3b..dc80fc2a6 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_base_behaviour.cpp @@ -715,7 +715,7 @@ void CMissionBaseBehaviour::jump( uint32 step, uint32 action,std::list< CMission // if they are actions in this out of order bloc, we launch them if( oooIndex < templ->OOOActions.size() ) { - action -= templ->Steps[step]->getActions().size(); + action -= (uint32)templ->Steps[step]->getActions().size(); for ( uint i = action; i < templ->OOOActions[oooIndex].size(); i++ ) { templ->OOOActions[oooIndex][i]->launch(_Mission,eventList); @@ -1149,7 +1149,7 @@ void CMissionBaseBehaviour::_updateUserJournalEntry( CCharacter & user, DBType & else if ( templ->getOutOfOrderSteps((*it).first - 1) == 0xFFFFFFFF ) { uint firstOOOStepIndex = ~0; - const uint size = templ->OutOfOrderSteps.size(); + const uint size = (uint)templ->OutOfOrderSteps.size(); for ( uint i = 0; i < size; i++ ) { if ( templ->OutOfOrderSteps[i].first <= (*it).first - 1 && (*it).first - 1 <= templ->OutOfOrderSteps[i].second ) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp index 0b9d39df6..b0bd41ffb 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp @@ -513,7 +513,7 @@ void CMissionManager::tickUpdate() for ( map< CMission*, std::vector >::iterator it = _PlaceDependantMissions.begin(); it != _PlaceDependantMissions.end();) { uint i = 0; - uint size = (*it).second.size(); + uint size = (uint)(*it).second.size(); map< CMission*, std::vector >::iterator itBack= it; ++itBack; for ( ; i < size; i++ ) @@ -1125,7 +1125,7 @@ void CMissionManager::addDynChat( CMission * instance, CMissionStepDynChat * ste return; } - const uint size = room->getBots().size(); + const uint size = (uint)room->getBots().size(); for ( uint i = 0; i < size; i++ ) { CCreature * c = CreatureManager.getCreature( room->getBots()[i] ); @@ -1184,7 +1184,7 @@ void CMissionManager::addDynChat( CMission * instance, CMissionStepDynChat * ste // For each concern mission, send an end dyn chat event to the player, specifying the mission CMissionEventEndDynChat event; - const uint eventCount = aliases.size(); + const uint eventCount = (uint)aliases.size(); for ( uint i = 0; i < eventCount; ++i ) { user->processMissionEvent(event,aliases[i]); @@ -1338,7 +1338,7 @@ void CMissionManager::removeAllUserDynChat(CCharacter * user) // This must be after _DynChats.erase(user->getEntityRowId()), otherwise the event (e.g. jump // back) can trigger a openDynChat() on the same bot that would lead to a reentrance bug. CMissionEventEndDynChat event; - const uint eventCount = aliases.size(); + const uint eventCount = (uint)aliases.size(); for ( uint i = 0; i < eventCount; ++i ) user->processMissionEvent(event,aliases[i] ); } @@ -1431,7 +1431,7 @@ void CMissionManager::dynChatChoice( CCharacter * user, const TDataSetRow & botR } const std::string & jump = dynChat->Answers[choice].Jump; uint i = 0; - uint nbJumpPoints = templ->JumpPoints.size(); + uint nbJumpPoints = (uint)templ->JumpPoints.size(); bool updateJournal = false; for (; i < nbJumpPoints; i++ ) { @@ -1841,7 +1841,7 @@ void CMissionManager::checkPlaceConstraints ( CMission* mission) /// check outside constraints for ( map::iterator it = mission->getOutsidePlacesBegin(); it != mission->getOutsidePlacesEnd(); ++it ) { - const uint size = user->getPlaces().size(); + const uint size = (uint)user->getPlaces().size(); for ( uint i = 0; i < size; i++ ) { if ( (*it).second.getAlias() == user->getPlaces()[i] ) @@ -1873,7 +1873,7 @@ void CMissionManager::checkPlaceConstraints ( CMission* mission) map::iterator itIn = mission->getInsidePlacesBegin(); for (; itIn != mission->getInsidePlacesEnd(); ++itIn ) { - const uint size = user->getPlaces().size(); + const uint size = (uint)user->getPlaces().size(); uint i = 0; for (; i < size; i++ ) { @@ -2078,7 +2078,7 @@ void CMissionManager::applyAICrashConsequences( NLNET::TServiceId aiServiceId ) string name; if (CWorldInstances::instance().getAIInstanceNameFromeServiceId(aiServiceId,name)) { - const uint size = _CrashHandlingMissions.size(); + const uint size = (uint)_CrashHandlingMissions.size(); for ( uint i = 0; i < size; i++ ) { if ( _CrashHandlingMissions[i] ) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_parser.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_parser.cpp index 20e4ff332..186d53793 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_parser.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_parser.cpp @@ -328,8 +328,8 @@ void CMissionParser::tokenizeString(const std::string &str, const std::string &s retList.clear(); if ( str.empty() ) return; - uint pos=0; - uint newPos=0; + std::string::size_type pos=0; + std::string::size_type newPos=0; while( (newPos= str.find_first_of(separators,pos)) != string::npos) { // if not empty sub str. (skip repetition of separator ) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue.cpp index 473484fd8..54e7eb79f 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue.cpp @@ -480,7 +480,7 @@ void CMissionQueue::addPlayer( const NLMISC::CEntityId &id, CMission *mission, b if (!forceTopOfQueue) { - entity.Position = _Entities.size(); + entity.Position = (uint16)_Entities.size(); entity.PositionOnline = nbOnline; _Entities.push_back(entity); diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp index b7e4ebcc9..3c2540c64 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.cpp @@ -78,7 +78,7 @@ void CMissionQueueManager::characterLoadedCallback(CCharacter *c) for ( uint i = 0 ; i < queues.QueueIds.size() ; ) { // check coherency with infos kept in manager - const uint size2 = playerQueues.size(); + const uint size2 = (uint)playerQueues.size(); uint j; for ( j = 0 ; j < size2 ; ++j) { @@ -154,7 +154,7 @@ void CMissionQueueManager::saveToFile() { std::string s; pdr.toString(s); - msg.DataMsg.serialBuffer((uint8*)&s[0], s.size()); + msg.DataMsg.serialBuffer((uint8*)&s[0], (uint)s.size()); } Bsi.sendFile( msg ); } diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.h b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.h index 3ca1b73ab..344a64a10 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.h +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_queue_manager.h @@ -48,7 +48,7 @@ public: #ifdef NL_DEBUG nlassert(find(id) == true); #endif - const uint size = QueueIds.size(); + const uint size = (uint)QueueIds.size(); for ( uint i = 0 ; i < size ; ++i ) { if (QueueIds[i] == id) @@ -62,7 +62,7 @@ public: bool find(uint32 id) const { - const uint size = QueueIds.size(); + const uint size = (uint)QueueIds.size(); for ( uint i = 0 ; i < size ; ++i ) { if (QueueIds[i] == id) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_misc.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_misc.cpp index 7b80e5347..ceeaeaf0f 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_misc.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_misc.cpp @@ -995,7 +995,7 @@ void CMissionStepVisit::getTextParams( uint & nbSubSteps,const std::string* & te static std::vector wornTexts; if ( _WornItems.size() > wornTexts.size() ) { - uint i = wornTexts.size(); + uint i = (uint)wornTexts.size(); wornTexts.resize( _WornItems.size() ); for (; i < wornTexts.size(); i++ ) { diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp index 5616e35b7..8f2bd749b 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_talk.cpp @@ -425,7 +425,7 @@ class CMissionStepGiveItem : public IMissionStepTemplate gift = true; TVectorParamCheck vect( 1 + _Params.size() ); vect[0].Type = STRING_MANAGER::integer; - vect[0].Int = _SubSteps.size(); + vect[0].Int = (sint32)_SubSteps.size(); if ( !_PhraseId.empty() ) { diff --git a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost.cpp b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost.cpp index 151f4fbf3..2ca3a5d70 100644 --- a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost.cpp +++ b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost.cpp @@ -1332,7 +1332,7 @@ bool COutpost::insertDefaultSquad(OUTPOSTENUMS::TPVPSide side, uint32 squadSlot) // right shift slots if (squads->size() >= 2) { - uint32 i = squads->size()-2; + uint32 i = (uint32)squads->size()-2; while (i >= squadIndex) { (*squads)[i+1] = (*squads)[i]; @@ -1400,7 +1400,7 @@ uint32 COutpost::getChallengeCost() const TAIAlias COutpost::getRandomSpawnZone() const { // choose a random spawn zone - sint32 randomCount = RandomGenerator.rand(_SpawnZones.size() - 1); + sint32 randomCount = RandomGenerator.rand((uint16)_SpawnZones.size() - 1); nlassert(randomCount >= 0 && randomCount < (sint32)_SpawnZones.size()); return _SpawnZones[randomCount].alias(); } @@ -1845,7 +1845,7 @@ bool COutpost::convertShopSquadIndex(uint32 shopSquadIndex, COutpostSquadDescrip } else { - shopSquadIndex -= _DefaultSquads.size(); + shopSquadIndex -= (uint32)_DefaultSquads.size(); if (shopSquadIndex < _BuyableSquads.size()) { squadDesc = _BuyableSquads[shopSquadIndex]; diff --git a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp index 4f8cc053b..51a69ab7e 100644 --- a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_manager.cpp @@ -304,7 +304,7 @@ void COutpostManager::loadOutpostPrimitives() OUTPOST_INF("Outpost '%s' was successfully parsed", outpost->getName().c_str()); // nb : short id starts at 1, 0 is used for invalid - _OutpostAliasToShortId.insert( make_pair( outpost->getAlias(), _Outposts.size()) ); + _OutpostAliasToShortId.insert( make_pair( outpost->getAlias(), (uint16)_Outposts.size()) ); } } } @@ -681,7 +681,7 @@ void COutpostManager::tickUpdate() } else { - uint32 nbOutpost = _Outposts.size(); + uint32 nbOutpost = (uint32)_Outposts.size(); uint32 nbOutpostPerTick = (uint32)floor(double(nbOutpost) / double(OutpostUpdatePeriod.get())); nbOutpostPerTick = std::max(uint32(1), nbOutpostPerTick); // The strict minimum is a single outpost update per tick @@ -705,7 +705,7 @@ void COutpostManager::tickUpdate() } else { - endIndex -= _Outposts.size(); + endIndex -= (uint32)_Outposts.size(); for (uint32 i = beginIndex; i < _Outposts.size(); i++) _Outposts[i]->updateOutpost(currentTime); for (uint32 i = 0; i < endIndex; i++) @@ -784,7 +784,7 @@ void COutpostManager::saveOutpost(NLMISC::CSmartPtr outpost) H_AUTO(COutpostSerialXML); std::string s; pdr.toString(s); - msg.DataMsg.serialBuffer((uint8*)&s[0], s.size()); + msg.DataMsg.serialBuffer((uint8*)&s[0], (uint)s.size()); } else { diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/aura_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/aura_effect.cpp index 738117858..1503058e5 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/aura_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/aura_effect.cpp @@ -71,7 +71,7 @@ bool CAuraRootEffect::update(CTimerEvent * event, bool ) // create or update effect on entities returned const vector &entities = entitiesSelector.getEntities(); - const uint size = entities.size(); + const uint size = (uint)entities.size(); for (uint i = 0; i < size ; ++i) { if (entities[i] && isEntityValidTarget(entities[i], creator) ) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/bounce_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/bounce_effect.cpp index f4ed11cc5..8a209ebd5 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/bounce_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/bounce_effect.cpp @@ -92,7 +92,7 @@ CEntityBase *CBounceEffect::getTargetForBounce() const // select valid entities const vector &entities = entitiesSelector.getEntities(); - const uint size = entities.size(); + const uint size = (uint)entities.size(); vector selectedEntities; selectedEntities.reserve(size); @@ -108,7 +108,7 @@ CEntityBase *CBounceEffect::getTargetForBounce() const if (selectedEntities.empty()) return NULL; - uint32 num = RandomGenerator.rand(selectedEntities.size()-1); + uint32 num = RandomGenerator.rand((uint16)selectedEntities.size()-1); return selectedEntities[num]; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_ai_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_ai_effect.cpp index 4b1a84509..bda200229 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_ai_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_ai_effect.cpp @@ -67,7 +67,7 @@ void CCombatAiActionEffect::apply( CCombatPhrase *phrase ) H_AUTO(CCombatAiActionEffect_apply); const vector & targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { //if ( !phrase->hasTargetDodged(i) ) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_disarm.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_disarm.cpp index f0da1234e..32c10ccd5 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_disarm.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_disarm.cpp @@ -61,7 +61,7 @@ void CCombatActionDisarm::apply( CCombatPhrase *phrase ) H_AUTO(CCombatActionDisarm_apply); const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { //if ( !phrase->hasTargetDodged(i) ) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_dot.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_dot.cpp index 1b069dc2a..e237c36ba 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_dot.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_dot.cpp @@ -73,7 +73,7 @@ void CCombatActionDoT::apply( CCombatPhrase *phrase ) const TGameCycle endDate = CTickEventHandler::getGameCycle() + _EffectDuration; const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { // if ( !phrase->hasTargetDodged(i) ) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp index 4c117ade5..8736cf601 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp @@ -336,7 +336,7 @@ CCombatPhrase::~CCombatPhrase() clearTargets(); - const uint size = _CombatActions.size(); + const uint size = (uint)_CombatActions.size(); for (uint i = 0 ; i < size ; ++i) { if (_CombatActions[i] != NULL) @@ -1933,7 +1933,7 @@ bool CCombatPhrase::launch() buildTargetList(true, false); - const uint32 nbTargets = _Targets.size(); + const uint32 nbTargets = (uint32)_Targets.size(); // update behaviour if ( _Behaviour.isCombat() ) @@ -1994,7 +1994,7 @@ bool CCombatPhrase::launch() buildTargetList(true, _IsMad); // resize datas - const uint32 nbTargets = _Targets.size(); + const uint32 nbTargets = (uint32)_Targets.size(); // update behaviour if ( _Behaviour.isCombat() ) @@ -2060,7 +2060,7 @@ bool CCombatPhrase::launch() CMirrorPropValueList targetList(TheDataset, _Attacker->getEntityRowId(), DSPropertyTARGET_LIST); targetList.clear(); - const sint size = _Targets.size(); + const sint size = (sint)_Targets.size(); for (sint i = size-1 ; i >= 0 ; --i) { PHRASE_UTILITIES::updateMirrorTargetList(targetList, _Targets[i].Target->getEntityRowId(), _Targets[i].Distance, false); @@ -2349,7 +2349,7 @@ bool CCombatPhrase::launchAttack(CEntityBase * actingEntity, bool rightHand, boo } else { - uint32 nbTargets = _Targets.size(); + uint32 nbTargets = (uint32)_Targets.size(); #if !FINAL_VERSION nlassert(nbTargets); #endif @@ -2818,7 +2818,7 @@ void CCombatPhrase::applyAttack(CEntityBase * actingEntity, bool rightHand) std::vector & actions = rightHand ? _RightApplyActions : _LeftApplyActions; - const uint nbActions = actions.size(); + const uint nbActions = (uint)actions.size(); // if there is no action for this hand, the attack failed if (nbActions == 0) @@ -2832,7 +2832,7 @@ void CCombatPhrase::applyAttack(CEntityBase * actingEntity, bool rightHand) applyAction(actions[i], actionReports, rightHand); } - const uint nbReports = actionReports.size(); + const uint nbReports = (uint)actionReports.size(); // if attacker is mad, change reports if (_IsMad) @@ -3524,7 +3524,7 @@ float CCombatPhrase::testOpponentDefense(CCombatDefenderPtr &combatDefender, boo // compute defender malus when facing several opponents const set &aggressors = CPhraseManager::getInstance().getMeleeAggressors(targetRowId); sint32 defenseModifier = 0; - uint32 nb = aggressors.size(); + uint32 nb = (uint32)aggressors.size(); if (nb > NbOpponentsBeforeMalus) { defenseModifier = (nb - NbOpponentsBeforeMalus) * ModPerSupernumeraryOpponent; @@ -4045,7 +4045,7 @@ bool CCombatPhrase::validateCombatActions( string &errorCode ) { H_AUTO(CCombatPhrase_validateCombatActions); - const uint size = _CombatActions.size(); + const uint size = (uint)_CombatActions.size(); for (uint i = 0 ; i < size ; ++i) { if ( _CombatActions[i] != NULL) @@ -4067,7 +4067,7 @@ void CCombatPhrase::applyCombatActions() // if (!_Defender) return; - const uint size = _CombatActions.size(); + const uint size = (uint)_CombatActions.size(); for (uint i = 0 ; i < size ; ++i) { if ( _CombatActions[i] != NULL) @@ -4493,7 +4493,7 @@ void CCombatPhrase::buildTargetList(bool rightHand, bool isMad) { string dummy; - const uint previousNbTargets = _Targets.size(); + const uint previousNbTargets = (uint)_Targets.size(); const set &aggressors = CPhraseManager::getInstance().getMeleeAggressors(_Attacker->getEntityRowId()); set::const_iterator it; @@ -4522,7 +4522,7 @@ void CCombatPhrase::buildTargetList(bool rightHand, bool isMad) } } - const uint nbTargets = _Targets.size(); + const uint nbTargets = (uint)_Targets.size(); const float damageFactor = min( 1.0f, _MultiTargetGlobalDamageFactor.applyValue(_WeaponSabrinaValue) / ( 1 + nbTargets - previousNbTargets) ); // start to previousNbTarget as previous targets already processed diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/damage_aura_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/damage_aura_effect.cpp index cddb91ad7..905c6c29d 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/damage_aura_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/damage_aura_effect.cpp @@ -72,7 +72,7 @@ bool CDamageAuraEffect::update(CTimerEvent * event, bool applyEffect) // create or update effect on entities returned const vector &entities = entitiesSelector.getEntities(); - const uint size = entities.size(); + const uint size = (uint)entities.size(); for (uint i = 0; i < size ; ++i) { if (entities[i] && (entities[i] != (CEntityBase*)_AffectedEntity) && isEntityValidTarget(entities[i]) ) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp index dbe0b3d07..4d2844339 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_action.cpp @@ -225,7 +225,7 @@ public: PHRASE_UTILITIES::sendDynamicSystemMessage(phrase->getActor(), "FABER_TEMP_INVENTORY_FULL"); // Delete remaining stacks so that the vector 'items' contains only valid items - uint sizeOk = itemStacks.size(); + uint sizeOk = (uint)itemStacks.size(); if ( sizeOk == 0 ) c->sendCloseTempInventoryImpulsion(); ++itSt; @@ -403,14 +403,14 @@ protected: uint32 mpOccurence = 0; // parsing faber plan - uint32 neededMp = phrase->getRootFaberPlan()->Faber->NeededMps.size(); + uint32 neededMp = (uint32)phrase->getRootFaberPlan()->Faber->NeededMps.size(); for( uint mp = 0; mp < neededMp; ++mp ) { //for each type of Mp needed for( uint k = 0; k < phrase->getRootFaberPlan()->Faber->NeededMps[ mp ].Quantity; ++k ) { // for each Mp of one type (we have Quantity by type) - uint32 NumMpParameters = phrase->getMps()[ mpOccurence ]->Mp->MpFaberParameters.size(); + uint32 NumMpParameters = (uint32)phrase->getMps()[ mpOccurence ]->Mp->MpFaberParameters.size(); // for each Faber parameters in Mp for( uint j = 0; j < NumMpParameters; ++j ) { @@ -698,14 +698,14 @@ protected: uint16 Quality = 0; // parsing faber plan - uint32 neededMp = phrase->getRootFaberPlan()->Faber->NeededMps.size(); + uint32 neededMp = (uint32)phrase->getRootFaberPlan()->Faber->NeededMps.size(); for( uint mp = 0; mp < neededMp; ++mp ) { //for each type of Mp needed for( uint k = 0; k < phrase->getRootFaberPlan()->Faber->NeededMps[ mp ].Quantity; ++k ) { // for each Mp of one type (we have Quantity by type) - uint32 NumMpParameters = phrase->getMps()[ mp ]->Mp->MpFaberParameters.size(); + uint32 NumMpParameters = (uint32)phrase->getMps()[ mp ]->Mp->MpFaberParameters.size(); // for each Faber parameters in Mp for( uint j = 0; j < NumMpParameters; ++j ) { @@ -1845,7 +1845,7 @@ protected: // Count number of MPs required (for possible XP gain) uint32 mpOccurence = 0; - uint32 neededMp = phrase->getRootFaberPlan()->Faber->NeededMps.size(); + uint32 neededMp = (uint32)phrase->getRootFaberPlan()->Faber->NeededMps.size(); for( uint mp = 0; mp < neededMp; ++mp ) { mpOccurence+= phrase->getRootFaberPlan()->Faber->NeededMps[ mp ].Quantity; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp index e660363e2..2386a32b2 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/faber_phrase.cpp @@ -391,10 +391,10 @@ void CFaberPhrase::apply() // TODO check compatibility of Rms with plan // temporary only check number of Mp match with plan - sint32 nbMp = _Mps.size(); + sint32 nbMp = (sint32)_Mps.size(); uint32 nbMpNeedeInPlan = 0; - uint32 neededMp = _RootFaberPlan->Faber->NeededMps.size(); + uint32 neededMp = (uint32)_RootFaberPlan->Faber->NeededMps.size(); for( uint mp = 0; mp < _RootFaberPlan->Faber->NeededMps.size(); ++mp ) { //for each type of Mp needed @@ -409,10 +409,10 @@ void CFaberPhrase::apply() return; } - nbMp = _MpsFormula.size(); + nbMp = (sint32)_MpsFormula.size(); nbMpNeedeInPlan = 0; - neededMp = _RootFaberPlan->Faber->NeededMpsFormula.size(); + neededMp = (uint32)_RootFaberPlan->Faber->NeededMpsFormula.size(); for( uint mp = 0; mp < _RootFaberPlan->Faber->NeededMpsFormula.size(); ++mp ) { //for each type of Mp needed diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp index 01c4e81af..e2112178a 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp @@ -1379,7 +1379,7 @@ const CStaticDepositRawMaterial *CFgProspectionPhrase::selectRMAtPos( // Now we are sure the deposit(s) before matchingEnd contain(s) raw materials compliant with the filters (not exclusively). // Select a random deposit among them. If not found, another attempt will be necessary. - uint nbMatching = matchingEnd - matchingDeposits.begin(); + uint nbMatching = (uint)(matchingEnd - matchingDeposits.begin()); *deposit = matchingDeposits[RandomGenerator.rand((uint16)(nbMatching-1))]; // Find the deposit, among the matching ones, for which the kami anger level is the lowest (nlassert(matchingEnd!=matchingDeposits.begin()) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_affect_stat.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_affect_stat.cpp index 13dc7de86..406e8c78d 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_affect_stat.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_affect_stat.cpp @@ -317,7 +317,7 @@ protected: TReportAction reportAction = actionReport; reportAction.ActionNature = (_IsOffensive?ACTNATURE::OFFENSIVE_MAGIC:ACTNATURE::CURATIVE_MAGIC); - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for ( uint i = 0; i < nbTargets; i++ ) { reportAction.TargetRowId = _ApplyTargets[i].RowId; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_damage_aura.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_damage_aura.cpp index 8e1b0ce05..be62882f0 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_damage_aura.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_damage_aura.cpp @@ -76,7 +76,7 @@ void CMagicAiActionDamageAura::launch( CMagicPhrase * phrase, sint deltaLevel, s return; const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(targets[i].getId())) @@ -118,7 +118,7 @@ void CMagicAiActionDamageAura::apply( CMagicPhrase * phrase, sint deltaLevel, si const TGameCycle endDate = CTickEventHandler::getGameCycle() + _EffectDuration; - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(_ApplyTargets[i].RowId)) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_dot.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_dot.cpp index 02e8b91e0..1b2ca965b 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_dot.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_dot.cpp @@ -101,7 +101,7 @@ void CMagicAiActionDoT::launch( CMagicPhrase * phrase, sint deltaLevel, sint ski skillValue -= debuff->getParamValue(); const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(targets[i].getId())) @@ -195,7 +195,7 @@ void CMagicAiActionDoT::apply( CMagicPhrase * phrase, sint deltaLevel, sint skil if (!actor) return; - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(_ApplyTargets[i].RowId)) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_effect.cpp index 329c89671..355d45896 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_effect.cpp @@ -100,7 +100,7 @@ void CMagicAiActionEffect::launch( CMagicPhrase * phrase, sint deltaLevel, sint skillValue -= debuff->getParamValue(); const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(targets[i].getId())) @@ -191,7 +191,7 @@ void CMagicAiActionEffect::apply( CMagicPhrase * phrase, sint deltaLevel, sint s endDate = CTickEventHandler::getGameCycle() + _EffectDuration; } - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(_ApplyTargets[i].RowId)) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_hot.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_hot.cpp index 76bd46f09..aaa7c02ae 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_hot.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_hot.cpp @@ -82,7 +82,7 @@ void CMagicAiActionHoT::launch( CMagicPhrase * phrase, sint deltaLevel, sint ski return; const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(targets[i].getId())) @@ -143,7 +143,7 @@ void CMagicAiActionHoT::apply( CMagicPhrase * phrase, sint deltaLevel, sint skil endDate = CTickEventHandler::getGameCycle() + _EffectDuration; } - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(_ApplyTargets[i].RowId)) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_mass_dispel.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_mass_dispel.cpp index b24d346e4..6fff5b229 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_mass_dispel.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_ai_mass_dispel.cpp @@ -60,7 +60,7 @@ void CMagicAiActionMassDispel::launch( CMagicPhrase * phrase, sint deltaLevel, s return; const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(targets[i].getId())) @@ -93,7 +93,7 @@ void CMagicAiActionMassDispel::apply( CMagicPhrase * phrase, sint deltaLevel, si { H_AUTO(CMagicAiActionMassDispel_apply); - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(_ApplyTargets[i].RowId)) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_attack.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_attack.cpp index e3a3f8959..90def1749 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_attack.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_attack.cpp @@ -664,7 +664,7 @@ void CMagicActionBasicDamage::launch( bool targetChanged = false; - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for ( uint i = 0; i < nbTargets ; ++i ) { @@ -834,7 +834,7 @@ void CMagicActionBasicDamage::apply( if (!actor) return; - uint const nbTargets = _ApplyTargets.size(); + uint const nbTargets = (uint)_ApplyTargets.size(); std::vector actionReports; actionReports.reserve(nbTargets); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_disarm.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_disarm.cpp index a3415b1ab..47310f823 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_disarm.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_disarm.cpp @@ -63,7 +63,7 @@ void CMagicActionDisarm::launch( CMagicPhrase * phrase, sint deltaLevel, sint sk return; const vector &targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(targets[i].getId())) @@ -108,7 +108,7 @@ void CMagicActionDisarm::apply( CMagicPhrase * phrase, sint deltaLevel, sint ski if (!actor) return; - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { if (!TheDataset.isAccessible(_ApplyTargets[i].RowId)) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_dot.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_dot.cpp index 668fadd96..3cf406fa9 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_dot.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_dot.cpp @@ -332,7 +332,7 @@ protected: // apply used item power factor on cost per update // _CostPerUpdate = sint32( _CostPerUpdate / (1.0 + phrase->getUsedItemStats().getPowerFactor(_Skill, phrase->getBrickMaxSabrinaCost())) ); - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for ( uint i = 0; i < nbTargets; i++ ) { TReportAction reportAction = actionReport; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_heal.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_heal.cpp index 7042ba802..6d264d09e 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_heal.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_heal.cpp @@ -147,7 +147,7 @@ protected: // Get Spell Targets const std::vector< CSpellTarget > & targets = phrase->getTargets(); - const uint nbTargets = targets.size(); + const uint nbTargets = (uint)targets.size(); // apply power factor os used item successFactor *= (1 + phrase->getUsedItemStats().getPowerFactor(_Skill, phrase->getBrickMaxSabrinaCost()) ); @@ -214,7 +214,7 @@ protected: if (!actor) return; - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); vector actionReports; if (reportXp) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_negative_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_negative_effect.cpp index 9a7bb85bb..7b6bb0aef 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_negative_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_action_negative_effect.cpp @@ -263,7 +263,7 @@ protected: if (!actor) return; - const uint nbTargets = _ApplyTargets.size(); + const uint nbTargets = (uint)_ApplyTargets.size(); for ( uint i = 0; i < nbTargets; i++ ) { // check target diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp index b562fbff7..4bf624422 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp @@ -1225,8 +1225,8 @@ bool CMagicPhrase::launch() } if (!_Skills.empty()) { - skillValue /= _Skills.size(); - skillBaseValue /= _Skills.size(); + skillValue /= (sint)_Skills.size(); + skillBaseValue /= (sint)_Skills.size(); } } else @@ -1495,7 +1495,7 @@ bool CMagicPhrase::launch() } /// test Invulnerabilty of each target ! - const uint nbTargets = _Targets.size(); + const uint nbTargets = (uint)_Targets.size(); NLMISC::CBitSet invulnerabilityOffensive(nbTargets); NLMISC::CBitSet invulnerabilityAll(nbTargets); @@ -1520,7 +1520,7 @@ bool CMagicPhrase::launch() if ( _Area ) { - const sint size = _Targets.size(); + const sint size = (sint)_Targets.size(); nlassertex( size == (sint32)affectedTargets.size(), ("%d %d", size, affectedTargets.size() ) ); nlassertex( size == (sint32)invulnerabilityAll.size(), ("%d %d", size, invulnerabilityAll.size() ) ); nlassertex( size == (sint32)invulnerabilityOffensive.size(), ("%d %d", size, invulnerabilityOffensive.size() ) ); @@ -1536,7 +1536,7 @@ bool CMagicPhrase::launch() } else if (!_Targets.empty()) { - const sint size = _Targets.size(); + const sint size = (sint)_Targets.size(); nlassertex( size == (sint32)invulnerabilityAll.size(), ("%d %d", size, invulnerabilityAll.size() ) ); nlassertex( size == (sint32)invulnerabilityOffensive.size(), ("%d %d", size, invulnerabilityOffensive.size() ) ); @@ -1700,7 +1700,7 @@ void CMagicPhrase::apply() if ( _Area ) { - const sint size = _Targets.size(); + const sint size = (sint)_Targets.size(); for (sint i = size-1 ; i >= 0 ; --i) { if ( affectedTargets[i] ) @@ -1893,7 +1893,7 @@ bool CMagicPhrase::buildProc( const TDataSetRow & actorRowId, const std::vector< H_AUTO(CMagicPhrase_buildProc); // get the brick forms - const uint size = brickIds.size(); + const uint size = (uint)brickIds.size(); vector< const CStaticBrick* > bricks(size); for( uint i = 0; i < size; i++ ) { @@ -1943,7 +1943,7 @@ void CMagicPhrase::testTargetsInvulnerabilities( CBitSet &invulnerabilityOffensi { H_AUTO(CMagicPhrase_testTargetsInvulnerabilities); - const uint nbTargets = _Targets.size(); + const uint nbTargets = (uint)_Targets.size(); for (uint i = 0 ; i < nbTargets ; ++i) { CEntityBase *target = CEntityBaseManager::getEntityBasePtr(_Targets[i].getId()); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.h b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.h index 1eb2aeb1f..fe160a176 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.h @@ -110,7 +110,7 @@ public: /// \accessors //@{ inline uint16 getSabrinaCost() const { return (uint16)(_SabrinaCost * _SabrinaRelativeCost); } - inline uint getNbActions() const { return _Actions.size(); } + inline uint getNbActions() const { return (uint)_Actions.size(); } inline sint32 getSapCost() const { return _SapCost; } inline sint32 getHPCost() const { return _HPCost; } inline ACTNATURE::TActionNature getNature() const { return _Nature; } diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp index 71eba7636..406a17b0a 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp @@ -378,7 +378,7 @@ void CPhraseManager::updatePhrases() // update max nb entities if (_MaxNbEntities < _PhrasesIndex.size()) { - _MaxNbEntities = _PhrasesIndex.size(); + _MaxNbEntities = (uint32)_PhrasesIndex.size(); #ifdef NL_DEBUG nlinfo("New record in nb of processed entities ! %u", _MaxNbEntities); #endif @@ -764,7 +764,7 @@ void CPhraseManager::sendEventReports() { // send to registered services for AI CBSAIEventReportMsg msgAI; - const uint nbAiReports = _AIEventReports.size(); + const uint nbAiReports = (uint)_AIEventReports.size(); for (uint i = 0 ; i < nbAiReports ; ++i ) { msgAI.pushBack( _AIEventReports[i] ); @@ -848,7 +848,7 @@ bool CPhraseManager::addPhrase( const TDataSetRow &actorRowId, CSPhrasePtr &phra if (_FreeIndex.empty()) { _EntityPhrases.push_back(entityPhrases); - index = _EntityPhrases.size()-1; + index = (uint32)_EntityPhrases.size()-1; } else { @@ -1879,7 +1879,7 @@ void CPhraseManager::breakCast( sint32 attackSkillValue, CEntityBase * entity, C } if (!magicPhrase->getSkills().empty()) { - magicSkillValue /= magicPhrase->getSkills().size(); + magicSkillValue /= (sint32)magicPhrase->getSkills().size(); } // boost magic skill for low level characters diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h index 8de4a5793..1f4616b63 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.h @@ -549,7 +549,7 @@ public: const CEntityPhrases *getEntityPhrases(TDataSetRow rowId) const; /// get current nb of entities in manager - uint32 getNbEntitiesInManager() const { return _PhrasesIndex.size(); } + uint32 getNbEntitiesInManager() const { return (uint32)_PhrasesIndex.size(); } /// get max nb of entities in manager uint32 getMaxNbEntitiesInManager() const { return _MaxNbEntities; } diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_utilities_functions.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_utilities_functions.cpp index a17248df9..7e32b3060 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_utilities_functions.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_utilities_functions.cpp @@ -299,7 +299,7 @@ TPairSlotShield getLocalisation( SHIELDTYPE::EShieldType shield, sint8 adjustem TPairSlotShield slotShield; SLocalisation local; - const uint nbLoc = LocalisationTable.size() / 3; + const uint nbLoc = (uint)LocalisationTable.size() / 3; if ( forcedSlot == SLOT_EQUIPMENT::UNDEFINED) { @@ -350,7 +350,7 @@ TPairSlotShield getLocalisation( SHIELDTYPE::EShieldType shield, sint8 adjustem } else { - local.LocalisationNumber = 1 + (uint8)RandomGenerator.rand(subTable.size()-1); + local.LocalisationNumber = 1 + (uint8)RandomGenerator.rand((uint16)subTable.size()-1); local.ShieldType = shield; it = subTable.find( local ); diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/redirect_attacks_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/redirect_attacks_effect.cpp index b34506593..cfff94eb5 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/redirect_attacks_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/redirect_attacks_effect.cpp @@ -110,7 +110,7 @@ CEntityBase *CRedirectAttacksEffect::getTargetForRedirection() const set aggroList = _AffectedCreature->getAggroList(); // select valid target - const uint size = aggroList.size(); + const uint size = (uint)aggroList.size(); vector selectedEntities; selectedEntities.reserve(size); @@ -127,7 +127,7 @@ CEntityBase *CRedirectAttacksEffect::getTargetForRedirection() const if (selectedEntities.empty()) return NULL; - uint32 num = RandomGenerator.rand(selectedEntities.size()-1); + uint32 num = RandomGenerator.rand((uint16)selectedEntities.size()-1); _TargetEntityForRedirection = selectedEntities[num]; } diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp index 7708a3d2e..a9fc7eda1 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp @@ -644,7 +644,7 @@ bool CSpecialPowerPhrase::validate() _Targets.push_back(entity->getTargetDataSetRow()); // validate all powers - const uint nbPowers = _Powers.size(); + const uint nbPowers = (uint)_Powers.size(); for (uint i = 0 ; i < nbPowers ; ++i) { #ifdef NL_DEBUG @@ -712,7 +712,7 @@ void CSpecialPowerPhrase::apply() void CSpecialPowerPhrase::applyPowers() { // apply powers - const uint nbPowers = _Powers.size(); + const uint nbPowers = (uint)_Powers.size(); for (uint i = 0 ; i < nbPowers ; ++i) { #ifdef NL_DEBUG diff --git a/code/ryzom/server/src/entities_game_service/player_manager/action_distance_checker.h b/code/ryzom/server/src/entities_game_service/player_manager/action_distance_checker.h index 9780a6244..4799ce870 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/action_distance_checker.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/action_distance_checker.h @@ -143,7 +143,7 @@ void CActionDistanceChecker::tickUpdate() _LastCheck = 0; // compute the higher check index that will be done this tick - uint max = _Checks.size(); + uint max = (uint)_Checks.size(); if ( max > _LastCheck + _NbCheckPerTick ) max = _LastCheck + _NbCheckPerTick; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/cdb.h b/code/ryzom/server/src/entities_game_service/player_manager/cdb.h index 9de693beb..443f72538 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/cdb.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/cdb.h @@ -137,7 +137,7 @@ public: /** * Return the count of strings composing this id */ - uint size() const { return _Ids.size(); } + uint size() const { return (uint)_Ids.size(); } private: std::vector _Ids; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp b/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp index 0d99f5612..969a56924 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/cdb_branch.cpp @@ -239,7 +239,7 @@ static inline void addNode( ICDBStructNode *newNode, NLMISC::IProgressCallback &progressCallBack ) { names.push_back(newName); - index.insert(make_pair(newName,nodes.size())); + index.insert(make_pair(newName,(NLMISC::TSStringId)nodes.size())); nodes.push_back(newNode); nodes.back()->setParent(parent); nodes.back()->setLabel(bankName); @@ -415,7 +415,7 @@ void CCDBStructNodeBranch::attachChild( ICDBStructNode * node, const string& nod node->setParent(this); _Nodes.push_back( node ); _Names.push_back( nodeName ); - _Index.insert( make_pair(nodeName,_Nodes.size() -1) ); + _Index.insert( make_pair(nodeName,(NLMISC::TSStringId)_Nodes.size() -1) ); calcIdBits(); } // attachChild // @@ -480,7 +480,7 @@ ICDBStructNode * CCDBStructNodeBranch::getNode (const CTextId& id , bool bCreate _Nodes.push_back( newNode ); _Names.push_back( str ); - _Index.insert( make_pair(str,_Nodes.size()-1) ); + _Index.insert( make_pair(str,(NLMISC::TSStringId)_Nodes.size()-1) ); newNode->setParent(this); itIdx = _Index.find(str); } diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index f4fd12c05..0288a67ef 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -714,12 +714,12 @@ void CCharacter::clear() _Pact.clear(); _KnownPhrases.clear(); _MissionHistories.clear(); - uint32 petCount= _PlayerPets.size(); _PlayerPets.clear(); _PlayerPets.resize(petCount); + uint32 petCount= (uint32)_PlayerPets.size(); _PlayerPets.clear(); _PlayerPets.resize(petCount); for(uint32 i=0;igetMissions().size(); + const uint size = (uint)team->getMissions().size(); for ( uint i = 0; i < size; i++ ) { nlassert(team->getMissions()[i]); @@ -2749,7 +2749,7 @@ void CCharacter::postLoadTreatment() _GuildId = 0; } - _NbSurvivePact = _Pact.size(); + _NbSurvivePact = (uint8)_Pact.size(); { H_AUTO(FixPetTicket); @@ -3743,7 +3743,7 @@ void CCharacter::enableAppropriateFiltersForSeller( CCreature * c ) //----------------------------------------------------------------------------- void CCharacter::updateTargetingChars() { - const uint size = _TargetingChars.size(); + const uint size = (uint)_TargetingChars.size(); for ( uint i = 0; i < size; i++ ) { CCharacter* user = PlayerManager.getChar( _TargetingChars[i] ); @@ -4232,7 +4232,7 @@ void CCharacter::addKnownBrick( const CSheetId& brickId ) break; }; - _InterfacesFlagsBitField |= 1 << uint8(flag); + _InterfacesFlagsBitField |= SINT64_CONSTANT(1) << uint8(flag); // _PropertyDatabase.setProp( "INTERFACES:FLAGS", _InterfacesFlagsBitField); CBankAccessor_PLR::getINTERFACES().setFLAGS(_PropertyDatabase, _InterfacesFlagsBitField); } @@ -4310,7 +4310,7 @@ void CCharacter::removeKnownBrick( const CSheetId& brickId ) break; }; - _InterfacesFlagsBitField |= 1 << uint8(flag); + _InterfacesFlagsBitField |= SINT64_CONSTANT(1) << uint8(flag); // _PropertyDatabase.setProp( "INTERFACES:FLAGS", _InterfacesFlagsBitField); CBankAccessor_PLR::getINTERFACES().setFLAGS(_PropertyDatabase, _InterfacesFlagsBitField); } @@ -4328,7 +4328,7 @@ void CCharacter::processTrainingBrick( const CStaticBrick *brick, bool sendChatM if (!brick) return; - const uint nbParams = brick->Params.size(); + const uint nbParams = (uint)brick->Params.size(); for ( uint i = 0 ; i < nbParams ; ++i ) { const TBrickParam::IId* param = brick->Params[i]; @@ -4390,7 +4390,7 @@ void CCharacter::unprocessTrainingBrick( const CStaticBrick *brick, bool sendCha if (!brick) return; - const uint nbParams = brick->Params.size(); + const uint nbParams = (uint)brick->Params.size(); for ( uint i = 0 ; i < nbParams ; ++i ) { const TBrickParam::IId* param = brick->Params[i]; @@ -4578,7 +4578,7 @@ bool CCharacter::getFillFaberRms( std::vector< const CStaticItem * >& rms, std:: //----------------------------------------------- bool CCharacter::lockFaberRms() { - uint size = _RmSelectedForFaber.size(); + uint size = (uint)_RmSelectedForFaber.size(); for( uint i = 0; i < size; ++i ) { @@ -4597,7 +4597,7 @@ bool CCharacter::lockFaberRms() } } - size = _RmFormulaSelectedForFaber.size(); + size = (uint)_RmFormulaSelectedForFaber.size(); for( uint i = 0; i < size; ++i ) { @@ -4625,14 +4625,14 @@ bool CCharacter::lockFaberRms() //----------------------------------------------- void CCharacter::unlockFaberRms() { - uint size = _RmSelectedForFaber.size(); + uint size = (uint)_RmSelectedForFaber.size(); for( uint i = 0; i < size; ++i ) { unLockItem( (INVENTORIES::TInventory)_RmSelectedForFaber[ i ].getInvId(), _RmSelectedForFaber[ i ].IndexInInv, _RmSelectedForFaber[ i ].Quantity ); } - size = _RmFormulaSelectedForFaber.size(); + size = (uint)_RmFormulaSelectedForFaber.size(); for( uint i = 0; i < size; ++i ) { @@ -4648,7 +4648,7 @@ void CCharacter::consumeFaberRms(bool failed) { TLogContext_Item_ConsumeFaberMp logContext(_Id); unlockFaberRms(); - uint size = _RmSelectedForFaber.size(); + uint size = (uint)_RmSelectedForFaber.size(); for( uint i = 0; i < size; ++i ) { @@ -4656,7 +4656,7 @@ void CCharacter::consumeFaberRms(bool failed) destroyItem( _RmSelectedForFaber[ i ].getInvId(), _RmSelectedForFaber[ i ].IndexInInv, _RmSelectedForFaber[ i ].Quantity ); } - size = _RmFormulaSelectedForFaber.size(); + size = (uint)_RmFormulaSelectedForFaber.size(); for( uint i = 0; i < size; ++i ) { @@ -5875,7 +5875,7 @@ void CCharacter::removeSpawnedPet(NLNET::TServiceId aiServiceId) */ uint CCharacter::getAnimalByTicket( CGameItemPtr item ) { - uint32 PlayerPetsSize = _PlayerPets.size(); + uint32 PlayerPetsSize = (uint32)_PlayerPets.size(); for( uint i=0; i!=PlayerPetsSize; ++i ) { if( _PlayerPets[ i ].TicketPetSheetId != CSheetId::Unknown ) @@ -5997,7 +5997,7 @@ bool CCharacter::petInventoryDistance( uint32 beastIndex ) //----------------------------------------------- void CCharacter::removeAnimal( CGameItemPtr item, CPetCommandMsg::TCommand mode ) { - uint32 PlayerPetsSize = _PlayerPets.size(); + uint32 PlayerPetsSize = (uint32)_PlayerPets.size(); sint32 PackAnimalIndex = -1; for( uint i = 0; i < PlayerPetsSize; ++i ) { @@ -6521,7 +6521,7 @@ void CCharacter::sendAnimalCommand( uint8 petIndexCode, uint8 command ) DROP_IF( !PackAnimalSystemEnabled, "Ignoring action on pack animals because pack animal suystem is not enabled: "<<_Id.toString(), return ); // calculate the size of the pets container for future use - uint32 numPets= _PlayerPets.size(); + uint32 numPets= (uint32)_PlayerPets.size(); // make sure the petIndexCode is valid (should be >=0 and <= _PlayerPets.size()) BOMB_IF(petIndexCode>numPets,"Ignoring action by player "<<_Id.toString()<<" on pet with invalid index",return); @@ -8644,7 +8644,7 @@ void CCharacter::setDatabase() break; }; - _InterfacesFlagsBitField |= 1 << uint8(flag); + _InterfacesFlagsBitField |= SINT64_CONSTANT(1) << uint8(flag); } else { @@ -8945,7 +8945,7 @@ void CCharacter::startTradePhrases(uint16 session) { // get nb of pages for trade list nlassert(NB_SLOT_PER_PAGE > 0); - const uint totalNbElts = _CurrentPhrasesTradeList.size(); + const uint totalNbElts = (uint)_CurrentPhrasesTradeList.size(); const uint nbPagesItems = 0; const uint nbPagesTotal = (uint16)ceil( double(totalNbElts) / NB_SLOT_PER_PAGE ); @@ -9096,7 +9096,7 @@ void CCharacter::fillTradePage(uint16 session, bool enableBuildingLossWarning) uint end; bool hasNext; - const uint totalNbElts = _CurrentPhrasesTradeList.size(); + const uint totalNbElts = (uint)_CurrentPhrasesTradeList.size(); if ( begin + NB_SLOT_PER_PAGE < totalNbElts ) { @@ -9441,8 +9441,8 @@ void CCharacter::buyPhraseByIndex( uint8 botChatIndex, uint16 knownPhraseIndex ) vector phraseRemoved; // get new phrases if any - const uint newSize = newPhrases.size(); - const uint oldSize = oldPhrases.size(); + const uint newSize = (uint)newPhrases.size(); + const uint oldSize = (uint)oldPhrases.size(); uint oldI = 0; for (uint newI = 0 ; newI < newSize ; ++newI) { @@ -9871,7 +9871,7 @@ void CCharacter::addPact( uint8 PactNature, uint8 PactType ) { CPact NewPact( PactNature, PactType ); _Pact.push_back( NewPact ); - _NbSurvivePact = _Pact.size(); + _NbSurvivePact = (uint8)_Pact.size(); SM_STATIC_PARAMS_1(params, STRING_MANAGER::integer); params[0].Int = PactType+1; sendDynamicSystemMessage(_Id, "OPS_PACT_GAIN_U", params); @@ -11363,7 +11363,7 @@ void CCharacter::fillMissionPage(uint16 sessionId) } else { - end = _CurrentMissionList.size(); + end = (uint)_CurrentMissionList.size(); hasNext = false; } // _PropertyDatabase.setProp( "CHOOSE_MISSIONS:SESSION", sessionId ); @@ -11633,7 +11633,7 @@ bool CCharacter::processMissionEventWithTeamMate( CMissionEvent & event, TAIAlia while (!vMembers.empty()) { // Pick up a member (in a random order) - uint idx = RandomGenerator.rand(vMembers.size() - 1); + uint idx = RandomGenerator.rand((uint16)vMembers.size() - 1); CCharacter * c = PlayerManager.getChar( vMembers[idx] ); if ((c != NULL) && c->getEnterFlag() && (c != this)) { @@ -12627,8 +12627,8 @@ void CCharacter::clearBeastTrain() commandMsg.Command = (uint16) CPetCommandMsg::FOLLOW; commandMsg.CharacterMirrorRow = TheDataset.getDataSetRow(_Id); - const uint size = _BeastTrain.size(); - const uint nbPets = _PlayerPets.size(); + const uint size = (uint)_BeastTrain.size(); + const uint nbPets = (uint)_PlayerPets.size(); for ( uint i = 0 ; i < size ; ++i ) { /// \todo Malkav: optimize this !!!!! @@ -12677,7 +12677,7 @@ void CCharacter::addBeast( uint16 petIndex ) return; } - const uint size = _BeastTrain.size(); + const uint size = (uint)_BeastTrain.size(); // check there is room in the train if (size == _TrainMaxSize) @@ -12740,7 +12740,7 @@ void CCharacter::setCurrentRegion(uint16 region) void CCharacter::setPlaces(const std::vector & places) { nldebug("CCharacter_setPlaces(%u)",places.size()); - const uint size = places.size(); + const uint size = (uint)places.size(); _Places.resize(places.size()); for ( uint i = 0; i < size; i++ ) _Places[i] = places[i]->getId(); @@ -12752,7 +12752,7 @@ void CCharacter::setPlaces(const std::vector & places) void CCharacter::memorize(uint8 memorizationSet, uint8 index, uint16 phraseId, const vector &bricks) { // check all used bricks are known - const uint size = bricks.size(); + const uint size = (uint)bricks.size(); for ( uint i = 0 ; i < size ; ++i) { if (_KnownBricks.find(bricks[i]) == _KnownBricks.end()) @@ -12784,7 +12784,7 @@ void CCharacter::addLink( CSLinkEffect * effect) // set the static action flag staticActionInProgress(true,STATIC_ACT_TYPES::Casting); - const uint8 size = _SEffectLinks.size(); + const uint8 size = (uint8)_SEffectLinks.size(); CEntityBase::addLink(effect); @@ -12946,7 +12946,7 @@ float CCharacter::getActualDamageFromExplosionWithArmor( float dmg ) const void CCharacter::checkPhrases() { // Re-build pre-built phrases (in case bricks changed) and remove phrases with still unknown bricks after. - const uint nbKnownPhrases = _KnownPhrases.size(); + const uint nbKnownPhrases = (uint)_KnownPhrases.size(); for(uint phraseIndex=0; phraseIndex &bricks, uint16 phraseId, co _KnownPhrases[phraseId].clear(); - const uint size = bricks.size(); + const uint size = (uint)bricks.size(); for (uint i = 0 ; i < size ; ++i) { if (bricks[i] != NLMISC::CSheetId::Unknown) @@ -13235,7 +13235,7 @@ bool CCharacter::learnPrebuiltPhrase( const CSheetId &phraseId, uint16 knownPhra _BoughtPhrases.insert( phraseId ); // Set bricks in the phrase as known bricks. - const uint size = phrase->Bricks.size(); + const uint size = (uint)phrase->Bricks.size(); for ( uint i = 0; i < size ; ++i) { if(phrase->Bricks[i] != CSheetId::Unknown) @@ -13258,7 +13258,7 @@ bool CCharacter::learnPrebuiltPhrase( const CSheetId &phraseId, uint16 knownPhra //----------------------------------------------- uint16 CCharacter::getFirstFreeSlotInKnownPhrase() { - const uint size = _KnownPhrases.size(); + const uint size = (uint)_KnownPhrases.size(); for (uint i = 2 ; i < size ; ++i) { if (_KnownPhrases[i].empty()) @@ -13270,7 +13270,7 @@ uint16 CCharacter::getFirstFreeSlotInKnownPhrase() _KnownPhrases.resize(3); else _KnownPhrases.resize(size+1); - return _KnownPhrases.size()-1; + return (uint16)_KnownPhrases.size()-1; } // getFirstFreeSlotInKnownPhrase // @@ -13281,7 +13281,7 @@ void CCharacter::getAvailablePhrasesList( const string &brickFilter, vector &qualities ) nlassert(invTemp != NULL); uint32 usedSlot = creature->getLootSlotCount(); - const uint8 size = creature->getMps().size(); + const uint8 size = (uint8)creature->getMps().size(); for (uint i = 0; i < size ; ++i) { const CCreatureRawMaterial *mp = creature->getCreatureRawMaterial(i); @@ -13400,7 +13400,7 @@ void CCharacter::getMatchingMissionLootRequirements( uint16 itemLevel, const std { // Matching OK CAutoQuarterItemDescription desc; - uint itemIndex = icm - materials.begin(); + uint itemIndex = (uint)(icm - materials.begin()); #ifdef NL_DEBUG nlassert( itemIndex <= (uint16)~0 ); #endif @@ -14230,7 +14230,7 @@ void CCharacter::sendContactListInit() // send to client bms.serialCont(friendStringIds); - uint32 nbState = friendOnlineStatus.size(); + uint32 nbState = (uint32)friendOnlineStatus.size(); bms.serial(nbState); for (uint i=0; i(getEntityRowId()) ); msgout2.serial(const_cast(*crowd)); - uint32 size = params.size(); + uint32 size = (uint32)params.size(); msgout2.serial(size); for ( uint i = 0; i < size; i++ ) { @@ -17967,7 +17967,7 @@ sint32 CCharacter::getSkillModifierForRace(EGSPD::CPeople::TPeople people) const EGSPD::getMatchingClassificationType(people, types); sint32 max = 0; - const uint nbTypes = types.size(); + const uint nbTypes = (uint)types.size(); for (uint i = 0 ; i < nbTypes ; ++i) { if (types[i] >=0 && types[i] < EGSPD::CClassificationType::EndClassificationType) @@ -17990,7 +17990,7 @@ void CCharacter::updateConnexionStat() _LastLogStats.begin()->LogoffTime = 0; _LastLogStats.begin()->Duration = 0; - uint32 size = _LastLogStats.size(); + uint32 size = (uint32)_LastLogStats.size(); if( size > NBLoginStats ) { for( uint i = 0; i < size - NBLoginStats; ++i ) @@ -19032,7 +19032,7 @@ const NLMISC::CEntityId &CCharacter::getFriend(uint16 index) const uint CCharacter::getNumIgnored() const { - return _IgnoreList.size(); + return (uint)_IgnoreList.size(); } @@ -19282,7 +19282,7 @@ void CCharacter::addInQueue(uint32 id) void CCharacter::removeFromQueue(uint32 id) { - const uint size = _MissionsQueues.size(); + const uint size = (uint)_MissionsQueues.size(); for ( uint i = 0 ; i < size ; ++i ) { if (_MissionsQueues[i] == id) @@ -19390,9 +19390,9 @@ void CCharacter::disableConsumableFamily(uint16 family, NLMISC::TGameCycle date) if( _ConsumableOverdoseEndDates.Dates.size() <= MaxBonusMalusDisplayed ) { // _PropertyDatabase.setProp( _DataIndexReminder->DisableConsumable.Family[_ConsumableOverdoseEndDates.Dates.size()-1], family ); - CBankAccessor_PLR::getDISABLE_CONSUMABLE().getArray(_ConsumableOverdoseEndDates.Dates.size()-1).setFAMILY(_PropertyDatabase, family ); + CBankAccessor_PLR::getDISABLE_CONSUMABLE().getArray((uint32)_ConsumableOverdoseEndDates.Dates.size()-1).setFAMILY(_PropertyDatabase, family ); // _PropertyDatabase.setProp( _DataIndexReminder->DisableConsumable.DisableTime[_ConsumableOverdoseEndDates.Dates.size()-1], date ); - CBankAccessor_PLR::getDISABLE_CONSUMABLE().getArray(_ConsumableOverdoseEndDates.Dates.size()-1).setDISABLE_TIME(_PropertyDatabase, date ); + CBankAccessor_PLR::getDISABLE_CONSUMABLE().getArray((uint32)_ConsumableOverdoseEndDates.Dates.size()-1).setDISABLE_TIME(_PropertyDatabase, date ); } } @@ -19663,7 +19663,7 @@ void CCharacter::sendNpcMissionGiverIconDesc( const std::vector& npcKeys //H_AUTO(SendNpcMissionGiverIconDesc); see USRCB_CLIENT:NPC_ICON:GET_DESC CBitMemStream bms; GenericMsgManager.pushNameToStream("NPC_ICON:SET_DESC", bms); - uint8 nb8 = npcKeys.size(); + uint8 nb8 = (uint8)npcKeys.size(); bms.serial( nb8 ); for ( std::vector::const_iterator ink=npcKeys.begin(); ink!=npcKeys.end(); ++ink ) diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_encyclopedia.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character_encyclopedia.cpp index 3ca43a90e..15966afc9 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_encyclopedia.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_encyclopedia.cpp @@ -262,7 +262,7 @@ bool CCharacterEncyclopedia::checkIfThemaCompleted(uint32 nAlbum, uint32 nThemaI const CStaticEncyclo &rSE = CSheets::getEncyclopedia(); const CStaticEncycloThema *pThm = rSE.getThema(nAlbum, nThemaInt+1); if (pThm == NULL) return false; - uint32 nNbTask = pThm->Tasks.size(); + uint32 nNbTask = (uint32)pThm->Tasks.size(); bool bRiteFinished = (_EncyCharAlbums[nAlbum].Themas[nThemaInt].getTaskState(0) == 2); bool bTasksFinished[7]; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h b/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h index 2f9acf755..de8aa0ce1 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_inlines.h @@ -203,7 +203,7 @@ inline bool CCharacter::isNearPetTpIsAllowed() const inline uint8 CCharacter::getNbPact() { - return _Pact.size(); + return (uint8)_Pact.size(); } //------------------------------------------------------------------------------ diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp index 17d175916..364502a71 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp @@ -531,7 +531,7 @@ bool CCharacter::pickUpItem(const CEntityId& entity) } // Check if this character have loot right - uint32 nRightSize = pCreature->getLootRight().size(); + uint32 nRightSize = (uint32)pCreature->getLootRight().size(); if (nRightSize > 0) { bool bLootRight = false; @@ -1243,8 +1243,8 @@ bool CCharacter::checkItemValidityWithEquipmentSlot( const CSheetId& sheet, uint //---------------------------------------------------------------------------- bool CCharacter::checkRightLeftHandCompatibility( const std::vector itemRight, const std::vector itemLeft ) { - const int itemRightSlotSize = itemRight.size(); - const int itemLeftSlotSize = itemLeft.size(); + const int itemRightSlotSize = (int)itemRight.size(); + const int itemLeftSlotSize = (int)itemLeft.size(); for( int i = 0; i < itemRightSlotSize; ++i ) { @@ -1265,8 +1265,8 @@ bool CCharacter::checkRightLeftHandCompatibility( const std::vector //---------------------------------------------------------------------------- bool CCharacter::checkIfItemCompatibleWithSlots( const std::vector itemSlot, std::vector< uint16 > slots ) { - const int itemSlotSize = itemSlot.size(); - const int typeSlotSize = slots.size(); + const int itemSlotSize = (int)itemSlot.size(); + const int typeSlotSize = (int)slots.size(); for( int i = 0; i < itemSlotSize; ++i ) { for( int j = 0; j < typeSlotSize; ++j ) diff --git a/code/ryzom/server/src/entities_game_service/player_manager/known_and_memorized_phrases.cpp b/code/ryzom/server/src/entities_game_service/player_manager/known_and_memorized_phrases.cpp index 30676675d..4209a0765 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/known_and_memorized_phrases.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/known_and_memorized_phrases.cpp @@ -164,7 +164,7 @@ bool CMemorizationSet::memorizeStarterPhrase(const std::vector const CStaticBrick * brick = CSheets::getSBrickForm( bricks[0] ); if( brick ) { - uint n = Phrases.size() / 2; + uint n = (uint)Phrases.size() / 2; BRICK_TYPE::EBrickType phraseType = BRICK_FAMILIES::brickType(brick->Family); if (phraseType == BRICK_TYPE::FORAGE_PROSPECTION || phraseType == BRICK_TYPE::FORAGE_EXTRACTION) { @@ -296,7 +296,7 @@ void CMemorizationSet::executePhrase(uint8 i, CCharacter *actor, const TDataSetR //----------------------------------------------- void CMemorizationSet::fixPhrases(const std::vector &knownPhrases, const TDataSetRow &rowId) { - const uint nbPhrases = Phrases.size(); + const uint nbPhrases = (uint)Phrases.size(); for(uint phraseIndex=0; phraseIndex &knownPhrases, const TDataSetRow &rowId) { - const uint nbSet = _MemSets.size(); + const uint nbSet = (uint)_MemSets.size(); for(uint i=0; i= 0; --i ) + for(sint32 i = (sint32)PowerActivationDates.size()-1; i >= 0; --i ) { if (PowerActivationDates[i].ConsumableFamilyId != (uint16)~0) { diff --git a/code/ryzom/server/src/entities_game_service/position_flag_manager.cpp b/code/ryzom/server/src/entities_game_service/position_flag_manager.cpp index 1ae26250c..738bb260f 100644 --- a/code/ryzom/server/src/entities_game_service/position_flag_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/position_flag_manager.cpp @@ -115,7 +115,7 @@ void CPositionFlagManager::serial(NLMISC::IStream & f) throw(NLMISC::EStream) } else { - len = _FlagPositions.size(); + len = (uint32)_FlagPositions.size(); f.serial(len); f.xmlPushEnd(); diff --git a/code/ryzom/server/src/entities_game_service/primitives_parser.cpp b/code/ryzom/server/src/entities_game_service/primitives_parser.cpp index b9ec3c00d..dfd92d25c 100644 --- a/code/ryzom/server/src/entities_game_service/primitives_parser.cpp +++ b/code/ryzom/server/src/entities_game_service/primitives_parser.cpp @@ -80,7 +80,7 @@ void CPrimitivesParser::init() for (uint i=0; i &prims = CPrimitiveCfg::getMap(mapConfigNames[i]); - primCount += prims.size(); + primCount += (uint)prims.size(); } uint numLoadedPrim = 0; diff --git a/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp b/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp index e08e57d0f..ec2f13c92 100644 --- a/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp +++ b/code/ryzom/server/src/entities_game_service/progression/progression_pve.cpp @@ -433,7 +433,7 @@ void CCharacterProgressionPVE::creatureDeath(TDataSetRow creature) // Decide how many mission items will be given away (supports any float average; typically 1.0) uint quantityOfMissionItemsToGive = 0; vector quantityPerMatchingMissionItem( matchingItemsForMissions.size(), 0 ); - uint iMaxMatchingMissionItem = quantityPerMatchingMissionItem.size() - 1; + uint iMaxMatchingMissionItem = (uint)quantityPerMatchingMissionItem.size() - 1; quantityOfMissionItemsToGive = (uint)QuarteringQuantityAverageForMissions.get(); float decimalPart = (uint)QuarteringQuantityAverageForMissions.get() - (float)floor( QuarteringQuantityAverageForMissions.get() ); quantityOfMissionItemsToGive = RandomGenerator.rand( quantityOfMissionItemsToGive * 2 ); @@ -1136,7 +1136,7 @@ void CCharacterProgressionPVE::clearPlayerDamage(const NLMISC::CEntityId &player if (removeDamageFromTeam == true) { - uint8 teamSize = (*itCreature).second.PlayerInflictedDamage[index].TeamMembers.size(); + uint8 teamSize = (uint8)(*itCreature).second.PlayerInflictedDamage[index].TeamMembers.size(); (*itCreature).second.PlayerInflictedDamage[index].TotalDamage -= (*itCreature).second.PlayerInflictedDamage[index].TotalDamage / teamSize; } @@ -1555,7 +1555,7 @@ void CCharacterProgressionPVE::removeCreature(TDataSetRow creature) vector &creatures = (*itTeam).second; uint j; - const uint size = creatures.size(); + const uint size = (uint)creatures.size(); for (j = 0 ; j < size ; ++j) { if (creatures[j] == creature) @@ -1590,7 +1590,7 @@ void CCharacterProgressionPVE::removeCreature(TDataSetRow creature) vector &creatures = (*itPlayer).second; uint j; - const uint size = creatures.size(); + const uint size = (uint)creatures.size(); for (j = 0 ; j < size ; ++j) { if (creatures[j] == creature) @@ -1622,7 +1622,7 @@ void CCharacterProgressionPVE::removeCreature(TDataSetRow creature) vector &creatures = (*itCreature).second; uint j; - const uint size = creatures.size(); + const uint size = (uint)creatures.size(); for (j = 0 ; j < size ; ++j) { if (creatures[j] == creature) @@ -1670,7 +1670,7 @@ void CCharacterProgressionPVE::transferDamageOnFictitiousCreature(TDataSetRow pl if (itPlayer != _PlayersWoundedCreatures.end()) { vector &playerAttackedCreatures = (*itPlayer).second; - uint nbCreatures = playerAttackedCreatures.size(); + uint nbCreatures = (uint)playerAttackedCreatures.size(); while (nbCreatures > 0) { // clear player damage against this creature @@ -1999,7 +1999,7 @@ bool CCharacterActions::forgetXpGain( TDataSetRow creature ) //---------------------------------------------------------------------------- void CSkillProgress::incNbAction( SKILLS::ESkills skill ) { - const uint size = _SkillsProgress.size(); + const uint size = (uint)_SkillsProgress.size(); for( uint i = 0; i < size; ++i ) { @@ -2026,7 +2026,7 @@ bool CSkillProgress::applyXp( CCharacter * c, float xpGainPerOpponent ) // compute total number of action (BUT skip all 'unknown' skills actions) - const uint size = _SkillsProgress.size(); + const uint size = (uint)_SkillsProgress.size(); double totalNbActions = 0; for( uint i = 0; i < size; ++i ) { @@ -2233,7 +2233,7 @@ void CCreatureTakenDamage::attributeKillsForMission(TDataSetRow victimRowId) { // compute the minimum damade to do to hava a kill attributed float minDamage = TotalCreatureInflictedDamage; - const uint size = PlayerInflictedDamage.size(); + const uint size = (uint)PlayerInflictedDamage.size(); for ( uint i = 0; i < PlayerInflictedDamage.size(); i++ ) minDamage += PlayerInflictedDamage[i].TotalDamage; minDamage = KillAttribMinFactor * minDamage; @@ -2294,7 +2294,7 @@ bool CCreatureTakenDamage::transferDamageOnFictitiousCreature(const CEntityId &p bool retValue = false; bool found = false; - const uint size = PlayerInflictedDamage.size(); + const uint size = (uint)PlayerInflictedDamage.size(); for ( uint i = 0 ; i < size ; ++i) { float damage; @@ -2329,7 +2329,7 @@ bool CCreatureTakenDamage::transferDamageOnFictitiousCreature(const CEntityId &p { TotalCreatureInflictedDamage += damage; - const uint nbC = CreatureInflictedDamage.size(); + const uint nbC = (uint)CreatureInflictedDamage.size(); for ( uint j = 0 ; j < nbC ; ++j) { if (CreatureInflictedDamage[j].CreatureId == CEntityId::Unknown) @@ -2391,7 +2391,7 @@ void CCreatureTakenDamage::attributeKill( uint16 teamId, TDataSetRow victimRowId while ( !members.empty() ) { - uint idx = RandomGenerator.rand( members.size() - 1 ); + uint idx = RandomGenerator.rand( (uint16)members.size() - 1 ); CCharacter * c = PlayerManager.getChar( members[idx] ); if ( c && c->getEnterFlag() ) { diff --git a/code/ryzom/server/src/entities_game_service/progression/progression_pve.h b/code/ryzom/server/src/entities_game_service/progression/progression_pve.h index 79db4510d..6a246da93 100644 --- a/code/ryzom/server/src/entities_game_service/progression/progression_pve.h +++ b/code/ryzom/server/src/entities_game_service/progression/progression_pve.h @@ -158,7 +158,7 @@ public: if (MaxSkillValue < skillValue) MaxSkillValue = skillValue; - const uint size = TeamMembers.size(); + const uint size = (uint)TeamMembers.size(); for (uint i = 0 ; i < size ; ++i) { if (TeamMembers[i].Id == playerId) @@ -176,7 +176,7 @@ public: /// remove a team member void removeMember(const NLMISC::CEntityId &playerId) { - const uint size = TeamMembers.size(); + const uint size = (uint)TeamMembers.size(); for (uint i = 0 ; i < size ; ++i) { if (TeamMembers[i].Id == playerId) @@ -232,7 +232,7 @@ struct CCreatureTakenDamage sint16 getIndexForTeam(uint16 teamId) { - const uint size = PlayerInflictedDamage.size(); + const uint size = (uint)PlayerInflictedDamage.size(); for ( uint i = 0 ; i < size ; ++i) { if ( PlayerInflictedDamage[i].TeamId == teamId ) @@ -245,7 +245,7 @@ struct CCreatureTakenDamage sint16 getIndexForPlayer(const NLMISC::CEntityId &id) { - const uint size = PlayerInflictedDamage.size(); + const uint size = (uint)PlayerInflictedDamage.size(); for ( uint i = 0 ; i < size ; ++i) { if ( PlayerInflictedDamage[i].PlayerId == id ) @@ -258,7 +258,7 @@ struct CCreatureTakenDamage sint16 getIndexForCreature(const NLMISC::CEntityId &id) { - const uint size = CreatureInflictedDamage.size(); + const uint size = (uint)CreatureInflictedDamage.size(); for ( uint i = 0 ; i < size ; ++i) { if ( CreatureInflictedDamage[i].CreatureId == id ) @@ -274,7 +274,7 @@ struct CCreatureTakenDamage { float maxDmg = TotalCreatureInflictedDamage; sint16 index = -1; - const uint size = PlayerInflictedDamage.size(); + const uint size = (uint)PlayerInflictedDamage.size(); for ( uint i = 0 ; i < size ; ++i) { if ( PlayerInflictedDamage[i].TotalDamage > maxDmg ) diff --git a/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp b/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp index 8fcbc5350..633c41a2e 100644 --- a/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp +++ b/code/ryzom/server/src/entities_game_service/progression/progression_pvp.cpp @@ -201,7 +201,7 @@ void CDamageScoreTable::changeAllDamageEquitably(sint32 damageDelta) if (damageDelta == 0) return; - const uint32 nbEntities = _TeamDamageScores.size() + _PlayerDamageScores.size() + _CreatureDamageScores.size(); + const uint32 nbEntities = (uint32)(_TeamDamageScores.size() + _PlayerDamageScores.size() + _CreatureDamageScores.size()); if (nbEntities == 0) return; @@ -336,7 +336,7 @@ void CDamageScoreTable::playerLeavesTeam(TDataSetRow playerRowId, TTeamId teamId return; vector & beneficiaries = teamScore->Beneficiaries; - const uint32 nbBeneficiaries = beneficiaries.size(); + const uint32 nbBeneficiaries = (uint32)beneficiaries.size(); // remove player from beneficiaries const bool isBeneficiary = removeElementFromVector(playerRowId, beneficiaries); diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_challenge.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_challenge.cpp index 75e66ada9..8046591be 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_challenge.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_challenge.cpp @@ -83,7 +83,7 @@ PVP_RELATION::TPVPRelation CPVPChallenge::getPVPRelation( CCharacter * user, CEn void CPVPChallenge::addUserTeam(CCharacter *user) { nlassert(user); - const CTpSpawnZone * zone = CPVPManager::getInstance()->getChallengeSpawnZone( _Teams.size() ); + const CTpSpawnZone * zone = CPVPManager::getInstance()->getChallengeSpawnZone( (uint)_Teams.size() ); nlassert(zone); sint32 x,y,z; float heading; @@ -186,7 +186,7 @@ bool CPVPChallenge::leavePVP( CCharacter * user, IPVP::TEndType type ) sendChallengeMessage( i, "CHALLENGE_HE_ABANDON",params); } - const uint size = _Teams[ teamIdx ].Members.size(); + const uint size = (uint)_Teams[ teamIdx ].Members.size(); for ( uint i = 0; i < size; i++ ) { CCharacter * c = PlayerManager.getChar( _Teams[ teamIdx ].Members[i].Row ); @@ -244,7 +244,7 @@ bool CPVPChallenge::leavePVP( CCharacter * user, IPVP::TEndType type ) /// check if there remains only 1 team uint lastTeamIdx = ~0; - const uint size = _Teams.size(); + const uint size = (uint)_Teams.size(); for ( uint i = 0; i < size; i++ ) { if ( !_Teams[i].Members.empty() ) @@ -265,7 +265,7 @@ bool CPVPChallenge::leavePVP( CCharacter * user, IPVP::TEndType type ) sendChallengeMessage( lastTeamIdx, "CHALLENGE_WON"); // free the island nlassert( lastTeamIdx < _Teams.size() ); - const uint size = _Teams[ lastTeamIdx ].Members.size(); + const uint size = (uint)_Teams[ lastTeamIdx ].Members.size(); for ( uint i = 0; i < size; i++ ) { CCharacter * c = PlayerManager.getChar( _Teams[ lastTeamIdx ].Members[i].Row ); @@ -355,10 +355,10 @@ bool CPVPChallenge::canApplyAreaEffect(CCharacter * caster, CEntityBase * areaTa //---------------------------------------------------------------------------- const CPVPChallenge::CMember * CPVPChallenge::getMember( const TDataSetRow & userRow, uint16& teamIdx, uint16 & memberIdx )const { - const uint size = _Teams.size(); + const uint size = (uint)_Teams.size(); for ( uint i = 0; i < size ; i++ ) { - const uint size2 = _Teams[i].Members.size(); + const uint size2 = (uint)_Teams[i].Members.size(); for ( uint j = 0; j < size2 ; j++ ) { if ( userRow == _Teams[i].Members[j].Row ) diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/totem_base.h b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/totem_base.h index a1d1c8704..50fe0ff85 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/totem_base.h +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_faction_reward_manager/totem_base.h @@ -73,7 +73,7 @@ public : inline void addNeighbour( TAIAlias neighbour ) { _Neighbours.push_back( neighbour ); } /// Get the number of neighbours - inline uint getNumNeighbours() const { return _Neighbours.size(); } + inline uint getNumNeighbours() const { return (uint)_Neighbours.size(); } /// Get the list of neighbours inline TAIAlias getNeighbour( uint index ) const { return _Neighbours[index]; } diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager.cpp index 82f01b434..f4c996f4f 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager.cpp @@ -1132,7 +1132,7 @@ sint32 CPVPManager:: allocatePVPIsland(CPVPChallenge* challenge) static const uint allocStep = 128; #endif // reallocate vector if necessary - const uint oldSize = _ChallengeIslands.size(); + const uint oldSize = (uint)_ChallengeIslands.size(); if ( _FirstFreeIslandIdx >= oldSize ) { const uint newSize = oldSize + allocStep; diff --git a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp index 618af6370..32e3c7fcb 100644 --- a/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp +++ b/code/ryzom/server/src/entities_game_service/pvp_manager/pvp_manager_2.cpp @@ -705,7 +705,7 @@ void CPVPManager2::characterKilledInPvPFaction( CCharacter * character, PVP_CLAN //---------------------------------------------------------------------------- bool CPVPManager2::addFactionWar( PVP_CLAN::TPVPClan clan1, PVP_CLAN::TPVPClan clan2 ) { - uint32 factionWarOccursSize = _FactionWarOccurs.size(); + uint32 factionWarOccursSize = (uint32)_FactionWarOccurs.size(); for( uint32 i = 0; i < factionWarOccursSize; ++i ) { if( _FactionWarOccurs[ i ].inPvPFaction( clan1, clan2 ) ) @@ -876,7 +876,7 @@ bool CPVPManager2::factionWarOccurs( PVP_CLAN::TPVPClan clan1, PVP_CLAN::TPVPCla { if( clan1 != PVP_CLAN::Neutral && clan2 != PVP_CLAN::Neutral ) { - uint32 factionWarOccursSize = _FactionWarOccurs.size(); + uint32 factionWarOccursSize = (uint32)_FactionWarOccurs.size(); for( uint32 i = 0; i < factionWarOccursSize; ++i ) { if( _FactionWarOccurs[ i ].inPvPFaction( clan1, clan2 ) ) @@ -910,7 +910,7 @@ bool CPVPManager2::factionWarOccurs( pair_PropertyDatabase.setProp( NLMISC::toString("INVENTORY:SHARE:%u:NB_MEMBER",j), _Rewards[j].Candidates.size() ); - shareItem.setNB_MEMBER(user->_PropertyDatabase, _Rewards[j].Candidates.size()); + shareItem.setNB_MEMBER(user->_PropertyDatabase, (uint8)_Rewards[j].Candidates.size()); uint p = 0; for (; p < _Rewards[j].Candidates.size();p++) diff --git a/code/ryzom/server/src/entities_game_service/team_manager/team.cpp b/code/ryzom/server/src/entities_game_service/team_manager/team.cpp index 1fcaf5ddd..178d34d6d 100644 --- a/code/ryzom/server/src/entities_game_service/team_manager/team.cpp +++ b/code/ryzom/server/src/entities_game_service/team_manager/team.cpp @@ -107,7 +107,7 @@ void CTeam::release() delete _RewardSharing; _RewardSharing = NULL; } - const uint size = _Missions.size(); + const uint size = (uint)_Missions.size(); for ( uint i = 0; i < size; i++ ) { _Missions[i]->clearUsersJournalEntry(); @@ -172,7 +172,7 @@ void CTeam::addCharacter(CCharacter *newCharacter) // update all member's DB // char buffer[256]; - uint position = _TeamMembers.size()-1; + uint position = (uint)_TeamMembers.size()-1; uint i =0; for (std::list::const_iterator it = _TeamMembers.begin() ; it != _TeamMembers.end() ; ++it) { @@ -395,7 +395,7 @@ void CTeam::removeCharacter( CCharacter * player ) // check if the team must be removed if ( _NbMembers == 1 ) { - const uint size = _Missions.size(); + const uint size = (uint)_Missions.size(); uint count = 0; while ( !_Missions.empty() && count < size ) { @@ -1117,7 +1117,7 @@ void CTeam::updateMembersPositions(bool forceUpdate) CMissionTeam* CTeam::getMissionByAlias( TAIAlias missionAlias ) { - const uint size = _Missions.size(); + const uint size = (uint)_Missions.size(); for ( uint i = 0; i < size; i++ ) { if ( _Missions[i] && _Missions[i]->getTemplateId() == missionAlias ) diff --git a/code/ryzom/server/src/entities_game_service/team_manager/team_manager.cpp b/code/ryzom/server/src/entities_game_service/team_manager/team_manager.cpp index 1a1b510b5..9f7aef68e 100644 --- a/code/ryzom/server/src/entities_game_service/team_manager/team_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/team_manager/team_manager.cpp @@ -636,7 +636,7 @@ void CTeamManager::update() const TGameCycle time = CTickEventHandler::getGameCycle(); // update team members position every 5s - const uint size = _Teams.size(); + const uint size = (uint)_Teams.size(); for ( uint i = 0 ; i < size ; ++i) { if ( (time + _Teams[i].getTeamId()) % 30 == 0) diff --git a/code/ryzom/server/src/entities_game_service/zone_manager.cpp b/code/ryzom/server/src/entities_game_service/zone_manager.cpp index 3f8972aa8..191917961 100644 --- a/code/ryzom/server/src/entities_game_service/zone_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/zone_manager.cpp @@ -751,7 +751,7 @@ bool CZoneManager::parseRegions( const NLLIGO::IPrimitive* prim ) if ( zone && prim->getPropertyByName("class",value) && value == "region" ) { CRegion * region = new CRegion(); - if ( region->build( zone,_Places.size() ) ) + if ( region->build( zone,(uint16)_Places.size() ) ) { bool found = false; for (uint i = 0; i < _Continents.size(); i++ ) @@ -802,7 +802,7 @@ bool CZoneManager::parseZones( const NLLIGO::IPrimitive* prim ) if ( value == "place" ) { CPlace* place = new CPlace(); - if ( place->build( zone,_Places.size() ) ) + if ( place->build( zone,(uint16)_Places.size() ) ) { for (uint i = 0; i < _Continents.size(); i++ ) { @@ -1027,7 +1027,7 @@ bool CZoneManager::parseStables( const NLLIGO::IPrimitive* prim ) bool found = false; CPlace* place = new CPlace(); - if ( place->build( primZone,_Places.size(), true ) ) + if ( place->build( primZone,(uint16)_Places.size(), true ) ) { for (uint i = 0; i < _Continents.size(); i++ ) { @@ -1205,7 +1205,7 @@ bool CZoneManager::parseGooBorder( const NLLIGO::IPrimitive* prim ) if( path ) { CPlace* place = new CPlace(); - if ( place->build( path,_Places.size() ) ) //assume CPrimPath and CPrimZone has the same members, method needed are only in CPrimZone + if ( place->build( path,(uint16)_Places.size() ) ) //assume CPrimPath and CPrimZone has the same members, method needed are only in CPrimZone { for (uint i = 0; i < _Continents.size(); i++ ) { @@ -1815,7 +1815,7 @@ void CZoneManager::updateCharacterPosition( CCharacter * user ) } // get new places - const uint newPlacesSize = places.size(); + const uint newPlacesSize = (uint)places.size(); //bool sendWarning = false; bool changed = false; for ( uint i = 0; i < newPlacesSize; i++ ) @@ -1848,7 +1848,7 @@ void CZoneManager::updateCharacterPosition( CCharacter * user ) } // get left places - const uint oldPlacesSize = user->getPlaces().size(); + const uint oldPlacesSize = (uint)user->getPlaces().size(); for ( uint i = 0; i < oldPlacesSize; i++ ) { uint j = 0; @@ -1977,7 +1977,7 @@ void CZoneManager::tickUpdate() { // *** Update deposits at low frequency (each deposit is updated once per DepositUpdateFrequency (which is a period in game cycles, actually)) // CPU is smoothed if there are more deposits than cycles in the period. - uint32 nbDeposit = _Deposits.size(); + uint32 nbDeposit = (uint32)_Deposits.size(); if( ( (_NextDepositIndexUpdated != 0) || (CTickEventHandler::getGameCycle() - _SpreadUpdateLoopBeginTick ) >= DepositUpdateFrequency.get()) ) { if ( _NextDepositIndexUpdated == 0 ) @@ -2081,7 +2081,7 @@ void CZoneManager::answerWhere(const NLMISC::CEntityId & eId) return; } - uint size = c->getPlaces().size(); + uint size = (uint)c->getPlaces().size(); CPlace * place = NULL; for ( uint i = 0; i < size; i++ ) { diff --git a/code/ryzom/server/src/entities_game_service/zone_manager.h b/code/ryzom/server/src/entities_game_service/zone_manager.h index 8442b295c..87392e17b 100644 --- a/code/ryzom/server/src/entities_game_service/zone_manager.h +++ b/code/ryzom/server/src/entities_game_service/zone_manager.h @@ -501,7 +501,7 @@ public: nlwarning("bad start point index %u: no spawn point in vector",startPointIdx ); return NULL; } - uint16 idx = (uint16)RandomGenerator.rand( _StartPoints[startPointIdx].size() - 1 ); + uint16 idx = (uint16)RandomGenerator.rand( (uint16)_StartPoints[startPointIdx].size() - 1 ); mission = _StartPoints[startPointIdx][idx].Mission; bot = _StartPoints[startPointIdx][idx].Welcomer; return getTpSpawnZone( _StartPoints[startPointIdx][idx].SpawnZoneId ); diff --git a/code/ryzom/server/src/frontend_service/client_host.cpp b/code/ryzom/server/src/frontend_service/client_host.cpp index e09f5eed8..364e840fb 100644 --- a/code/ryzom/server/src/frontend_service/client_host.cpp +++ b/code/ryzom/server/src/frontend_service/client_host.cpp @@ -476,7 +476,7 @@ void CClientHost::CGenericMultiPartTemp::set (CActionGenericMultiPart *agmp, BlockReceived[agmp->Part] = true; NbCurrentBlock++; - TempSize += agmp->PartCont.size(); + TempSize += (uint32)agmp->PartCont.size(); if (NbCurrentBlock == NbBlock) { diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp index 9bfa7a686..d71e60e0f 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.cpp @@ -230,7 +230,7 @@ void CDistancePrioritizer::fillOutBox( CClientHost& client, TOutBox& outbox ) { // Exit when the size limit has been reached before all the pairs have been filled #ifdef NL_DEBUG - uint nbRemainingPairs = _PrioritizedEntitiesByClient[clientId].size() - _CurrentEntitiesToStudy[clientId]; + uint nbRemainingPairs = (uint)_PrioritizedEntitiesByClient[clientId].size() - _CurrentEntitiesToStudy[clientId]; if ( nbRemainingPairs > 0 ) LOG_WHAT_IS_SENT( "%u: C%hu S%hu: %u pairs remaining", CTickEventHandler::getGameCycle(), clientId, (uint16)slot, nbRemainingPairs ); LOG_WHAT_IS_SENT( "C%hu: outbox full (%d bits)", clientId, currentPosInBit ); @@ -1131,7 +1131,7 @@ void fillTARGET_LIST( TOutBox& outbox, TPropIndex ) outbox.serialBitAndLog(payLoad); // restricts to 256 entities - uint longListSize = TargetSlotsList.size(); + uint longListSize = (uint)TargetSlotsList.size(); if (longListSize > 32) longListSize = 32; @@ -1531,7 +1531,7 @@ void TVPNodeServer::initSortedFlatVPTree() void TVPNodeServer::initSortedFlatVPTreeFill() { - uint thisItem = SortedFlatVPTreeFill.size(); + uint thisItem = (uint)SortedFlatVPTreeFill.size(); SortedFlatVPTreeFill.push_back(CSortedFlatVPTreeFillItem()); SortedFlatVPTreeFill[thisItem].Node = this; @@ -1539,7 +1539,7 @@ void TVPNodeServer::initSortedFlatVPTreeFill() if (a()) a()->initSortedFlatVPTreeFill(); if (b()) b()->initSortedFlatVPTreeFill(); - SortedFlatVPTreeFill[thisItem].NextIfNoPayload = SortedFlatVPTreeFill.size(); + SortedFlatVPTreeFill[thisItem].NextIfNoPayload = (uint)SortedFlatVPTreeFill.size(); } diff --git a/code/ryzom/server/src/frontend_service/distance_prioritizer.h b/code/ryzom/server/src/frontend_service/distance_prioritizer.h index 7d9cb15ba..397a86e97 100644 --- a/code/ryzom/server/src/frontend_service/distance_prioritizer.h +++ b/code/ryzom/server/src/frontend_service/distance_prioritizer.h @@ -161,7 +161,7 @@ public: static void fastFillDiscreetProperties(TOutBox& outbox) { - uint i = 0, size = SortedFlatVPTreeFill.size(); + uint i = 0, size = (uint)SortedFlatVPTreeFill.size(); while (i < size) { CSortedFlatVPTreeFillItem& item = SortedFlatVPTreeFill[i++]; diff --git a/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp b/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp index 7f1e46076..36bdec364 100644 --- a/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp +++ b/code/ryzom/server/src/frontend_service/fe_receive_sub.cpp @@ -1527,7 +1527,7 @@ void CFeReceiveSub::removeFromRemoveList( TClientId clientid ) uint32 CFeReceiveSub::getNbClient() { - return _ClientMap.size(); + return (uint32)_ClientMap.size(); } @@ -1685,7 +1685,7 @@ NLMISC_DYNVARIABLE( uint32, NbPlayers, "Number of connected players" ) { // We can only read the value if ( get ) - *pointer = CFrontEndService::instance()->receiveSub()->clientMap().size(); + *pointer = (uint32)CFrontEndService::instance()->receiveSub()->clientMap().size(); } diff --git a/code/ryzom/server/src/frontend_service/fe_receive_task.h b/code/ryzom/server/src/frontend_service/fe_receive_task.h index f4b548c62..2eb31abed 100644 --- a/code/ryzom/server/src/frontend_service/fe_receive_task.h +++ b/code/ryzom/server/src/frontend_service/fe_receive_task.h @@ -69,7 +69,7 @@ struct TReceivedMessage const uint8 *userDataR() const { return &*_Data.begin() + MsgHeaderSize; } /// Return the size of user data - uint32 userSize() { return _Data.size() - MsgHeaderSize; } + uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; } /// Return the data vector (event type header byte + user data) vector& data() { return _Data; } diff --git a/code/ryzom/server/src/frontend_service/frontend_service.cpp b/code/ryzom/server/src/frontend_service/frontend_service.cpp index 07e0b2546..ce47e5322 100644 --- a/code/ryzom/server/src/frontend_service/frontend_service.cpp +++ b/code/ryzom/server/src/frontend_service/frontend_service.cpp @@ -964,7 +964,7 @@ void cbServiceUp( const string& serviceName, NLNET::TServiceId serviceId, void * // send number of players on FS CMessage msgPlr("NBPLAYERS2"); - uint32 nbClients = CFrontEndService::instance()->receiveSub()->clientMap().size(); + uint32 nbClients = (uint32)CFrontEndService::instance()->receiveSub()->clientMap().size(); uint32 nbPendingClients = CLoginServer::getNbPendingUsers(); msgPlr.serial(nbClients); @@ -1019,7 +1019,7 @@ void cbServiceDown( const string& serviceName, NLNET::TServiceId serviceId, void nlinfo( "Entering SERVER_DOWN mode" ); // remove all limbo clients - uint clientsInLimbo = CFrontEndService::instance()->receiveSub()->LimboClients.size(); + uint clientsInLimbo = (uint)CFrontEndService::instance()->receiveSub()->LimboClients.size(); CFrontEndService::instance()->receiveSub()->LimboClients.clear(); nlinfo("Removed %d clients in limbo mode", clientsInLimbo); } diff --git a/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp b/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp index 65648612d..3f3872508 100644 --- a/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp +++ b/code/ryzom/server/src/frontend_service/gateway_fes_transport.cpp @@ -139,7 +139,7 @@ public: virtual uint32 getRouteCount() const { - return _Routes.size(); + return (uint32)_Routes.size(); } void dump(NLMISC::CLog &log) const diff --git a/code/ryzom/server/src/frontend_service/impulse_encoder.cpp b/code/ryzom/server/src/frontend_service/impulse_encoder.cpp index 4497bbdca..75e694e3d 100644 --- a/code/ryzom/server/src/frontend_service/impulse_encoder.cpp +++ b/code/ryzom/server/src/frontend_service/impulse_encoder.cpp @@ -299,10 +299,10 @@ uint CImpulseEncoder::queueSize(uint level) const case 2: channels = _Level2; break; } - uint size = _MainQueues[level].size(); + uint size = (uint)_MainQueues[level].size(); for (channel=0; channel"; - _Id = _RegisteredManagers.size(); + _Id = (uint)_RegisteredManagers.size(); _Cycle = 0; _CompleteCycle = false; _RegisteredManagers.push_back(this); diff --git a/code/ryzom/server/src/frontend_service/packet_history.cpp b/code/ryzom/server/src/frontend_service/packet_history.cpp index f5e2e01bb..1b2341e57 100644 --- a/code/ryzom/server/src/frontend_service/packet_history.cpp +++ b/code/ryzom/server/src/frontend_service/packet_history.cpp @@ -39,7 +39,7 @@ CPacketHistory::CPacketHistory() void CPacketHistory::clear() { - uint32 num = _ClientsHistories.size(); + uint32 num = (uint32)_ClientsHistories.size(); _ClientsHistories.clear(); _ClientsHistories.resize(num); } diff --git a/code/ryzom/server/src/frontend_service/processing_spreader.cpp b/code/ryzom/server/src/frontend_service/processing_spreader.cpp index a4e8fa2bd..6c442a14e 100644 --- a/code/ryzom/server/src/frontend_service/processing_spreader.cpp +++ b/code/ryzom/server/src/frontend_service/processing_spreader.cpp @@ -48,7 +48,7 @@ void CProcessingSpreader::init() void CProcessingSpreader::getProcessingBounds( THostMap::iterator& firstit, sint& firstindex, sint& outerboundindex ) { THostMap& clientmap = CFrontEndService::instance()->receiveSub()->clientMap(); - sint nbClients = clientmap.size(); + sint nbClients = (sint)clientmap.size(); // Test if the index has reached the end of the client map if ( _ClientMapIndex >= nbClients ) diff --git a/code/ryzom/server/src/frontend_service/property_history.cpp b/code/ryzom/server/src/frontend_service/property_history.cpp index ddd2aa9aa..2599d5738 100644 --- a/code/ryzom/server/src/frontend_service/property_history.cpp +++ b/code/ryzom/server/src/frontend_service/property_history.cpp @@ -44,7 +44,7 @@ CPropertyHistory::CPropertyHistory() void CPropertyHistory::clear() { - uint32 num = _ClientEntries.size(); + uint32 num = (uint32)_ClientEntries.size(); _ClientEntries.clear(); _ClientEntries.resize(num); } diff --git a/code/ryzom/server/src/frontend_service/selection_generator.cpp b/code/ryzom/server/src/frontend_service/selection_generator.cpp index 7d1c141eb..f8613f357 100644 --- a/code/ryzom/server/src/frontend_service/selection_generator.cpp +++ b/code/ryzom/server/src/frontend_service/selection_generator.cpp @@ -166,7 +166,7 @@ ISelectionGenerator::TSelectionLevel CScoringGenerator::getNext() // Return the index of the smallest score and add index+1 to the min score TLevelScores::iterator iminscore = min_element( _LevelScores.begin(), _LevelScores.end() ); - uint32 index = iminscore - _LevelScores.begin(); + uint32 index = (uint32)(iminscore - _LevelScores.begin()); (*iminscore) += (index + 1); //printScores(); return index; diff --git a/code/ryzom/server/src/gameplay_module_lib/module_core.cpp b/code/ryzom/server/src/gameplay_module_lib/module_core.cpp index 750f25755..d4aa0d7cf 100644 --- a/code/ryzom/server/src/gameplay_module_lib/module_core.cpp +++ b/code/ryzom/server/src/gameplay_module_lib/module_core.cpp @@ -22,7 +22,7 @@ IModuleCore::~IModuleCore() { MODULE_INFO( "Module core destructor : inform all referencing module and delete the contained module parent" ); - const uint size = _ModulesReferencingMe.size(); + const uint size = (uint)_ModulesReferencingMe.size(); for ( uint i = 0; i < size; i++ ) { if ( _ModulesReferencingMe[i] ) diff --git a/code/ryzom/server/src/gameplay_module_lib/module_core.h b/code/ryzom/server/src/gameplay_module_lib/module_core.h index ff26d7943..804550deb 100644 --- a/code/ryzom/server/src/gameplay_module_lib/module_core.h +++ b/code/ryzom/server/src/gameplay_module_lib/module_core.h @@ -48,7 +48,7 @@ public: bool getReferencingModule( ModuleClass* & module)const { module = NULL; - const uint size = _ModulesReferencingMe.size(); + const uint size = (uint)_ModulesReferencingMe.size(); for (uint i = 0; i < size; i++ ) { ModuleClass * moduleChecked = dynamic_cast( (::IModule*)_ModulesReferencingMe[i] ); diff --git a/code/ryzom/server/src/gameplay_module_lib/module_parent.h b/code/ryzom/server/src/gameplay_module_lib/module_parent.h index d2210c2a0..0f6bac511 100644 --- a/code/ryzom/server/src/gameplay_module_lib/module_parent.h +++ b/code/ryzom/server/src/gameplay_module_lib/module_parent.h @@ -53,7 +53,7 @@ public: bool getModule( ModuleClass* & module )const { module = NULL; - const uint size = _Modules.size(); + const uint size = (uint)_Modules.size(); for (uint i = 0;i < size; i++ ) { ModuleClass * moduleChecked = dynamic_cast( (::IModule*)_Modules[i] ); diff --git a/code/ryzom/server/src/gpm_service/gpm_utilities.h b/code/ryzom/server/src/gpm_service/gpm_utilities.h index eb1831683..1ce83981e 100644 --- a/code/ryzom/server/src/gpm_service/gpm_utilities.h +++ b/code/ryzom/server/src/gpm_service/gpm_utilities.h @@ -169,7 +169,7 @@ public: void pop_back() { nlassert(_Top > _Array); --_Top; } //T &front() { return _Array[0]; } T &back() { nlassert(_Top > _Array); return *(_Top-1); } - uint size() { return _Top-_Array; } + uint size() { return (uint)(_Top-_Array); } bool empty() { return _Top == _Array; } void clear() { _Top = _Array; } }; diff --git a/code/ryzom/server/src/gpm_service/messages.cpp b/code/ryzom/server/src/gpm_service/messages.cpp index e83f01c2e..8fd774750 100644 --- a/code/ryzom/server/src/gpm_service/messages.cpp +++ b/code/ryzom/server/src/gpm_service/messages.cpp @@ -816,7 +816,7 @@ void cbVisionRequest( NLNET::CMessage& msgin, const std::string &serviceName, NL CMessage msgout("VISION_ANSWER"); msgout.serial(rid); uint i; - const uint size = entities.size(); + const uint size = (uint)entities.size(); for ( i = 0 ; i < size ; ++i) msgout.serial(entities[i].first, entities[i].second); diff --git a/code/ryzom/server/src/gpm_service/move_checker.cpp b/code/ryzom/server/src/gpm_service/move_checker.cpp index 13a7c4a2e..beca3531a 100644 --- a/code/ryzom/server/src/gpm_service/move_checker.cpp +++ b/code/ryzom/server/src/gpm_service/move_checker.cpp @@ -46,7 +46,7 @@ public: _X=0; _Y=0; _MaxDist=0; - _MaxDistTime=_Distances.size()/2; + _MaxDistTime=(uint32)_Distances.size()/2; } void start(TDataSetRow entityIndex, sint32 x, sint32 y, uint32 tick) @@ -58,7 +58,7 @@ public: _X=x; _Y=y; _MaxDist=0; - _MaxDistTime=_Distances.size()/2; + _MaxDistTime=(uint32)_Distances.size()/2; } void add(TDataSetRow entityIndex, sint32 x, sint32 y, uint32 tick) @@ -99,7 +99,7 @@ public: if ( (_Counter-_MaxDistTime) == (_Distances.size()/2) ) { std::string s; - for (uint32 i=_Distances.size();i!=0;--i) + for (uint32 i=(uint32)_Distances.size();i!=0;--i) { s+=NLMISC::toString(" %d",_Distances[(_Counter-i)%_Distances.size()]); } diff --git a/code/ryzom/server/src/gpm_service/patat_grid.cpp b/code/ryzom/server/src/gpm_service/patat_grid.cpp index 3b19c6753..eef3e5886 100644 --- a/code/ryzom/server/src/gpm_service/patat_grid.cpp +++ b/code/ryzom/server/src/gpm_service/patat_grid.cpp @@ -74,8 +74,8 @@ void CPatatGrid::readPrimitive(IPrimitive *primitive, std::vector &inFil primitive->getPropertyByName("class", className) && _PrimZoneFilters.find(className) != _PrimZoneFilters.end()) { - _ZoneMap.insert(TZoneMap::value_type(primName, _PrimZones.size())); - inFile.push_back(_PrimZones.size()); + _ZoneMap.insert(TZoneMap::value_type(primName, (sint32)_PrimZones.size())); + inFile.push_back((uint32)_PrimZones.size()); _PrimZones.push_back(static_cast(*primitive)); // _PrimZones.back().Name = primName; } @@ -146,7 +146,7 @@ void CPatatGrid::usePrim(const string &primFile, std::vector &inFile) } uint i; - uint firstPrimZone = _PrimZones.size(); + uint firstPrimZone = (uint)_PrimZones.size(); inFile.clear(); // get CPrimNode @@ -268,7 +268,7 @@ void CPatatGrid::usePrim(const string &primFile, std::vector &inFile) } else { - newIndex = _EntryTable.size(); + newIndex = (uint32)_EntryTable.size(); _EntryTable.resize(newIndex+1); } diff --git a/code/ryzom/server/src/gpm_service/world_position_manager.cpp b/code/ryzom/server/src/gpm_service/world_position_manager.cpp index 0d3f2cc94..cd2e563c2 100644 --- a/code/ryzom/server/src/gpm_service/world_position_manager.cpp +++ b/code/ryzom/server/src/gpm_service/world_position_manager.cpp @@ -1660,7 +1660,7 @@ void CWorldPositionManager::computeCellVision( CCell *cell, CVisionEntry* entiti if (!cell->isIndoor()) { - uint numOffsets = _ObjectVisionCellOffsets.size(); + uint numOffsets = (uint)_ObjectVisionCellOffsets.size(); CCellOffset* offsetPtr = &(_ObjectVisionCellOffsets[0]); // warning!! _VisionCellOffsets must be filled CCellOffset* offsetEnd = &(_ObjectVisionCellOffsets[numOffsets-1]); // warning!! _VisionCellOffsets must be filled //pair *offsetPtr = &(_ObjectVisionCellOffsets[0]); // warning!! _VisionCellOffsets must be filled @@ -1709,7 +1709,7 @@ void CWorldPositionManager::computeCellVision( CCell *cell, CVisionEntry* entiti // if the cell has vision on other cells if (!cell->isIndoor()) { - uint numOffsets = _VisionCellOffsets.size(); + uint numOffsets = (uint)_VisionCellOffsets.size(); CCellOffset* offsetPtr = &(_VisionCellOffsets[0]); // warning!! _VisionCellOffsets must be filled CCellOffset* offsetEnd = &(_VisionCellOffsets[_VisionCellOffsets.size()-1]); // warning!! _VisionCellOffsets must be filled //pair *offsetPtr = &(_VisionCellOffsets[0]); // warning!! _VisionCellOffsets must be filled @@ -1750,7 +1750,7 @@ void CWorldPositionManager::computeCellVision( CCell *cell, CVisionEntry* entiti while (offsetPtr <= offsetEnd); } - numEntities = fillPtr-entitiesSeenFromCell; + numEntities = (uint)(fillPtr-entitiesSeenFromCell); } /****************************************************************\ @@ -1796,8 +1796,8 @@ void CWorldPositionManager::setCellVisionToEntity( CWorldEntity *entity, CVision return; } - (*itFE).second.VisionIn += visionDelta.EntitiesIn.size(); - (*itFE).second.VisionOut += visionDelta.EntitiesOut.size(); + (*itFE).second.VisionIn += (sint32)visionDelta.EntitiesIn.size(); + (*itFE).second.VisionOut += (sint32)visionDelta.EntitiesOut.size(); //(*itFE).second.VisionReplace += visionDelta.EntitiesReplace.size(); (*itFE).second.Message.serial(visionDelta); diff --git a/code/ryzom/server/src/input_output_service/chat_manager.cpp b/code/ryzom/server/src/input_output_service/chat_manager.cpp index 86761dfb5..e16ca6223 100644 --- a/code/ryzom/server/src/input_output_service/chat_manager.cpp +++ b/code/ryzom/server/src/input_output_service/chat_manager.cpp @@ -1569,7 +1569,7 @@ void CChatManager::sendChatParam( CChatGroup::TGroupType senderChatMode, const T // send the chat phrase to the client params2[0].Type = STRING_MANAGER::bot; params2[0].setEId( TheDataset.getEntityId(sender) ); - uint32 first = 0, last = params.size(); + uint32 first = 0, last = (uint32)params.size(); for ( ; first != last ; ++first) { params2[first + 1] = params[first]; diff --git a/code/ryzom/server/src/input_output_service/string_manager.cpp b/code/ryzom/server/src/input_output_service/string_manager.cpp index 62d48ca52..cfe041d95 100644 --- a/code/ryzom/server/src/input_output_service/string_manager.cpp +++ b/code/ryzom/server/src/input_output_service/string_manager.cpp @@ -886,7 +886,7 @@ uint32 CStringManager::storeString(const ucstring &str) { // create a new entry std::pair ret; - ret = _StringIdx.insert(std::make_pair(str, _StringBase.size())); + ret = _StringIdx.insert(std::make_pair(str, (uint32)_StringBase.size())); nlassert(ret.second); _StringBase.push_back(str); @@ -1016,7 +1016,7 @@ void CStringManager::retrieveEntityNames( TServiceId serviceId ) } } NLNET::CMessage msgout( "ENTITY_NAMES" ); - uint32 len = names.size(); + uint32 len = (uint32)names.size(); msgout.serial( len ); vector< pair >::const_iterator itn; for ( itn=names.begin(); itn!=names.end(); ++itn ) diff --git a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp index d4d7168dd..562563f49 100644 --- a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp +++ b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp @@ -1337,11 +1337,11 @@ void CStringManager::mergeEntityWords(CEntityWords& dest, const CEntityWords& so uint32 extraRows = 0; // extra columns not supported yet - uint32 osz = source._ColumnInfo.size(); + uint32 osz = (uint32)source._ColumnInfo.size(); std::map::const_iterator iti; for (iti=source._ColumnInfo.begin(); iti!=source._ColumnInfo.end(); ++iti) if (dest._ColumnInfo.find((*iti).first) == dest._ColumnInfo.end()) - extraColumns.push_back(std::make_pair((*iti).first, osz+extraColumns.size())); + extraColumns.push_back(std::make_pair((*iti).first, osz+(uint32)extraColumns.size())); for (iti=source._RowInfo.begin(); iti!=source._RowInfo.end(); ++iti) if (dest._RowInfo.find((*iti).first) == dest._RowInfo.end()) @@ -1350,10 +1350,10 @@ void CStringManager::mergeEntityWords(CEntityWords& dest, const CEntityWords& so bool dataSizeChanged = (extraRows != 0); uint32* data = dest._Data; - uint sCols = source._ColumnInfo.size(); - uint sRows = source._RowInfo.size(); - uint oCols = dest._ColumnInfo.size(); - uint oRows = dest._RowInfo.size(); + uint sCols = (uint)source._ColumnInfo.size(); + uint sRows = (uint)source._RowInfo.size(); + uint oCols = (uint)dest._ColumnInfo.size(); + uint oRows = (uint)dest._RowInfo.size(); uint nCols = oCols; uint nRows = oRows+extraRows; @@ -1457,15 +1457,15 @@ void CStringManager::displayEntityWords(TLanguages language, STRING_MANAGER::TPa { CDisplayColumnInfo inf; inf.Name = (*iti).first; - inf.MaxWidth = inf.Name.size(); + inf.MaxWidth = (uint)inf.Name.size(); inf.InRow = (*iti).second; columns.push_back(inf); } std::sort(columns.begin(), columns.end()); - uint nCols = words._ColumnInfo.size(); - uint rRows = words._RowInfo.size(); + uint nCols = (uint)words._ColumnInfo.size(); + uint rRows = (uint)words._RowInfo.size(); for (iti=words._RowInfo.begin(); iti!=words._RowInfo.end(); ++iti) { @@ -1480,7 +1480,7 @@ void CStringManager::displayEntityWords(TLanguages language, STRING_MANAGER::TPa for (uint col=0; col::const_iterator first(lpv.getParams().begin()), last(lpv.getParams().end()); for (; first != last; ++first) { - uint32 index = pt.size(); + uint32 index = (uint32)pt.size(); pt.push_back(*first); // store the index in the persistent log entry @@ -313,7 +313,7 @@ public: // serial the log entryes s.serialCont(_DiskLogEntries); // serial the param tables - uint32 nbTable = _ParamTables.size(); + uint32 nbTable = (uint32)_ParamTables.size(); if (s.isReading()) { s.serial(nbTable); diff --git a/code/ryzom/server/src/logger_service/logger_service.cpp b/code/ryzom/server/src/logger_service/logger_service.cpp index 144ddf4df..3dc9467b9 100644 --- a/code/ryzom/server/src/logger_service/logger_service.cpp +++ b/code/ryzom/server/src/logger_service/logger_service.cpp @@ -505,7 +505,7 @@ public: // the query thread has posted a result, send it the the BS const TThreadResult &threadResult = _QueryResult.peek(); - uint32 nbLog = threadResult.Lines->size(); + uint32 nbLog = (uint32)threadResult.Lines->size(); if( _WriteLineCounter != nbLog) { @@ -529,7 +529,7 @@ public: continue; } - saveFile.DataMsg.serialBuffer((uint8*)&(*first->begin()), first->size()); + saveFile.DataMsg.serialBuffer((uint8*)&(*first->begin()), (uint)first->size()); saveFile.DataMsg.serialBuffer((uint8*)newLine, 1); ++_WriteLineCounter; @@ -776,9 +776,9 @@ public: if (pr.QueryTree.get() != NULL) { - totalLogParsed += ls._DiskLogEntries.size(); + totalLogParsed += (uint32)ls._DiskLogEntries.size(); TLogEntries logs = pr.QueryTree->evalNode(ls); - totalLogSelected += logs.size(); + totalLogSelected += (uint32)logs.size(); // add the context log to the selection vector contextLogs; @@ -843,7 +843,7 @@ public: // insert the selected context logs.insert(contextLogs.begin(), contextLogs.end()); - totalLogOutput += logs.size(); + totalLogOutput += (uint32)logs.size(); // output the final log selection first = logs.begin(); @@ -1021,7 +1021,7 @@ public: // let the CRunt time compute the daylight saving offset fileDate.tm_isdst = -1; - uint32 date = mktime(&fileDate); + uint32 date = (uint32)mktime(&fileDate); // check that the date is within a selected time slice for (uint j=0; j::iterator first(selectedFile.begin()), last(selectedFile.end()); for (uint counter=0; first != last; ++first, ++counter) @@ -1147,7 +1147,7 @@ public: } catch (CQueryParser::EInvalidQuery iq) { - uint index= iq.It - query.begin(); + uint index= (uint)(iq.It - query.begin()); _QueryStatus.write(TThreadStatus(qs_log, toString("Error will parsing query near char %u : %s", index+1, iq.ErrorStr))); _QueryStatus.write(TThreadStatus(qs_log, query)); CSString err; @@ -1225,7 +1225,7 @@ endQuery: vector sheetIds; for (uint i=0; i<3000; ++i) { - sheetIds.push_back(allSheets[randu32(rand, allSheets.size())]); + sheetIds.push_back(allSheets[randu32(rand, (uint32)allSheets.size())]); } @@ -1255,7 +1255,7 @@ endQuery: else { // select a random log type - uint32 logType = randu32(rand, _LogDefs.size()); + uint32 logType = randu32(rand, (uint32)_LogDefs.size()); LGS::TLogDefinition &ld = _LogDefs[logType]; @@ -1307,13 +1307,13 @@ endQuery: } break; case LGS::TSupportedParamType::spt_entityId: - le.LogInfo.getParams().push_back(TParamValue(entityIds[randu32(rand, entityIds.size())])); + le.LogInfo.getParams().push_back(TParamValue(entityIds[randu32(rand, (uint32)entityIds.size())])); break; case LGS::TSupportedParamType::spt_sheetId: - le.LogInfo.getParams().push_back(TParamValue(sheetIds[randu32(rand, sheetIds.size())])); + le.LogInfo.getParams().push_back(TParamValue(sheetIds[randu32(rand, (uint32)sheetIds.size())])); break; case LGS::TSupportedParamType::spt_itemId: - le.LogInfo.getParams().push_back(TParamValue(itemIds[randu32(rand, itemIds.size())])); + le.LogInfo.getParams().push_back(TParamValue(itemIds[randu32(rand, (uint32)itemIds.size())])); break; } } @@ -1351,13 +1351,13 @@ endQuery: } break; case LGS::TSupportedParamType::spt_entityId: - lpv.getParams().push_back(TParamValue(entityIds[randu32(rand, entityIds.size())])); + lpv.getParams().push_back(TParamValue(entityIds[randu32(rand, (uint32)entityIds.size())])); break; case LGS::TSupportedParamType::spt_sheetId: - lpv.getParams().push_back(TParamValue(sheetIds[randu32(rand, sheetIds.size())])); + lpv.getParams().push_back(TParamValue(sheetIds[randu32(rand, (uint32)sheetIds.size())])); break; case LGS::TSupportedParamType::spt_itemId: - lpv.getParams().push_back(TParamValue(itemIds[randu32(rand, itemIds.size())])); + lpv.getParams().push_back(TParamValue(itemIds[randu32(rand, (uint32)itemIds.size())])); break; } } diff --git a/code/ryzom/server/src/mail_forum_service/hof_generator.cpp b/code/ryzom/server/src/mail_forum_service/hof_generator.cpp index c1019b8ff..56bc0d58a 100644 --- a/code/ryzom/server/src/mail_forum_service/hof_generator.cpp +++ b/code/ryzom/server/src/mail_forum_service/hof_generator.cpp @@ -200,9 +200,9 @@ void CHoFGenerator::setNextStep() static const string phpHeader = "\n"; - ofile.serialBuffer((uint8*)(&phpHeader[0]), phpHeader.size()); - ofile.serialBuffer((uint8*)(&_GeneratedScript[0]), _GeneratedScript.size()); - ofile.serialBuffer((uint8*)(&phpFooter[0]), phpFooter.size()); + ofile.serialBuffer((uint8*)(&phpHeader[0]), (uint)phpHeader.size()); + ofile.serialBuffer((uint8*)(&_GeneratedScript[0]), (uint)_GeneratedScript.size()); + ofile.serialBuffer((uint8*)(&phpFooter[0]), (uint)phpFooter.size()); if (HoFVerbose.get()) { @@ -706,7 +706,7 @@ void CHoFGenerator::generatePHPArray(const std::string & varName, const CTable & phpArray.clear(); phpArray += toString("$%s = array(", varName.c_str()); - uint32 nbRows = tableRows->size(); + uint32 nbRows = (uint32)tableRows->size(); if (maxRows < nbRows) nbRows = maxRows; diff --git a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp index e0de15059..18baa2196 100644 --- a/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp +++ b/code/ryzom/server/src/mail_forum_service/mail_forum_service.cpp @@ -238,7 +238,7 @@ void CMailForumService::openSession( uint32 shardid, string username, string coo if (ofile.open(sessionfile)) { cookie += "\n"; - ofile.serialBuffer((uint8*)(&cookie[0]), cookie.size()); + ofile.serialBuffer((uint8*)(&cookie[0]), (uint)cookie.size()); } if (CFile::fileExists(checkmailfile)) diff --git a/code/ryzom/server/src/mirror_service/data_set_ms.h b/code/ryzom/server/src/mirror_service/data_set_ms.h index 4001a194c..f1ad6b369 100644 --- a/code/ryzom/server/src/mirror_service/data_set_ms.h +++ b/code/ryzom/server/src/mirror_service/data_set_ms.h @@ -491,7 +491,7 @@ public: const std::vector& remoteClientServicesToSync() const { return _RemoteClientServicesToSync; } /// Return the number of acknowledges still expected - NLNET::TServiceId8::size_type nbAcksExpected() const { return _LocalClientsDueToSendATEAck.size(); } + NLNET::TServiceId8::size_type nbAcksExpected() const { return (NLNET::TServiceId8::size_type)_LocalClientsDueToSendATEAck.size(); } protected: diff --git a/code/ryzom/server/src/mirror_service/mirror_service.cpp b/code/ryzom/server/src/mirror_service/mirror_service.cpp index d7ccc6f18..aebf6ce01 100644 --- a/code/ryzom/server/src/mirror_service/mirror_service.cpp +++ b/code/ryzom/server/src/mirror_service/mirror_service.cpp @@ -695,7 +695,7 @@ void CMirrorService::buildAndSendAllDeltas() if ( tracker.needsSyncAfterAllATEAcknowledgesReceived() ) { // "Sync delta". Switches tracker.isAllowedToSendToRemoteMS() to true (and the corresponding removal one as well). - syncOnlineLocallyManagedEntitiesIntoDeltaAndOpenEntityTrackersToRemoteMS( delta, dataset, tracker, isl-dataset._EntityTrackers[ADDING].begin() ); + syncOnlineLocallyManagedEntitiesIntoDeltaAndOpenEntityTrackersToRemoteMS( delta, dataset, tracker, (uint)(isl-dataset._EntityTrackers[ADDING].begin()) ); } else { @@ -2999,7 +2999,7 @@ void CMirrorService::synchronizeSubscriptionsToNewMS( TServiceId newRemoteMSId ) msgout.serial( mainTag() ); // Send sync corresponding to MARCS message (list of client services) - uint32 nbClientServices = _ClientServices.size(); + uint32 nbClientServices = (uint32)_ClientServices.size(); msgout.serial( nbClientServices ); TClientServices::const_iterator ics; for ( ics=_ClientServices.begin(); ics!=_ClientServices.end(); ++ics ) diff --git a/code/ryzom/server/src/mirror_service/ms_automaton.cpp b/code/ryzom/server/src/mirror_service/ms_automaton.cpp index 33c8ac2e1..64bf88c93 100644 --- a/code/ryzom/server/src/mirror_service/ms_automaton.cpp +++ b/code/ryzom/server/src/mirror_service/ms_automaton.cpp @@ -496,7 +496,7 @@ void CMirrorService::tellLocalServicesAndSendMessages() { serialToMessageFromLocalQueue( msgout, (*im) ); } - uint32 nbMsgs = nbBroadcastedMsgs + GET_CLIENT_SERVICE_INFO(ics).Messages.size(); + uint32 nbMsgs = nbBroadcastedMsgs + (uint32)GET_CLIENT_SERVICE_INFO(ics).Messages.size(); msgout.poke( nbMsgs, nbBufPos ); //H_BEFORE(tellUMMSend); CUnifiedNetwork::getInstance()->send( (*ics).first, msgout ); diff --git a/code/ryzom/server/src/monitor_service/client.cpp b/code/ryzom/server/src/monitor_service/client.cpp index a367634fb..430f97829 100644 --- a/code/ryzom/server/src/monitor_service/client.cpp +++ b/code/ryzom/server/src/monitor_service/client.cpp @@ -260,8 +260,8 @@ void CMonitorClient::update () } } - uint addTotalSize = PendingAdd.size()*addSize; - uint rmvTotalSize = PendingRemove.size()*rmvSize; + uint addTotalSize = (uint)PendingAdd.size()*addSize; + uint rmvTotalSize = (uint)PendingRemove.size()*rmvSize; uint posTotalSize = posToSend*posSize; uint miscPropTotalSize = miscPropToSend*miscPropSize; uint strTotalSize = 0; @@ -274,7 +274,7 @@ void CMonitorClient::update () std::map::iterator ite = StringMap.find (id); nlassert (ite != StringMap.end()); strToSend.push_back( make_pair(id, &((*ite).second)) ); - strTotalSize += 4+4+(*ite).second.size(); + strTotalSize += 4+4+(uint)(*ite).second.size(); } bool restrictAdd = (addTotalSize > maxAddSize); @@ -340,9 +340,9 @@ void CMonitorClient::update () ++Removed; } - StillToAdd = PendingAdd.size(); - StillToRemove = PendingRemove.size(); - CurrentlyInVision = InVision.size(); + StillToAdd = (uint32)PendingAdd.size(); + StillToRemove = (uint32)PendingRemove.size(); + CurrentlyInVision = (uint32)InVision.size(); if (StartOffset >= InVision.size()) StartOffset = 0; @@ -411,7 +411,7 @@ void CMonitorClient::update () msgout.setType("ADD"); // version 1 : added sheet ID of the entity msgout.serialVersion(1); - uint32 count = Add.size(); + uint32 count = (uint32)Add.size(); msgout.serial(count); uint i; for (i=0; isize(); + sentStrSize += 4+4+(uint)(strToSend[i].second)->size(); uint32 count = i; msgout.serial(count); diff --git a/code/ryzom/server/src/pd_lib/db_delta_file.cpp b/code/ryzom/server/src/pd_lib/db_delta_file.cpp index c99b6519f..53100174d 100644 --- a/code/ryzom/server/src/pd_lib/db_delta_file.cpp +++ b/code/ryzom/server/src/pd_lib/db_delta_file.cpp @@ -113,7 +113,7 @@ bool CDBDeltaFile::write(uint32 index, const uint8* rowdata) if (it == _IndexMap.end()) { // seek to end (should be after last row) - uint32 rowSeek = _DataStart + _Header.FullRowSize*_IndexMap.size(); + uint32 rowSeek = _DataStart + _Header.FullRowSize*(uint32)_IndexMap.size(); // a little check if (fseek(_File, 0, SEEK_END) != 0) diff --git a/code/ryzom/server/src/pd_lib/db_description_parser.cpp b/code/ryzom/server/src/pd_lib/db_description_parser.cpp index 2949dda00..df3fae778 100644 --- a/code/ryzom/server/src/pd_lib/db_description_parser.cpp +++ b/code/ryzom/server/src/pd_lib/db_description_parser.cpp @@ -74,7 +74,7 @@ bool CDBDescriptionParser::loadDescriptionFile(const string& filename) */ bool CDBDescriptionParser::loadDescription(const uint8* description) { - uint sz = strlen((const char*)description); + uint sz = (uint)strlen((const char*)description); // set description and compute hashkey _Description = (const char*)description; @@ -566,7 +566,7 @@ bool CDBDescriptionParser::buildColumns(uint tableIndex) return false; } - column.Index = table.Columns.size(); + column.Index = (uint)table.Columns.size(); column.Name = attribute.Name; column.TypeId = attribute.TypeId; column.DataType = _Database.Types[attribute.TypeId].DataType; @@ -595,7 +595,7 @@ bool CDBDescriptionParser::buildColumns(uint tableIndex) for (j=0; j 0) { _LogBuffer.resize(bufferSize); @@ -771,7 +771,7 @@ public: */ uint32 getNumMessages() const { - return _Messages.size(); + return (uint32)_Messages.size(); } /** @@ -796,8 +796,8 @@ public: buildFolders(); } - uint32 numFolders = _Folders.size(); - uint32 numMessages = _Messages.size(); + uint32 numFolders = (uint32)_Folders.size(); + uint32 numMessages = (uint32)_Messages.size(); f.serial(numFolders); f.serial(numMessages); @@ -987,7 +987,7 @@ public: /** * size() */ - uint size() const { return _Queues.size(); } + uint size() const { return (uint)_Queues.size(); } /** * get() diff --git a/code/ryzom/server/src/pd_lib/pd_server_utils.h b/code/ryzom/server/src/pd_lib/pd_server_utils.h index 712c4afdd..ec1df021a 100644 --- a/code/ryzom/server/src/pd_lib/pd_server_utils.h +++ b/code/ryzom/server/src/pd_lib/pd_server_utils.h @@ -307,9 +307,9 @@ protected: /// standard FILE handler FILE* _File; - bool readBuffer(void* buf, uint len) { if (_File == NULL) return false; uint32 rb = fread(buf, 1, len, _File); _ReadBytes += rb; return rb == len; } - bool writeBuffer(const void* buf, uint len) { if (_File == NULL) return false; uint32 wb = fwrite(buf, 1, len, _File); _WrittenBytes += wb; return wb == len; } - bool readBuffer(void* buf, uint len, uint& readlen) { if (_File == NULL) return false; readlen = fread(buf, 1, len, _File); return readlen == len; } + bool readBuffer(void* buf, uint len) { if (_File == NULL) return false; uint32 rb = (uint32)fread(buf, 1, len, _File); _ReadBytes += rb; return rb == len; } + bool writeBuffer(const void* buf, uint len) { if (_File == NULL) return false; uint32 wb = (uint32)fwrite(buf, 1, len, _File); _WrittenBytes += wb; return wb == len; } + bool readBuffer(void* buf, uint len, uint& readlen) { if (_File == NULL) return false; readlen = (uint)fread(buf, 1, len, _File); return readlen == len; } static uint64 _ReadBytes; static uint64 _WrittenBytes; @@ -432,7 +432,7 @@ public: /** * Get Number of Mapped rows */ - uint32 numMapped() const { return _KeyMap.size(); } + uint32 numMapped() const { return (uint32)_KeyMap.size(); } diff --git a/code/ryzom/server/src/pd_lib/pds_table_buffer.h b/code/ryzom/server/src/pd_lib/pds_table_buffer.h index 12dcdd019..e74c1e91b 100644 --- a/code/ryzom/server/src/pd_lib/pds_table_buffer.h +++ b/code/ryzom/server/src/pd_lib/pds_table_buffer.h @@ -301,12 +301,12 @@ public: /** * Get the number of actually loaded rows */ - uint32 getLoadedRows() const { return _RowMap.size(); } + uint32 getLoadedRows() const { return (uint32)_RowMap.size(); } /** * Get memory load */ - uint32 getMemoryLoad() const { return _RowMap.size()*_InternalRowSize; } + uint32 getMemoryLoad() const { return (uint32)_RowMap.size()*_InternalRowSize; } diff --git a/code/ryzom/server/src/persistant_data_service/pds_attribute.cpp b/code/ryzom/server/src/persistant_data_service/pds_attribute.cpp index 7a1c1c5b8..e6e4cda5f 100644 --- a/code/ryzom/server/src/persistant_data_service/pds_attribute.cpp +++ b/code/ryzom/server/src/persistant_data_service/pds_attribute.cpp @@ -151,7 +151,7 @@ bool CAttribute::buildColumns() { vector& columns = _Parent->_Columns; - _Offset = columns.size(); + _Offset = (uint32)columns.size(); switch (_MetaType) { @@ -160,7 +160,7 @@ bool CAttribute::buildColumns() CColumn column; column._Parent = this; column._Root = _Root; - column._Id = columns.size(); + column._Id = (uint32)columns.size(); column._Name = _Name; column._MetaType = PDS_Type; column._DataType = _DataType; @@ -190,7 +190,7 @@ bool CAttribute::buildColumns() CColumn column = sub->_Columns[i]; column._Parent = this; column._Root = _Root; - column._Id = columns.size(); + column._Id = (uint32)columns.size(); column._Name = _Name+"."+column._Name; column._Init = true; columns.push_back(column); @@ -205,7 +205,7 @@ bool CAttribute::buildColumns() CColumn column; column._Parent = this; column._Root = _Root; - column._Id = columns.size(); + column._Id = (uint32)columns.size(); column._Name = _Name; column._MetaType = _MetaType; column._DataType = _DataType; @@ -239,7 +239,7 @@ bool CAttribute::buildColumns() CColumn column; column._Parent = this; column._Root = _Root; - column._Id = columns.size(); + column._Id = (uint32)columns.size(); column._Name = _Name+"["+index->getIndexName(i)+"]"; column._MetaType = PDS_Type; column._DataType = _DataType; @@ -277,7 +277,7 @@ bool CAttribute::buildColumns() CColumn column = sub->_Columns[j]; column._Parent = this; column._Root = _Root; - column._Id = columns.size(); + column._Id = (uint32)columns.size(); column._Name = _Name+"["+index->getIndexName(i)+"]"+"."+column._Name; column._Init = true; columns.push_back(column); @@ -302,7 +302,7 @@ bool CAttribute::buildColumns() CColumn column; column._Parent = this; column._Root = _Root; - column._Id = columns.size(); + column._Id = (uint32)columns.size(); column._Name = _Name+"["+index->getIndexName(i)+"]";; column._MetaType = PDS_ForwardRef; column._DataType = _DataType; @@ -320,7 +320,7 @@ bool CAttribute::buildColumns() break; } - _Columns = columns.size() - _Offset; + _Columns = (uint32)columns.size() - _Offset; return true; } diff --git a/code/ryzom/server/src/persistant_data_service/pds_database.cpp b/code/ryzom/server/src/persistant_data_service/pds_database.cpp index 5ac93fed6..36e9c06dd 100644 --- a/code/ryzom/server/src/persistant_data_service/pds_database.cpp +++ b/code/ryzom/server/src/persistant_data_service/pds_database.cpp @@ -1179,7 +1179,7 @@ CDatabase* CDatabase::adapt(const string& description) // get 'From' HashKey CHashKey hash1 = _Description.getHashKey(); // get 'Into' HashKey - CHashKey hash2 = getSHA1((const uint8*)(description.c_str()), description.size()); + CHashKey hash2 = getSHA1((const uint8*)(description.c_str()), (uint32)description.size()); // same hash, ok go on if (hash1 == hash2) diff --git a/code/ryzom/server/src/persistant_data_service/pds_table_inline.h b/code/ryzom/server/src/persistant_data_service/pds_table_inline.h index d185748f7..38cb0a271 100644 --- a/code/ryzom/server/src/persistant_data_service/pds_table_inline.h +++ b/code/ryzom/server/src/persistant_data_service/pds_table_inline.h @@ -1097,7 +1097,7 @@ inline const CColumn* CTable::getColumn(CLocatePath &path, bool verbose) const } } - indexValue *= table->getColumns().size(); + indexValue *= (TEnumValue)table->getColumns().size(); if (indexValue >= attr->getColumns()) { diff --git a/code/ryzom/server/src/server_share/bmp4image.h b/code/ryzom/server/src/server_share/bmp4image.h index 5e1b336a0..30133abf3 100644 --- a/code/ryzom/server/src/server_share/bmp4image.h +++ b/code/ryzom/server/src/server_share/bmp4image.h @@ -366,7 +366,7 @@ public: void writeLine() { - File.serialBuffer((uint8*)(&(Line[0])), Line.size()*2); + File.serialBuffer((uint8*)(&(Line[0])), (uint)Line.size()*2); } }; @@ -397,7 +397,7 @@ public: void writeLine() { - File.serialBuffer((uint8*)(&(GreyLine[0])), GreyLine.size()*sizeof(GreyLine[0])); + File.serialBuffer((uint8*)(&(GreyLine[0])), (uint)GreyLine.size()*sizeof(GreyLine[0])); } }; diff --git a/code/ryzom/server/src/server_share/handy_commands.cpp b/code/ryzom/server/src/server_share/handy_commands.cpp index 0ebdd2a30..cfaccf836 100644 --- a/code/ryzom/server/src/server_share/handy_commands.cpp +++ b/code/ryzom/server/src/server_share/handy_commands.cpp @@ -234,7 +234,7 @@ NLMISC_CATEGORISED_COMMAND(utils,pdrInfo,"Extract info from pdr file(s)","0 && NLMISC::CSString(args.back()).right(4)==".csv") { @@ -420,7 +420,7 @@ NLMISC_CATEGORISED_COMMAND(utils,dir,"list files in the current directory","[ directories; NLMISC::CPath::getPathContent(".",false,true,false,directories); - for (uint32 i=directories.size();i--;) + for (uint32 i=(uint32)directories.size();i--;) { if (!NLMISC::testWildCard(directories[i],wildcard)) { @@ -436,7 +436,7 @@ NLMISC_CATEGORISED_COMMAND(utils,dir,"list files in the current directory","[ files; NLMISC::CPath::getPathContent(".",false,false,true,files); - for (uint32 i=files.size();i--;) + for (uint32 i=(uint32)files.size();i--;) { if (!NLMISC::testWildCard(files[i],wildcard)) { @@ -577,7 +577,7 @@ NLMISC_CATEGORISED_COMMAND(utils,viewBinFile,"view a binary file segment","fileBody.size()) { - count= fileBody.size()-start; + count= (uint32)fileBody.size()-start; } // display the data diff --git a/code/ryzom/server/src/server_share/light_ig_loader.h b/code/ryzom/server/src/server_share/light_ig_loader.h index 20fe0fe08..d34e2f082 100644 --- a/code/ryzom/server/src/server_share/light_ig_loader.h +++ b/code/ryzom/server/src/server_share/light_ig_loader.h @@ -54,7 +54,7 @@ public: /// Num instances uint getNumInstance() { - return _ShapeNames.size(); + return (uint)_ShapeNames.size(); } /// get shape name diff --git a/code/ryzom/server/src/server_share/msg_brick_service.h b/code/ryzom/server/src/server_share/msg_brick_service.h index 49ea9e9f4..59ce7411c 100644 --- a/code/ryzom/server/src/server_share/msg_brick_service.h +++ b/code/ryzom/server/src/server_share/msg_brick_service.h @@ -159,8 +159,8 @@ public: //void pushBack( const TDataSetRow& originator, const TDataSetRow& target, const CAiEventReport &report) void pushBack( const CAiEventReport &report) { - const uint size = Originator.size(); - const uint nbElts = report.AffectedStats.empty() ? 1 : report.AffectedStats.size(); + const uint size = (uint)Originator.size(); + const uint nbElts = report.AffectedStats.empty() ? 1 : (uint)report.AffectedStats.size(); Originator.resize(size+nbElts); Target.resize(size+nbElts); diff --git a/code/ryzom/server/src/server_share/mysql_wrapper.cpp b/code/ryzom/server/src/server_share/mysql_wrapper.cpp index ba4d80ac1..1be4c0e96 100644 --- a/code/ryzom/server/src/server_share/mysql_wrapper.cpp +++ b/code/ryzom/server/src/server_share/mysql_wrapper.cpp @@ -58,7 +58,7 @@ namespace MSW static string buffer; // reserve space in the buffer according to the mysql documentation buffer.resize(str.size()*2+1); - unsigned long resultSize = mysql_escape_string((char*)buffer.data(), str.data(), str.size()); + unsigned long resultSize = mysql_escape_string((char*)buffer.data(), str.data(), (unsigned long)str.size()); // now, resize to the real size buffer.resize(resultSize); @@ -186,14 +186,14 @@ namespace MSW TTime startDate = CTime::getLocalTime(); - int result = mysql_real_query(_MysqlContext, queryString.c_str(), queryString.size()); + int result = mysql_real_query(_MysqlContext, queryString.c_str(), (unsigned long)queryString.size()); if (result != 0) { if (result == CR_SERVER_GONE_ERROR) { // reconnect and retry the request if (_connect()) - result = mysql_real_query(_MysqlContext, queryString.c_str(), queryString.size()); + result = mysql_real_query(_MysqlContext, queryString.c_str(), (unsigned long)queryString.size()); else { nlwarning("Failed to reopen closed connection to send query '%s'", queryString.c_str()); @@ -277,7 +277,7 @@ namespace MSW myTm.tm_wday = -1; myTm.tm_yday = -1; // Convert the local date into a UTC unix time - uint32 t = nl_mktime(&myTm); + uint32 t = (uint32)nl_mktime(&myTm); time = t; } @@ -300,7 +300,7 @@ namespace MSW myTm.tm_wday = -1; myTm.tm_yday = -1; // Convert the local date into a UTC unix time - uint32 t = nl_mktime(&myTm); + uint32 t = (uint32)nl_mktime(&myTm); time = t; } @@ -323,7 +323,7 @@ namespace MSW myTm.tm_wday = -1; myTm.tm_yday = -1; // Convert the local date into a UTC unix time - uint32 t = nl_mktime(&myTm); + uint32 t = (uint32)nl_mktime(&myTm); time = t; } @@ -346,7 +346,7 @@ namespace MSW myTm.tm_wday = -1; myTm.tm_yday = -1; // Convert the local date into a UTC unix time - uint32 t = nl_mktime(&myTm); + uint32 t = (uint32)nl_mktime(&myTm); time = t; } diff --git a/code/ryzom/server/src/server_share/npc_description_messages.cpp b/code/ryzom/server/src/server_share/npc_description_messages.cpp index 5fb7da8cd..25673a3a7 100644 --- a/code/ryzom/server/src/server_share/npc_description_messages.cpp +++ b/code/ryzom/server/src/server_share/npc_description_messages.cpp @@ -121,7 +121,7 @@ void CScriptData::serial(NLMISC::IStream &f) } else { - size = Scripts.size(); + size = (uint16)Scripts.size(); f.serial(size); for (TScripts::iterator it = Scripts.begin(); it != Scripts.end(); ++it) { @@ -161,7 +161,7 @@ void CCustomLootTableManager::serial(NLMISC::IStream &f) } else { - size = Tables.size(); + size = (uint16)Tables.size(); f.serial(size); for (TCustomLootTable::iterator it = Tables.begin(); it != Tables.end(); ++it) { diff --git a/code/ryzom/server/src/server_share/primitive_cfg.cpp b/code/ryzom/server/src/server_share/primitive_cfg.cpp index 34de864f1..edd4d71d0 100644 --- a/code/ryzom/server/src/server_share/primitive_cfg.cpp +++ b/code/ryzom/server/src/server_share/primitive_cfg.cpp @@ -80,7 +80,7 @@ inline bool stringToWordAndTail(const std::string &input,std::string &word, std: word=input.substr(i,j-i); // find the end of the tail text - for (i=input.size();i>j && isWhiteSpace(input[i-1]);) --i; // i points to character after end of tail text + for (i=(uint)input.size();i>j && isWhiteSpace(input[i-1]);) --i; // i points to character after end of tail text // find start of tail text do { ++j; } while(j& theVision= _VisionGroups[i]; if (theVision==NULL) @@ -625,7 +625,7 @@ namespace R2_VISION { NLMISC::CSmartPtr& theVision= vectAppend(_VisionGroups); theVision= new CVisionGroup; - theVision->setVisionId(_VisionGroups.size()-1); + theVision->setVisionId((uint32)_VisionGroups.size()-1); theVision->addViewer(entity.ViewerRecord); } } @@ -674,7 +674,7 @@ namespace R2_VISION visionGroups.clear(); // run throught the vision groups once updating the bounding coordinates and sort keys - for (uint32 i=_VisionGroups.size();i--;) + for (uint32 i=(uint32)_VisionGroups.size();i--;) { NLMISC::CSmartPtr& theVisionGroup= _VisionGroups[i]; @@ -693,7 +693,7 @@ namespace R2_VISION // add the vision group to the local vision group list (sorting as we go) uint32 theSortKey= theVisionGroup->getSortKey(); - uint32 j=visionGroups.size(); // point to back entry in vision group + uint32 j=(uint32)visionGroups.size(); // point to back entry in vision group visionGroups.push_back(NULL); // create the new space that we're going to fill while (j!=0 && visionGroups[j-1]->getSortKey()>theSortKey) { @@ -708,7 +708,7 @@ namespace R2_VISION return; // run through the vision groups to update them - for (uint32 i=visionGroups.size();i--;) + for (uint32 i=(uint32)visionGroups.size();i--;) { NLMISC::CSmartPtr& vi= visionGroups[i]; @@ -854,7 +854,7 @@ namespace R2_VISION void CInstance::release() { // iterate over vision groups getting them to clear their childrens' visions - for (uint32 i=_VisionGroups.size();i--;) + for (uint32 i=(uint32)_VisionGroups.size();i--;) { if (_VisionGroups[i]!=NULL) { @@ -863,7 +863,7 @@ namespace R2_VISION } // remove all of the entities from the instance - for (uint32 i=_Entities.size();i--;) + for (uint32 i=(uint32)_Entities.size();i--;) { SUniverseEntity* theEntity= _TheUniverse->getEntity(_Entities[i].DataSetRow); BOMB_IF(theEntity==NULL,"Failed to locate universe entity corresponding to instance entity in CInstance::realease()",continue); @@ -931,7 +931,7 @@ namespace R2_VISION // flag the viewer as belongning to this vision, with this vision index viewer->VisionId=_VisionId; - viewer->VisionIndex=_Viewers.size(); + viewer->VisionIndex=(uint32)_Viewers.size(); // add the new viewer to the viewers vector _Viewers.push_back(viewer); @@ -978,14 +978,14 @@ namespace R2_VISION TEST(("merge %d with %d",_VisionId,other->_VisionId)); // merge the viewer vectors - for (uint32 i=other->_Viewers.size();i--;) + for (uint32 i=(uint32)other->_Viewers.size();i--;) { // get a pointer to the viewer object that we're moving from the other vision group NLMISC::CSmartPtr& theViewer= other->_Viewers[i]; // update the vision id to point to ourselves and the next slot in our viewers vector theViewer->VisionId=_VisionId; - theViewer->VisionIndex=_Viewers.size(); + theViewer->VisionIndex=(uint32)_Viewers.size(); TEST(("moveGroup ent=%d old grp=%d new grp=%d",theViewer->getViewerId().getIndex(),other->_VisionId,_VisionId)); @@ -1018,7 +1018,7 @@ namespace R2_VISION BOMB_IF(_Viewers.empty(),"Attempting to split a vision group with no members",return); // setup some handy locals - uint32 viewerSize= _Viewers.size(); + uint32 viewerSize= (uint32)_Viewers.size(); // setup a couple of vectors to hold x coordinates and y coordinates static std::vector xvect; @@ -1175,7 +1175,7 @@ namespace R2_VISION uint32 ymin= ~0u; uint32 xmax= 0; uint32 ymax= 0; - for (uint32 i=_Viewers.size();i--;) + for (uint32 i=(uint32)_Viewers.size();i--;) { const CViewer& viewer=*_Viewers[i]; xmin= std::min(xmin,viewer.getX()); @@ -1215,7 +1215,7 @@ namespace R2_VISION TInvisibilityLevel visionLevel= getVisionLevel(); // calculate the distance from each of the entities to our ref position - for (uint32 i=entities.size();i--;) + for (uint32 i=(uint32)entities.size();i--;) { // get a refference to the nth entity const SInstanceEntity& theEntity= entities[i]; @@ -1282,7 +1282,7 @@ namespace R2_VISION void CVisionGroup::updateViewers(CUniverse* theUniverse) { // iterate over the viewers, udating their vision - for (uint32 i=_Viewers.size();i--;) + for (uint32 i=(uint32)_Viewers.size();i--;) { _Viewers[i]->updateVision(_Vision,theUniverse,false); } @@ -1353,7 +1353,7 @@ namespace R2_VISION inline uint32 CVisionGroup::numViewers() const { - return _Viewers.size(); + return (uint32)_Viewers.size(); } inline void CVisionGroup::setVisionId(uint32 visionId) @@ -1425,7 +1425,7 @@ namespace R2_VISION uint32 playerVisionEntryIndex=1; // iterate down from the last vision entry to vision entry 1 (don't touch entry 0 because it's reserved) - for (uint32 i=_Vision.size()-1; i>0; i--) + for (uint32 i=(uint32)_Vision.size()-1; i>0; i--) { // get a refference to the vision entry to be dealt with (removed) SViewedEntity& visionEntry= _Vision[i]; @@ -1461,8 +1461,8 @@ namespace R2_VISION void CViewer::_updateVisionNormal(const TVision& vision,CUniverse* theUniverse,bool firstTime,CPlayerVisionDelta& result) { // prepare to apply our group's vision to our own... - sint32 oldVisionIdx= _Vision.size()-1; // note that there is always a dummy entry at start of vision vector - sint32 newVisionIdx= vision.size()-1; // note that there is always a dummy entry at start of vision vector + sint32 oldVisionIdx= (sint32)_Vision.size()-1; // note that there is always a dummy entry at start of vision vector + sint32 newVisionIdx= (sint32)vision.size()-1; // note that there is always a dummy entry at start of vision vector static std::vector newVisionEntries; // temp vector - static for reasons of optimisation newVisionEntries.clear(); @@ -1536,7 +1536,7 @@ namespace R2_VISION BOMB_IF(freeVisionSlotOffset<0,"BIG BAD BUG generating vision ... too few free vision slots found",newVisionEntries.resize(_FreeVisionSlots.size())); // deal with new vision entries - for (uint32 i= newVisionEntries.size();i--;) + for (uint32 i= (uint32)newVisionEntries.size();i--;) { // derefference the new vision entry const SViewedEntity& visionEntry= vision[newVisionEntries[i]]; @@ -1620,7 +1620,7 @@ namespace R2_VISION // the entity's free vision slots std::string freeVisionSlotsString; - for (uint32 i=_FreeVisionSlots.size();i--;) + for (uint32 i=(uint32)_FreeVisionSlots.size();i--;) { if (!freeVisionSlotsString.empty()) freeVisionSlotsString+= ' '; diff --git a/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp b/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp index 07338e26f..8faaaa82e 100644 --- a/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp +++ b/code/ryzom/server/src/shard_unifier_service/database_mapping.cpp @@ -357,7 +357,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -375,7 +375,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -1010,7 +1010,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -1028,7 +1028,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -1610,7 +1610,7 @@ namespace RSMGR while (!childs.empty()) { - getSessionParticipantsByIndex(childs.size()-1)->remove(connection); + getSessionParticipantsByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -1623,7 +1623,7 @@ namespace RSMGR while (!childs.empty()) { - getKnownByByIndex(childs.size()-1)->remove(connection); + getKnownByByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -1752,7 +1752,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -1770,7 +1770,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -2603,7 +2603,7 @@ namespace RSMGR while (!childs.empty()) { - getKnownUsersByIndex(childs.size()-1)->remove(connection); + getKnownUsersByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -2742,7 +2742,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -2760,7 +2760,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -3504,7 +3504,7 @@ namespace RSMGR while (!childs.empty()) { - getSessionParticipantsByIndex(childs.size()-1)->remove(connection); + getSessionParticipantsByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -3517,7 +3517,7 @@ namespace RSMGR while (!childs.empty()) { - getGuildInvitesByIndex(childs.size()-1)->remove(connection); + getGuildInvitesByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -3530,7 +3530,7 @@ namespace RSMGR while (!childs.empty()) { - getJournalEntriesByIndex(childs.size()-1)->remove(connection); + getJournalEntriesByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -3649,7 +3649,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -3667,7 +3667,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -4656,7 +4656,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -4674,7 +4674,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -5106,7 +5106,7 @@ namespace RSMGR while (!childs.empty()) { - getInvitesByIndex(childs.size()-1)->remove(connection); + getInvitesByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -5221,7 +5221,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -5239,7 +5239,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -5891,7 +5891,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -5909,7 +5909,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -6529,7 +6529,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -6547,7 +6547,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -7157,7 +7157,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -7175,7 +7175,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -7631,7 +7631,7 @@ namespace RSMGR while (!childs.empty()) { - getFolderAccessByIndex(childs.size()-1)->remove(connection); + getFolderAccessByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -7750,7 +7750,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -7768,7 +7768,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -8423,7 +8423,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -8441,7 +8441,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -8945,7 +8945,7 @@ namespace RSMGR while (!childs.empty()) { - getSessionLogsByIndex(childs.size()-1)->remove(connection); + getSessionLogsByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -8958,7 +8958,7 @@ namespace RSMGR while (!childs.empty()) { - getPlayerRatingsByIndex(childs.size()-1)->remove(connection); + getPlayerRatingsByIndex((uint32)childs.size()-1)->remove(connection); } } @@ -9049,7 +9049,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -9067,7 +9067,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -9689,7 +9689,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -9707,7 +9707,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -10240,7 +10240,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -10258,7 +10258,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); diff --git a/code/ryzom/server/src/shard_unifier_service/entity_locator.cpp b/code/ryzom/server/src/shard_unifier_service/entity_locator.cpp index 0d4c53df8..0ece2c44e 100644 --- a/code/ryzom/server/src/shard_unifier_service/entity_locator.cpp +++ b/code/ryzom/server/src/shard_unifier_service/entity_locator.cpp @@ -315,7 +315,7 @@ namespace ENTITYLOC void onModuleUpdate() { // update the Total concurent user varialb - TotalConcurentUser.set(_ConnectedUsers.size()); + TotalConcurentUser.set((uint32)_ConnectedUsers.size()); } ///////////////////////////////////////////////////////////// diff --git a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp index 9843137cb..ac16c8cfe 100644 --- a/code/ryzom/server/src/shard_unifier_service/name_manager.cpp +++ b/code/ryzom/server/src/shard_unifier_service/name_manager.cpp @@ -655,7 +655,7 @@ void CNameManager::saveGuildNames() nlinfo("NAMEMGR::save: send message to BS"); CBackupMsgSaveFile msg( fileName, CBackupMsgSaveFile::SaveFile, Bsi ); - msg.DataMsg.serialBuffer((uint8*)s.c_str(), s.size()); + msg.DataMsg.serialBuffer((uint8*)s.c_str(), (uint)s.size()); Bsi.sendFile(msg); } @@ -760,7 +760,7 @@ bool CNameManager::loadAccountNamesFromTxt() // read the file content into a buffer uint32 size=NLMISC::CFile::getFileSize(f); input.resize(size); - uint32 readSize= fread(&input[0],1,size,f); + uint32 readSize= (uint32)fread(&input[0],1,size,f); fclose(f); BOMB_IF(readSize!=size,"Failed to read file content for file: "+fileName,return false); @@ -873,7 +873,7 @@ bool CNameManager::loadCharacterNamesFromTxt() // read the file content into a buffer uint32 size=NLMISC::CFile::getFileSize(f); input.resize(size); - uint32 readSize= fread(&input[0],1,size,f); + uint32 readSize= (uint32)fread(&input[0],1,size,f); fclose(f); BOMB_IF(readSize!=size,"Failed to read file content for file: "+fileName,return false); @@ -1105,7 +1105,7 @@ bool CNameManager::loadGuildsNamesFromTxt() // read the file content into a buffer uint32 size=NLMISC::CFile::getFileSize(f); input.resize(size); - uint32 readSize= fread(&input[0],1,size,f); + uint32 readSize= (uint32)fread(&input[0],1,size,f); fclose(f); BOMB_IF(readSize!=size,"Failed to read file content for file: "+fileName,return false); diff --git a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.cpp b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.cpp index 146b14c6d..b4dd9d0e8 100644 --- a/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.cpp +++ b/code/ryzom/server/src/shard_unifier_service/nel_database_mapping.cpp @@ -303,7 +303,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -321,7 +321,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); @@ -781,7 +781,7 @@ namespace RSMGR } else if (cmd == NOPE::cc_instance_count) { - return _ObjectCache.size(); + return (uint32)_ObjectCache.size(); } // default return value @@ -799,7 +799,7 @@ namespace RSMGR TReleasedObject::iterator first(_ReleasedObject.begin()), last(_ReleasedObject.end()); for (; first != last; ++first) { - nbReleased += first->second.size(); + nbReleased += (uint32)first->second.size(); } nlinfo(" There are %u object instances in cache not referenced (waiting deletion or re-use))", nbReleased); diff --git a/code/ryzom/server/src/tick_service/tick_service.cpp b/code/ryzom/server/src/tick_service/tick_service.cpp index 75d276036..0d0c0b34c 100644 --- a/code/ryzom/server/src/tick_service/tick_service.cpp +++ b/code/ryzom/server/src/tick_service/tick_service.cpp @@ -910,7 +910,7 @@ void CTickServiceGameCycleTimeMeasure::displayStat( NLMISC::CLog *log, TTimeMeas if ( HistoryByMirror.size() > 1 ) { log->displayRawNL( "\tAll mirror services:" ); - gatheredStats[stat].displayStat( log, MirrorTimeMeasureTypeToCString, (stat==MHTSum) ? HistoryByMirror.size() : 1 ); // not displaying the 3 stats + gatheredStats[stat].displayStat( log, MirrorTimeMeasureTypeToCString, (stat==MHTSum) ? (uint)HistoryByMirror.size() : 1 ); // not displaying the 3 stats } } { @@ -927,7 +927,7 @@ void CTickServiceGameCycleTimeMeasure::displayStat( NLMISC::CLog *log, TTimeMeas if ( HistoryByService.size() > 1 ) { log->displayRawNL( "\tAll client services:" ); - gatheredStats[stat].displayStat( log, ServiceTimeMeasureTypeToCString, (stat==MHTSum) ? HistoryByService.size() : 1 ); // not displaying the 3 stats + gatheredStats[stat].displayStat( log, ServiceTimeMeasureTypeToCString, (stat==MHTSum) ? (uint)HistoryByService.size() : 1 ); // not displaying the 3 stats } } }