From 7ffa7858bf285ed208636c18d50aafa6fe8095ba Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 13 May 2010 22:45:24 +0200 Subject: [PATCH] Changed: #825 Remove all warning when compiling Ryzom on Linux --- code/ryzom/client/src/animation_set.h | 2 +- code/ryzom/client/src/animation_state.cpp | 2 +- code/ryzom/client/src/animation_state.h | 2 +- code/ryzom/client/src/cdb_branch.cpp | 4 +- code/ryzom/client/src/character_cl.h | 2 +- code/ryzom/client/src/client.cpp | 2 +- .../client_sheets/automaton_list_sheet.cpp | 4 +- .../src/client_sheets/character_sheet.cpp | 2 +- .../src/client_sheets/emot_list_sheet.cpp | 2 +- .../client/src/client_sheets/flora_sheet.h | 2 +- .../client/src/client_sheets/item_fx_sheet.h | 2 +- .../client/src/client_sheets/item_sheet.cpp | 2 +- .../src/client_sheets/race_stats_sheet.cpp | 2 +- .../client_sheets/unblock_titles_sheet.cpp | 4 +- code/ryzom/client/src/color_slot_manager.cpp | 8 +-- code/ryzom/client/src/commands.cpp | 12 ++--- code/ryzom/client/src/continent.cpp | 2 +- code/ryzom/client/src/continent_manager.cpp | 2 +- code/ryzom/client/src/debug_client.cpp | 6 +-- code/ryzom/client/src/decal.cpp | 16 +++--- code/ryzom/client/src/entities.cpp | 32 ++++++------ .../client/src/entity_animation_manager.h | 2 +- code/ryzom/client/src/entity_cl.cpp | 8 +-- code/ryzom/client/src/far_tp.cpp | 4 +- code/ryzom/client/src/ground_fx_manager.cpp | 4 +- code/ryzom/client/src/hair_set.cpp | 4 +- code/ryzom/client/src/http_client.cpp | 2 +- code/ryzom/client/src/http_client_curl.cpp | 2 +- code/ryzom/client/src/ig_callback.cpp | 4 +- code/ryzom/client/src/init.cpp | 2 +- code/ryzom/client/src/init_main_loop.cpp | 4 +- .../src/interface_v3/action_handler_edit.cpp | 26 +++++----- .../src/interface_v3/action_handler_help.cpp | 10 ++-- .../client/src/interface_v3/chat_filter.h | 2 +- .../client/src/interface_v3/chat_window.h | 2 +- .../ryzom/client/src/interface_v3/ctrl_base.h | 2 +- .../client/src/interface_v3/ctrl_button.h | 2 +- .../client/src/interface_v3/ctrl_polygon.cpp | 4 +- .../client/src/interface_v3/ctrl_polygon.h | 2 +- .../ryzom/client/src/interface_v3/ctrl_quad.h | 2 +- .../src/interface_v3/ctrl_sheet_selection.cpp | 4 +- .../src/interface_v3/ctrl_text_button.h | 2 +- .../src/interface_v3/dbgroup_build_phrase.cpp | 8 +-- .../src/interface_v3/dbgroup_combo_box.h | 2 +- .../src/interface_v3/dbgroup_list_sheet.cpp | 2 +- .../src/interface_v3/dbgroup_list_sheet.h | 2 +- .../dbgroup_list_sheet_bonus_malus.cpp | 2 +- .../interface_v3/dbgroup_list_sheet_text.h | 2 +- .../client/src/interface_v3/dbview_bar.h | 2 +- .../client/src/interface_v3/dbview_bar3.h | 2 +- .../src/interface_v3/encyclopedia_manager.cpp | 4 +- .../client/src/interface_v3/group_compas.cpp | 4 +- .../client/src/interface_v3/group_editbox.cpp | 36 ++++++------- .../client/src/interface_v3/group_html.cpp | 10 ++-- .../src/interface_v3/group_html_webig.cpp | 2 +- .../interface_v3/group_in_scene_user_info.cpp | 4 +- .../client/src/interface_v3/group_list.cpp | 4 +- .../client/src/interface_v3/group_list.h | 4 +- .../client/src/interface_v3/group_map.cpp | 12 ++--- .../client/src/interface_v3/group_menu.cpp | 10 ++-- .../client/src/interface_v3/group_menu.h | 4 +- .../src/interface_v3/group_paragraph.cpp | 6 +-- .../client/src/interface_v3/group_paragraph.h | 4 +- .../src/interface_v3/group_quick_help.cpp | 2 +- .../client/src/interface_v3/group_table.cpp | 6 +-- .../client/src/interface_v3/group_tree.cpp | 18 +++---- .../src/interface_v3/interface_3d_scene.h | 2 +- .../src/interface_v3/interface_element.cpp | 2 +- .../src/interface_v3/interface_element.h | 2 +- .../src/interface_v3/interface_expr_node.cpp | 6 +-- .../interface_v3/interface_expr_user_fct.cpp | 2 +- .../src/interface_v3/interface_group.cpp | 2 +- .../client/src/interface_v3/interface_group.h | 2 +- .../client/src/interface_v3/interface_link.h | 2 +- .../src/interface_v3/interface_manager.cpp | 6 +-- .../src/interface_v3/interface_parser.cpp | 10 ++-- .../src/interface_v3/interface_parser.h | 4 +- .../src/interface_v3/item_special_effect.cpp | 2 +- .../src/interface_v3/libwww_nel_stream.cpp | 4 +- .../client/src/interface_v3/lua_helper.cpp | 2 +- .../ryzom/client/src/interface_v3/lua_ihm.cpp | 6 +-- .../client/src/interface_v3/macrocmd_key.cpp | 2 +- .../client/src/interface_v3/obs_huge_list.cpp | 2 +- .../client/src/interface_v3/people_list.cpp | 2 +- .../client/src/interface_v3/people_list.h | 2 +- .../src/interface_v3/sbrick_manager.cpp | 4 +- .../client/src/interface_v3/skill_manager.cpp | 2 +- .../client/src/interface_v3/sphrase_manager.h | 2 +- .../ryzom/client/src/interface_v3/view_base.h | 2 +- .../client/src/interface_v3/view_bitmap.h | 2 +- .../src/interface_v3/view_bitmap_combo.h | 2 +- .../src/interface_v3/view_bitmap_faber_mp.h | 4 +- .../client/src/interface_v3/view_polygon.cpp | 2 +- .../client/src/interface_v3/view_polygon.h | 2 +- .../ryzom/client/src/interface_v3/view_quad.h | 2 +- .../client/src/interface_v3/view_renderer.cpp | 6 +-- .../client/src/interface_v3/view_text.cpp | 42 +++++++-------- .../ryzom/client/src/interface_v3/view_text.h | 4 +- .../client/src/interface_v3/yubo_chat.cpp | 4 +- .../client/src/landscape_poly_drawer.cpp | 8 +-- code/ryzom/client/src/login_patch.cpp | 30 +++++------ code/ryzom/client/src/login_patch.h | 2 +- code/ryzom/client/src/misc.cpp | 10 ++-- code/ryzom/client/src/net_manager.cpp | 6 +-- code/ryzom/client/src/network_connection.cpp | 10 ++-- code/ryzom/client/src/prim_file.cpp | 8 +-- code/ryzom/client/src/property_decoder.cpp | 2 +- .../r2/displayer_visual_activity_sequence.cpp | 6 +-- .../client/src/r2/displayer_visual_group.cpp | 4 +- .../client/src/r2/dmc/action_historic.cpp | 2 +- .../src/r2/dmc/client_edition_module.cpp | 8 +-- .../client/src/r2/dmc/com_lua_module.cpp | 10 ++-- code/ryzom/client/src/r2/dmc/dmc.cpp | 4 +- code/ryzom/client/src/r2/editor.cpp | 8 +-- code/ryzom/client/src/r2/entity_sorter.cpp | 2 +- code/ryzom/client/src/r2/mesh_array.cpp | 2 +- code/ryzom/client/src/r2/mesh_array.h | 2 +- code/ryzom/client/src/r2/prim_render.cpp | 16 +++--- code/ryzom/client/src/r2/tool.cpp | 2 +- code/ryzom/client/src/r2/tool_draw_prim.cpp | 6 +-- code/ryzom/client/src/rosace.h | 4 +- code/ryzom/client/src/sheet_manager.cpp | 2 +- code/ryzom/client/src/sky.cpp | 2 +- .../src/streamable_entity_composite.cpp | 2 +- .../client/src/streamable_entity_composite.h | 2 +- code/ryzom/client/src/streamable_ig.h | 2 +- .../client/src/string_manager_client.cpp | 24 ++++----- code/ryzom/client/src/timed_fx_manager.cpp | 4 +- code/ryzom/client/src/village.cpp | 2 +- code/ryzom/client/src/water_map.cpp | 6 +-- .../client/src/weather_manager_client.cpp | 2 +- .../_backup_service_interface_non_module.cpp | 6 +-- .../common/src/game_share/action_block.cpp | 2 +- .../common/src/game_share/action_factory.cpp | 4 +- .../game_share/action_generic_multi_part.h | 4 +- .../game_share/backup_service_interface.cpp | 2 +- .../ryzom/common/src/game_share/bnp_patch.cpp | 14 ++--- .../common/src/game_share/data_set_base.h | 2 +- code/ryzom/common/src/game_share/dyn_chat.cpp | 2 +- code/ryzom/common/src/game_share/fame.cpp | 4 +- .../game_share/file_description_container.cpp | 8 +-- .../game_share/file_description_container.h | 2 +- .../common/src/game_share/login_registry.cpp | 2 +- code/ryzom/common/src/game_share/mirror.cpp | 2 +- code/ryzom/common/src/game_share/mirror.h | 2 +- .../src/game_share/mirrored_data_set.cpp | 4 +- .../common/src/game_share/mirrored_data_set.h | 2 +- .../src/game_share/mirrored_data_set_types.h | 2 +- code/ryzom/common/src/game_share/object.cpp | 28 +++++----- .../common/src/game_share/persistent_data.cpp | 52 +++++++++---------- .../src/game_share/persistent_data_tree.cpp | 2 +- .../common/src/game_share/r2_share_itf.h | 2 +- code/ryzom/common/src/game_share/r2_types.h | 2 +- .../common/src/game_share/ring_access.cpp | 2 +- code/ryzom/common/src/game_share/scenario.cpp | 36 ++++++------- .../src/game_share/scenario_entry_points.cpp | 2 +- code/ryzom/common/src/game_share/send_chat.h | 4 +- .../game_share/server_animation_module.cpp | 42 +++++++-------- .../src/game_share/server_edition_module.cpp | 18 +++---- .../src/game_share/small_string_manager.cpp | 4 +- .../src/game_share/string_manager_sender.cpp | 2 +- .../src/game_share/string_mgr_module.cpp | 12 ++--- code/ryzom/common/src/game_share/task_list.h | 2 +- .../time_weather_season/weather_function.h | 2 +- code/ryzom/common/src/game_share/timer.cpp | 4 +- code/ryzom/common/src/game_share/timer.h | 2 +- 166 files changed, 491 insertions(+), 491 deletions(-) diff --git a/code/ryzom/client/src/animation_set.h b/code/ryzom/client/src/animation_set.h index 7ed7b372b..4903b944b 100644 --- a/code/ryzom/client/src/animation_set.h +++ b/code/ryzom/client/src/animation_set.h @@ -106,7 +106,7 @@ public: } // get number of animation states - uint getNumAnimationState() const { return _AnimationStates.size(); } + uint getNumAnimationState() const { return (uint)_AnimationStates.size(); } // get an animation state by its index CAnimationState *getAnimationStateByIndex(uint index); diff --git a/code/ryzom/client/src/animation_state.cpp b/code/ryzom/client/src/animation_state.cpp index 0be7189e5..cd823c1cc 100644 --- a/code/ryzom/client/src/animation_state.cpp +++ b/code/ryzom/client/src/animation_state.cpp @@ -276,7 +276,7 @@ CAnimation::TAnimId CAnimationState::chooseAnim(uint32 jobSpecialisation, EGSPD: { uint i; uint best; - const uint count = _Animations.size (); + const uint count = (uint)_Animations.size (); double bestAng = 1000.0; // Big value to be > to the first element. for (i=0; i 0 ) for ( idb=1; nbNodesOfBank > unsigned(1<::iterator it = Automatons.begin(); while (it != Automatons.end()) diff --git a/code/ryzom/client/src/client_sheets/character_sheet.cpp b/code/ryzom/client/src/client_sheets/character_sheet.cpp index 10aa16e79..69925b132 100644 --- a/code/ryzom/client/src/client_sheets/character_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/character_sheet.cpp @@ -731,7 +731,7 @@ void CCharacterSheet::serial(class NLMISC::IStream &f) throw(NLMISC::EStream) // body to bone f.serial(BodyToBone); // attack list - uint32 size = AttackLists.size(); + uint32 size = (uint32)AttackLists.size(); f.serial(size); AttackLists.resize(size); // diff --git a/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp b/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp index 56c27a018..78a9a9f74 100644 --- a/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/emot_list_sheet.cpp @@ -103,7 +103,7 @@ void CEmotListSheet::serial(class NLMISC::IStream &f) throw(NLMISC::EStream) } else { - size = Emots.size(); + size = (uint32)Emots.size(); f.serial (size); } for (uint i = 0; i < size; i++) diff --git a/code/ryzom/client/src/client_sheets/flora_sheet.h b/code/ryzom/client/src/client_sheets/flora_sheet.h index 308c85a3e..a17c6593b 100644 --- a/code/ryzom/client/src/client_sheets/flora_sheet.h +++ b/code/ryzom/client/src/client_sheets/flora_sheet.h @@ -74,7 +74,7 @@ public: */ const CPlantInfo *getPlantInfoFromWeightedIndex(uint64 index) const; // Plant info access - uint getNumPlantInfos() const { return _Plants.size(); } + uint getNumPlantInfos() const { return (uint)_Plants.size(); } const CPlantInfo &getPlantInfo(uint index) const { return _Plants[index]; } private: std::vector _Plants; diff --git a/code/ryzom/client/src/client_sheets/item_fx_sheet.h b/code/ryzom/client/src/client_sheets/item_fx_sheet.h index 4b39ed375..2f4910ab2 100644 --- a/code/ryzom/client/src/client_sheets/item_fx_sheet.h +++ b/code/ryzom/client/src/client_sheets/item_fx_sheet.h @@ -48,7 +48,7 @@ public: const char *getAdvantageFX() const; const char *getAttackFX() const; // static fxs - uint getNumStaticFX() const { return _StaticFXs.size(); } + uint getNumStaticFX() const { return (uint)_StaticFXs.size(); } const char *getStaticFXName(uint index) const; const char *getStaticFXBone(uint index) const; const NLMISC::CVector &getStaticFXOffset(uint index) const; diff --git a/code/ryzom/client/src/client_sheets/item_sheet.cpp b/code/ryzom/client/src/client_sheets/item_sheet.cpp index 13e980bc2..aee6b4f88 100644 --- a/code/ryzom/client/src/client_sheets/item_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/item_sheet.cpp @@ -379,7 +379,7 @@ void CItemSheet::build(const NLGEORGES::UFormElm &item) nlwarning(" Can't load the VPValue from sheet name in sheet %s", Id.toString().c_str() ); else { - sint i = pos - 1; + sint i = (sint)pos - 1; for(; i >= 0; i-- ) { if ( !isdigit( sheetName[i] ) ) diff --git a/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp b/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp index 67bb9121b..3a34313d5 100644 --- a/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/race_stats_sheet.cpp @@ -309,7 +309,7 @@ void CRaceStatsSheet::serial(class NLMISC::IStream &f) throw(NLMISC::EStream) f.serial(Automaton); f.serial(BodyToBone); // attack list - uint32 size = AttackLists.size(); + uint32 size = (uint32)AttackLists.size(); f.serial(size); AttackLists.resize(size); // diff --git a/code/ryzom/client/src/client_sheets/unblock_titles_sheet.cpp b/code/ryzom/client/src/client_sheets/unblock_titles_sheet.cpp index 739bc6c0d..86565934c 100644 --- a/code/ryzom/client/src/client_sheets/unblock_titles_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/unblock_titles_sheet.cpp @@ -174,7 +174,7 @@ void CUnblockTitlesSheet::build(const UFormElm &item) if( !strSkillsNeeded.empty() ) { - uint16 skillsNeededSz = TitlesUnblock[title].SkillsNeeded.size(); + uint16 skillsNeededSz = (uint16)TitlesUnblock[title].SkillsNeeded.size(); TitlesUnblock[title].SkillsNeeded.resize(skillsNeededSz+1); TitlesUnblock[title].SkillsLevelNeeded.resize(skillsNeededSz+1); @@ -235,7 +235,7 @@ void CUnblockTitlesSheet::build(const UFormElm &item) if( !strItemsNeeded.empty() ) { - uint16 itemsNeededSz = TitlesUnblock[title].ItemsNeeded.size(); + uint16 itemsNeededSz = (uint16)TitlesUnblock[title].ItemsNeeded.size(); TitlesUnblock[title].ItemsNeeded.resize(itemsNeededSz+1); TitlesUnblock[title].ItemsQualityNeeded.resize(itemsNeededSz+1); diff --git a/code/ryzom/client/src/color_slot_manager.cpp b/code/ryzom/client/src/color_slot_manager.cpp index 19ac15bc1..d8e7116f6 100644 --- a/code/ryzom/client/src/color_slot_manager.cpp +++ b/code/ryzom/client/src/color_slot_manager.cpp @@ -116,7 +116,7 @@ CColorSlotManager::TIntCouple CColorSlotManager::findFileExtensionInSlot(const s TStringVect::const_iterator extIt = std::find(it->begin(), it->end(), ext); if (extIt != it->end()) { - return std::make_pair(it - _Slots.begin(), extIt - it->begin()); + return std::make_pair((uint)(it - _Slots.begin()), (uint)(extIt - it->begin())); } } return TIntCouple((uint) NotFound, 0); @@ -136,7 +136,7 @@ uint CColorSlotManager::addSlot(const TStringVect &slotDescs) { NLMISC::strupr(_Slots.back()[k]); } - return _Slots.size() - 1; + return (uint)_Slots.size() - 1; } @@ -327,7 +327,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st { return false; } - uint startSlot = _Slots.size(); + uint startSlot = (uint)_Slots.size(); @@ -362,7 +362,7 @@ bool CColorSlotManager::addSlotsFromConfigFile(NLMISC::CConfigFile &cf, uint &st } startSlotDest = startSlot; - numSlots = _Slots.size() - startSlot; + numSlots = (uint)_Slots.size() - startSlot; return true; } diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 81b440c28..c69d91733 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -754,7 +754,7 @@ NLMISC_COMMAND(log, "Add/Del Positive/Negative Filters for logs", "Log System ") { - int size = args.size(); + int size = (int)args.size(); if (size != 1) return false; @@ -839,7 +839,7 @@ NLMISC_COMMAND(execScript, "Execute a script file (.cmd)","") NLMISC_COMMAND(db, "Modify Database"," ") { CInterfaceManager *pIM = CInterfaceManager::getInstance(); - int size = args.size(); + int size = (int)args.size(); if (size == 2) { #if !FINAL_VERSION @@ -4046,7 +4046,7 @@ NLMISC_COMMAND(logFaberMpCompatibles, "log all MP compatibles for faber the item } // header - uint numMpSlots= brick->FaberPlan.ItemPartMps.size(); + uint numMpSlots= (uint)brick->FaberPlan.ItemPartMps.size(); nlinfo("********** FABERLOG **********"); nlinfo(" ItemBuilt Origin: %s", ITEM_ORIGIN::enumToString(itemBuilt->ItemOrigin).c_str() ); nlinfo(" NumMPSlot: %d", numMpSlots); @@ -5028,8 +5028,8 @@ bool CUserCommand::execute(const std::string &/* rawCommandString */, const std: // Find the good keyword table CMode *mode = NULL; - if (FixedArgModes.find (args.size()) != FixedArgModes.end()) - mode = &(FixedArgModes[args.size()]); + if (FixedArgModes.find ((uint)args.size()) != FixedArgModes.end()) + mode = &(FixedArgModes[(uint)args.size()]); else if (!InfiniteMode.Keywords.empty() && (args.size() >= InfiniteMode.KeywordsCount)) mode = &InfiniteMode; @@ -5258,7 +5258,7 @@ NLMISC_COMMAND(dumpPosAsPrim, "ld helper : add current position to pos.primitive { COFile stream; stream.open(path); - stream.serialBuffer((uint8 *) &srcFile[0], srcFile.size()); + stream.serialBuffer((uint8 *) &srcFile[0], (uint)srcFile.size()); } catch(NLMISC::EStream &e) { diff --git a/code/ryzom/client/src/continent.cpp b/code/ryzom/client/src/continent.cpp index 2bf29812d..e432df203 100644 --- a/code/ryzom/client/src/continent.cpp +++ b/code/ryzom/client/src/continent.cpp @@ -382,7 +382,7 @@ static uint getNumZones() if (Landscape == NULL) return 0; std::vector zoneLoaded; Landscape->getAllZoneLoaded(zoneLoaded); - return zoneLoaded.size(); + return (uint)zoneLoaded.size(); } //----------------------------------------------- diff --git a/code/ryzom/client/src/continent_manager.cpp b/code/ryzom/client/src/continent_manager.cpp index 51c40e51d..fd59a5ffe 100644 --- a/code/ryzom/client/src/continent_manager.cpp +++ b/code/ryzom/client/src/continent_manager.cpp @@ -491,7 +491,7 @@ void CContinentManager::serialUserLandMarks(NLMISC::IStream &f) f.serialVersion(1); if (!f.isReading()) { - uint32 numCont = _Continents.size(); + uint32 numCont = (uint32)_Continents.size(); f.serial(numCont); for(TContinents::iterator it = _Continents.begin(); it != _Continents.end(); ++it) { diff --git a/code/ryzom/client/src/debug_client.cpp b/code/ryzom/client/src/debug_client.cpp index 47ea9345d..663fa9965 100644 --- a/code/ryzom/client/src/debug_client.cpp +++ b/code/ryzom/client/src/debug_client.cpp @@ -147,17 +147,17 @@ void flushDebugStack(const std::string &title) { // Log Title. string strTmp = toString(" %s\n", title.c_str()); - DebugFile.serialBuffer((uint8*)strTmp.c_str(), strTmp.size()); + DebugFile.serialBuffer((uint8*)strTmp.c_str(), (uint)strTmp.size()); for(uint i=0; i nlwarning else diff --git a/code/ryzom/client/src/decal.cpp b/code/ryzom/client/src/decal.cpp index 8446f09c0..a992eb9d9 100644 --- a/code/ryzom/client/src/decal.cpp +++ b/code/ryzom/client/src/decal.cpp @@ -305,7 +305,7 @@ void CDecal::renderTriCache(NL3D::IDriver &drv, NL3D::CShadowPolyReceiver &/* { { CVertexBufferReadWrite vba; - _VB.setNumVertices(_TriCache.size()); + _VB.setNumVertices((uint32)_TriCache.size()); _VB.lock(vba); memcpy(vba.getVertexCoordPointer(), &_TriCache[0], sizeof(CRGBAVertex) * _TriCache.size()); } @@ -337,23 +337,23 @@ void CDecal::renderTriCache(NL3D::IDriver &drv, NL3D::CShadowPolyReceiver &/* simpleMat.texEnvArg0RGB(0, CMaterial::Constant, CMaterial::SrcColor); simpleMat.setDoubleSided(true); simpleMat.texConstantColor(0, CRGBA::White); - drv.renderRawTriangles(simpleMat, 0, _TriCache.size() / 3); + drv.renderRawTriangles(simpleMat, 0, (uint32)_TriCache.size() / 3); IDriver::TPolygonMode pm = drv.getPolygonMode(); drv.setPolygonMode(IDriver::Line); simpleMat.texConstantColor(0, CRGBA::Red); - drv.renderRawTriangles(simpleMat, 0, _TriCache.size() / 3); + drv.renderRawTriangles(simpleMat, 0, (uint32)_TriCache.size() / 3); drv.setPolygonMode(pm); } else { - drv.renderRawTriangles(_Material, 0, _TriCache.size() / 3); + drv.renderRawTriangles(_Material, 0, (uint32)_TriCache.size() / 3); } } else { { CVertexBufferReadWrite vba; - _VB.setNumVertices(_TriCache.size()); + _VB.setNumVertices((uint32)_TriCache.size()); _VB.lock(vba); NLMISC::CRGBA col = _Diffuse; if (drv.getVertexColorFormat()==CVertexBuffer::TBGRA) @@ -391,11 +391,11 @@ void CDecal::renderTriCache(NL3D::IDriver &drv, NL3D::CShadowPolyReceiver &/* static CMaterial simpleMat2; simpleMat2.initUnlit(); simpleMat2.setDoubleSided(true); - drv.renderRawTriangles(simpleMat2, 0, _TriCache.size() / 3); + drv.renderRawTriangles(simpleMat2, 0, (uint32)_TriCache.size() / 3); } else { - drv.renderRawTriangles(_Material, 0, _TriCache.size() / 3); + drv.renderRawTriangles(_Material, 0, (uint32)_TriCache.size() / 3); } } } @@ -515,7 +515,7 @@ void CDecal::render(NL3D::UDriver &/* drv */, planes[1].make(-CVector::J, camPos - tileNear * CVector::J), planes[2].make(CVector::I, camPos + tileNear * CVector::I), planes[3].make(-CVector::I, camPos - tileNear * CVector::I); - uint numVerts = clipPoly.Vertices.size(); + uint numVerts = (uint)clipPoly.Vertices.size(); clipPoly2D.Vertices.resize(numVerts); for (uint k = 0; k < numVerts; ++k) { diff --git a/code/ryzom/client/src/entities.cpp b/code/ryzom/client/src/entities.cpp index 150e28008..b1780e042 100644 --- a/code/ryzom/client/src/entities.cpp +++ b/code/ryzom/client/src/entities.cpp @@ -735,7 +735,7 @@ bool CEntityManager::remove(uint slot, bool warning) //----------------------------------------------- void CEntityManager::removeCollision() { - const uint nbEntities = _Entities.size(); + const uint nbEntities = (uint)_Entities.size(); for(uint i=0; isetFontSize(ClientCfg.NameFontSize); CRGBA color; - const uint activeCount = _ActiveEntities.size (); + const uint activeCount = (uint)_ActiveEntities.size (); uint i; for(i=0; iupdateAllPostRender (); } - const uint count = _VisibleEntities.size (); + const uint count = (uint)_VisibleEntities.size (); for(i=0; isheetId().toString().c_str(), _Entities[i]->pos().x, _Entities[i]->pos().y, _Entities[i]->pos().z, _Entities[i]->front().x, _Entities[i]->front().y, _Entities[i]->front().z, i); - f.serialBuffer((uint8*)strTmp.c_str(), strTmp.size()); + f.serialBuffer((uint8*)strTmp.c_str(), (uint)strTmp.size()); } } strTmp = "};\n"; - f.serialBuffer((uint8*)strTmp.c_str(), strTmp.size()); + f.serialBuffer((uint8*)strTmp.c_str(), (uint)strTmp.size()); // Close the File. f.close(); @@ -1587,7 +1587,7 @@ void CEntityManager::serial(class NLMISC::IStream &f) throw(NLMISC::EStream) // f.serial(_EntitiesAllocated); no need to serialize this one except maybe to check. // Serialize each entity. - const uint nb = _Entities.size(); + const uint nb = (uint)_Entities.size(); for(uint i=0; iEmots.size();} + uint getNbEmots() {return (uint)_EmotList->Emots.size();} /** Method to get the emot associated to an index. * \param index : number of the emot asked. * \param result : will be filled with the name of the emot associated. diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index b90844eea..46a31e595 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -1184,7 +1184,7 @@ uint32 CEntityCL::addInstance(const string &shapeName, const std::string &stickP // Create new instance slot? if(instIdx == CEntityCL::BadIndex) { - idx= _Instances.size(); + idx= (uint32)_Instances.size(); _Instances.push_back(SInstanceCL()); } @@ -1255,7 +1255,7 @@ void CEntityCL::show(bool s) //----------------------------------------------- void CEntityCL::hideSkin() { - const uint nbInst = _Instances.size(); + const uint nbInst = (uint)_Instances.size(); for(uint i = 0; i &clippingPlanes, cons // Speed Clip: clip just the sphere. // if out of only plane, entirely out. - const uint count = clippingPlanes.size (); + const uint count = (uint)clippingPlanes.size (); uint i; for(i=0;i %s\n", CLoginStateMachine::toString(ev).c_str(), CLoginStateMachine::toString(_CurrentState).c_str(), CLoginStateMachine::toString(stateId).c_str()); \ if ( outputF.open( "error_join.log", true, true ) ) \ { \ - outputF.serialBuffer( (uint8*)(&sLog[0]), sLog.size() ); \ + outputF.serialBuffer( (uint8*)(&sLog[0]), (uint)sLog.size() ); \ outputF.close(); \ } \ } \ @@ -902,7 +902,7 @@ retryJoinEdit: time_t currentTime; time( ¤tTime ); string headerS = NLMISC::toString( "\n\n%s%s\n\n", asctime(localtime(¤tTime)), outErrorMsg.c_str() ); - outputF.serialBuffer( (uint8*)(&headerS[0]), headerS.size() ); + outputF.serialBuffer( (uint8*)(&headerS[0]), (uint)headerS.size() ); // outputF.serialBuffer( (uint8*)(&res[0]), res.size() ); outputF.close(); } diff --git a/code/ryzom/client/src/ground_fx_manager.cpp b/code/ryzom/client/src/ground_fx_manager.cpp index 1a378b012..9bdc425d0 100644 --- a/code/ryzom/client/src/ground_fx_manager.cpp +++ b/code/ryzom/client/src/ground_fx_manager.cpp @@ -320,10 +320,10 @@ void CGroundFXManager::checkIntegrity() } } } - uint numFX = _ActiveFXs.size(); + uint numFX = (uint)_ActiveFXs.size(); nlassert(numFX == _NumFX); nlassert(numFX <= _MaxNumFX); - uint numCachedFX = _CachedFXs.size(); + uint numCachedFX = (uint)_CachedFXs.size(); nlassert(numCachedFX == _NumCachedFX); nlassert(numCachedFX <= _MaxNumCachedFX); } diff --git a/code/ryzom/client/src/hair_set.cpp b/code/ryzom/client/src/hair_set.cpp index c454b9c85..e7c4a1692 100644 --- a/code/ryzom/client/src/hair_set.cpp +++ b/code/ryzom/client/src/hair_set.cpp @@ -80,7 +80,7 @@ uint CHairSet::getNumHairItem(EGSPD::CPeople::TPeople gspeople) const { H_AUTO_USE(RZ_HairSet) EPeople people = convPeople(gspeople); - return people != DontKnow ? _Hairs[people].size() : 0; + return people != DontKnow ? (uint)_Hairs[people].size() : 0; } @@ -102,7 +102,7 @@ sint CHairSet::getHairItemFromId(EGSPD::CPeople::TPeople gspeople, uint Id) cons EPeople people = convPeople(gspeople); if (people == DontKnow) return -1; TIntArray::const_iterator it = std::find(_Hairs[people].begin(), _Hairs[people].end(), Id); - if (it != _Hairs[people].end()) return it - _Hairs[people].begin(); + if (it != _Hairs[people].end()) return (sint)(it - _Hairs[people].begin()); else return -1; } diff --git a/code/ryzom/client/src/http_client.cpp b/code/ryzom/client/src/http_client.cpp index 8bfcfe7a5..dd5220fc1 100644 --- a/code/ryzom/client/src/http_client.cpp +++ b/code/ryzom/client/src/http_client.cpp @@ -79,7 +79,7 @@ bool CHttpClient::send(const std::string& buffer, bool verbose) nlassert(_Sock.connected()); if(verbose) nldebug("Sending '%s' to '%s'", buffer.c_str(), _Sock.remoteAddr().asString().c_str()); - uint32 size = buffer.size(); + uint32 size = (uint32)buffer.size(); if(!buffer.empty()) { if(_Sock.send((uint8 *)buffer.c_str(), size, false) != CSock::Ok) diff --git a/code/ryzom/client/src/http_client_curl.cpp b/code/ryzom/client/src/http_client_curl.cpp index 62ea343ff..e829cd930 100644 --- a/code/ryzom/client/src/http_client_curl.cpp +++ b/code/ryzom/client/src/http_client_curl.cpp @@ -30,7 +30,7 @@ using namespace std; size_t CCurlHttpClient::writeDataFromCurl(void *buffer, size_t size, size_t nmemb, void *pHttpClient) { CCurlHttpClient * httpClient = static_cast(pHttpClient); - httpClient->pushReceivedData((uint8*)buffer, size*nmemb); + httpClient->pushReceivedData((uint8*)buffer, (uint)(size*nmemb)); return size*nmemb; } diff --git a/code/ryzom/client/src/ig_callback.cpp b/code/ryzom/client/src/ig_callback.cpp index 8dd327cda..14bd4f988 100644 --- a/code/ryzom/client/src/ig_callback.cpp +++ b/code/ryzom/client/src/ig_callback.cpp @@ -375,7 +375,7 @@ void CIGCallback::CIGInstance::updateFromSheets() H_AUTO_USE(RZ_IGCallback) nlassert(_EntitySheets.size() == _IG->getNumInstance()); // See for which objects distance should be overriden (object which use a .PLANT sheet) - uint numInstances = _EntitySheets.size(); + uint numInstances = (uint)_EntitySheets.size(); for(uint k = 0; k < numInstances; ++k) { if (_EntitySheets[k] && _EntitySheets[k]->Type == CEntitySheet::PLANT) @@ -402,7 +402,7 @@ void CIGCallback::CIGInstance::updateManagedFXs() H_AUTO_USE(RZ_IGCallback) nlassert(_EntitySheets.size() == _IG->getNumInstance()); // See for which objects distance should be overriden (object which use a .PLANT sheet) - uint numInstances = _EntitySheets.size(); + uint numInstances = (uint)_EntitySheets.size(); // vector of fx that should be managed by the dedicated manager. static for malloc perf static std::vector timedFXs; timedFXs.clear(); diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 39b0808eb..149a8fbda 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -193,7 +193,7 @@ void *XmlMalloc4NeL (size_t size) // if (XmlAllocUsesSTL) { int *newB = (int *) xmlStlAlloc.allocate(size + sizeof(int)); - *newB = size; + *newB = (int)size; return (void *) (newB + 1); } // else diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index 6ef4ea4be..dc1967f6b 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -207,7 +207,7 @@ struct CStatThread : public NLMISC::IRunnable name = UserEntity->getEntityName().toString(); std::string userid = toString("u%d", NetMngr.getUserId())+name; - return toUpper(getMD5((const uint8 *)userid.c_str(), userid.size()).toString()); + return toUpper(getMD5((const uint8 *)userid.c_str(), (uint32)userid.size()).toString()); } // return true if we sent the connect because we have all information @@ -222,7 +222,7 @@ struct CStatThread : public NLMISC::IRunnable std::string params; addParam(params, "ra", randomString()); std::string session = toString("%d%d", NetMngr.getUserId(), CTime::getSecondsSince1970()); - addParam(params, "sessioncookie", toUpper(getMD5((const uint8 *)session.c_str(), session.size()).toString())); + addParam(params, "sessioncookie", toUpper(getMD5((const uint8 *)session.c_str(), (uint32)session.size()).toString())); addParam(params, "cookie", cookie()); addParam(params, "browsertoken", "X"); addParam(params, "platformtoken", "Win32"); diff --git a/code/ryzom/client/src/interface_v3/action_handler_edit.cpp b/code/ryzom/client/src/interface_v3/action_handler_edit.cpp index 00cd477b3..16c7c2184 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_edit.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_edit.cpp @@ -69,7 +69,7 @@ static inline uint getCharacterCategory(ucchar c) static uint skipUCCharsRight(uint startPos, const ucstring &str) { uint pos = startPos; - uint endIndex = str.length(); + uint endIndex = (uint)str.length(); uint ccat = getCharacterCategory(str[pos]); // skip characters of the same category while (pos != endIndex && getCharacterCategory(str[pos]) == ccat) ++pos; @@ -284,11 +284,11 @@ class CAHEditGotoLineBegin : public CAHEdit // go to the start of line if (_GroupEdit->getViewText()) { - sint line = _GroupEdit->getViewText()->getLineFromIndex(_GroupEdit->getCursorPos() + _GroupEdit->getPrompt().length()); + sint line = _GroupEdit->getViewText()->getLineFromIndex(_GroupEdit->getCursorPos() + (uint)_GroupEdit->getPrompt().length()); if (line == -1) return; sint newPos = std::max(_GroupEdit->getViewText()->getLineStartIndex(line), (sint) _GroupEdit->getPrompt().length()); if (newPos == -1) return; - _GroupEdit->setCursorPos(newPos - _GroupEdit->getPrompt().length()); + _GroupEdit->setCursorPos(newPos - (sint32)_GroupEdit->getPrompt().length()); _GroupEdit->setCursorAtPreviousLineEnd(false); } } @@ -306,20 +306,20 @@ class CAHEditGotoLineEnd : public CAHEdit { if (_GroupEdit->getViewText()->getMultiLine()) { - sint line = _GroupEdit->getViewText()->getLineFromIndex(_GroupEdit->getCursorPos() + _GroupEdit->getPrompt().length(), _GroupEdit->isCursorAtPreviousLineEnd()); + sint line = _GroupEdit->getViewText()->getLineFromIndex(_GroupEdit->getCursorPos() + (uint)_GroupEdit->getPrompt().length(), _GroupEdit->isCursorAtPreviousLineEnd()); if (line == -1) return; sint newPos; bool endOfPreviousLine; _GroupEdit->getViewText()->getLineEndIndex(line, newPos, endOfPreviousLine); if (newPos != -1) { - _GroupEdit->setCursorPos(newPos - _GroupEdit->getPrompt().length()); + _GroupEdit->setCursorPos(newPos - (sint32)_GroupEdit->getPrompt().length()); _GroupEdit->setCursorAtPreviousLineEnd(endOfPreviousLine); } } else { - _GroupEdit->setCursorPos(_GroupEdit->getPrompt().length() + _GroupEdit->getInputString().length()); + _GroupEdit->setCursorPos((sint32)_GroupEdit->getPrompt().length() + (sint32)_GroupEdit->getInputString().length()); } } } @@ -344,7 +344,7 @@ class CAHEditGotoBlockEnd : public CAHEdit { void actionPart () { - _GroupEdit->setCursorPos(_GroupEdit->getInputStringRef().length()); + _GroupEdit->setCursorPos((sint32)_GroupEdit->getInputStringRef().length()); _GroupEdit->setCursorAtPreviousLineEnd(false); } }; @@ -374,7 +374,7 @@ class CAHEditPreviousLine : public CAHEdit } else if (!_GroupEdit->getMaxHistoric() && _GroupEdit->getViewText()->getMultiLine()) { - uint cursorPosInText = _GroupEdit->getCursorPos() + _GroupEdit->getPrompt().length(); + uint cursorPosInText = _GroupEdit->getCursorPos() + (uint)_GroupEdit->getPrompt().length(); if ( (_GroupEdit->getCursorPos() == (sint32) _GroupEdit->getInputStringRef().length() && _GroupEdit->getViewText()->getNumLine() == 1) || _GroupEdit->getViewText()->getLineFromIndex(cursorPosInText, _GroupEdit->isCursorAtPreviousLineEnd()) == 0 @@ -392,7 +392,7 @@ class CAHEditPreviousLine : public CAHEdit _GroupEdit->getViewText()->getCharacterIndexFromPosition(cx, cy, newCharIndex, newLineEnd); if (newLineEnd) { - _GroupEdit->setCursorPos(newCharIndex - _GroupEdit->getPrompt().length()); + _GroupEdit->setCursorPos(newCharIndex - (sint32)_GroupEdit->getPrompt().length()); _GroupEdit->setCursorAtPreviousLineEnd(true); sint32 newPos = _GroupEdit->getCursorPos(); clamp(newPos, (sint32) 0, (sint32) _GroupEdit->getInputStringRef().size()); @@ -413,7 +413,7 @@ class CAHEditPreviousLine : public CAHEdit { _GroupEdit->setCursorPos(newCharIndex + 1); } - _GroupEdit->setCursorPos(_GroupEdit->getCursorPos()-_GroupEdit->getPrompt().length()); + _GroupEdit->setCursorPos(_GroupEdit->getCursorPos()-(sint32)_GroupEdit->getPrompt().length()); sint32 newpos = _GroupEdit->getCursorPos(); clamp(newpos, (sint32) 0, (sint32)_GroupEdit->getInputStringRef().size()); _GroupEdit->setCursorPos(newpos); @@ -448,7 +448,7 @@ class CAHEditNextLine : public CAHEdit { sint cx, cy; sint height; - _GroupEdit->getViewText()->getCharacterPositionFromIndex(_GroupEdit->getCursorPos() + _GroupEdit->getPrompt().length(), _GroupEdit->isCursorAtPreviousLineEnd(), cx, cy, height); + _GroupEdit->getViewText()->getCharacterPositionFromIndex(_GroupEdit->getCursorPos() + (sint)_GroupEdit->getPrompt().length(), _GroupEdit->isCursorAtPreviousLineEnd(), cx, cy, height); if (cy != 0) { cy -= height; @@ -457,7 +457,7 @@ class CAHEditNextLine : public CAHEdit _GroupEdit->getViewText()->getCharacterIndexFromPosition(cx, cy, newCharIndex, newLineEnd); if (newLineEnd) { - _GroupEdit->setCursorPos(newCharIndex - _GroupEdit->getPrompt().length()); + _GroupEdit->setCursorPos(newCharIndex - (sint32)_GroupEdit->getPrompt().length()); _GroupEdit->setCursorAtPreviousLineEnd(true); sint32 newPos = _GroupEdit->getCursorPos(); clamp(newPos, (sint32) 0, (sint32) _GroupEdit->getInputStringRef().size()); @@ -478,7 +478,7 @@ class CAHEditNextLine : public CAHEdit { _GroupEdit->setCursorPos(min(sint32(newCharIndex + 1), sint32(_GroupEdit->getInputStringRef().length() + _GroupEdit->getPrompt().length()))); } - _GroupEdit->setCursorPos(_GroupEdit->getCursorPos()-_GroupEdit->getPrompt().length()); + _GroupEdit->setCursorPos(_GroupEdit->getCursorPos()-(sint32)_GroupEdit->getPrompt().length()); sint32 newPos = _GroupEdit->getCursorPos(); clamp(newPos, (sint32) 0, (sint32) _GroupEdit->getInputStringRef().size()); _GroupEdit->setCursorPos(newPos); diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 1800148e1..5b26013ee 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -223,7 +223,7 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc // update WindowList if possible initWindows(); - sint maxHelpWindow= _InfoWindows.size(); + sint maxHelpWindow= (sint)_InfoWindows.size(); // Update Active window list @@ -429,7 +429,7 @@ void CInterfaceHelp::closeAll() { // update WindowList if possible initWindows(); - sint maxHelpWindow= _InfoWindows.size(); + sint maxHelpWindow= (sint)_InfoWindows.size(); _ActiveWindows.clear(); // For all windows @@ -447,7 +447,7 @@ void CInterfaceHelp::resetWindowPos(sint y) // update WindowList if possible initWindows(); - sint maxHelpWindow= _InfoWindows.size(); + sint maxHelpWindow= (sint)_InfoWindows.size(); uint32 w, h; pIM->getViewRenderer().getScreenSize(w,h); @@ -473,7 +473,7 @@ void CInterfaceHelp::serialInfoWindows(NLMISC::IStream &f) resetWindowPos(-100); f.serialCont(infoWindowSave); - uint minSize= min(infoWindowSave.size(), _InfoWindows.size()); + uint minSize= (uint)min(infoWindowSave.size(), _InfoWindows.size()); for(uint i=0;isetX(infoWindowSave[i].X); @@ -2508,7 +2508,7 @@ void refreshMissionHelp(CSheetHelpSetup &setup, const CPrerequisitInfos &infos) } // inactivate other lines - for (uint i = infos.Prerequisits.size(); i < 15 ; ++i) + for (uint i = (uint)infos.Prerequisits.size(); i < 15 ; ++i) { const std::string text = setup.HelpWindow->getId() + ":content:scroll_text_id:text_list:" + NLMISC::toString("text_%u",i+1); CViewText *viewText = dynamic_cast(setup.HelpWindow->getElement(text)); diff --git a/code/ryzom/client/src/interface_v3/chat_filter.h b/code/ryzom/client/src/interface_v3/chat_filter.h index 1cae0132e..31c4d1268 100644 --- a/code/ryzom/client/src/interface_v3/chat_filter.h +++ b/code/ryzom/client/src/interface_v3/chat_filter.h @@ -57,7 +57,7 @@ public: void addListeningWindow(CChatWindow *w); void removeListeningWindow(CChatWindow *w); bool isListeningWindow(CChatWindow *w) const; - uint getNumListeningWindows() const { return _ListeningWindows.size(); } + uint getNumListeningWindows() const { return (uint)_ListeningWindows.size(); } CChatWindow *getListeningWindow(uint index); // helpers : depending on the 'listening' flag value, remove or add the window from the list void setWindowState(CChatWindow *cw, bool listening); diff --git a/code/ryzom/client/src/interface_v3/chat_window.h b/code/ryzom/client/src/interface_v3/chat_window.h index d94f91d5e..dd5bfaac1 100644 --- a/code/ryzom/client/src/interface_v3/chat_window.h +++ b/code/ryzom/client/src/interface_v3/chat_window.h @@ -246,7 +246,7 @@ public: // try to rename a window bool rename(const ucstring &oldName, const ucstring &newName, bool newNameLocalize); // warning : this is slow - uint getNumChatWindow() const { return _ChatWindowMap.size(); } + uint getNumChatWindow() const { return (uint)_ChatWindowMap.size(); } // warning : this is slow : for debug only CChatWindow *getChatWindowByIndex(uint index); /////////////////////////////////////////////////////////////////////////////////////// diff --git a/code/ryzom/client/src/interface_v3/ctrl_base.h b/code/ryzom/client/src/interface_v3/ctrl_base.h index bb37803ae..0033dce6b 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_base.h +++ b/code/ryzom/client/src/interface_v3/ctrl_base.h @@ -63,7 +63,7 @@ public: virtual CCtrlBase *getSubCtrl (sint32 /* x */, sint32 /* y */) { return this; } /// Debug - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } /// Get the ContextHelp for this control. Default is to return _ContextHelp diff --git a/code/ryzom/client/src/interface_v3/ctrl_button.h b/code/ryzom/client/src/interface_v3/ctrl_button.h index 7c79247a0..3dcb0f896 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_button.h @@ -48,7 +48,7 @@ public: virtual void updateCoords(); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } // Display part virtual void draw(); diff --git a/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp b/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp index c79f4c1dc..b46c2014f 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_polygon.cpp @@ -50,7 +50,7 @@ void CCtrlPolygon::updateBoudingRect() sint32 ymin = INT_MAX; sint32 xmax = INT_MIN; sint32 ymax = INT_MIN; - uint numVerts = _Poly.Vertices.size(); + uint numVerts = (uint)_Poly.Vertices.size(); _XFormPoly.Vertices.resize(numVerts); for(uint k = 0; k < numVerts; ++k) { @@ -155,7 +155,7 @@ void CCtrlPolygon::draw() if (_Touched) { _RealTris.clear(); - uint numTris = _Tris.size(); + uint numTris = (uint)_Tris.size(); sint32 cornerX, cornerY; static std::vector winTris; winTris.resize(numTris); diff --git a/code/ryzom/client/src/interface_v3/ctrl_polygon.h b/code/ryzom/client/src/interface_v3/ctrl_polygon.h index 3e119ffdc..20b09ee0f 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_polygon.h +++ b/code/ryzom/client/src/interface_v3/ctrl_polygon.h @@ -42,7 +42,7 @@ class CCtrlPolygon : public CCtrlBase { public: CCtrlPolygon(); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } virtual void updateCoords(); virtual void draw(); /** Change the vertices. This is costly because concav / complex polys are split in a list of triangles diff --git a/code/ryzom/client/src/interface_v3/ctrl_quad.h b/code/ryzom/client/src/interface_v3/ctrl_quad.h index 1c2ab9ad9..0422f99af 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_quad.h +++ b/code/ryzom/client/src/interface_v3/ctrl_quad.h @@ -44,7 +44,7 @@ public: bool parse(xmlNodePtr cur,CInterfaceGroup *parentGroup); virtual void updateCoords(); virtual void draw(); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } // from CViewBase virtual sint32 getAlpha() const { return (sint32) _Color.A; } diff --git a/code/ryzom/client/src/interface_v3/ctrl_sheet_selection.cpp b/code/ryzom/client/src/interface_v3/ctrl_sheet_selection.cpp index 02c2e2ec1..7f7dee1d7 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_sheet_selection.cpp +++ b/code/ryzom/client/src/interface_v3/ctrl_sheet_selection.cpp @@ -45,8 +45,8 @@ sint CCtrlSheetSelection::addGroup(const std::string &name) return - 1; } _Groups.push_back(CSheetSelectionGroup(name)); - _GroupNameToIndex[name] = _Groups.size() - 1; - return _Groups.size() - 1; + _GroupNameToIndex[name] = (uint)_Groups.size() - 1; + return (sint)_Groups.size() - 1; } //============================================================= diff --git a/code/ryzom/client/src/interface_v3/ctrl_text_button.h b/code/ryzom/client/src/interface_v3/ctrl_text_button.h index 907f757d0..183ab3ab8 100644 --- a/code/ryzom/client/src/interface_v3/ctrl_text_button.h +++ b/code/ryzom/client/src/interface_v3/ctrl_text_button.h @@ -47,7 +47,7 @@ public: virtual void updateCoords(); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } // Display part virtual void draw(); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp index 66776eb6d..ec9622589 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_build_phrase.cpp @@ -322,7 +322,7 @@ void CDBGroupBuildPhrase::startComposition(const CSPhraseCom &phrase) // simulate a root selection validateRoot(rootBrick); // setup params of the root - numParam= rootBrick->ParameterFamilies.size(); + numParam= (uint)rootBrick->ParameterFamilies.size(); brickIndexForParam= 0; // For all brick not the root @@ -344,7 +344,7 @@ void CDBGroupBuildPhrase::startComposition(const CSPhraseCom &phrase) curParam++; // If this parameter has additonal parameter they follow if( brick && !brick->ParameterFamilies.empty() ) - numParam+= brick->ParameterFamilies.size(); + numParam+= (uint)brick->ParameterFamilies.size(); } // a mandatory/optional/credit? else @@ -363,7 +363,7 @@ void CDBGroupBuildPhrase::startComposition(const CSPhraseCom &phrase) curParam= 0; numParam= 0; if(brick) - numParam= brick->ParameterFamilies.size(); + numParam= (uint)brick->ParameterFamilies.size(); } } } @@ -1749,7 +1749,7 @@ void CDBGroupBuildPhrase::updateDisplayFromRootBrick() // else ok, setup the composition else { - _NumMandatories= brick->MandatoryFamilies.size(); + _NumMandatories= (uint32)brick->MandatoryFamilies.size(); // Don't enable any optional/credit by default _NumCredits= 0; _NumOptionals= 0; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h index 7afba81c8..62be81037 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_combo_box.h @@ -68,7 +68,7 @@ public: const ucstring &getText(uint i) const; const ucstring &getTexture(uint i) const; void removeText(uint i); - uint getNumTexts() const {return _Texts.size();} + uint getNumTexts() const {return (uint)_Texts.size();} // selection void setSelection(sint32 val); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp index 27c676674..75cca443b 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp @@ -297,7 +297,7 @@ void CDBGroupListSheet::updateCoords () uint numValidSheets; if (_Array) { - numValidSheets = _SheetChildren.size(); + numValidSheets = (uint)_SheetChildren.size(); } else { diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h index 5b488c0f3..bb1a346a3 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h @@ -59,7 +59,7 @@ public: // Get the index of a sheet inserted in this list. Returns -1 if it is not an index of that list virtual sint getIndexOf(const CDBCtrlSheet *sheet) const; // get number of sheets - virtual uint getNbSheet() const { return _SheetChildren.size(); } + virtual uint getNbSheet() const { return (uint)_SheetChildren.size(); } // get a sheet by its index virtual CDBCtrlSheet *getSheet(uint index) const; // Get the number of active elements diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_bonus_malus.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_bonus_malus.cpp index 75c525f41..af757d186 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_bonus_malus.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_bonus_malus.cpp @@ -91,7 +91,7 @@ void CDBGroupListSheetBonusMalus::draw () // sint32 drl= getRenderLayer()+1; // May draw disable bitmaps on the ctrl sheets if disabled. - uint numCtrls= min(_SheetChildren.size(), _DisableStates.size()); + uint numCtrls= (uint)min(_SheetChildren.size(), _DisableStates.size()); for(uint i=0;iCtrl; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h index 30e32383f..7f4f274a1 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h @@ -49,7 +49,7 @@ public: CDBGroupListSheetText(const TCtorParam ¶m); virtual ~CDBGroupListSheetText(); // AJM: make base class destructors virtual to avoid memory leaks! - virtual uint getNbSheet() const { return _SheetChildren.size(); } + virtual uint getNbSheet() const { return (uint)_SheetChildren.size(); } /// CInterfaceGroup Interface virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); diff --git a/code/ryzom/client/src/interface_v3/dbview_bar.h b/code/ryzom/client/src/interface_v3/dbview_bar.h index dd29fa58b..79d73fd78 100644 --- a/code/ryzom/client/src/interface_v3/dbview_bar.h +++ b/code/ryzom/client/src/interface_v3/dbview_bar.h @@ -50,7 +50,7 @@ public: void setType (TViewBar vb); bool parse(xmlNodePtr cur,CInterfaceGroup * parentGroup); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } virtual void updateCoords (); virtual void draw (); diff --git a/code/ryzom/client/src/interface_v3/dbview_bar3.h b/code/ryzom/client/src/interface_v3/dbview_bar3.h index 05db4c028..751b93a1b 100644 --- a/code/ryzom/client/src/interface_v3/dbview_bar3.h +++ b/code/ryzom/client/src/interface_v3/dbview_bar3.h @@ -36,7 +36,7 @@ public: CDBViewBar3(const TCtorParam ¶m); bool parse(xmlNodePtr cur,CInterfaceGroup * parentGroup); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } virtual void updateCoords (); void setMini (bool mini); diff --git a/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp b/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp index 94cd842d5..13e830154 100644 --- a/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp +++ b/code/ryzom/client/src/interface_v3/encyclopedia_manager.cpp @@ -132,7 +132,7 @@ void CEncyclopediaManager::updateAlbum(const CEncyMsgAlbum &a) CEncyMsgAlbum *pA = getAlbum(a.Name); if (pA == NULL) { - uint32 nBack = _Albums.size(); + uint32 nBack = (uint32)_Albums.size(); _Albums.push_back(CEncyMsgAlbum()); pA = &_Albums[nBack]; } @@ -152,7 +152,7 @@ void CEncyclopediaManager::updateThema(uint32 nAlbumName, const CEncyMsgThema &t // Thema not found add it ! if (pT == NULL) { - uint32 nBack = pA->Themas.size(); + uint32 nBack = (uint32)pA->Themas.size(); pA->Themas.push_back(CEncyMsgThema()); pT = &pA->Themas[nBack]; diff --git a/code/ryzom/client/src/interface_v3/group_compas.cpp b/code/ryzom/client/src/interface_v3/group_compas.cpp index 78a529013..e642fa456 100644 --- a/code/ryzom/client/src/interface_v3/group_compas.cpp +++ b/code/ryzom/client/src/interface_v3/group_compas.cpp @@ -887,7 +887,7 @@ void CGroupCompasMenu::setActive (bool state) // and add each entry const std::vector & entries = CCompassDialogsManager::getInstance().getEntries(); - const uint size = entries.size(); + const uint size = (uint)entries.size(); for( uint i = 0; i < size; ++i) { CCompassTarget ct; @@ -993,7 +993,7 @@ class CCompassDialogsStringCallback : public IStringWaitCallback { virtual void onDynStringAvailable(uint /* stringId */, const ucstring &value) { - uint size = CCompassDialogsManager::getInstance()._Entries.size(); + uint size = (uint)CCompassDialogsManager::getInstance()._Entries.size(); for ( uint i = 0; i < size; i++) { ucstring name; diff --git a/code/ryzom/client/src/interface_v3/group_editbox.cpp b/code/ryzom/client/src/interface_v3/group_editbox.cpp index 59f13948c..58be769c9 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.cpp +++ b/code/ryzom/client/src/interface_v3/group_editbox.cpp @@ -208,7 +208,7 @@ bool CGroupEditBox::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) prop = (char*) xmlGetProp( cur, (xmlChar*)"negative_filter" ); if (prop) { - uint length = strlen(prop); + uint length = (uint)strlen(prop); _NegativeFilter.resize(length); std::copy((const char *) prop, (const char *) prop + length, _NegativeFilter.begin()); } @@ -254,8 +254,8 @@ void CGroupEditBox::draw () sint32 blankTextId= rVR.getBlankTextureId(); CRGBA col= _BackSelectColor; col.A= pIM->getGlobalColorForContent().A; - sint32 minPos= min(_CursorPos, _SelectCursorPos) + _Prompt.length(); - sint32 maxPos= max(_CursorPos, _SelectCursorPos) + _Prompt.length(); + sint32 minPos= min(_CursorPos, _SelectCursorPos) + (sint32)_Prompt.length(); + sint32 maxPos= max(_CursorPos, _SelectCursorPos) + (sint32)_Prompt.length(); // get its position on screen sint cxMinPos, cyMinPos; @@ -311,7 +311,7 @@ void CGroupEditBox::draw () // get its position on screen sint cx, cy; sint height; - _ViewText->getCharacterPositionFromIndex(_CursorPos + _Prompt.length(), _CursorAtPreviousLineEnd, cx, cy, height); + _ViewText->getCharacterPositionFromIndex(_CursorPos + (sint)_Prompt.length(), _CursorAtPreviousLineEnd, cx, cy, height); // display the cursor // get the texture for the cursor if (_CursorTexID == -1) @@ -394,7 +394,7 @@ void CGroupEditBox::paste() else sString = (const char*)hLock; - sint length = sString.length(); + sint length = (sint)sString.length(); ucstring toAppend; // filter character depending on the netry type @@ -524,14 +524,14 @@ void CGroupEditBox::paste() } } } - length = toAppend.size(); + length = (sint)toAppend.size(); if ((uint) (_InputString.length() + length) > _MaxNumChar) { - length = _MaxNumChar - _InputString.length(); + length = _MaxNumChar - (sint)_InputString.length(); } ucstring toAdd = toAppend.substr(0, length); _InputString = _InputString.substr(0, _CursorPos) + toAdd + _InputString.substr(_CursorPos); - _CursorPos += toAdd.length(); + _CursorPos += (sint32)toAdd.length(); GlobalUnlock (hObj); nlinfo ("Chat input was pasted from the clipboard"); } @@ -712,7 +712,7 @@ bool CGroupEditBox::undo() setInputString(_StartInputString); _CanUndo = false; _CanRedo = true; - setCursorPos(_InputString.length()); + setCursorPos((sint32)_InputString.length()); setSelectionAll(); return true; } @@ -726,7 +726,7 @@ bool CGroupEditBox::redo() setInputString(_ModifiedInputString); _CanUndo = true; _CanRedo = false; - setCursorPos(_InputString.length()); + setCursorPos((sint32)_InputString.length()); setSelectionAll(); return true; } @@ -769,7 +769,7 @@ bool CGroupEditBox::expand() // then back to ucstring _InputString.fromUtf8(command); _InputString = '/' + _InputString; - _CursorPos = _InputString.length(); + _CursorPos = (sint32)_InputString.length(); _CursorAtPreviousLineEnd = false; triggerOnChangeAH(); return true; @@ -895,7 +895,7 @@ bool CGroupEditBox::handleEvent (const CEventDescriptor& event) _ViewText->getCharacterIndexFromPosition(eventDesc.getX() - _ViewText->getXReal(), eventDesc.getY() - _ViewText->getYReal(), newCurPos, cursorAtPreviousLineEnd); _CursorAtPreviousLineEnd = cursorAtPreviousLineEnd; _CursorPos = newCurPos; - _CursorPos -= _Prompt.length(); + _CursorPos -= (sint32)_Prompt.length(); _CursorPos = std::max(_CursorPos, sint32(0)); return true; @@ -990,7 +990,7 @@ void CGroupEditBox::updateCoords() // Check if cursor visible sint xCursVT, xCurs, yTmp, hTmp; // Get the cursor pos from the BL of the viewtext - _ViewText->getCharacterPositionFromIndex(_CursorPos+_Prompt.size(), false, xCursVT, yTmp, hTmp); + _ViewText->getCharacterPositionFromIndex(_CursorPos+(sint)_Prompt.size(), false, xCursVT, yTmp, hTmp); // Get the cursor pos from the BL of the edit box xCurs = xCursVT - (_XReal - _ViewText->getXReal()); // If the cursor is outside the edit box move the view text to show the cursor @@ -1098,7 +1098,7 @@ void CGroupEditBox::setInputString(const ucstring &str) _InputString = str; if (_CursorPos > (sint32) str.length()) { - _CursorPos = str.length(); + _CursorPos = (sint32)str.length(); _CursorAtPreviousLineEnd = false; } if (!_ViewText) return; @@ -1192,7 +1192,7 @@ void CGroupEditBox::setSelectionAll() { _CurrSelection = this; _SelectCursorPos= 0; - _CursorPos= _InputString.size(); + _CursorPos= (sint32)_InputString.size(); _CursorAtPreviousLineEnd = false; } } @@ -1254,7 +1254,7 @@ void CGroupEditBox::setCommand(const ucstring &command, bool execute) else { CInterfaceManager::getInstance()->setCaptureKeyboard (this); - _CursorPos = _InputString.length(); + _CursorPos = (sint32)_InputString.length(); } } @@ -1392,8 +1392,8 @@ void CGroupEditBox::setFocusOnText() pIM->setCaptureKeyboard (this); _CurrSelection = this; - _SelectCursorPos= _InputString.size(); - _CursorPos= _InputString.size(); + _SelectCursorPos= (sint32)_InputString.size(); + _CursorPos= (sint32)_InputString.size(); _CursorAtPreviousLineEnd = false; } diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index eab3aff0e..ba53686f2 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -65,7 +65,7 @@ extern CActionsContext ActionsContext; string CGroupHTML::localImageName(const string &url) { string dest = "cache/"; - dest += getMD5((uint8 *)url.c_str(), url.size()).toString(); + dest += getMD5((uint8 *)url.c_str(), (uint32)url.size()).toString(); dest += ".cache"; return dest; } @@ -358,7 +358,7 @@ void CGroupHTML::addText (const char * buf, int len) // Build the final unicode string ucstring tmp; tmp.reserve(len); - uint ucLen = inputUCString.size(); + uint ucLen = (uint)inputUCString.size(); //uint ucLenWithoutSpace = 0; for (uint i=0; i ("enter_recover_focus", "false")); templateParams.push_back (std::pair ("max_num_chars", "1024")); CInterfaceGroup *textArea = im->createGroupInstance (templateName.c_str(), - getParagraph()->getId(), templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + getParagraph()->getId(), templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); // Group created ? if (textArea) @@ -2221,7 +2221,7 @@ CDBGroupComboBox *CGroupHTML::addComboBox(const std::string &templateName, const std::vector > templateParams; templateParams.push_back (std::pair ("id", name)); CInterfaceGroup *group = im->createGroupInstance (templateName.c_str(), - getParagraph()->getId(), templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + getParagraph()->getId(), templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); // Group created ? if (group) diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index 6ee39b114..6b596d694 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -58,7 +58,7 @@ static string getWebAuthKey() UserEntity->getDisplayName().toString() + toString(cid) + NetMngr.getLoginCookie().toString(); - string key = getMD5((const uint8*)rawKey.c_str(), rawKey.size()).toString(); + string key = getMD5((const uint8*)rawKey.c_str(), (uint32)rawKey.size()).toString(); //nlinfo("rawkey = '%s'", rawKey.c_str()); //nlinfo("authkey = %s", key.c_str()); return key; diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp index 261b57ece..4da5550ad 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_user_info.cpp @@ -686,7 +686,7 @@ class CHandlerResetCharacterInScene : public IActionHandler bool pvpOnly= nlstricmp(sParams,"pvponly")==0; // Reset all entities uint i; - uint numEntity = EntitiesMngr.entities().size(); + uint numEntity = (uint)EntitiesMngr.entities().size(); for (i=0; i > templateParams; templateParams.push_back (std::pair("id", id)); groupInfo = CInterfaceManager::getInstance()->createGroupInstance ( templateName, - "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); } CGroupInSceneUserInfo *info = dynamic_cast(groupInfo); diff --git a/code/ryzom/client/src/interface_v3/group_list.cpp b/code/ryzom/client/src/interface_v3/group_list.cpp index 43e6df6c7..ae6f2e673 100644 --- a/code/ryzom/client/src/interface_v3/group_list.cpp +++ b/code/ryzom/client/src/interface_v3/group_list.cpp @@ -76,10 +76,10 @@ void CGroupList::addChild (CViewBase* child, bool deleteOnRemove) } // add child at last index - addChildAtIndex(child, _Elements.size(), deleteOnRemove); + addChildAtIndex(child, (uint)_Elements.size(), deleteOnRemove); if (_Elements.size() >= 2) { - setOrder(_Elements.size() - 1, getOrder(_Elements.size() - 2) + 1); + setOrder((uint)_Elements.size() - 1, getOrder((uint)_Elements.size() - 2) + 1); } } diff --git a/code/ryzom/client/src/interface_v3/group_list.h b/code/ryzom/client/src/interface_v3/group_list.h index af49496fc..9f17caf53 100644 --- a/code/ryzom/client/src/interface_v3/group_list.h +++ b/code/ryzom/client/src/interface_v3/group_list.h @@ -86,7 +86,7 @@ public: void removeHead(); // Get the number of children - uint getNumChildren() const { return _Elements.size(); } + uint getNumChildren() const { return (uint)_Elements.size(); } // Get the number of active children uint getNumActiveChildren() const; @@ -132,7 +132,7 @@ public: virtual CInterfaceElement* getElement (const std::string &id) { return CInterfaceGroup::getElement (id); } - sint32 getNbElement() { return _Elements.size(); } + sint32 getNbElement() { return (sint32)_Elements.size(); } sint32 getSpace() { return _Space; } void setDynamicDisplaySize (bool dds) { _DynamicDisplaySize = dds; } diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 98d946663..c1f1ccf3f 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -1175,7 +1175,7 @@ void CGroupMap::checkCoords() uint i; if (_RespawnPos.size() < _RespawnLM.size()) { - for (i = _RespawnPos.size(); i < _RespawnLM.size(); i++) + for (i = (uint)_RespawnPos.size(); i < _RespawnLM.size(); i++) { delCtrl(_RespawnLM[i]); _RespawnLM[i] = NULL; @@ -2245,7 +2245,7 @@ void CGroupMap::setScale(float newScale) //============================================================================================================ void CGroupMap::updateLandMarkList(TLandMarkButtonVect &lmVect) { - uint numLM = lmVect.size(); + uint numLM = (uint)lmVect.size(); for(uint k = 0; k < numLM; ++k) { CLandMarkButton *lmb = lmVect[k]; @@ -2259,7 +2259,7 @@ void CGroupMap::updateLandMarkList(TLandMarkButtonVect &lmVect) //============================================================================================================ void CGroupMap::updateLandMarkTextList(TLandMarkTextVect &lmVect) { - uint numLM = lmVect.size(); + uint numLM = (uint)lmVect.size(); for(uint k = 0; k < numLM; ++k) { CLandMarkText *lmt = lmVect[k]; @@ -2276,7 +2276,7 @@ void CGroupMap::updateLandMarkTextList(TLandMarkTextVect &lmVect) //============================================================================================================ void CGroupMap::removeLandMarks(TLandMarkButtonVect &lm) { - uint numLM = lm.size(); + uint numLM = (uint)lm.size(); for(uint k = 0; k < numLM; ++k) { if (lm[k]) @@ -2491,7 +2491,7 @@ CCtrlButton *CGroupMap::addUserLandMark(const NLMISC::CVector2f &pos, const ucst _CurContinent->UserLandMarks.push_back(ulm); // add a landmark with a menu to remove it - addLandMark(_UserLM, pos, title, getUserLandMarkOptions(_CurContinent->UserLandMarks.size() - 1)); + addLandMark(_UserLM, pos, title, getUserLandMarkOptions((uint32)_CurContinent->UserLandMarks.size() - 1)); // Save the config file each time a user landmark is created CInterfaceManager *pIM = CInterfaceManager::getInstance(); @@ -2571,7 +2571,7 @@ void CGroupMap::removeExceedingUserLandMarks(uint maxNumber) uint CGroupMap::getNumUserLandMarks() const { if (_CurContinent == NULL) return 0; - return _CurContinent->UserLandMarks.size(); + return (uint)_CurContinent->UserLandMarks.size(); } //============================================================================================================ CLandMarkOptions CGroupMap::getUserLandMarkOptions(uint32 lmindex) const diff --git a/code/ryzom/client/src/interface_v3/group_menu.cpp b/code/ryzom/client/src/interface_v3/group_menu.cpp index 7b991090c..41e150184 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.cpp +++ b/code/ryzom/client/src/interface_v3/group_menu.cpp @@ -342,7 +342,7 @@ bool CGroupSubMenu::parse (xmlNodePtr cur, CInterfaceGroup *parent) string completeId = _Parent->getId() + ":" + _Lines[_Lines.size()-1].Id; CInterfaceGroup *pUGLeft = im->createGroupInstance((const char*)usergroup, completeId, vparams); if (pUGLeft) - setUserGroupLeft(_Lines.size()-1, pUGLeft, true); + setUserGroupLeft((uint)_Lines.size()-1, pUGLeft, true); } usergroup = (char*) xmlGetProp (cur, (xmlChar*)"usergroup_r"); if (usergroup) @@ -357,7 +357,7 @@ bool CGroupSubMenu::parse (xmlNodePtr cur, CInterfaceGroup *parent) string completeId = _Parent->getId() + ":" + _Lines[_Lines.size()-1].Id; CInterfaceGroup *pUG = im->createGroupInstance((const char*)usergroup, completeId, vparams); if (pUG) - setUserGroupRight(_Lines.size()-1, pUG, true); + setUserGroupRight((uint)_Lines.size()-1, pUG, true); } } cur = cur->next; @@ -1123,7 +1123,7 @@ CInterfaceElement* CGroupSubMenu::getElement (const std::string &id) // ------------------------------------------------------------------------------------------------ void CGroupSubMenu::addSeparator(const std::string &id) { - addSeparatorAtIndex(_Lines.size(), id); + addSeparatorAtIndex((uint)_Lines.size(), id); } // ------------------------------------------------------------------------------------------------ @@ -1377,7 +1377,7 @@ void CGroupSubMenu::hideSubMenus () // ------------------------------------------------------------------------------------------------ void CGroupSubMenu::reset() { - uint lineCount = _Lines.size(); + uint lineCount = (uint)_Lines.size(); for(sint k = lineCount - 1; k >= 0; --k) { removeLine(k); @@ -1516,7 +1516,7 @@ void CGroupSubMenu::setUserGroupLeft(uint line, CInterfaceGroup *group, bool own CGroupSubMenu *CGroupSubMenu::cloneMenu(CGroupSubMenu *appendToMenu, CGroupMenu *newFather, CInterfaceGroup *initGroup /* = NULL */) const { CGroupSubMenu *copyMenu = appendToMenu ? appendToMenu : new CGroupSubMenu(CViewText::TCtorParam()); - uint startSize = copyMenu->_Lines.size(); + uint startSize = (uint)copyMenu->_Lines.size(); copyMenu->_GroupMenu = newFather; copyMenu->initOptions(initGroup); copyMenu->_Lines.reserve(_Lines.size() + startSize); diff --git a/code/ryzom/client/src/interface_v3/group_menu.h b/code/ryzom/client/src/interface_v3/group_menu.h index 6fb23f39a..ff0985ec1 100644 --- a/code/ryzom/client/src/interface_v3/group_menu.h +++ b/code/ryzom/client/src/interface_v3/group_menu.h @@ -128,7 +128,7 @@ public: void addSeparatorAtIndex(uint index, const std::string &id = ""); - uint getNumLine() const { return _Lines.size(); } + uint getNumLine() const { return (uint)_Lines.size(); } void removeLine(uint index); const std::string getActionHandler(uint lineIndex) const; const std::string getActionHandlerParam(uint lineIndex) const; @@ -157,7 +157,7 @@ public: void removeAllUserGroups(); - uint getNumLines() const { return _Lines.size(); } + uint getNumLines() const { return (uint)_Lines.size(); } // return pointer to submenu or NULL if there's none CGroupSubMenu *getSubMenu(uint index) const; diff --git a/code/ryzom/client/src/interface_v3/group_paragraph.cpp b/code/ryzom/client/src/interface_v3/group_paragraph.cpp index 04bdc4033..aad604d24 100644 --- a/code/ryzom/client/src/interface_v3/group_paragraph.cpp +++ b/code/ryzom/client/src/interface_v3/group_paragraph.cpp @@ -71,10 +71,10 @@ void CGroupParagraph::addChild (CViewBase* child, bool deleteOnRemove) } // add child at last index - addChildAtIndex(child, _Elements.size(), deleteOnRemove); + addChildAtIndex(child, (uint)_Elements.size(), deleteOnRemove); if (_Elements.size() >= 2) { - setOrder(_Elements.size() - 1, getOrder(_Elements.size() - 2) + 1); + setOrder((uint)_Elements.size() - 1, getOrder((uint)_Elements.size() - 2) + 1); } invalidateContent(); } @@ -487,7 +487,7 @@ void CGroupParagraph::updateCoords() // For each elements, place them uint firstElementOnLine = 0; - const uint elmCount = _Elements.size(); + const uint elmCount = (uint)_Elements.size(); uint i; for (i = 0; i < elmCount+1; ++i) { diff --git a/code/ryzom/client/src/interface_v3/group_paragraph.h b/code/ryzom/client/src/interface_v3/group_paragraph.h index 980a6fd9d..be82c28a6 100644 --- a/code/ryzom/client/src/interface_v3/group_paragraph.h +++ b/code/ryzom/client/src/interface_v3/group_paragraph.h @@ -102,7 +102,7 @@ public: // void removeHead(); // Get the number of children - uint getNumChildren() const { return _Elements.size(); } + uint getNumChildren() const { return (uint)_Elements.size(); } // Get the number of active children uint getNumActiveChildren() const; @@ -150,7 +150,7 @@ public: virtual CInterfaceElement* getElement (const std::string &id) { return CInterfaceGroup::getElement (id); } - sint32 getNbElement() { return _Elements.size(); } + sint32 getNbElement() { return (sint32)_Elements.size(); } sint32 getSpace() { return _Space; } void forceSizeW (sint32 newSizeW); diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 0080e54ef..9df6c343e 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -246,7 +246,7 @@ void CGroupQuickHelp::beginElement (uint element_number, const BOOL *present, co // Extract the string step.EventToComplete.insert (events.substr (first, last-first)); - first = last+1; + first = (uint)last+1; } } } diff --git a/code/ryzom/client/src/interface_v3/group_table.cpp b/code/ryzom/client/src/interface_v3/group_table.cpp index 7561f6cd6..2f4b018c1 100644 --- a/code/ryzom/client/src/interface_v3/group_table.cpp +++ b/code/ryzom/client/src/interface_v3/group_table.cpp @@ -403,7 +403,7 @@ void CGroupTable::updateCoords() } // Width of cells and table borders - sint32 borderWidth = 2*Border + (_Columns.size()+1) * CellSpacing + (_Columns.size()*2) * CellPadding; + sint32 borderWidth = 2*Border + ((sint32)_Columns.size()+1) * CellSpacing + ((sint32)_Columns.size()*2) * CellPadding; // Get the width sint32 tableWidthMax = ForceWidthMin?ForceWidthMin:_LastParentW; // getWReal(); @@ -786,7 +786,7 @@ sint32 CGroupTable::getMaxUsedW() const for (i=0; i= 0; -- sonIndex) + for (sint sonIndex = (sint)Children.size() - 1; sonIndex >= 0; -- sonIndex) { if (Children[sonIndex]->Show) { @@ -82,7 +82,7 @@ CGroupTree::SNode::~SNode() { makeOrphan(); // IMPORTANT : must delete in reverse order because "makeOrphan" is called when deleting sons, thus changing vector size... - for (sint i = Children.size() - 1; i >= 0; --i) + for (sint i = (sint)Children.size() - 1; i >= 0; --i) delete Children[i]; Children.clear(); // TestYoyo @@ -667,7 +667,7 @@ void CGroupTree::draw() col.A = (uint8)(((sint32)col.A*((sint32)pIM->getGlobalColorForContent().A+1))>>8); } - drawSelection( getHrcIconXEnd(_Lines[_OverLine].Depth + _Lines[_OverLine].getNumAdditionnalBitmap()), (_Lines.size()-_OverLine-1)*_BmpH, + drawSelection( getHrcIconXEnd(_Lines[_OverLine].Depth + _Lines[_OverLine].getNumAdditionnalBitmap()), ((sint)_Lines.size()-_OverLine-1)*_BmpH, _WReal-getHrcIconXEnd(_Lines[_OverLine].Depth + _Lines[_OverLine].getNumAdditionnalBitmap()), col); } // Draw extended over @@ -703,7 +703,7 @@ void CGroupTree::draw() col.A = (uint8)(((sint32)col.A*((sint32)pIM->getGlobalColorForContent().A+1))>>8); } - drawSelection( getHrcIconXEnd(_Lines[_SelectedLine].Depth + _Lines[_SelectedLine].getNumAdditionnalBitmap()), (_Lines.size()-_SelectedLine-1)*_BmpH, + drawSelection( getHrcIconXEnd(_Lines[_SelectedLine].Depth + _Lines[_SelectedLine].getNumAdditionnalBitmap()), ((sint)_Lines.size()-_SelectedLine-1)*_BmpH, _WReal-getHrcIconXEnd(_Lines[_SelectedLine].Depth + _Lines[_SelectedLine].getNumAdditionnalBitmap()), col ); } @@ -913,7 +913,7 @@ void CGroupTree::rebuild() addTextLine (0, _RootNode); // Reformating - sint32 sizeH = _Lines.size()*_BmpH; + sint32 sizeH = (sint32)_Lines.size()*_BmpH; for (uint i = 0; i < _Lines.size(); ++i) _Lines[i].TextOrTemplate->setY (_Lines[i].Node->YDecal + sizeH - ((1+_Lines[i].TextOrTemplate->getY())*_BmpH)); // Add the hierarchy bitmaps @@ -1013,7 +1013,7 @@ void CGroupTree::addTextLine (uint8 nDepth, CGroupTree::SNode *pNode) line.TextOrTemplate->setParent (this); line.TextOrTemplate->setParentPos (NULL); line.TextOrTemplate->setX (getHrcIconXEnd(nDepth-1 + line.getNumAdditionnalBitmap())); - line.TextOrTemplate->setY (_Lines.size()); + line.TextOrTemplate->setY ((sint32)_Lines.size()); line.TextOrTemplate->setModulateGlobalColor(this->getModulateGlobalColor()); if (pNode->DisplayText) addView (line.TextOrTemplate); @@ -1099,7 +1099,7 @@ void CGroupTree::addHierarchyBitmaps () // A Bitmap must be created CViewBitmap *pVB = createViewBitmap(nLine, "t", "blank.tga"); pVB->setX (getHrcIconXStart(nLayer)); - pVB->setY (_Lines.size()*_BmpH - ((1+nLine)*_BmpH)); + pVB->setY ((sint32)_Lines.size()*_BmpH - ((1+nLine)*_BmpH)); bool bAddBitmap = true; bool bAddXExtendBitmap = false; @@ -1225,7 +1225,7 @@ void CGroupTree::addHierarchyBitmaps () { CViewBitmap *pVB = createViewBitmap(nLine, "ext_t", _ArboXExtend); pVB->setX (getHrcIconXStart(nLayer) - _XExtend); - pVB->setY (_Lines.size()*_BmpH - ((1+nLine)*_BmpH)); + pVB->setY ((sint32)_Lines.size()*_BmpH - ((1+nLine)*_BmpH)); addView (pVB); _Lines[nLine].Bmps.push_back(pVB); } @@ -1243,7 +1243,7 @@ void CGroupTree::addHierarchyBitmaps () { CViewBitmap *pVB = createViewBitmap(nLine, "custom_bm", _Lines[nLine].Node->Bitmap); pVB->setX (getHrcIconXStart(_Lines[nLine].Depth + 1)); - pVB->setY (_Lines.size()*_BmpH - ((1+nLine)*_BmpH)); + pVB->setY ((sint32)_Lines.size()*_BmpH - ((1+nLine)*_BmpH)); _Lines[nLine].Bmps.push_back(pVB); addView (pVB); } diff --git a/code/ryzom/client/src/interface_v3/interface_3d_scene.h b/code/ryzom/client/src/interface_v3/interface_3d_scene.h index d65c4672c..7c0e94854 100644 --- a/code/ryzom/client/src/interface_v3/interface_3d_scene.h +++ b/code/ryzom/client/src/interface_v3/interface_3d_scene.h @@ -93,7 +93,7 @@ public: void remove(NL3D::UInstanceGroup *pIG); - uint getCharacter3DCount() const { return _Characters.size(); } + uint getCharacter3DCount() const { return (uint)_Characters.size(); } CInterface3DCharacter *getCharacter3D(uint index); CInterface3DCamera *getCamera(uint index); diff --git a/code/ryzom/client/src/interface_v3/interface_element.cpp b/code/ryzom/client/src/interface_v3/interface_element.cpp index 6509a2bfc..f937a34e9 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.cpp +++ b/code/ryzom/client/src/interface_v3/interface_element.cpp @@ -1232,7 +1232,7 @@ CInterfaceElement *CInterfaceElement::clone() std::copy(dupStream.buffer(), dupStream.buffer() + dupStream.length(), datas.begin()); dupStream.resetPtrTable(); dupStream.invert(); - dupStream.fill(&datas[0], datas.size()); + dupStream.fill(&datas[0], (uint32)datas.size()); dupStream.serialPolyPtr(begunThisCloneWarHas); } catch(NLMISC::EStream &) diff --git a/code/ryzom/client/src/interface_v3/interface_element.h b/code/ryzom/client/src/interface_v3/interface_element.h index 1fe91c383..86d61afd0 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.h +++ b/code/ryzom/client/src/interface_v3/interface_element.h @@ -173,7 +173,7 @@ public: virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); /// Debug info on memory - virtual uint32 getMemory () { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory () { return (uint32)(sizeof(*this)+_Id.size()); } /// helper: display a parse error with the id of the lement void parseError (CInterfaceGroup *parentGroup, const char *reason = NULL); diff --git a/code/ryzom/client/src/interface_v3/interface_expr_node.cpp b/code/ryzom/client/src/interface_v3/interface_expr_node.cpp index 53324a839..bb38767ef 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr_node.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr_node.cpp @@ -41,7 +41,7 @@ void CInterfaceExprNodeValue::getDepends(std::vector &/* nodes */) void CInterfaceExprNodeValueFnCall::eval(CInterfaceExprValue &result) { nlassert(Func); - uint numParams = Params.size(); + uint numParams = (uint)Params.size(); std::vector params(numParams); for(uint k = 0; k < numParams; ++k) { @@ -53,7 +53,7 @@ void CInterfaceExprNodeValueFnCall::eval(CInterfaceExprValue &result) void CInterfaceExprNodeValueFnCall::evalWithDepends(CInterfaceExprValue &result, std::vector &nodes) { nlassert(Func); - uint numParams = Params.size(); + uint numParams = (uint)Params.size(); std::vector params(numParams); for(uint k = 0; k < numParams; ++k) { @@ -64,7 +64,7 @@ void CInterfaceExprNodeValueFnCall::evalWithDepends(CInterfaceExprValue &result, void CInterfaceExprNodeValueFnCall::getDepends(std::vector &nodes) { - uint numParams = Params.size(); + uint numParams = (uint)Params.size(); for(uint k = 0; k < numParams; ++k) { Params[k]->getDepends(nodes); diff --git a/code/ryzom/client/src/interface_v3/interface_expr_user_fct.cpp b/code/ryzom/client/src/interface_v3/interface_expr_user_fct.cpp index 7e8f9a45f..691576511 100644 --- a/code/ryzom/client/src/interface_v3/interface_expr_user_fct.cpp +++ b/code/ryzom/client/src/interface_v3/interface_expr_user_fct.cpp @@ -430,7 +430,7 @@ static DECLARE_INTERFACE_USER_FCT(userFctSwitch) return false; sint64 n = args[0].getInteger(); - if ((n > (args.size()-2)) || (n < 0)) + if ((n > ((sint64)args.size()-2)) || (n < 0)) return false; result = args[(uint)n+1]; diff --git a/code/ryzom/client/src/interface_v3/interface_group.cpp b/code/ryzom/client/src/interface_v3/interface_group.cpp index 5e88391c0..91022dedb 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.cpp +++ b/code/ryzom/client/src/interface_v3/interface_group.cpp @@ -724,7 +724,7 @@ bool CInterfaceGroup::handleEvent (const CEventDescriptor &event) return true; // For each child group - for (sint i = _ChildrenGroups.size()-1; i >= 0; --i) + for (sint i = (sint)_ChildrenGroups.size()-1; i >= 0; --i) { CInterfaceGroup *pIG = _ChildrenGroups[i]; if (pIG->getActive()) diff --git a/code/ryzom/client/src/interface_v3/interface_group.h b/code/ryzom/client/src/interface_v3/interface_group.h index fa3406b9f..5079c1899 100644 --- a/code/ryzom/client/src/interface_v3/interface_group.h +++ b/code/ryzom/client/src/interface_v3/interface_group.h @@ -69,7 +69,7 @@ public: bool delElement (const std::string &id, bool noWarning=false); bool delElement (CInterfaceElement *pIE, bool noWarning=false); - uint getNumGroup() const { return _ChildrenGroups.size(); } + uint getNumGroup() const { return (uint)_ChildrenGroups.size(); } CInterfaceGroup *getGroup(uint index) const; sint32 getMaxUsedW() const; diff --git a/code/ryzom/client/src/interface_v3/interface_link.h b/code/ryzom/client/src/interface_v3/interface_link.h index d50797b81..5b7e6d9fb 100644 --- a/code/ryzom/client/src/interface_v3/interface_link.h +++ b/code/ryzom/client/src/interface_v3/interface_link.h @@ -89,7 +89,7 @@ public: */ void removeTarget(CInterfaceElement *elem); // Get the number of targets of this link - uint getNumTargets() const { return _Targets.size(); } + uint getNumTargets() const { return (uint)_Targets.size(); } // Get the i-th target CInterfaceElement *getTarget(uint index) const { return _Targets[index]._InterfaceElement; } diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 8507490b2..4fdc00375 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -2814,7 +2814,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event) { // Take the top most control. uint nMaxDepth = 0; - for (sint32 i = _CtrlsUnderPointer.size()-1; i >= 0; i--) + for (sint32 i = (sint32)_CtrlsUnderPointer.size()-1; i >= 0; i--) { CCtrlBase *ctrl= _CtrlsUnderPointer[i]; if (ctrl && ctrl->isCapturable() && isControlInWindow(ctrl, pNewCurrentWnd)) @@ -2863,7 +2863,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event) // Take the top most control. { uint nMaxDepth = 0; - for (sint32 i = _CtrlsUnderPointer.size()-1; i >= 0; i--) + for (sint32 i = (sint32)_CtrlsUnderPointer.size()-1; i >= 0; i--) { CCtrlBase *ctrl= _CtrlsUnderPointer[i]; if (ctrl && ctrl->isCapturable() && isControlInWindow(ctrl, pNewCurrentWnd)) @@ -3956,7 +3956,7 @@ uint CInterfaceManager::getProcedureNumActions(const std::string &procName) cons if(it!=_ProcedureMap.end()) { const CProcedure &proc= it->second; - return proc.Actions.size(); + return (uint)proc.Actions.size(); } else return 0; diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index 16cd02f1a..6aa2d4143 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -487,7 +487,7 @@ static void interfaceScriptAsMemStream(const std::string &script, CMemStream &de } destStream.seek(0, NLMISC::IStream::begin); if (script.empty()) return; - destStream.serialBuffer(const_cast((const uint8 *) &script[0]), script.size()); + destStream.serialBuffer(const_cast((const uint8 *) &script[0]), (uint)script.size()); destStream.invert(); destStream.seek(0, NLMISC::IStream::begin); } @@ -701,7 +701,7 @@ bool CInterfaceParser::parseXMLDocument(xmlNodePtr root, bool reload) // Resize action category array uint actionCategoryCount = CIXml::countChildren(curNode, "action_category"); - Actions.reserveCategories(Actions.getCategories ().size()+actionCategoryCount); + Actions.reserveCategories((uint)Actions.getCategories ().size()+actionCategoryCount); EditActions.reserveCategories(1); while (curNode) @@ -2625,7 +2625,7 @@ bool CInterfaceParser::solveDefine(const std::string &propVal, std::string &n curPos++; // get the id pos - uint startIdPos= curPos; + uint startIdPos= (uint)curPos; while( curPos='0' && in[curPos]<='9') { curPos++; @@ -2772,7 +2772,7 @@ void CInterfaceParser::CAction::buildBlocks (const std::string &in, std::vector // There is some digit it is an argument // copy the last not param sub string. - sint nbToCopy = curPos-countNbIdent-countNbDigit-lastPos; + sint nbToCopy = (sint)(curPos-countNbIdent-countNbDigit-lastPos); if (nbToCopy > 0) lastString += in.substr(lastPos, nbToCopy); diff --git a/code/ryzom/client/src/interface_v3/interface_parser.h b/code/ryzom/client/src/interface_v3/interface_parser.h index c0811c273..449a8f60d 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.h +++ b/code/ryzom/client/src/interface_v3/interface_parser.h @@ -244,7 +244,7 @@ public: CInterfaceGroup *createGroupInstance(const std::string &templateName, const std::string &parentID, std::vector > &templateParams, bool updateLinks = true) { if (templateParams.size() > 0) - return createGroupInstance(templateName, parentID, &templateParams[0], templateParams.size(), updateLinks); + return createGroupInstance(templateName, parentID, &templateParams[0], (uint)templateParams.size(), updateLinks); else return createGroupInstance(templateName, parentID, NULL, 0, updateLinks); } @@ -258,7 +258,7 @@ public: CInterfaceElement *createUIElement(const std::string &templateName, const std::string &parentID, std::vector > &templateParams, bool updateLinks = true) { if (templateParams.size() > 0) - return createUIElement(templateName, parentID, &templateParams[0], templateParams.size(), updateLinks); + return createUIElement(templateName, parentID, &templateParams[0], (uint)templateParams.size(), updateLinks); else return createUIElement(templateName, parentID, NULL, 0, updateLinks); } diff --git a/code/ryzom/client/src/interface_v3/item_special_effect.cpp b/code/ryzom/client/src/interface_v3/item_special_effect.cpp index 75a89aaa5..4e2ed42ca 100644 --- a/code/ryzom/client/src/interface_v3/item_special_effect.cpp +++ b/code/ryzom/client/src/interface_v3/item_special_effect.cpp @@ -113,7 +113,7 @@ ucstring CItemSpecialEffectHelper::getEffect(const std::string &effect, bool &fi } // Check number of arguments - uint n = (effectMap[name]).size(); + uint n = (uint)(effectMap[name]).size(); if (params.size() != n) { nlinfo("Bad arguments for : %s", effect.c_str()); diff --git a/code/ryzom/client/src/interface_v3/libwww_nel_stream.cpp b/code/ryzom/client/src/interface_v3/libwww_nel_stream.cpp index 5327482a9..4667f4c17 100644 --- a/code/ryzom/client/src/interface_v3/libwww_nel_stream.cpp +++ b/code/ryzom/client/src/interface_v3/libwww_nel_stream.cpp @@ -434,7 +434,7 @@ PRIVATE int HTNeLReader_read (HTInputStream * me) /* Read the file desriptor */ while (fp) { - if ((me->b_read = nel_fread(me->data, FILE_BUFFER_SIZE, fp)) == 0) + if ((me->b_read = (int)nel_fread(me->data, FILE_BUFFER_SIZE, fp)) == 0) { HTAlertCallback *cbf = HTAlert_find(HT_PROG_DONE); // HTTRACE(PROT_TRACE, "ANSI read... Finished loading file %p\n" _ fp); @@ -509,7 +509,7 @@ PRIVATE int HTNeLReader_close (HTInputStream * me) PUBLIC int HTNeLReader_consumed (HTInputStream * me, size_t bytes) { me->write += bytes; - me->b_read -= bytes; + me->b_read -= (int)bytes; HTHost_setRemainingRead(me->host, me->b_read); return HT_OK; } diff --git a/code/ryzom/client/src/interface_v3/lua_helper.cpp b/code/ryzom/client/src/interface_v3/lua_helper.cpp index d7d48d122..81039010e 100644 --- a/code/ryzom/client/src/interface_v3/lua_helper.cpp +++ b/code/ryzom/client/src/interface_v3/lua_helper.cpp @@ -411,7 +411,7 @@ bool CLuaState::executeFile(const std::string &pathName) } */ script.resize(CFile::getFileSize(pathName)); - inputFile.serialBuffer((uint8 *) &script[0], script.size()); + inputFile.serialBuffer((uint8 *) &script[0], (uint)script.size()); // execute the script text, with dbgSrc==filename (use @ for lua internal purpose) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.cpp b/code/ryzom/client/src/interface_v3/lua_ihm.cpp index 4945002ff..927f50f2e 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm.cpp @@ -3205,7 +3205,7 @@ int CLuaIHM::tableToString(CLuaState &ls) while (ls.next(-2)) { ls.toString(-1); - length += ls.strlen(-1); + length += (uint)ls.strlen(-1); ls.pop(2); } std::string result; @@ -3215,7 +3215,7 @@ int CLuaIHM::tableToString(CLuaState &ls) ls.pushNil(); while (ls.next(-2)) { - uint length = ls.strlen(-1); + uint length = (uint)ls.strlen(-1); if (length) { memcpy(dest, ls.toString(-1), length); @@ -3658,7 +3658,7 @@ void CLuaIHM::sortGuildMembers() sint32 CLuaIHM::getNbGuildMembers() { //H_AUTO(Lua_CLuaIHM_getNbGuildMembers) - return CGuildManager::getInstance()->getGuildMembers().size(); + return (sint32)CGuildManager::getInstance()->getGuildMembers().size(); } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp index 613b492ea..4d16c523a 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_key.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_key.cpp @@ -83,7 +83,7 @@ void addKeyLine (CGroupList *pParent, const ucstring &keyName, const ucstring &s { CInterfaceManager *pIM = CInterfaceManager::getInstance(); CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); - uint lineId= pMCM->NewKey->AllLines.size(); + uint lineId= (uint)pMCM->NewKey->AllLines.size(); string templateId = pParent->getId() + ":k" + NLMISC::toString(lineId); vector< pair > vParams; vParams.push_back(make_pair(string("id"), templateId)); diff --git a/code/ryzom/client/src/interface_v3/obs_huge_list.cpp b/code/ryzom/client/src/interface_v3/obs_huge_list.cpp index 03bd8f7be..bb9f35193 100644 --- a/code/ryzom/client/src/interface_v3/obs_huge_list.cpp +++ b/code/ryzom/client/src/interface_v3/obs_huge_list.cpp @@ -452,7 +452,7 @@ void CHugeListObs::update(ICDBNode * /* node */) // In the display we want a contiguous set of items. Not For Trading, because of Resale if(_Category==Trading) { - numLoadedPages= itemPages->size(); + numLoadedPages= (uint)itemPages->size(); } else { diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 2255176d6..d42c24a47 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -307,7 +307,7 @@ sint CPeopleList::addPeople(const ucstring &name, uint teamMateIndex /*= 0*/) _Peoples.push_back(CPeople()); _Peoples.back().Container = gc; _Peoples.back().GlobalID = _CurrPeopleID; - updatePeopleMenu(_Peoples.size() - 1); + updatePeopleMenu((uint)_Peoples.size() - 1); ++_CurrPeopleID; diff --git a/code/ryzom/client/src/interface_v3/people_list.h b/code/ryzom/client/src/interface_v3/people_list.h index 67c6ae58a..cfedbe418 100644 --- a/code/ryzom/client/src/interface_v3/people_list.h +++ b/code/ryzom/client/src/interface_v3/people_list.h @@ -76,7 +76,7 @@ public: // Get index from the id of the container that represent the people sint getIndexFromContainerID(const std::string &id) const; // Get the number of people in this list - uint getNumPeople() const { return _Peoples.size(); } + uint getNumPeople() const { return (uint)_Peoples.size(); } // Get name of a people ucstring getName(uint index) const; // Sort people alphabetically diff --git a/code/ryzom/client/src/interface_v3/sbrick_manager.cpp b/code/ryzom/client/src/interface_v3/sbrick_manager.cpp index c5c619663..64c651b46 100644 --- a/code/ryzom/client/src/interface_v3/sbrick_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sbrick_manager.cpp @@ -281,7 +281,7 @@ sint32 CSBrickManager::CBrickContainer::getNumParameters(NLMISC::CSheetId id) c CSBrickSheet *brick= pBM->getBrick(id); if(brick) { - return brick->ParameterFamilies.size(); + return (sint32)brick->ParameterFamilies.size(); } else { @@ -449,7 +449,7 @@ void CSBrickManager::compileBrickProperties() textTemp.erase(); // Parse the text - uint textSize= text.size(); + uint textSize= (uint)text.size(); for(uint j=0;j winTris; winTris.resize(numTris); diff --git a/code/ryzom/client/src/interface_v3/view_polygon.h b/code/ryzom/client/src/interface_v3/view_polygon.h index 17399bcb3..cd07a2bba 100644 --- a/code/ryzom/client/src/interface_v3/view_polygon.h +++ b/code/ryzom/client/src/interface_v3/view_polygon.h @@ -35,7 +35,7 @@ class CViewPolygon : public CViewBase { public: CViewPolygon(); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } virtual void updateCoords(); virtual void draw(); void setVertices(const std::vector &vertices); diff --git a/code/ryzom/client/src/interface_v3/view_quad.h b/code/ryzom/client/src/interface_v3/view_quad.h index 01847ab71..907f65962 100644 --- a/code/ryzom/client/src/interface_v3/view_quad.h +++ b/code/ryzom/client/src/interface_v3/view_quad.h @@ -42,7 +42,7 @@ public: bool parse(xmlNodePtr cur,CInterfaceGroup *parentGroup); virtual void updateCoords(); virtual void draw(); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } // from CViewBase virtual sint32 getAlpha() const { return (sint32) _Color.A; } diff --git a/code/ryzom/client/src/interface_v3/view_renderer.cpp b/code/ryzom/client/src/interface_v3/view_renderer.cpp index c3244f6d2..90a010394 100644 --- a/code/ryzom/client/src/interface_v3/view_renderer.cpp +++ b/code/ryzom/client/src/interface_v3/view_renderer.cpp @@ -664,7 +664,7 @@ void CViewRenderer::drawUnclippedTriangles(sint layerId, const std::vector=0 && layerIdLayers[layerId]; - uint startCount = layer.FilteredAlphaBlendedTris.size(); + uint startCount = (uint)layer.FilteredAlphaBlendedTris.size(); layer.FilteredAlphaBlendedTris.resize(startCount + tris.size()); const NLMISC::CTriangle *src =&tris[0]; const NLMISC::CTriangle *last = src + tris.size(); @@ -1167,7 +1167,7 @@ void CViewRenderer::flush () // alpha blended if (!layer.FilteredAlphaBlendedQuads.empty()) { - Driver->drawQuads (&(layer.FilteredAlphaBlendedQuads[0]), layer.FilteredAlphaBlendedQuads.size(), _Material); + Driver->drawQuads (&(layer.FilteredAlphaBlendedQuads[0]), (uint32)layer.FilteredAlphaBlendedQuads.size(), _Material); layer.FilteredAlphaBlendedQuads.clear(); } if (!layer.FilteredAlphaBlendedTris.empty()) @@ -1182,7 +1182,7 @@ void CViewRenderer::flush () _Material.setBlendFunc (NL3D::UMaterial::one, NL3D::UMaterial::one); if (!layer.FilteredAdditifQuads.empty()) { - Driver->drawQuads (&(layer.FilteredAdditifQuads[0]), layer.FilteredAdditifQuads.size(), _Material); + Driver->drawQuads (&(layer.FilteredAdditifQuads[0]), (uint32)layer.FilteredAdditifQuads.size(), _Material); layer.FilteredAdditifQuads.clear(); } if (!layer.FilteredAdditifTris.empty()) diff --git a/code/ryzom/client/src/interface_v3/view_text.cpp b/code/ryzom/client/src/interface_v3/view_text.cpp index 588dcdadd..316b724d3 100644 --- a/code/ryzom/client/src/interface_v3/view_text.cpp +++ b/code/ryzom/client/src/interface_v3/view_text.cpp @@ -500,14 +500,14 @@ void CViewText::draw () } // next word - charIndex+= currWord.Text.length(); + charIndex+= (sint)currWord.Text.length(); } charIndex += currLine.getEndSpaces() + (currLine.getLF() ? 1 : 0); } } // draw - for (sint i = _Lines.size()-1; i >= 0; --i) + for (sint i = (sint)_Lines.size()-1; i >= 0; --i) { CLine &currLine = *_Lines[i]; // current x position @@ -848,7 +848,7 @@ void CViewText::updateTextContextMultiLine(uint nMaxWidth) float rWidthCurrentLine = 0, rWidthLetter; bool linePushed= false; // for all the text - uint textSize= _Text.size(); + uint textSize= (uint)_Text.size(); uint formatTagIndex= 0; for (i = 0; i < textSize; ++i) { @@ -1019,14 +1019,14 @@ void CViewText::updateTextContextMultiLineJustified(uint nMaxWidth, bool expandS } // Detect change of wordFormat at the begining of the word - if(isFormatTagChange(spaceEnd, formatTagIndex)) + if(isFormatTagChange((uint)spaceEnd, formatTagIndex)) { - getFormatTagChange(spaceEnd, formatTagIndex, wordFormat); + getFormatTagChange((uint)spaceEnd, formatTagIndex, wordFormat); } // Get word until a space, a \n, or a FormatTagChange is encountered uint i; - for(i= spaceEnd;i<_Text.length();i++) + for(i= (uint)spaceEnd;i<(uint)_Text.length();i++) { ucchar c= _Text[i]; if(c==' ' || c=='\n') @@ -1364,7 +1364,7 @@ void CViewText::updateTextContext () } else { - for (sint i = _Text.size() - 1; i >= 0; --i) + for (sint i = (sint)_Text.size() - 1; i >= 0; --i) { ucLetter= _Text[i]; ucstring ucStrLetter; @@ -1465,7 +1465,7 @@ sint CViewText::getLineFromIndex(uint index, bool cursorDisplayedAtEndOfPrevious } charIndex = newCharIndex; } - return _Lines.size() - 1; + return (sint)_Lines.size() - 1; } else { @@ -1629,7 +1629,7 @@ void CViewText::getCharacterPositionFromIndex(sint index, bool cursorAtPreviousL return; } } - charIndex += currWord.Text.length() + currWord.NumSpaces; + charIndex += (uint)currWord.Text.length() + currWord.NumSpaces; px += currWord.NumSpaces * currLine.getSpaceWidth() + currWord.Info.StringWidth; } } @@ -1690,12 +1690,12 @@ void CViewText::getCharacterIndexFromPosition(sint x, sint y, uint &index, bool float py = 0.f; if (py > y) { - index = _Text.length(); + index = (uint)_Text.length(); cursorAtPreviousLineEnd = false; return; } sint line; - for (line = _Lines.size() - 1; line >= 0; --line) + for (line = (uint)_Lines.size() - 1; line >= 0; --line) { float newPy = py + _FontHeight + _MultiLineSpace; if (newPy > y) @@ -1758,7 +1758,7 @@ void CViewText::getCharacterIndexFromPosition(sint x, sint y, uint &index, bool } } px = newPx; - charPos += currWord.Text.length() + currWord.NumSpaces; + charPos += (uint)currWord.Text.length() + currWord.NumSpaces; } index = charPos; cursorAtPreviousLineEnd = false; @@ -1769,7 +1769,7 @@ void CViewText::getCharacterIndexFromPosition(sint x, sint y, uint &index, bool cursorAtPreviousLineEnd = false; if (y < 0) { - index = _Text.length(); + index = (uint)_Text.length(); return; } if (y > (sint) _FontHeight) @@ -1833,7 +1833,7 @@ uint CViewText::getNumLine() const { if (_MultiLine) { - return _Lines.size(); + return (uint)_Lines.size(); } else { @@ -1935,7 +1935,7 @@ void CViewText::CWord::build(const ucstring &text, uint numSpaces/*=0*/) // *************************************************************************** void CViewText::removeEndSpaces() { - int i = _Text.size()-1; + int i = (int)_Text.size()-1; while ((i>=0) && ((_Text[i] < 0x20) || (_Text[i] == ' '))) { i--; @@ -2252,7 +2252,7 @@ void CViewText::buildFormatTagText(const ucstring &text, ucstring &textBuild, s // Build the text without the formatTags, and get the color tags separately textBuild.reserve(text.size()); - uint textSize= text.size(); + uint textSize= (uint)text.size(); // Must herit all the props from old tags. CViewText::CFormatTag precTag; // set default. for (uint i = 0; i < textSize;) @@ -2263,7 +2263,7 @@ void CViewText::buildFormatTagText(const ucstring &text, ucstring &textBuild, s CViewText::CFormatTag ct= precTag; // get new color and skip tag. ct.Color= getColorTag(text, i); - ct.Index= textBuild.size(); + ct.Index= (uint)textBuild.size(); formatTags.push_back(ct); } else if(isTabTag(text, i, textSize)) @@ -2272,7 +2272,7 @@ void CViewText::buildFormatTagText(const ucstring &text, ucstring &textBuild, s CViewText::CFormatTag ct= precTag; // get new Tab and skip tag. ct.TabX= getTabTag(text, i); - ct.Index= textBuild.size(); + ct.Index= (uint)textBuild.size(); formatTags.push_back(ct); } else if(isTooltipTag(text, i, textSize)) @@ -2287,11 +2287,11 @@ void CViewText::buildFormatTagText(const ucstring &text, ucstring &textBuild, s } else { - ct.IndexTt= tooltips.size(); + ct.IndexTt= (uint)tooltips.size(); tooltips.push_back(uitt); } - ct.Index= textBuild.size(); + ct.Index= (uint)textBuild.size(); formatTags.push_back(ct); } else @@ -2307,7 +2307,7 @@ void CViewText::buildFormatTagText(const ucstring &text, ucstring &textBuild, s { CViewText::CFormatTag ct= precTag; ct.TabX= 0; - ct.Index= textBuild.size(); + ct.Index= (uint)textBuild.size(); formatTags.push_back(ct); } } diff --git a/code/ryzom/client/src/interface_v3/view_text.h b/code/ryzom/client/src/interface_v3/view_text.h index c70caa4ad..0f75ea3ba 100644 --- a/code/ryzom/client/src/interface_v3/view_text.h +++ b/code/ryzom/client/src/interface_v3/view_text.h @@ -54,7 +54,7 @@ public: void parseTextOptions (xmlNodePtr cur); bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); - virtual uint32 getMemory() { return sizeof(*this)+_Id.size(); } + virtual uint32 getMemory() { return (uint32)(sizeof(*this)+_Id.size()); } /// Updating virtual void draw (); @@ -308,7 +308,7 @@ private: // Add a new word (and its context) in the line + a number of spaces to append at the end of the line void addWord(const ucstring &word, uint numSpaces, const CFormatInfo &wordFormat, uint fontWidth); void addWord(const CWord &word, uint fontWidth); - uint getNumWords() const { return _Words.size(); } + uint getNumWords() const { return (uint)_Words.size(); } CWord &getWord(uint index) { return _Words[index]; } float getSpaceWidth() const { return _SpaceWidth; } void setSpaceWidth(float width) { _SpaceWidth = width; } diff --git a/code/ryzom/client/src/interface_v3/yubo_chat.cpp b/code/ryzom/client/src/interface_v3/yubo_chat.cpp index 4bf6fb10c..d24ae8bea 100644 --- a/code/ryzom/client/src/interface_v3/yubo_chat.cpp +++ b/code/ryzom/client/src/interface_v3/yubo_chat.cpp @@ -250,7 +250,7 @@ void CYuboChat::sendInternal(const ucstring &msg) } // append linefield toSend+= "\r\n"; - uint32 size= toSend.size(); + uint32 size= (uint32)toSend.size(); uint32 off= 0; // until the whole message is sent while(size!=0) @@ -262,7 +262,7 @@ void CYuboChat::sendInternal(const ucstring &msg) } // maybe send the rest of the message (very rare....) off+=size; - size= toSend.size()-off; + size= (uint32)toSend.size()-off; } } catch(Exception &e) diff --git a/code/ryzom/client/src/landscape_poly_drawer.cpp b/code/ryzom/client/src/landscape_poly_drawer.cpp index b0ff987bd..5ec749eca 100644 --- a/code/ryzom/client/src/landscape_poly_drawer.cpp +++ b/code/ryzom/client/src/landscape_poly_drawer.cpp @@ -113,7 +113,7 @@ void CLandscapePolyDrawer::addPoly(const NLMISC::CPolygon2D &poly, _PolyColor.push_back(color); _BBoxes.push_back(bBox); - buildShadowVolume(_Polygons.size()); + buildShadowVolume((uint)_Polygons.size()); } //----------------------------------------------------------------------------------------------------------- @@ -381,7 +381,7 @@ void CLandscapePolyDrawer::buildShadowVolume(uint poly) CIndexBuffer ib; CVector2f barycenter(0, 0); const CPolygon2D & polygon = _Polygons[poly-1]; - uint verticesNb = polygon.Vertices.size(); + uint verticesNb = (uint)polygon.Vertices.size(); // barycenter polygon for(i=0; igetDriver()->activeVertexBuffer(_PolyVB[poly-1]); ((CDriverUser*)Driver)->getDriver()->activeIndexBuffer(_PolyIB[poly-1]); ((CDriverUser*)Driver)->getDriver()->renderTriangles( - *GenericMat.getObjectPtr(), 0, 4*_Polygons[poly-1].Vertices.size()); + *GenericMat.getObjectPtr(), 0, 4*(uint32)_Polygons[poly-1].Vertices.size()); if(!firstPass) { diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 47a75d97f..f0bb8c359 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -159,7 +159,7 @@ public: try { CNel7ZipInStream *me = (CNel7ZipInStream*)object; - me->_Stream->serialBuffer((uint8*)buffer, size); + me->_Stream->serialBuffer((uint8*)buffer, (uint)size); *processedSize = size; return SZ_OK; } @@ -248,7 +248,7 @@ void CPatchManager::init(const std::vector& patchURIs, const std::s } srand(NLMISC::CTime::getSecondsSince1970()); - UsedServer = rand() * PatchServers.size() / (RAND_MAX+1); + UsedServer = rand() * (sint)PatchServers.size() / (RAND_MAX+1); ServerPath = CPath::standardizePath (sServerPath); ServerVersion = sServerVersion; @@ -589,10 +589,10 @@ void CPatchManager::startPatchThread(const vector &CategoriesSelected, b } // Add all required categories - uint32 nSize = CatsSelected.size(); + uint32 nSize = (uint32)CatsSelected.size(); do { - nSize = CatsSelected.size(); + nSize = (uint32)CatsSelected.size(); for (i = 0; i < CatsSelected.size(); ++i) { @@ -1380,7 +1380,7 @@ void CPatchManager::decompressFile (const string &filename) currentSize += res; //if(isVerboseLog()) nlinfo("Calling fwrite for %d bytes", res); - int res2 = fwrite (buffer, 1, res, fp); + int res2 = (int)fwrite (buffer, 1, res, fp); //if(isVerboseLog()) nlinfo("fwrite returns %d", res2); if (res2 != res) { @@ -1846,7 +1846,7 @@ uint CPatchManager::applyScanDataResult() { TSyncDataScanState::CAccessor ac(&DataScanState); CDataScanState &val= ac.value(); - numError= val.FilesWithScanDataError.size(); + numError= (uint)val.FilesWithScanDataError.size(); // Touch the files with error (will be reloaded at next patch) for(uint i=0;i outBuffer = auto_ptr(new uint8[fileSize]); // decompress the file in memory - ret = LzmaDecode(&state, (unsigned char*) pos, inSize-(pos-inBuffer.get()), &inProcessed, (unsigned char*)outBuffer.get(), fileSize, &outProcessed); + ret = LzmaDecode(&state, (unsigned char*) pos, (SizeT)(inSize-(pos-inBuffer.get())), &inProcessed, (unsigned char*)outBuffer.get(), (SizeT)fileSize, &outProcessed); if (ret != 0 || outProcessed != fileSize) { nlwarning("Failed to decode lzma file '%s'", lzmaFile.c_str()); @@ -2084,7 +2084,7 @@ bool CPatchManager::unpackLZMA(const std::string &lzmaFile, const std::string &d // store on output buffer COFile outStream(destFileName); - outStream.serialBuffer(outBuffer.get(), fileSize); + outStream.serialBuffer(outBuffer.get(), (uint)fileSize); return true; } @@ -3316,7 +3316,7 @@ void CDownloadThread::run() // At first launch calculat the amount of data need to download if (_FirstTime) { - for (unsigned int first = 0,last = _Entries.size() ; first != last; ++first) + for (uint first = 0,last = (uint)_Entries.size() ; first != last; ++first) { _FullSize += _Entries[first].SZipFileSize; } @@ -3325,7 +3325,7 @@ void CDownloadThread::run() } - for (unsigned int first = 0,last = _Entries.size() ; first != last; ++first) + for (uint first = 0,last = (uint)_Entries.size() ; first != last; ++first) { std::string patchName = CPath::standardizePath (_Entries[first].PatchName, false); std::string sourceName = CPath::standardizePath (_Entries[first].SourceName, false); @@ -3413,9 +3413,9 @@ void CInstallThread::run() std::set allowed; - unsigned int first, last; + uint first, last; - for (first = 0,last = _Entries.size() ; first != last; ++first) + for (first = 0,last = (uint)_Entries.size() ; first != last; ++first) { std::string correct = CPath::standardizePath (patchPath + _Entries[first].PatchName, false); allowed.insert(correct); @@ -3440,7 +3440,7 @@ void CInstallThread::run() // calculate size of data to download in order to know the install speed if (_FirstTime) { - for (unsigned int first = 0,last = _Entries.size() ; first != last; ++first) + for (uint first = 0,last = (uint)_Entries.size() ; first != last; ++first) { _FullSize += _Entries[first].Size; } @@ -3449,7 +3449,7 @@ void CInstallThread::run() } - for (first = 0,last = _Entries.size() ; first != last; ++first) + for (first = 0,last = (uint)_Entries.size() ; first != last; ++first) { std::string patchName = CPath::standardizePath (patchPath +_Entries[first].PatchName, false); std::string sourceName = CPath::standardizePath (_Entries[first].SourceName, false); diff --git a/code/ryzom/client/src/login_patch.h b/code/ryzom/client/src/login_patch.h index e55288283..8baaf9014 100644 --- a/code/ryzom/client/src/login_patch.h +++ b/code/ryzom/client/src/login_patch.h @@ -533,7 +533,7 @@ public: // Add files to be patched (avoid multiple time the same file) void add(const CPatchManager::SFileToPatch &ftp); - int getNbFileToPatch() { return AllFilesToPatch.size(); } + int getNbFileToPatch() { return (int)AllFilesToPatch.size(); } int getCurrentFilePatched() { return (int) floorf(CurrentFilePatched); } int getPatchingSize() { return PatchSizeProgress; } float getCurrentFileProgress() const { return fmodf(CurrentFilePatched, 1.f); } diff --git a/code/ryzom/client/src/misc.cpp b/code/ryzom/client/src/misc.cpp index 2eb87dc0c..90ad18da9 100644 --- a/code/ryzom/client/src/misc.cpp +++ b/code/ryzom/client/src/misc.cpp @@ -143,7 +143,7 @@ void makeUp(NL3D::UInstance face, sint idMakeUp) std::string::size_type pos = texFilename.find(tattooStr, 0); if (pos != std::string::npos) { - uint charIndex = pos + strlen(tattooStr); + uint charIndex = (uint)(pos + strlen(tattooStr)); if (texFilename.length() >= charIndex + 2) { texFilename[charIndex] = '0' + (unsigned char) (idMakeUp / 10); @@ -948,7 +948,7 @@ std::string getStringCategoryIfAny(const ucstring &src, ucstring &dest) ucstring::size_type nextPos = src.find((ucchar) '&', startPos+1); if (nextPos != ucstring::npos) { - uint codeSize = nextPos - startPos - 1; + uint codeSize = (uint)nextPos - startPos - 1; colorCode.resize( codeSize ); for(uint k = 0; k < codeSize; ++k) { @@ -1022,7 +1022,7 @@ inline bool isEndSentence (ucstring& str, uint index) void setCase (ucstring &str, TCaseMode mode) { - const uint length = str.length(); + const uint length = (uint)str.length(); uint i; bool newString = true; bool newSentence = true; @@ -1090,9 +1090,9 @@ sint ucstrnicmp(const ucstring &s0, uint p0, uint n0, const ucstring &s1) { // start const ucchar *start1= s1.c_str(); - uint lenS1= s1.size(); + uint lenS1= (uint)s1.size(); const ucchar *start0= s0.c_str(); - uint lenS0= s0.size(); + uint lenS0= (uint)s0.size(); if(p0!=0) { if(p0& dataset, float rp ) { //nlassert( ! dataset.empty() ); //nlassert( (rp >= 0) && (rp <= 1) ); - uint ds = dataset.size(); + uint ds = (uint)dataset.size(); if ( ds == 1 ) return (float)(*dataset.begin()); float fpIndex = rp * (float)(ds-1); @@ -344,7 +344,7 @@ NLMISC::CHashKeyMD5 getTextMD5(const std::string& filename) return NLMISC::CHashKeyMD5(); std::vector buffer(fi.getFileSize()); - fi.serialBuffer(&(buffer[0]), buffer.size()); + fi.serialBuffer(&(buffer[0]), (uint)buffer.size()); std::vector::iterator it = buffer.begin(); do @@ -357,7 +357,7 @@ NLMISC::CHashKeyMD5 getTextMD5(const std::string& filename) } while (it != buffer.end()); - return NLMISC::getMD5((&buffer[0]), buffer.size()); + return NLMISC::getMD5((&buffer[0]), (uint32)buffer.size()); } /* @@ -2219,7 +2219,7 @@ void CNetworkConnection::sendSystemAckProbe() buildSystemHeader(message); uint8 probe = SYSTEM_ACK_PROBE_CODE; - uint32 numprobes = _LatestProbes.size(); + uint32 numprobes = (uint32)_LatestProbes.size(); message.serial(probe); message.serial(numprobes); @@ -3041,7 +3041,7 @@ void CNetworkConnection::CGenericMultiPartTemp::set (CActionGenericMultiPart *ag BlockReceived[agmp->Part] = true; NbCurrentBlock++; - TempSize += agmp->PartCont.size(); + TempSize += (uint32)agmp->PartCont.size(); if (NbCurrentBlock == NbBlock) { diff --git a/code/ryzom/client/src/prim_file.cpp b/code/ryzom/client/src/prim_file.cpp index 1d60f320a..354eff459 100644 --- a/code/ryzom/client/src/prim_file.cpp +++ b/code/ryzom/client/src/prim_file.cpp @@ -155,7 +155,7 @@ void CPrimFileMgr::load (sint primFileIndex) for (seg = 0; seg < _PrimRegion.VPaths.size (); seg++) { // For each - uint pointCount = _PrimRegion.VPaths[seg].VPoints.size (); + uint pointCount = (uint)_PrimRegion.VPaths[seg].VPoints.size (); for (point = 0; point < pointCount; point++) { @@ -167,7 +167,7 @@ void CPrimFileMgr::load (sint primFileIndex) for (seg = 0; seg < _PrimRegion.VZones.size (); seg++) { // For each - uint pointCount = _PrimRegion.VZones[seg].VPoints.size (); + uint pointCount = (uint)_PrimRegion.VZones[seg].VPoints.size (); for (point = 0; point < pointCount; point ++) { @@ -291,7 +291,7 @@ void CPrimFileMgr::display (NL3D::UDriver &driver) CVector pos (0,0,0); // For each - uint pointCount = _PrimRegion.VPaths[seg].VPoints.size (); + uint pointCount = (uint)_PrimRegion.VPaths[seg].VPoints.size (); vector &points = _PrimRegion.VPaths[seg].VPoints; // Some points ? @@ -324,7 +324,7 @@ void CPrimFileMgr::display (NL3D::UDriver &driver) changeColor (currentColor); // For each - uint pointCount = _PrimRegion.VZones[seg].VPoints.size (); + uint pointCount = (uint)_PrimRegion.VZones[seg].VPoints.size (); vector &points = _PrimRegion.VZones[seg].VPoints; // Some points ? diff --git a/code/ryzom/client/src/property_decoder.cpp b/code/ryzom/client/src/property_decoder.cpp index c6b0579d7..9fdb50e48 100644 --- a/code/ryzom/client/src/property_decoder.cpp +++ b/code/ryzom/client/src/property_decoder.cpp @@ -166,7 +166,7 @@ void CPropertyDecoder::getPosition(TCLEntityId entity, CAction::TValue &posx void CPropertyDecoder::clear() { - uint sz = _Entities.size(); + uint sz = (uint)_Entities.size(); _Entities.clear(); _Entities.resize(sz); } diff --git a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp index fa6212579..959ff13a8 100644 --- a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp @@ -236,7 +236,7 @@ void CDisplayerVisualActivitySequence::update() } if (_AddedToWorldMap) { - setWorldMapNumEdges(_FootSteps.size()); + setWorldMapNumEdges((uint)_FootSteps.size()); nlassert(gm); onUpdate(*gm); } @@ -545,7 +545,7 @@ void CDisplayerVisualActivitySequence::setWorldMapNumEdges(uint count) } else { - uint left = count - _WorldMapEdges.size(); + uint left = count - (uint)_WorldMapEdges.size(); while (left --) { CCtrlQuad *cq = new CCtrlQuad; @@ -571,7 +571,7 @@ void CDisplayerVisualActivitySequence::onAdd(CGroupMap &/* owner */) nlassert(!_AddedToWorldMap); _AddedToWorldMap = true; _Touched = true; - setWorldMapNumEdges(_FootSteps.size()); + setWorldMapNumEdges((uint)_FootSteps.size()); } //********************************************************* diff --git a/code/ryzom/client/src/r2/displayer_visual_group.cpp b/code/ryzom/client/src/r2/displayer_visual_group.cpp index 5a6d7e448..d6bc3d983 100644 --- a/code/ryzom/client/src/r2/displayer_visual_group.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_group.cpp @@ -400,7 +400,7 @@ void CDisplayerVisualGroup::updateAccessibility() } _LastIsland = getEditor().getIslandCollision().getPackedIsland(); updatePrimVertices(); - uint numVerts = _Prim.getVertices().size(); + uint numVerts = (uint)_Prim.getVertices().size(); _CurrPrimInaccessible = false; // Old version : path should be accessible along the edges /* @@ -882,7 +882,7 @@ uint CDisplayerVisualGroup::getNumSons() const { //H_AUTO(R2_CDisplayerVisualGroup_getNumSons) updateInstanceList(); - return _Instances.size(); + return (uint)_Instances.size(); } // ********************************************************************************************************* diff --git a/code/ryzom/client/src/r2/dmc/action_historic.cpp b/code/ryzom/client/src/r2/dmc/action_historic.cpp index f9efcd246..b024c1c84 100644 --- a/code/ryzom/client/src/r2/dmc/action_historic.cpp +++ b/code/ryzom/client/src/r2/dmc/action_historic.cpp @@ -436,7 +436,7 @@ void CActionHistoric::CAction::undo(IDynamicMapClient *dmc, CScenario &scenario) nlassert(_FlushedCount <= _Requests.size()); nlassert(_Completed); nlassert(dmc); - for (sint k = _Requests.size() - 1; k >= 0; --k) + for (sint k = (sint)_Requests.size() - 1; k >= 0; --k) { _Requests[k]->undo(dmc, scenario); } diff --git a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp index 7a92e575f..d860cd951 100644 --- a/code/ryzom/client/src/r2/dmc/client_edition_module.cpp +++ b/code/ryzom/client/src/r2/dmc/client_edition_module.cpp @@ -1410,7 +1410,7 @@ bool CClientEditionModule::loadUserComponent(const std::string& filename, bool m } uncompressedFile = new uint8[uncompressedFileLength]; - int length = fread(uncompressedFile, sizeof(char), uncompressedFileLength, file); + int length = (int)fread(uncompressedFile, sizeof(char), uncompressedFileLength, file); if (length <0) { nlwarning("Error while reading %s", filename.c_str()); @@ -1456,7 +1456,7 @@ bool CClientEditionModule::loadUserComponent(const std::string& filename, bool m } // REGENERATE HEADER - md5Id = getMD5((uint8*)data.data(), data.size()); + md5Id = getMD5((uint8*)data.data(), (uint32)data.size()); timeStamp = NLMISC::CTime::getSecondsSince1970(); //std::stringstream ss; @@ -1487,7 +1487,7 @@ bool CClientEditionModule::loadUserComponent(const std::string& filename, bool m delete [] uncompressedFile; uncompressedFile = new uint8[ data.size() ]; memcpy(uncompressedFile, data.c_str(), data.size()); - uncompressedFileLength = data.size(); + uncompressedFileLength = (uint32)data.size(); @@ -2570,7 +2570,7 @@ bool CClientEditionModule::hasCharacterSameCharacterIdMd5(const std::string & ch } uint32 val = 0; - uint32 first=0,last=charIdMd5.size(); + uint32 first=0,last=(uint32)charIdMd5.size(); for (;first != last; ++first) { diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index 1323f4c88..654f74154 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -680,7 +680,7 @@ sint CComLuaModule::luaPrint(lua_State* state) object->serialize(ss); std::vector lines; NLMISC::splitString(ss, "\n", lines); - uint first=0, last=lines.size(); + uint first=0, last=(uint)lines.size(); for (; first != last ; ++first) { nlinfo("%s", lines[first].c_str()); } //this2->_Client->requestCreateScenario(object); @@ -1107,7 +1107,7 @@ void CComLuaModule::setObjectToLua(lua_State* state, CObject* object) { first = 0; - last = keys.size(); + last = (uint32)keys.size(); // if (!keys.empty()) { lua_pushstring(state, "Keys"); @@ -1332,7 +1332,7 @@ CObject* CComLuaModule::loadFromBuffer(const std::string& data, const std::strin if (dump) { COFile testNico("test_nico.lua"); - testNico.serialBuffer(const_cast((const uint8 *) &data[0]), data.size()); + testNico.serialBuffer(const_cast((const uint8 *) &data[0]), (uint)data.size()); } CObject* object = NULL; // TMP TMP @@ -1681,7 +1681,7 @@ sint CComLuaModule::luaGetUserTriggers(lua_State* state) const TUserTriggerDescriptions& triggers = this2->_Client->getEditionModule().getUserTriggers(); - uint32 first = 0, last = triggers.size(); + uint32 first = 0, last = (uint32)triggers.size(); lua_newtable(state); for ( ; first != last ; ++first) { @@ -1728,7 +1728,7 @@ sint CComLuaModule::luaGetRuntimeActs(lua_State* state) const TActPositionDescriptions& actPositionDescriptions = this2->_Client->getEditionModule().getRuntimeActs(); - uint32 first = 0, last = actPositionDescriptions.size(); + uint32 first = 0, last = (uint32)actPositionDescriptions.size(); lua_newtable(state); for ( ; first != last ; ++first) { diff --git a/code/ryzom/client/src/r2/dmc/dmc.cpp b/code/ryzom/client/src/r2/dmc/dmc.cpp index ef69c300e..df18c12f8 100644 --- a/code/ryzom/client/src/r2/dmc/dmc.cpp +++ b/code/ryzom/client/src/r2/dmc/dmc.cpp @@ -279,7 +279,7 @@ void CDynamicMapClient::saveRtData(const std::string& filename) out2 += "scenario = "; scenario->serialize(out2); //std::string tmp=out2.str(); - out.serialBuffer((uint8*)out2.c_str(),out2.size()); + out.serialBuffer((uint8*)out2.c_str(),(uint)out2.size()); return; } nlwarning("Can't save: no scenario yet"); @@ -371,7 +371,7 @@ void CDynamicMapClient::show() const std::vector lines; NLMISC::splitString(ss, "\n", lines); - uint first=0, last=lines.size(); + uint first=0, last=(uint)lines.size(); for (; first != last ; ++first) { nlinfo("%s", lines[first].c_str()); } /* while ( std::getline(ss, s)) diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index 732699bf5..fd53a078d 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -4197,7 +4197,7 @@ bool CEditor::isPostFixedByNumber(const ucstring &baseName) { //H_AUTO(R2_CEditor_isPostFixedByNumber) // strip number & spaces at the end of the name - sint lastIndex = baseName.length() - 1; + sint lastIndex = (sint)baseName.length() - 1; while (lastIndex > 0) { int currChar = (int) baseName[lastIndex]; @@ -4220,7 +4220,7 @@ ucstring CEditor::genInstanceName(const ucstring &baseName) uint maxIndex = 0; // strip number & spaces at the end of the name ucstring strippedName = baseName; - sint lastIndex = strippedName.length() - 1; + sint lastIndex = (sint)strippedName.length() - 1; while (lastIndex > 0) { int currChar = (int) strippedName[lastIndex]; @@ -7260,13 +7260,13 @@ void CEditor::initClassInheritanceTable() } if (name.isString()) { - _ClassNameToIndex[name.toString()] = classes.size(); + _ClassNameToIndex[name.toString()] = (uint)classes.size(); classes.push_back(name.toString()); baseClasses[name.toString()] = baseName; } } - _KindOfTable.init(classes.size(), classes.size(), 0); + _KindOfTable.init((uint)classes.size(), (uint)classes.size(), 0); _BaseClassIndices.resize(classes.size()); for (uint k = 0; k < classes.size(); ++k) { diff --git a/code/ryzom/client/src/r2/entity_sorter.cpp b/code/ryzom/client/src/r2/entity_sorter.cpp index d2d5d3a42..e30387ce8 100644 --- a/code/ryzom/client/src/r2/entity_sorter.cpp +++ b/code/ryzom/client/src/r2/entity_sorter.cpp @@ -191,7 +191,7 @@ void CEntitySorter::updateVisibleList() #ifdef NL_DEBUG nlassert(_EntityDisplayers.count(dve)); #endif - _EntityDisplayers[dve] = _VisibleList.size() - 1; + _EntityDisplayers[dve] = (sint)_VisibleList.size() - 1; } } diff --git a/code/ryzom/client/src/r2/mesh_array.cpp b/code/ryzom/client/src/r2/mesh_array.cpp index 9629d22be..26a308509 100644 --- a/code/ryzom/client/src/r2/mesh_array.cpp +++ b/code/ryzom/client/src/r2/mesh_array.cpp @@ -63,7 +63,7 @@ void CMeshArray::resize(uint newSize) } else { - uint oldSize = _MeshInstances.size(); + uint oldSize = (uint)_MeshInstances.size(); _MeshInstances.resize(newSize); for(uint k = oldSize; k < newSize; ++k) { diff --git a/code/ryzom/client/src/r2/mesh_array.h b/code/ryzom/client/src/r2/mesh_array.h index 199250e1b..e0e4f7372 100644 --- a/code/ryzom/client/src/r2/mesh_array.h +++ b/code/ryzom/client/src/r2/mesh_array.h @@ -37,7 +37,7 @@ public: void setShapeName(const std::string &shapeName); const std::string &getShapeName() const{ return _ShapeName; } void resize(uint newSize); - uint getSize() const { return _MeshInstances.size(); } + uint getSize() const { return (uint)_MeshInstances.size(); } NL3D::UInstance &getInstance(uint index); const NL3D::UInstance &getInstance(uint index) const; NL3D::UInstance operator[](uint index) { return getInstance(index); } diff --git a/code/ryzom/client/src/r2/prim_render.cpp b/code/ryzom/client/src/r2/prim_render.cpp index cc96ed35c..4aecb95f5 100644 --- a/code/ryzom/client/src/r2/prim_render.cpp +++ b/code/ryzom/client/src/r2/prim_render.cpp @@ -342,7 +342,7 @@ void CPrimRender::update() if (!_Look.VertexShapeName.empty()) { _VertexShapeInstances.setShapeName(_Look.VertexShapeName); - _VertexShapeInstances.resize(_Vertices.size()); + _VertexShapeInstances.resize((uint)_Vertices.size()); } else { @@ -373,14 +373,14 @@ void CPrimRender::update() switch(_Look.Shape) { case CPrimLook::Star: - _NumEdges = _Vertices.size() <= 1 ? 0 : _Vertices.size() - 1; + _NumEdges = _Vertices.size() <= 1 ? 0 : (sint)_Vertices.size() - 1; break; case CPrimLook::PolyLine: - _NumEdges = _Vertices.size() <= 1 ? 0 : _Vertices.size() - 1; + _NumEdges = _Vertices.size() <= 1 ? 0 : (sint)_Vertices.size() - 1; if (!_Look.LastEdgeIsValid && _NumEdges != 0) -- _NumEdges; break; case CPrimLook::ClosedPolyLine: - _NumEdges = _Vertices.size() >= 3 ? _Vertices.size() : std::max((sint) 0, (sint) (_Vertices.size() - 1)); + _NumEdges = _Vertices.size() >= 3 ? (sint)_Vertices.size() : std::max((sint) 0, (sint) (_Vertices.size() - 1)); if (!_Look.LastEdgeIsValid && _NumEdges != 0) -- _NumEdges; break; default: @@ -435,7 +435,7 @@ void CPrimRender::updatePos() // world map if (_AddedToWorldMap) { - setWorldMapNumVertices(_Look.VertexLook.WorldMapTexture.empty() ? 0 : _Vertices.size()); + setWorldMapNumVertices(_Look.VertexLook.WorldMapTexture.empty() ? 0 : (uint)_Vertices.size()); setWorldMapNumEdges(_Look.EdgeLook.WorldMapTexture.empty() ? 0 : _NumEdges); } // @@ -598,7 +598,7 @@ void CPrimRender::setWorldMapNumVertices(uint count) } else { - uint left = count - _WorldMapVertices.size(); + uint left = count - (uint)_WorldMapVertices.size(); while (left --) { CViewBitmap *bm = new CViewBitmap(CViewBase::TCtorParam()); @@ -638,10 +638,10 @@ void CPrimRender::setWorldMapNumEdges(uint count) } else { - uint left = count - _WorldMapEdges.size(); + uint left = count - (uint)_WorldMapEdges.size(); while (left --) { - CCtrlQuad *cq = newCtrlQuad(_WorldMapEdges.size()); + CCtrlQuad *cq = newCtrlQuad((uint)_WorldMapEdges.size()); cq->setModulateGlobalColor(false); cq->setActive(_Active); gm->addCtrl(cq); diff --git a/code/ryzom/client/src/r2/tool.cpp b/code/ryzom/client/src/r2/tool.cpp index d99bc7a47..a0e97539b 100644 --- a/code/ryzom/client/src/r2/tool.cpp +++ b/code/ryzom/client/src/r2/tool.cpp @@ -590,7 +590,7 @@ CInstance *CTool::checkInstanceUnderMouse(IDisplayerUIHandle **miniMapHandle /*= sint8 bestCandidateLayer = -128; // see if the element is under the mouse const std::vector &ctrlsUnder = getUI().getCtrlsUnderPointer(); - for(sint k = ctrlsUnder.size() - 1; k >= 0; --k) + for(sint k = (sint)ctrlsUnder.size() - 1; k >= 0; --k) { IDisplayerUIHandle *handle = dynamic_cast(ctrlsUnder[k]); if (handle != NULL) diff --git a/code/ryzom/client/src/r2/tool_draw_prim.cpp b/code/ryzom/client/src/r2/tool_draw_prim.cpp index 389b9555b..e2eac61ba 100644 --- a/code/ryzom/client/src/r2/tool_draw_prim.cpp +++ b/code/ryzom/client/src/r2/tool_draw_prim.cpp @@ -139,7 +139,7 @@ bool CToolDrawPrim::init(const CLuaObject ¶meters) _CookieValue = parameters["CookieValue"]; _PrimType = parameters["Type"].toString() == "Region" ? Region : Road; _Prim.setLook(_PrimLook); - _NumPoints = _Points.size(); + _NumPoints = (uint)_Points.size(); if (!parameters["ForceShowPrims"].isNil()) { @@ -715,7 +715,7 @@ bool CToolDrawPrim::isValidPolyShape(bool ignoreLast, std::list &split bool CToolDrawPrim::testAccessibleEdges(bool ignoreLast) { //H_AUTO(R2_CToolDrawPrim_testAccessibleEdges) - uint numPoints = _Points.size(); + uint numPoints = (uint)_Points.size(); if (_PrimType == Road) { numPoints -= ignoreLast ? 2 : 1; @@ -813,7 +813,7 @@ void CToolDrawPrim::onActivate() { _Points.push_back(sons[k]->getWorldPos().asVector()); } - _NumPoints = _Points.size(); + _NumPoints = (uint)_Points.size(); _StartNumPoints = _NumPoints; _InitialPoints = _Points; } diff --git a/code/ryzom/client/src/rosace.h b/code/ryzom/client/src/rosace.h index 6d7cdeb4f..22be94be6 100644 --- a/code/ryzom/client/src/rosace.h +++ b/code/ryzom/client/src/rosace.h @@ -148,7 +148,7 @@ public: CRosacePage(); CRosacePage(sint nb); /// Return the number of components in the page. - inline uint size() const {return _Components.size();} + inline uint size() const {return (uint)_Components.size();} /// Display all the components in the page. void display(); /// Execute the callback associated to the selected component. @@ -207,7 +207,7 @@ public: CRosaceContext(); CRosaceContext(sint nb); /// Return the number of pages in the context. - inline uint size() const {return _Pages.size();} + inline uint size() const {return (uint)_Pages.size();} /// Display all the pages in the context. void display(); /// Execute the callback associated to the selected component in the selected page. diff --git a/code/ryzom/client/src/sheet_manager.cpp b/code/ryzom/client/src/sheet_manager.cpp index 79b5d8aee..fcf2b5b1f 100644 --- a/code/ryzom/client/src/sheet_manager.cpp +++ b/code/ryzom/client/src/sheet_manager.cpp @@ -917,7 +917,7 @@ uint CSheetManager::getNumItem(SLOTTYPE::EVisualSlot slot) // Check slot. if(s < _VisualSlots.size()) { - return _VisualSlots[s].size(); + return (uint)_VisualSlots[s].size(); } else { diff --git a/code/ryzom/client/src/sky.cpp b/code/ryzom/client/src/sky.cpp index 4d416b579..a37ed77a3 100644 --- a/code/ryzom/client/src/sky.cpp +++ b/code/ryzom/client/src/sky.cpp @@ -231,7 +231,7 @@ uint CSky::setup(const CClientDate &date, const CClientDate &animationDate, floa { if (!_Scene) return 0; uint numVisibleObjects = 0; - uint numObjects = _Objects.size(); + uint numObjects = (uint)_Objects.size(); float dayPart = date.Hour / _NumHourInDay; clamp(dayPart, 0.f, 1.f); clamp(weatherLevel, 0.f, 1.f); diff --git a/code/ryzom/client/src/streamable_entity_composite.cpp b/code/ryzom/client/src/streamable_entity_composite.cpp index 6b1fa3ce3..742e41506 100644 --- a/code/ryzom/client/src/streamable_entity_composite.cpp +++ b/code/ryzom/client/src/streamable_entity_composite.cpp @@ -77,7 +77,7 @@ void CStreamableEntityComposite::remove(IStreamableEntity *entity) /*virtual*/ void CStreamableEntityComposite::forceUpdate(const NLMISC::CVector &pos, NLMISC::IProgressCallback &progress) { H_AUTO_USE(RZ_StremableEntityComposite) - const uint size = _Entities.size(); + const uint size = (uint)_Entities.size(); uint count = 0; for(TStreambleEntities::iterator it = _Entities.begin(); it != _Entities.end(); ++it) { diff --git a/code/ryzom/client/src/streamable_entity_composite.h b/code/ryzom/client/src/streamable_entity_composite.h index ce5b67bbe..94f1d6696 100644 --- a/code/ryzom/client/src/streamable_entity_composite.h +++ b/code/ryzom/client/src/streamable_entity_composite.h @@ -38,7 +38,7 @@ public: /// Remove all entities (& elte them) void removeAll(); /// Get the number of entity - uint getNumEntities() const { return _Entities.size(); } + uint getNumEntities() const { return (uint)_Entities.size(); } /// Get an entity by its index IStreamableEntity *getEntity(uint index) const { return _Entities[index]; } //\name from IStreamableEntity diff --git a/code/ryzom/client/src/streamable_ig.h b/code/ryzom/client/src/streamable_ig.h index eb276724f..e111bd1bd 100644 --- a/code/ryzom/client/src/streamable_ig.h +++ b/code/ryzom/client/src/streamable_ig.h @@ -94,7 +94,7 @@ public: // Get num of IG in the streamable IG.. uint getIGNum() const { - return _IGs.size(); + return (uint)_IGs.size(); } ///////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/code/ryzom/client/src/string_manager_client.cpp b/code/ryzom/client/src/string_manager_client.cpp index 98d37b332..c058dd367 100644 --- a/code/ryzom/client/src/string_manager_client.cpp +++ b/code/ryzom/client/src/string_manager_client.cpp @@ -713,8 +713,8 @@ restartLoop: if(str.size()>PlayerSelectedHomeShardNameWithParenthesis.size()) { // If the shard name is the same as the player home shard name, remove it - uint len= PlayerSelectedHomeShardNameWithParenthesis.size(); - uint start= str.size()-len; + uint len= (uint)PlayerSelectedHomeShardNameWithParenthesis.size(); + uint start= (uint)str.size()-len; if(ucstrnicmp(str, start, len, PlayerSelectedHomeShardNameWithParenthesis)==0) str.resize(start); } @@ -1319,11 +1319,11 @@ void CStringManagerClient::specialWordsMemoryCompress() while (it != _SpecItem_TempMap.end()) { nNbEntries++; - nLabelSize += it->first.size() + 1; - nNameDescSize += it->second.Name.size() + 1; - nNameDescSize += it->second.WomenName.size() + 1; - nNameDescSize += it->second.Desc.size() + 1; - nNameDescSize += it->second.Desc2.size() + 1; + nLabelSize += (uint32)it->first.size() + 1; + nNameDescSize += (uint32)it->second.Name.size() + 1; + nNameDescSize += (uint32)it->second.WomenName.size() + 1; + nNameDescSize += (uint32)it->second.Desc.size() + 1; + nNameDescSize += (uint32)it->second.Desc2.size() + 1; it++; } @@ -1347,27 +1347,27 @@ void CStringManagerClient::specialWordsMemoryCompress() _SpecItems[nNbEntries].Label = _SpecItem_Labels+nLabelSize; strcpy(_SpecItems[nNbEntries].Label, it->first.c_str()); - nLabelSize += it->first.size() + 1; + nLabelSize += (uint32)it->first.size() + 1; _SpecItems[nNbEntries].Name = _SpecItem_NameDesc+nNameDescSize; memcpy(_SpecItems[nNbEntries].Name, it->second.Name.c_str(), 2*(it->second.Name.size()+1)); _SpecItems[nNbEntries].Name[it->second.Name.size()] = 0; - nNameDescSize += it->second.Name.size() + 1; + nNameDescSize += (uint32)it->second.Name.size() + 1; _SpecItems[nNbEntries].WomenName = _SpecItem_NameDesc+nNameDescSize; memcpy(_SpecItems[nNbEntries].WomenName, it->second.WomenName.c_str(), 2*(it->second.WomenName.size()+1)); _SpecItems[nNbEntries].WomenName[it->second.WomenName.size()] = 0; - nNameDescSize += it->second.WomenName.size() + 1; + nNameDescSize += (uint32)it->second.WomenName.size() + 1; _SpecItems[nNbEntries].Desc = _SpecItem_NameDesc+nNameDescSize; memcpy(_SpecItems[nNbEntries].Desc, it->second.Desc.c_str(), 2*(it->second.Desc.size()+1)); _SpecItems[nNbEntries].Desc[it->second.Desc.size()] = 0; - nNameDescSize += it->second.Desc.size() + 1; + nNameDescSize += (uint32)it->second.Desc.size() + 1; _SpecItems[nNbEntries].Desc2 = _SpecItem_NameDesc+nNameDescSize; memcpy(_SpecItems[nNbEntries].Desc2, it->second.Desc2.c_str(), 2*(it->second.Desc2.size()+1)); _SpecItems[nNbEntries].Desc2[it->second.Desc2.size()] = 0; - nNameDescSize += it->second.Desc2.size() + 1; + nNameDescSize += (uint32)it->second.Desc2.size() + 1; nNbEntries++; it++; diff --git a/code/ryzom/client/src/timed_fx_manager.cpp b/code/ryzom/client/src/timed_fx_manager.cpp index d95371d85..4a7977280 100644 --- a/code/ryzom/client/src/timed_fx_manager.cpp +++ b/code/ryzom/client/src/timed_fx_manager.cpp @@ -943,7 +943,7 @@ void CTimedFXManager::updateInstanciatedFXList() CManagedFX *toInstanciateListHead = NULL; CManagedFX *alreadyInstanciatedListHead = NULL; uint numInstances = 0; - uint numDistanceRanges = _CandidateFXListSortedByDist.size(); + uint numDistanceRanges = (uint)_CandidateFXListSortedByDist.size(); sint maxNumPossibleInstance = (sint) (_MaxNumberOfFXInstances - _FXManager.getNumFXtoRemove()); if (maxNumPossibleInstance > 0) { @@ -1075,7 +1075,7 @@ void CTimedFXManager::updateCandidateFXListSorting() H_AUTO_USE(RZ_TimedFX) // re-sort all instances by distance nlassert(_CandidateFXListSortedByDist.size() == _CandidateFXListSortedByDistTmp.size()); - uint numDistanceRanges = _CandidateFXListSortedByDist.size(); + uint numDistanceRanges = (uint)_CandidateFXListSortedByDist.size(); for(uint k = 0; k < numDistanceRanges; ++k) { CManagedFX *currCandidate = _CandidateFXListSortedByDist[k]; diff --git a/code/ryzom/client/src/village.cpp b/code/ryzom/client/src/village.cpp index 211d9b51f..b858e794f 100644 --- a/code/ryzom/client/src/village.cpp +++ b/code/ryzom/client/src/village.cpp @@ -101,7 +101,7 @@ bool CVillage::setupFromSheet(NL3D::UScene *scene, const CVillageSheet &sheet, C _IG.setLoadedIGMap(loadedIGMap); - _IG.reserve(sheet.IGs.size()); + _IG.reserve((uint)sheet.IGs.size()); _IG.Name = sheet.Name; diff --git a/code/ryzom/client/src/water_map.cpp b/code/ryzom/client/src/water_map.cpp index 8172c4bf5..ba2e5ca1b 100644 --- a/code/ryzom/client/src/water_map.cpp +++ b/code/ryzom/client/src/water_map.cpp @@ -136,7 +136,7 @@ void CWaterMap::waterSurfaceAdded(const NLMISC::CPolygon2D &shape, const NLMISC: float height = worldMatrix.getPos().z; // transform the water shape in grid coordinates CWaterInfo wi; - uint numVerts = shape.Vertices.size(); + uint numVerts = (uint)shape.Vertices.size(); wi.Shape.Vertices.resize(numVerts); wi.SplashEnabled = splashEnabled; NLMISC::CMatrix toGridMatrix; @@ -202,8 +202,8 @@ void CWaterMap::waterSurfaceAdded(const NLMISC::CPolygon2D &shape, const NLMISC: currWI = &_WaterInfoIndexVectVect[_Grid[x + (y + minY) * _Width]]; _WaterInfoIndexVectVect.back().resize(currWI->size() + 1); std::copy(currWI->begin(), currWI->end(), _WaterInfoIndexVectVect.back().begin()); - _WaterInfoIndexVectVect.back().back() = _WaterInfoVect.size() - 1; - goodList = _WaterInfoIndexVectVect.size() - 1; + _WaterInfoIndexVectVect.back().back() = (uint16)_WaterInfoVect.size() - 1; + goodList = (sint)_WaterInfoIndexVectVect.size() - 1; } _Grid[x + (y + minY) * _Width] = goodList; // reassign new list } diff --git a/code/ryzom/client/src/weather_manager_client.cpp b/code/ryzom/client/src/weather_manager_client.cpp index b299e788e..5acad01f8 100644 --- a/code/ryzom/client/src/weather_manager_client.cpp +++ b/code/ryzom/client/src/weather_manager_client.cpp @@ -352,7 +352,7 @@ void CWeatherManagerClient::setupFXs(const NLMISC::CMatrix &camMat, NLPACS::UGlo CRGBAF localNoPrecipitation = continent.FogMap.getMapValue (CFogMapBuild::NoPrecipitation, pos.x, pos.y, CRGBAF(0.f, 0.f, 0.f, 0.f)); _LocalPrecipitationFactor = 1.f - localNoPrecipitation.R; // - uint numAskedFXs = _CurrWeatherStateClient.FXs.size(); + uint numAskedFXs = (uint)_CurrWeatherStateClient.FXs.size(); askedPrecipitations.resize(numAskedFXs); uint k; for(k = 0; k < numAskedFXs; ++k) diff --git a/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp b/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp index cea758354..1315bddf8 100644 --- a/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp +++ b/code/ryzom/common/src/game_share/_backup_service_interface_non_module.cpp @@ -261,7 +261,7 @@ void cbBSPingPong(NLNET::CMessage& /* msgin */, const std::string &/* serviceNam SPingPongStruct& thePingPong= PingPongs[serviceId]; // workout the size of the Times vector - uint32 numTimes= thePingPong.Times.size(); + uint32 numTimes= (uint32)thePingPong.Times.size(); // store away the current time in the next available slot TTime timeNow=NLMISC::CTime::getLocalTime(); @@ -335,7 +335,7 @@ void CBSIINonModule::serviceUpdate() displayStr+=NLMISC::toString("%sBS(%hu)[",displayStr.empty()?"":"; ",it->first.get()); // workout the size of the Times vector - uint32 numTimes= it->second.Times.size(); + uint32 numTimes= (uint32)it->second.Times.size(); // iterate down from min(...)-1 to 1 for (uint32 i=numTimes;--i;) @@ -767,7 +767,7 @@ NLMISC::TTime CBSIINonModule::getLastAckTime() const SPingPongStruct& thePingPong= it->second; // workout the size of the Times vector - uint32 numTimes= thePingPong.Times.size(); + uint32 numTimes= (uint32)thePingPong.Times.size(); // compare the last entry in the times vector to the result so far... result= min(result,thePingPong.Times[(thePingPong.Count-1)%numTimes]); diff --git a/code/ryzom/common/src/game_share/action_block.cpp b/code/ryzom/common/src/game_share/action_block.cpp index a65aeaf1c..ce33114c3 100644 --- a/code/ryzom/common/src/game_share/action_block.cpp +++ b/code/ryzom/common/src/game_share/action_block.cpp @@ -42,7 +42,7 @@ void CActionBlock::serial(CBitMemStream &msg) uint i; - uint8 num = Actions.size(); + uint8 num = (uint8)Actions.size(); msg.serial(num); //static char buff[1024], cat[128]; diff --git a/code/ryzom/common/src/game_share/action_factory.cpp b/code/ryzom/common/src/game_share/action_factory.cpp index d0ce026a4..94bc4f90a 100644 --- a/code/ryzom/common/src/game_share/action_factory.cpp +++ b/code/ryzom/common/src/game_share/action_factory.cpp @@ -88,14 +88,14 @@ uint CActionFactory::getNbActionsInStore() for ( std::vector::iterator iv=RegisteredAction.begin(); iv!=RegisteredAction.end(); ++iv ) { TActionStore& actionStore = (*iv); - nb += actionStore.second.size(); + nb += (uint)actionStore.second.size(); } return nb; } uint CActionFactory::getNbActionsInStore(uint code) { - return RegisteredAction[code].second.size(); + return (uint)RegisteredAction[code].second.size(); } diff --git a/code/ryzom/common/src/game_share/action_generic_multi_part.h b/code/ryzom/common/src/game_share/action_generic_multi_part.h index c9a25c545..e4058866e 100644 --- a/code/ryzom/common/src/game_share/action_generic_multi_part.h +++ b/code/ryzom/common/src/game_share/action_generic_multi_part.h @@ -68,7 +68,7 @@ public: virtual uint32 size () { uint32 bytesize = 1 + 2 + 2 + 4; // header - bytesize += PartCont.size(); + bytesize += (uint32)PartCont.size(); return bytesize*8; } @@ -81,7 +81,7 @@ public: uint32 start = part*size; uint32 end = start + size; if (end > v.size()) - end = v.size(); + end = (uint32)v.size(); PartCont.resize (end-start); std::copy (v.begin()+start, v.begin()+end, PartCont.begin()); diff --git a/code/ryzom/common/src/game_share/backup_service_interface.cpp b/code/ryzom/common/src/game_share/backup_service_interface.cpp index 1568f6776..b7d60b54f 100644 --- a/code/ryzom/common/src/game_share/backup_service_interface.cpp +++ b/code/ryzom/common/src/game_share/backup_service_interface.cpp @@ -51,7 +51,7 @@ public: // return true if the file name is ok, otherwise false bool checkFileName(const std::string& fileName) const { - for (uint32 i=fileName.size();i--;) + for (uint32 i=(uint32)fileName.size();i--;) { if (operator[](fileName[i])==true) continue; diff --git a/code/ryzom/common/src/game_share/bnp_patch.cpp b/code/ryzom/common/src/game_share/bnp_patch.cpp index 7c3a893f9..3c59f4ba8 100644 --- a/code/ryzom/common/src/game_share/bnp_patch.cpp +++ b/code/ryzom/common/src/game_share/bnp_patch.cpp @@ -278,7 +278,7 @@ uint32 CBNPFile::getLatestVersionNumber(uint32 max) const if (_Versions.empty()) return 0; uint32 i=0; - for (i=_Versions.size();i--;) + for (i=(uint32)_Versions.size();i--;) if (_Versions[i].getVersionNumber()<=max) return _Versions[i].getVersionNumber(); @@ -288,7 +288,7 @@ uint32 CBNPFile::getLatestVersionNumber(uint32 max) const uint32 CBNPFile::versionCount() const { - return _Versions.size(); + return (uint32)_Versions.size(); } const CBNPFileVersion& CBNPFile::getVersion(uint32 idx) const @@ -371,7 +371,7 @@ uint32 CBNPFileSet::addVersion(const std::string& bnpDirectory, const std::strin uint32 result=0; // add versions to different files - for (uint32 i=_Files.size();i--;) + for (uint32 i=(uint32)_Files.size();i--;) if (_Files[i].addVersion(bnpDirectory,refDirectory,version)!=false) result= std::max(result,_Files[i].getLatestVersionNumber()); @@ -383,7 +383,7 @@ uint32 CBNPFileSet::getVersionNumber() const { uint32 result=0; - for (uint32 i=_Files.size();i--;) + for (uint32 i=(uint32)_Files.size();i--;) result= std::max(result,_Files[i].getLatestVersionNumber()); return result; @@ -396,7 +396,7 @@ void CBNPFileSet::clear() uint32 CBNPFileSet::fileCount() const { - return _Files.size(); + return (uint32)_Files.size(); } const CBNPFile& CBNPFileSet::getFile(uint32 idx) const @@ -539,7 +539,7 @@ bool CBNPCategory::isHidden() const uint32 CBNPCategory::fileCount() const { - return _Files.size(); + return (uint32)_Files.size(); } const std::string& CBNPCategory::getFile(uint32 idx) const @@ -637,7 +637,7 @@ const std::string& CBNPCategorySet::getFile(uint32 idx) const uint32 CBNPCategorySet::categoryCount() const { - return _Category.size(); + return (uint32)_Category.size(); } CBNPCategory& CBNPCategorySet::getCategory(uint32 idx) diff --git a/code/ryzom/common/src/game_share/data_set_base.h b/code/ryzom/common/src/game_share/data_set_base.h index ac04016df..0db688aa5 100644 --- a/code/ryzom/common/src/game_share/data_set_base.h +++ b/code/ryzom/common/src/game_share/data_set_base.h @@ -336,7 +336,7 @@ public: TDataSetIndex maxNbRows() const { return _MaxNbRows; } /// Return the number of properties in the dataset - TPropertyIndex nbProperties() const { return _PropIndexToType.size(); } + TPropertyIndex nbProperties() const { return (TPropertyIndex)_PropIndexToType.size(); } /// Return the type of the specified property TTypeOfProp getPropType( TPropertyIndex propIndex ) const diff --git a/code/ryzom/common/src/game_share/dyn_chat.cpp b/code/ryzom/common/src/game_share/dyn_chat.cpp index e4b40aed9..69469e319 100644 --- a/code/ryzom/common/src/game_share/dyn_chat.cpp +++ b/code/ryzom/common/src/game_share/dyn_chat.cpp @@ -318,7 +318,7 @@ CDynChatSession *CDynChat::getSession(TChanID chan, const TDataSetRow &client) //================================================================ void CDynChat::getChans(std::vector &channels) { - uint numChans = _Chans.size(); + uint numChans = (uint)_Chans.size(); channels.resize(numChans); uint k = 0; for(TChanMap::iterator it = _Chans.begin(); it != _Chans.end(); ++it, ++k) diff --git a/code/ryzom/common/src/game_share/fame.cpp b/code/ryzom/common/src/game_share/fame.cpp index 86d8b0d22..ce3414242 100644 --- a/code/ryzom/common/src/game_share/fame.cpp +++ b/code/ryzom/common/src/game_share/fame.cpp @@ -79,7 +79,7 @@ NLMISC_COMMAND(displayStaticFames, "Display the fame for each factions", "[ &names = sf.getFactionNames(); uint start =0; - uint end = names.size(); + uint end = (uint)names.size(); if (args.size() == 1) @@ -431,7 +431,7 @@ void CStaticFames::loadStaticFame( const string& filename ) } } // 3rd, allocate fame table and load the data - _FameTableSize = _FactionNameIndex.size(); + _FameTableSize = (uint)_FactionNameIndex.size(); _FameTable = new sint32[_FameTableSize*_FameTableSize]; _PropagationFactorTable = new float[_FameTableSize*_FameTableSize]; diff --git a/code/ryzom/common/src/game_share/file_description_container.cpp b/code/ryzom/common/src/game_share/file_description_container.cpp index dae8c6c7c..5dd9d5a7e 100644 --- a/code/ryzom/common/src/game_share/file_description_container.cpp +++ b/code/ryzom/common/src/game_share/file_description_container.cpp @@ -154,7 +154,7 @@ void CFileDescriptionContainer::addFiles(const std::string& directory, const std // extract the files that match the given wildcard and build a result vector { H_AUTO(fdcAddFilesTestWildcards) - for (uint32 i=rawFileNames.size();i--;) + for (uint32 i=(uint32)rawFileNames.size();i--;) { uint32 j; for (j=0;jtoString(); uint32 firstValue = 0; - uint32 lastValue = _Value.size(); + uint32 lastValue = (uint32)_Value.size(); for (; firstValue != lastValue; ++firstValue) { if ( key == _Value[firstValue].first) @@ -999,7 +999,7 @@ void CObjectTable::sort() } { uint32 firstValue = 0; - uint32 lastValue = _Value.size(); + uint32 lastValue = (uint32)_Value.size(); for (; firstValue != lastValue; ++firstValue) { if ( _Value[firstValue].first != "Keys" && _Value[firstValue].second != 0) @@ -1087,7 +1087,7 @@ void CObjectTable::doSerialize(std::string& out, CSerializeContext& context) co std::vector indexs; uint32 i = 0; - uint32 size = _Value.size(); + uint32 size = (uint32)_Value.size(); indexs.reserve(size); for (; i < size ; ++i) { @@ -1170,7 +1170,7 @@ CObject* CObjectTable::getAttr(const std::string & name) const if (name.size() >= 1 && '0' <= name[0] && name[0] <='9') { uint32 first2 = 0; - uint32 end2 = name.size(); + uint32 end2 = (uint32)name.size(); for ( ; first2 != end2 && '0' <= name[first2] && name[first2] <= '9'; ++first2) {} if (first2 == end2) { @@ -1309,7 +1309,7 @@ void CObjectTable::clear() uint32 CObjectTable::getSize() const { //H_AUTO(R2_CObjectTable_getSize) - return _Value.size(); + return (uint32)_Value.size(); } bool CObjectTable::doIsTable() const { return true;} @@ -1321,7 +1321,7 @@ sint32 CObjectTable::findIndex(const CObject* child) const { //H_AUTO(R2_CObjectTable_findIndex) CHECK_TABLE_INTEGRITY - uint32 first(0), last(_Value.size()); + uint32 first = 0, last = (uint32)_Value.size(); for (; first != last && _Value[first].second != child ; ++first){} if (first == last) return -1; return first; @@ -1331,7 +1331,7 @@ sint32 CObjectTable::findIndex(const std::string &key) const { //H_AUTO(R2_CObjectTable_findIndex) CHECK_TABLE_INTEGRITY - uint32 first(0), last(_Value.size()); + uint32 first = 0, last = (uint32)_Value.size(); for (; first != last && _Value[first].first != key ; ++first){} if (first == last) return -1; return first; @@ -1399,7 +1399,7 @@ bool CObjectTable::insert(const std::string& key, CObject* value, sint32 posit { //H_AUTO(R2_CObjectTable_insert) CHECK_TABLE_INTEGRITY - uint32 count = _Value.size(); + uint32 count = (uint32)_Value.size(); BOMB_IF(!( -1 <= position && position <= static_cast(count)), "Try to take an element that does not exist", return false); BOMB_IF(!value, "Try to insert a Null value", return false); @@ -1892,7 +1892,7 @@ uint32 CObject::instanceIdToUint32(const std::string& instanceId) { //H_AUTO(R2_CObject_instanceIdToUint32) if (instanceId.empty()) return 0; - uint32 size = instanceId.size(); + uint32 size = (uint32)instanceId.size(); if ( instanceId.substr(0, 6) != "Client") { nlwarning("R2Share: Wrong InstanceId(%s)", instanceId.c_str()); @@ -2231,13 +2231,13 @@ public: { uint initLength = stream.getPos(); serializer->Level +=2; - uint32 first(0), last(optionalPropFoundIndex.size()); + uint32 first = 0, last = (uint32)optionalPropFoundIndex.size(); uint8 optionalSize = static_cast(last); stream.serial(optionalSize); for (; first != last; ++first) { std::string key = data->getKey(optionalPropFoundIndex[first]); - uint32 uiKey(0), lastLocal(_OptionalProp.size()); + uint32 uiKey = 0, lastLocal = (uint32)_OptionalProp.size(); for ( ; uiKey != lastLocal && _OptionalProp[uiKey]!=key ; ++uiKey){} @@ -2261,7 +2261,7 @@ public: uint initLength = stream.getPos(); serializer->Level +=2; - uint32 first(0), last(valuePropFoundIndex.size()); + uint32 first = 0, last = (uint32)valuePropFoundIndex.size(); uint16 last16 = static_cast(last); stream.serial(last16); for (; first != last; ++first) @@ -2285,7 +2285,7 @@ public: serializer->Level +=2; - uint32 first(0), last(otherPropFoundIndex.size()); + uint32 first = 0, last = (uint32)otherPropFoundIndex.size(); uint16 last16 = static_cast(last); stream.serial(last16); for (; first != last; ++first) @@ -2960,7 +2960,7 @@ void CObjectSerializerImpl::serialImpl(NLMISC::IStream& stream, CObject*& data, { uint initLength = stream.getPos(); std::string value = data->toString(); - uint32 size = value.size(); + uint32 size = (uint32)value.size(); if (size == 0) { diff --git a/code/ryzom/common/src/game_share/persistent_data.cpp b/code/ryzom/common/src/game_share/persistent_data.cpp index 454ddfaa5..e35b5fd39 100644 --- a/code/ryzom/common/src/game_share/persistent_data.cpp +++ b/code/ryzom/common/src/game_share/persistent_data.cpp @@ -105,7 +105,7 @@ uint16 CPersistentDataRecord::addString(const string& name) // H_AUTO(CPersistentDataRecordAddString); // store the length of the input string for speed of access (just to help the optimiser do its job) - uint32 len= name.size(); + uint32 len= (uint32)name.size(); //Disabled to allow >=256 char strings. //DROP_IF(len>=256,"Attempt to add a string of > 256 characters to the string table",return 0); @@ -115,7 +115,7 @@ uint16 CPersistentDataRecord::addString(const string& name) { case 0: // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { if (_StringTable[i].empty()) return (uint16)i; @@ -127,7 +127,7 @@ uint16 CPersistentDataRecord::addString(const string& name) char c0= name[0]; // first and only char of name // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { const string &s= _StringTable[i]; if (s.size()==len && s[0]==c0) @@ -141,7 +141,7 @@ uint16 CPersistentDataRecord::addString(const string& name) uint16 c01= *(uint16*)&name[0]; // first and only 2 chars of name // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { const string &s= _StringTable[i]; if (s.size()==len && (*(uint16*)&s[0]==c01) ) @@ -156,7 +156,7 @@ uint16 CPersistentDataRecord::addString(const string& name) char c2= name[2]; // third and final char of name // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { const string &s= _StringTable[i]; if (s.size()==len && (*(uint16*)&s[0]==c01) && s[2]==c2) @@ -170,7 +170,7 @@ uint16 CPersistentDataRecord::addString(const string& name) uint32 c0123= *(uint32*)&name[0]; // first and only 4 chars of name // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { const string &s= _StringTable[i]; if (s.size()==len && (*(uint32*)&s[0]==c0123) ) @@ -189,7 +189,7 @@ uint16 CPersistentDataRecord::addString(const string& name) uint32 cLast= *(uint32*)&name[endOffs]; // last 4 chars of name (touch or overlap with first 4 chars) // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { const string &s= _StringTable[i]; if (s.size()==len && (*(uint32*)&s[0]==cFirst) && (*(uint32*)&s[endOffs]==cLast)) @@ -209,7 +209,7 @@ uint16 CPersistentDataRecord::addString(const string& name) uint32 cLast= *(uint32*)&name[endOffs]; // last 4 chars of name (touch or overlap with middle 4 chars) // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { const string &s= _StringTable[i]; if (s.size()==len && (*(uint32*)&s[0]==cFirst) && (*(uint32*)&s[endOffs]==cLast) && (*(uint32*)&s[4]==cMid)) @@ -230,7 +230,7 @@ uint16 CPersistentDataRecord::addString(const string& name) uint32 cLast= *(uint32*)&name[endOffs]; // last 4 chars of name (touch or overlap with third 4 chars) // run through the existing strings looking for a match - for (uint32 i=_StringTable.size();i--;) + for (uint32 i=(uint32)_StringTable.size();i--;) { const string &s= _StringTable[i]; if (s.size()==len && (*(uint32*)&s[0]==cFirst) && (*(uint32*)&s[endOffs]==cLast) @@ -278,7 +278,7 @@ uint16 CPersistentDataRecord::addString(const string& name) { // H_AUTO(CPersistentDataRecordAddString_NoMatchFound); - uint16 result= _StringTable.size(); + uint16 result= (uint16)_StringTable.size(); _StringTable.push_back(name); BOMB_IF(result==(uint16)~0u,"No more room in string table!!!",_StringTable.pop_back()); return result; @@ -547,8 +547,8 @@ uint32 CPersistentDataRecord::totalDataSize() const result+= sizeof(uint32); // sizeof 'number of args in the arg table' variable result+= sizeof(uint32); // sizeof 'number of strings in the string table' variable result+= sizeof(uint32); // sizeof 'string table data size' variable - result+= _TokenTable.size()*sizeof(TToken); // sizeof the token data - result+= _ArgTable.size()*sizeof(_ArgTable[0]); // size of the args data + result+= (uint32)_TokenTable.size()*sizeof(TToken); // sizeof the token data + result+= (uint32)_ArgTable.size()*sizeof(_ArgTable[0]); // size of the args data result+= stringDataSize(); // the data size for the strings in the string table return result; @@ -559,7 +559,7 @@ uint32 CPersistentDataRecord::stringDataSize() const { uint32 result=0; for (uint32 i=0;i<_StringTable.size();++i) - result+=_StringTable[i].size()+1; // the data size for the strings in the string table + result+=(uint32)_StringTable[i].size()+1; // the data size for the strings in the string table return result; } @@ -568,7 +568,7 @@ bool CPersistentDataRecord::toStream(NLMISC::IStream& dest) H_AUTO(CPersistentDataRecordWriteToStream); #define WRITE(type,what) { type v= (type)(what); dest.serial(v); } - #define WRITE_BUFF(type,what) dest.serialBuffer( (uint8*)&what[0], sizeof(type) * what.size() ) + #define WRITE_BUFF(type,what) dest.serialBuffer( (uint8*)&what[0], sizeof(type) * (uint)what.size() ) // mark the amount of data in output stream before we start adding pdr contents uint32 dataStart= dest.getPos(); @@ -618,9 +618,9 @@ bool CPersistentDataRecord::toBuffer(char *dest,uint32 bufferSize) // write the header block WRITE(uint32,0); WRITE(uint32,totalDataSize()); - WRITE(uint32,_TokenTable.size()); - WRITE(uint32,_ArgTable.size()); - WRITE(uint32,_StringTable.size()); + WRITE(uint32,(uint32)_TokenTable.size()); + WRITE(uint32,(uint32)_ArgTable.size()); + WRITE(uint32,(uint32)_StringTable.size()); WRITE(uint32,stringDataSize()); // write the tokens @@ -787,7 +787,7 @@ bool CPersistentDataRecord::writeToTxtFile(const char* fileName,TStringFormat st // write the binary data to file try { - f.serialBuffer((uint8*)&s[0],s.size()); + f.serialBuffer((uint8*)&s[0],(uint)s.size()); } catch(...) { @@ -952,7 +952,7 @@ bool CPersistentDataRecord::fromXML(const std::string& s) // to contain any data of their own - they are just a fonctionality wrapper round a std::string nlctassert(sizeof(string)==sizeof(CSString)); const CSString& buff= static_cast(s); - uint32 len=s.size(); + uint32 len=(uint32)s.size(); // make sure the persistent data record is cleared out before we fill it with data clear(); @@ -989,7 +989,7 @@ bool CPersistentDataRecord::fromXML(const std::string& s) DROP_IF(clauses.size()<2||clauses[0]!="/xml"||clauses.back()!="xml","Invalid data file - didn't find .. structure",return false) // run through the set of clauses to add them to the data block... - for (uint32 i=clauses.size()-1;--i;) + for (uint32 i=(uint32)clauses.size()-1;--i;) { // clauses are of four types: <...>=struct_begin =struct_end, <../>=prop, =comment if (clauses[i].left(1)=="!" || clauses[i].left(1)=="?") @@ -1075,7 +1075,7 @@ bool CPersistentDataRecord::fromStream(NLMISC::IStream& stream, uint32 size) // read the file data try { - stream.serialBuffer((uint8*)&buff[0],buff.size()); + stream.serialBuffer((uint8*)&buff[0],(uint)buff.size()); } catch(...) { @@ -1134,7 +1134,7 @@ bool CPersistentDataRecord::readFromFile(const char* fileName) buffer.resize(length); // read the data - uint32 blocksRead= fread(&buffer[0],length,1,inf); + uint32 blocksRead= (uint32)fread(&buffer[0],length,1,inf); fclose(inf); DROP_IF( blocksRead!=1, "Failed to read data from file "<_Children.size()); + return attachToParent(parent,parent==NULL?~0u:(uint32)parent->_Children.size()); } bool CPersistentDataTreeNode::attachToParent(CPersistentDataTreeNode* parent,uint32 idx) diff --git a/code/ryzom/common/src/game_share/r2_share_itf.h b/code/ryzom/common/src/game_share/r2_share_itf.h index b960f4368..91d8bab1c 100644 --- a/code/ryzom/common/src/game_share/r2_share_itf.h +++ b/code/ryzom/common/src/game_share/r2_share_itf.h @@ -199,7 +199,7 @@ namespace R2 // skill name too short _Value = invalid_val; } - uint32 size = skillName.size()-1; + uint32 size = (uint32)skillName.size()-1; if (size < end_of_enum) _Value = TValues(size); else diff --git a/code/ryzom/common/src/game_share/r2_types.h b/code/ryzom/common/src/game_share/r2_types.h index 24171ce39..ae9be76e4 100644 --- a/code/ryzom/common/src/game_share/r2_types.h +++ b/code/ryzom/common/src/game_share/r2_types.h @@ -359,7 +359,7 @@ namespace R2 uint32 size = 0; if (!f.isReading() ) { - size = Value.size(); + size = (uint32)Value.size(); f.serial(size); } else diff --git a/code/ryzom/common/src/game_share/ring_access.cpp b/code/ryzom/common/src/game_share/ring_access.cpp index 0065d83c9..eb6bf1d4c 100644 --- a/code/ryzom/common/src/game_share/ring_access.cpp +++ b/code/ryzom/common/src/game_share/ring_access.cpp @@ -228,7 +228,7 @@ bool CRingAccess::isSheetClient(const NLMISC::CSheetId& sheet) const std::string sheetStr = sheet.toString(); - uint32 sheetLength = sheetStr.length(); + uint32 sheetLength = (uint32)sheetStr.length(); diff --git a/code/ryzom/common/src/game_share/scenario.cpp b/code/ryzom/common/src/game_share/scenario.cpp index 901a3715e..74306ff71 100644 --- a/code/ryzom/common/src/game_share/scenario.cpp +++ b/code/ryzom/common/src/game_share/scenario.cpp @@ -840,14 +840,14 @@ bool CScenarioValidator::setScenarioToLoad( const std::string& filename, CScenar static const char * slashheader = "---- /Header\n\n"; static const char * comment = "-- "; - static const unsigned int headerLen = strlen(header); - static const unsigned int slasheaderLen = strlen(slashheader); - static const unsigned int commentLen = strlen(comment); + static const unsigned int headerLen = (unsigned int)strlen(header); + static const unsigned int slasheaderLen = (unsigned int)strlen(slashheader); + static const unsigned int commentLen = (unsigned int)strlen(comment); NLMISC::CSString tmp; tmp.resize( inf.getFileSize() ); - inf.serialBuffer((uint8*)&tmp[0], tmp.size()); + inf.serialBuffer((uint8*)&tmp[0], (uint)tmp.size()); _ScenarioBody = tmp.replace("\r\n", "\n"); @@ -902,12 +902,12 @@ bool CScenarioValidator::setScenarioToLoad( const std::string& filename, CScenar std::string::size_type subHeader = _ScenarioBody.find("-- BodyMD5", startHeader); if (checkMD5) { - std::string md5Id1 = NLMISC::getMD5((uint8*)(_ScenarioBody.data() + subHeader), endHeader - subHeader).toString(); + std::string md5Id1 = NLMISC::getMD5((uint8*)(_ScenarioBody.data() + subHeader), (uint32)(endHeader - subHeader)).toString(); if (values[2].second != md5Id1 ) { return false; } - std::string md5Id2 = NLMISC::getMD5((uint8*)(_ScenarioBody.data() + endHeader + slasheaderLen), _ScenarioBody.size() - (endHeader + slasheaderLen)).toString(); + std::string md5Id2 = NLMISC::getMD5((uint8*)(_ScenarioBody.data() + endHeader + slasheaderLen), (uint32)(_ScenarioBody.size() - (endHeader + slasheaderLen))).toString(); if (values[3].second != md5Id2) { return false; @@ -965,7 +965,7 @@ bool CScenarioValidator::setScenarioToSave(const std::string& filename, CObject* _ScenarioBody = out2; { - NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_ScenarioBody.data(), _ScenarioBody.size()); + NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_ScenarioBody.data(),(uint32) _ScenarioBody.size()); _BodyMd5 = md5Id.toString().c_str(); } @@ -986,7 +986,7 @@ bool CScenarioValidator::setScenarioToSave(const std::string& filename, CObject* _HeaderBody =out2; std::string headerBodyMd5; { - NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_HeaderBody.data(), _HeaderBody.size()); + NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_HeaderBody.data(), (uint32)_HeaderBody.size()); _HeaderMd5 = md5Id.toString().c_str(); headerMD5 = _HeaderMd5; } @@ -1044,7 +1044,7 @@ bool CScenarioValidator::applySave(const std::string& signature) out2 += "---- /Header\n\n"; out2 += _ScenarioBody; - out.serialBuffer((uint8*)out2.c_str(), out2.size()); + out.serialBuffer((uint8*)out2.c_str(), (uint)out2.size()); if (_Filename != std::string("data/r2_buffer.dat") ) { nlinfo("Scenario %s saved", _Filename.c_str()); @@ -1099,14 +1099,14 @@ bool CUserComponentValidator::setUserComponentToLoad( const std::string& filenam static const char * slashheader = "---- /Header\n\n"; static const char * comment = "-- "; - static const unsigned int headerLen = strlen(header); - static const unsigned int slasheaderLen = strlen(slashheader); - static const unsigned int commentLen = strlen(comment); + static const unsigned int headerLen = (unsigned int)strlen(header); + static const unsigned int slasheaderLen = (unsigned int)strlen(slashheader); + static const unsigned int commentLen = (unsigned int)strlen(comment); NLMISC::CSString tmp; tmp.resize( inf.getFileSize() ); - inf.serialBuffer((uint8*)&tmp[0], tmp.size()); + inf.serialBuffer((uint8*)&tmp[0], (uint)tmp.size()); _UserComponentBody = tmp.replace("\r\n", "\n"); // Scenario without header @@ -1157,12 +1157,12 @@ bool CUserComponentValidator::setUserComponentToLoad( const std::string& filenam std::string::size_type subHeader = _UserComponentBody.find("-- BodyMD5", startHeader); if (checkMD5) { - std::string md5Id1 = NLMISC::getMD5((uint8*)(_UserComponentBody.data() + subHeader), endHeader - subHeader).toString(); + std::string md5Id1 = NLMISC::getMD5((uint8*)(_UserComponentBody.data() + subHeader), (uint32)(endHeader - subHeader)).toString(); if (values[2].second != md5Id1 ) { return false; } - std::string md5Id2 = NLMISC::getMD5((uint8*)(_UserComponentBody.data() + endHeader + slasheaderLen), _UserComponentBody.size() - (endHeader + slasheaderLen)).toString(); + std::string md5Id2 = NLMISC::getMD5((uint8*)(_UserComponentBody.data() + endHeader + slasheaderLen), (uint32)(_UserComponentBody.size() - (endHeader + slasheaderLen))).toString(); if (values[3].second != md5Id2) { return false; @@ -1213,7 +1213,7 @@ bool CUserComponentValidator::setUserComponentToSave(const std::string& filename _UserComponentBody = body; { - NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_UserComponentBody.data(), _UserComponentBody.size()); + NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_UserComponentBody.data(), (uint32)_UserComponentBody.size()); _BodyMd5 = md5Id.toString().c_str(); } @@ -1248,7 +1248,7 @@ bool CUserComponentValidator::setUserComponentToSave(const std::string& filename std::string headerBodyMd5; { - NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_HeaderBody.data(), _HeaderBody.size()); + NLMISC::CHashKeyMD5 md5Id = NLMISC::getMD5((uint8*)_HeaderBody.data(), (uint32)_HeaderBody.size()); _HeaderMd5 = md5Id.toString().c_str(); headerMD5 = _HeaderMd5; } @@ -1311,7 +1311,7 @@ bool CUserComponentValidator::applySave(const std::string& signature) out2 += _UserComponentBody; - out.serialBuffer((uint8*)out2.c_str(),out2.size()); + out.serialBuffer((uint8*)out2.c_str(),(uint)out2.size()); if (_Filename != std::string("data/r2_buffer.dat") ) { nlinfo("UserComponent %s saved", _Filename.c_str()); diff --git a/code/ryzom/common/src/game_share/scenario_entry_points.cpp b/code/ryzom/common/src/game_share/scenario_entry_points.cpp index b6711beb2..81dd3e6e2 100644 --- a/code/ryzom/common/src/game_share/scenario_entry_points.cpp +++ b/code/ryzom/common/src/game_share/scenario_entry_points.cpp @@ -189,7 +189,7 @@ void CScenarioEntryPoints::loadFromFile() // read the file contents into a string 's' CSString s; s.resize(inf.getFileSize()); - inf.serialBuffer((uint8*)&s[0],s.size()); + inf.serialBuffer((uint8*)&s[0],(uint)s.size()); // close the file inf.close(); diff --git a/code/ryzom/common/src/game_share/send_chat.h b/code/ryzom/common/src/game_share/send_chat.h index 20786ec14..cefb8bba0 100644 --- a/code/ryzom/common/src/game_share/send_chat.h +++ b/code/ryzom/common/src/game_share/send_chat.h @@ -68,7 +68,7 @@ inline void npcChatParamToChannel(const TDataSetRow &senderId, CChatGroup::TGrou msgout.serialEnum(groupType); msgout.serial(const_cast(phraseId)); - uint32 size = params.size(); + uint32 size = (uint32)params.size(); msgout.serial(size); // params.resize(size); for ( uint i = 0; i < size; i++ ) @@ -153,7 +153,7 @@ inline void forwardToDssArg(const TDataSetRow &senderId, CChatGroup::TGroupType msgout.serialEnum(groupType); msgout.serial(sentenceId); msgout.serial(scenarioId); - uint32 size=argValues.size(),i=0; + uint32 size=(uint32)argValues.size(),i=0; msgout.serial(size); for(;i& entities =found->second.getAToBMap(); - return entities.size(); + return (uint32)entities.size(); } @@ -426,7 +426,7 @@ public: void sendSeasonToChar(uint32 charId, uint8 season) const; - uint32 getActCount() const { return Pdrs.size(); } + uint32 getActCount() const { return (uint32)Pdrs.size(); } void updateUserTriggerDescriptions(TUserTriggerDescriptions& userTriggerDescriptions); @@ -503,11 +503,11 @@ void CAnimationSession::updateUserTriggerDescriptions(TUserTriggerDescriptions& //Act0 trigger uint32 actIndex = 0; - uint32 actCount = Acts.size(); + uint32 actCount = (uint32)Acts.size(); for ( ; actIndex != actCount; ++actIndex) { CRtAct* act = Acts[actIndex]; - uint32 userTriggerCount = act->UserTriggers.size(); + uint32 userTriggerCount = (uint32)act->UserTriggers.size(); uint32 index = 0; for ( ; index != userTriggerCount; ++index) { @@ -527,7 +527,7 @@ void CAnimationSession::updateActPositionDescriptions(TActPositionDescriptions& actPositionDescriptions.clear(); uint32 actIndex = 0; - uint32 actCount = Acts.size(); + uint32 actCount = (uint32)Acts.size(); for ( ; actIndex != actCount; ++actIndex) { CRtAct* act = Acts[actIndex]; @@ -594,7 +594,7 @@ public: vector result; NLMISC::splitString(str, "\n", result); - uint32 first(0), last(result.size()); + uint32 first = 0, last = (uint32)result.size(); for ( ; first != last ; ++first) { result[first] = prefix + result[first] ; @@ -948,7 +948,7 @@ void CServerAnimationModule::init(NLNET::IModuleSocket* gateway, CDynamicMapServ // check if the AI service is up const std::vector &connectionList = CUnifiedNetwork::getInstance()->getConnectionList(); - for( uint i = connectionList.size(); i > 0; --i ) + for( uint i = (uint)connectionList.size(); i > 0; --i ) { nldebug( "R2An: %s is already up", CUnifiedNetwork::getInstance()->getServiceName(connectionList[i-1]).c_str() ); if( "AIS" == CUnifiedNetwork::getInstance()->getServiceName(connectionList[i-1]) ) @@ -1053,7 +1053,7 @@ IPrimitive* CServerAnimationModule::getAction(CObject* action, const std::string vector result; NLMISC::splitString(str, "\n", result); - uint32 first(0), last(result.size()); + uint32 first = 0, last = (uint32)result.size(); for ( ; first != last ; ++first) { if (first == 0) @@ -1139,7 +1139,7 @@ bool CServerAnimationModule::queueSession(CAnimationSession* session, bool /* ru std::string ss; output.open("outpout.rt"); session->RtData->serialize(ss); - output.serialBuffer((uint8*)ss.c_str(), ss.size()); + output.serialBuffer((uint8*)ss.c_str(), (uint)ss.size()); output.flush(); output.close(); } @@ -1638,7 +1638,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C std::string sheet_client = objectNpc->toString("SheetClient"); { - uint32 len = sheet_client.length(); + uint32 len = (uint32)sheet_client.length(); //9=".creature".length() if(len>9) { @@ -1651,7 +1651,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C std::string sheet = objectNpc->toString("Sheet"); { - uint32 len = sheet.length(); + uint32 len = (uint32)sheet.length(); //9=".creature".length() if(len>9) { @@ -1664,13 +1664,13 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C if (UseSheetClientWithLevel) { static std::string basic="basic_"; - static uint32 basicSize = basic.size(); + static uint32 basicSize = (uint32)basic.size(); static std::string female = "_female"; - static uint32 femaleSize = female.size(); + static uint32 femaleSize = (uint32)female.size(); static std::string male = "_male"; - static uint32 maleSize = male.size(); + static uint32 maleSize = (uint32)male.size(); - uint32 sheetClientSize = sheet_client.size(); + uint32 sheetClientSize = (uint32)sheet_client.size(); // Special case of basic_*_female or basic_*_female if ( (sheetClientSize > basicSize && sheet_client.substr(0, basicSize) == basic) && !sheet.empty() && @@ -2006,7 +2006,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi } } - uint32 first(0), last(primDocs.size()); + uint32 first = 0, last = (uint32)primDocs.size(); animSession->Pdrs.resize(last); @@ -3728,14 +3728,14 @@ void CServerAnimationModule::requestLoadTable(CAnimationSession* session) msg.serial(scenarioId); { - uint32 size = session->ConnectedChars.size(); + uint32 size = (uint32)session->ConnectedChars.size(); std::vector connected; for(uint32 i=0; igetClientProxyPtr(session->ConnectedChars[i]); if (ptr){ connected.push_back(ptr); } } - uint32 connectedSize = connected.size(); + uint32 connectedSize = (uint32)connected.size(); msg.serial( connectedSize ); for(uint32 i=0; i itemsAndQuantities; - uint32 first(0), last(itemNames.size()); + uint32 first = 0, last = (uint32)itemNames.size(); for (; first != last ; ++first) { std::vector itemAndQt; @@ -4292,7 +4292,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerAnimationModule, displayMissionItems) CAnimationSession* animationSession = getSession(sessionId); if (animationSession) { - uint32 first(0), last(animationSession->MissionItems.size()); + uint32 first = 0, last = (uint32)animationSession->MissionItems.size(); log.displayNL("%d Missions Item:", last); for ( ;first != last ; ++first) { @@ -4331,7 +4331,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerAnimationModule, displayUserTriggers) animationSession->updateUserTriggerDescriptions(userTriggerDescriptions); - uint32 first(0), last(userTriggerDescriptions.size()); + uint32 first = 0, last = (uint32)userTriggerDescriptions.size(); log.displayNL("%d User Trigger:", last); for ( ;first != last ; ++first) { diff --git a/code/ryzom/common/src/game_share/server_edition_module.cpp b/code/ryzom/common/src/game_share/server_edition_module.cpp index 29c0351cc..940f013a0 100644 --- a/code/ryzom/common/src/game_share/server_edition_module.cpp +++ b/code/ryzom/common/src/game_share/server_edition_module.cpp @@ -518,7 +518,7 @@ std::string CKeysHolder::getSignature(const std::string& md5, const std::string& } std::string tmp = md5; tmp += found->second.PrivateKeyValue; - std::string wantedSignature = NLMISC::CHashKeyMD5(NLMISC::getMD5((uint8*)tmp.data(), tmp.size())).toString(); + std::string wantedSignature = NLMISC::CHashKeyMD5(NLMISC::getMD5((uint8*)tmp.data(), (uint32)tmp.size())).toString(); return key + ":" + wantedSignature; } @@ -1184,7 +1184,7 @@ void CServerEditionModule::updateRSMGR() { runningSession->setSessionId(first->first); runningSession->setInstanceId(first->second->getAiInstanceId()); - runningSession->setNbPlayingChars(first->second->getCurrentChars().size()); + runningSession->setNbPlayingChars((uint32)first->second->getCurrentChars().size()); runningSession->setSessionType(first->second->getSessionType()); } @@ -4304,7 +4304,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerEditionModule, displaySession) log.displayNL("HighLevel data:"); std::vector lines; NLMISC::splitString(ss, "\n", lines); - uint first=0, last=lines.size(); + uint first=0, last=(uint)lines.size(); for (; first != last ; ++first) { log.displayNL("%s", lines[first].c_str()); } } } @@ -4329,7 +4329,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerEditionModule, displaySession) std::vector lines; NLMISC::splitString(ss, "\n", lines); - uint first=0, last=lines.size(); + uint first=0, last=(uint)lines.size(); for (; first != last ; ++first) { log.displayNL("%s", lines[first].c_str()); } } @@ -4405,7 +4405,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerEditionModule, dumpSession) log.displayNL("HighLevel data:"); std::vector lines; NLMISC::splitString(ss, "\n", lines); - uint first=0, last=lines.size(); + uint first=0, last=(uint)lines.size(); for (; first != last ; ++first) { log.displayNL("%s", lines[first].c_str()); } } } @@ -4430,7 +4430,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerEditionModule, dumpSession) std::vector lines; NLMISC::splitString(ss, "\n", lines); - uint first=0, last=lines.size(); + uint first=0, last=(uint)lines.size(); for (; first != last ; ++first) { log.displayNL("%s", lines[first].c_str()); } } @@ -5504,7 +5504,7 @@ void CServerEditionModule::updateSessionListFile() nldebug("UPDATING ring access override file list - BSI send file: %s",getOverrideRingAccessFilename().c_str()); CBackupMsgSaveFile msg( getOverrideRingAccessFilename(), CBackupMsgSaveFile::SaveFileCheck, Bsi ); - msg.DataMsg.serialBuffer((uint8*)copy.c_str(), copy.size()); + msg.DataMsg.serialBuffer((uint8*)copy.c_str(), (uint)copy.size()); Bsi.sendFile( msg ); _MustUpdateOverrideRingAcess = false; } @@ -6320,7 +6320,7 @@ void CServerEditionModule::multiPartMsgBody(NLNET::IModuleProxy *sbs, uint32 cha if (!info->WaitingMsg) { nlwarning("Error: Char %u was ask to receive a multi-part message part but the first part seems to have been lost.", charId) ;return; } - info->WaitingMsg->serialBuffer(const_cast(&data[0]), data.size()); + info->WaitingMsg->serialBuffer(const_cast(&data[0]), (uint)data.size()); //info->WaitingMsgCurrentSize += data.size(); const NLNET::TModuleProxyPtr* clientEditionProxyPtr = getClientProxyPtr(charId); @@ -6328,7 +6328,7 @@ void CServerEditionModule::multiPartMsgBody(NLNET::IModuleProxy *sbs, uint32 cha { NLNET::TModuleProxyPtr clientEditionProxy = (*clientEditionProxyPtr); CShareClientEditionItfProxy proxy( *clientEditionProxyPtr ); - proxy.multiPartMsgBody(this, partId, data.size()); + proxy.multiPartMsgBody(this, partId, (uint32)data.size()); } } diff --git a/code/ryzom/common/src/game_share/small_string_manager.cpp b/code/ryzom/common/src/game_share/small_string_manager.cpp index a20e3e7ab..308cc5177 100644 --- a/code/ryzom/common/src/game_share/small_string_manager.cpp +++ b/code/ryzom/common/src/game_share/small_string_manager.cpp @@ -145,7 +145,7 @@ void CSmallStringManager::serial(NLMISC::IStream& stream) //serialize maxId stream.serial(_MaxId); //serialize the number of free ids - uint32 tmp = _FreeIds.size(); + uint32 tmp = (uint32)_FreeIds.size(); stream.serial(tmp); //serialize the free ids std::set< uint32 >::const_iterator first(_FreeIds.begin()),last(_FreeIds.end()); @@ -154,7 +154,7 @@ void CSmallStringManager::serial(NLMISC::IStream& stream) tmp = *first; stream.serial(tmp); } - tmp = _IdToString.size(); + tmp = (uint32)_IdToString.size(); nlassert(tmp==_StringToId.size()); //serialize the number of entries diff --git a/code/ryzom/common/src/game_share/string_manager_sender.cpp b/code/ryzom/common/src/game_share/string_manager_sender.cpp index cecc5896a..cfea77c61 100644 --- a/code/ryzom/common/src/game_share/string_manager_sender.cpp +++ b/code/ryzom/common/src/game_share/string_manager_sender.cpp @@ -262,7 +262,7 @@ namespace STRING_MANAGER msgout2.serial( const_cast(clientRowId) ); msgout2.serial(const_cast(stringNameStr)); - uint32 size = params.size(); + uint32 size = (uint32)params.size(); msgout2.serial(size); for ( uint i = 0; i < size; i++ ) { diff --git a/code/ryzom/common/src/game_share/string_mgr_module.cpp b/code/ryzom/common/src/game_share/string_mgr_module.cpp index 1341473e2..01f68ba2d 100644 --- a/code/ryzom/common/src/game_share/string_mgr_module.cpp +++ b/code/ryzom/common/src/game_share/string_mgr_module.cpp @@ -380,7 +380,7 @@ void CStringManagerModule::registerTableRequested(const CMessage& msgin) void CStringManagerModule::registerTableRequested(TSessionId sessionId, std::vector >& entries) { std::string id,text; - uint32 nbEntry = entries.size(); + uint32 nbEntry = (uint32)entries.size(); releaseTable(sessionId.asInt()); for(uint i=0;i args) { - uint32 size = args.size(); + uint32 size = (uint32)args.size(); std::string ret=""; { - uint pos = 0; + std::string::size_type pos = 0; CSString cstring(str); for(uint i=0;ibegin()),last(localTable->end()); CMessage msg("idList"); - uint32 nb = localTable->size(); + uint32 nb = (uint32)localTable->size(); msg.serial(nb); for( ; first!=last; ++first) { @@ -655,7 +655,7 @@ void CStringManagerModule::sendTable(TSessionId scenarioId,IModuleProxy *moduleP TLocalTable* localTable = getLocalTable(scenarioId.asInt()); if (localTable != NULL) { - uint32 nb = localTable->size(); + uint32 nb = (uint32)localTable->size(); if(nb==0)return; CMessage msg("stringTable"); //eid of the client requesting the string table @@ -761,7 +761,7 @@ void ClientInfo::addIncarnation(TChanID chanId,TDataSetRow& npcId) //release all channels used by this client void ClientInfo::clear() { - uint32 size = _Incarnations.size(); + uint32 size = (uint32)_Incarnations.size(); for(uint32 i=0;i* task) { _Tasks.push_back(task); _Clean = false; } void addTaskAt(T t, CTask* task) { task->setTime(t); _Tasks.push_back(task);_Clean = false; } - uint32 getSize() const { return _Tasks.size(); } + uint32 getSize() const { return (uint32)_Tasks.size(); } CTask* getTaskAt(uint32 index) const { nlassert( index < _Tasks.size()); return _Tasks[index].getTask();} void removeTaskAt(uint32 index){ nlassert( index < _Tasks.size()); _Tasks.erase(_Tasks.begin() + index); }; diff --git a/code/ryzom/common/src/game_share/time_weather_season/weather_function.h b/code/ryzom/common/src/game_share/time_weather_season/weather_function.h index 13079ed59..d8f001f40 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/weather_function.h +++ b/code/ryzom/common/src/game_share/time_weather_season/weather_function.h @@ -73,7 +73,7 @@ public: * The maxima and minima are in the range [0, numWeatherSetups] * \param pressure 0 for low pressure and 1 for high pressure */ - uint getNumWeatherSetups() const { return _WeatherSetups.size(); } + uint getNumWeatherSetups() const { return (uint)_WeatherSetups.size(); } const CWeatherSetup *getWeatherSetup(uint index) const { return _WeatherSetups.empty() ? NULL : _WeatherSetups[index].WS; } uint32 getWeatherSetupWeight(uint index) const { return _WeatherSetups[index].Weight; } uint32 getWeatherSetupsTotalWeight() const { return _TotalWeight; } diff --git a/code/ryzom/common/src/game_share/timer.cpp b/code/ryzom/common/src/game_share/timer.cpp index 48987ed62..c0aa08988 100644 --- a/code/ryzom/common/src/game_share/timer.cpp +++ b/code/ryzom/common/src/game_share/timer.cpp @@ -72,7 +72,7 @@ void CTimerManager::tickUpdate() // iterate through the vector processing its events uint32 nextFreeSlot=0; - uint32 size=vect.size(); + uint32 size=(uint32)vect.size(); for (uint32 i=0;i eventPtr=vect[i]; @@ -97,7 +97,7 @@ void CTimerManager::tickUpdate() if (!vect.empty()) { //nlinfo("TimerManagerUpdate: Processed %d of %d events",vect.size()-nextFreeSlot, vect.size()); - NbEventsToProcessInTimerManagerUpdate = vect.size(); + NbEventsToProcessInTimerManagerUpdate = (uint32)vect.size(); NbProcessedEventsInTimerManagerUpdate = NbEventsToProcessInTimerManagerUpdate.get() - nextFreeSlot; } // resize the vector back down to keep only the events that we haven't dealt with yet diff --git a/code/ryzom/common/src/game_share/timer.h b/code/ryzom/common/src/game_share/timer.h index 83d88841a..2a0fc8ea3 100644 --- a/code/ryzom/common/src/game_share/timer.h +++ b/code/ryzom/common/src/game_share/timer.h @@ -416,7 +416,7 @@ inline void CTimerEvent::set(CTimer* owner,NLMISC::TGameCycle time,uint32 variat for (uint32 i=0;igetEventVector(time+i); - uint32 length=vect.size(); + uint32 length=(uint32)vect.size(); if (length<=bestLength) { bestLength= length;