From 7c79fd574bbe384da6dc86d7ab3f4d2b0a44b53a Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 17 May 2010 14:30:28 +0200 Subject: [PATCH] Changed: #853 Compilation on 64-bits platforms --- .../server/src/ai_service/ai_script_comp.cpp | 6 +-- .../server/src/ai_service/ais_user_models.cpp | 6 +-- .../server/src/ai_service/script_compiler.cpp | 2 +- .../src/entities_game_service/admin.cpp | 46 +++++++++---------- .../egs_sheets/egs_static_brick.cpp | 2 +- .../egs_sheets/egs_static_game_item.cpp | 4 +- .../mission_manager/ai_alias_translator.cpp | 4 +- .../mission_manager/mission_step_queue.cpp | 4 +- .../mission_manager/mission_step_talk.cpp | 2 +- code/ryzom/server/src/pd_lib/pd_lib.cpp | 4 +- code/ryzom/server/src/pd_lib/pd_messages.cpp | 2 +- .../persistant_data_service/db_manager.cpp | 5 +- 12 files changed, 44 insertions(+), 43 deletions(-) diff --git a/code/ryzom/server/src/ai_service/ai_script_comp.cpp b/code/ryzom/server/src/ai_service/ai_script_comp.cpp index 3bff6fd04..91c747926 100644 --- a/code/ryzom/server/src/ai_service/ai_script_comp.cpp +++ b/code/ryzom/server/src/ai_service/ai_script_comp.cpp @@ -11,8 +11,8 @@ using namespace NLMISC; void explodeSubStrings(const std::string &str, vector &strings, sint32 parenthesis=0) { const std::string separators("(),"); - uint32 current=0; - uint32 nextCurrent=current; + string::size_type current=0; + string::size_type nextCurrent=current; strings.clear(); nextCurrent=str.find_first_of(separators.c_str(), current); @@ -1060,7 +1060,7 @@ CFightScriptComp *CFightScriptCompReader::createScriptComp (const string &str) t { string scriptCompName; { - const uint32 index=str.find_first_of("()", 0); + const string::size_type index=str.find_first_of("()", 0); if (index==string::npos) throw ReadFightActionException("ScriptComp Creation of :"+str+" Failed because of bad Syntax"); scriptCompName=str.substr(0,index); diff --git a/code/ryzom/server/src/ai_service/ais_user_models.cpp b/code/ryzom/server/src/ai_service/ais_user_models.cpp index 3f524d9ff..ccccc755e 100644 --- a/code/ryzom/server/src/ai_service/ais_user_models.cpp +++ b/code/ryzom/server/src/ai_service/ais_user_models.cpp @@ -35,8 +35,8 @@ void stripWhitespaces(std::string& str) { if(str.empty()) return; - int startIndex = str.find_first_not_of(" "); - int endIndex = str.find_last_not_of(" "); + string::size_type startIndex = str.find_first_not_of(" "); + string::size_type endIndex = str.find_last_not_of(" "); std::string tmp = str; str.erase(); @@ -46,7 +46,7 @@ void stripWhitespaces(std::string& str) std::string removeComment(const std::string &str) { - uint newPos= str.find("//",0); + string::size_type newPos= str.find("//",0); if (newPos != string::npos) { diff --git a/code/ryzom/server/src/ai_service/script_compiler.cpp b/code/ryzom/server/src/ai_service/script_compiler.cpp index 9a7a2bfb6..3d2bd9a78 100644 --- a/code/ryzom/server/src/ai_service/script_compiler.cpp +++ b/code/ryzom/server/src/ai_service/script_compiler.cpp @@ -1117,7 +1117,7 @@ void CCompiler::dumpByteCode (const string &sourceCode, const string &fullName, { // Build a valid filename string tmp = fullName; - int pos; + string::size_type pos; while ((pos=tmp.find (':')) != string::npos) tmp[pos] = '-'; diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index 4a93cf3bd..469e0ad69 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -1245,17 +1245,17 @@ NLMISC_COMMAND (createItemInBag, "Create an item and put it in the player bag", } // banners are the only items in game which use privilege - if( sheetName.find("banner") != -1 ) + if( sheetName.find("banner") != string::npos ) { CPlayer * player = PlayerManager.getPlayer( PlayerManager.getPlayerId(eid) ); // if (player != NULL && !player->havePriv(":DEV:") ) if (player != NULL && player->havePriv(BannerPriv) ) { - if( sheetName.find("_gu") != -1 && !player->havePriv(":G:") ) return false; - if( sheetName.find("_sgu") != -1 && !player->havePriv(":SG:") ) return false; - if( sheetName.find("_vgu") != -1 && !player->havePriv(":VG:") ) return false; - if( sheetName.find("_gm") != -1 && !player->havePriv(":GM:") ) return false; - if( sheetName.find("_sgm") != -1 && !player->havePriv(":SGM:") ) return false; + if( sheetName.find("_gu") != string::npos && !player->havePriv(":G:") ) return false; + if( sheetName.find("_sgu") != string::npos && !player->havePriv(":SG:") ) return false; + if( sheetName.find("_vgu") != string::npos && !player->havePriv(":VG:") ) return false; + if( sheetName.find("_gm") != string::npos && !player->havePriv(":GM:") ) return false; + if( sheetName.find("_sgm") != string::npos && !player->havePriv(":SGM:") ) return false; } } @@ -1333,16 +1333,16 @@ NLMISC_COMMAND (createItemInTmpInv, "Create an item and put it in the player tem } // banners are the only items in game which use privilege - if( sheetName.find("banner") != -1 ) + if( sheetName.find("banner") != string::npos ) { CPlayer * player = PlayerManager.getPlayer( PlayerManager.getPlayerId(eid) ); if (player != NULL && player->havePriv(BannerPriv) ) { - if( sheetName.find("_gu") != -1 && !player->havePriv(":G:") ) return false; - if( sheetName.find("_sgu") != -1 && !player->havePriv(":SG:") ) return false; - if( sheetName.find("_vgu") != -1 && !player->havePriv(":VG:") ) return false; - if( sheetName.find("_gm") != -1 && !player->havePriv(":GM:") ) return false; - if( sheetName.find("_sgm") != -1 && !player->havePriv(":SGM:") ) return false; + if( sheetName.find("_gu") != string::npos && !player->havePriv(":G:") ) return false; + if( sheetName.find("_sgu") != string::npos && !player->havePriv(":SG:") ) return false; + if( sheetName.find("_vgu") != string::npos && !player->havePriv(":VG:") ) return false; + if( sheetName.find("_gm") != string::npos && !player->havePriv(":GM:") ) return false; + if( sheetName.find("_sgm") != string::npos && !player->havePriv(":SGM:") ) return false; } } @@ -1403,16 +1403,16 @@ NLMISC_COMMAND (createItemInInv, "Create items and put them in the given invento } // banners are the only items in game which use privilege - if( sheetName.find("banner") != -1 ) + if( sheetName.find("banner") != string::npos ) { CPlayer * player = PlayerManager.getPlayer( PlayerManager.getPlayerId(eid) ); if (player != NULL && player->havePriv(BannerPriv) ) { - if( sheetName.find("_gu") != -1 && !player->havePriv(":G:") ) return false; - if( sheetName.find("_sgu") != -1 && !player->havePriv(":SG:") ) return false; - if( sheetName.find("_vgu") != -1 && !player->havePriv(":VG:") ) return false; - if( sheetName.find("_gm") != -1 && !player->havePriv(":GM:") ) return false; - if( sheetName.find("_sgm") != -1 && !player->havePriv(":SGM:") ) return false; + if( sheetName.find("_gu") != string::npos && !player->havePriv(":G:") ) return false; + if( sheetName.find("_sgu") != string::npos && !player->havePriv(":SG:") ) return false; + if( sheetName.find("_vgu") != string::npos && !player->havePriv(":VG:") ) return false; + if( sheetName.find("_gm") != string::npos && !player->havePriv(":GM:") ) return false; + if( sheetName.find("_sgm") != string::npos && !player->havePriv(":SGM:") ) return false; } } @@ -4039,12 +4039,12 @@ NLMISC_COMMAND(broadcast,"[repeat= or during=