From a970ad675c60dc779c1dd887cf040804fe72c387 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 13 May 2010 22:53:14 +0200 Subject: [PATCH] Changed: #853 Compilation on 64-bits platforms --- code/nel/include/nel/misc/win_event_emitter.h | 2 +- .../3d/driver/direct3d/driver_direct3d.cpp | 8 ++--- .../src/3d/driver/opengl/driver_opengl.cpp | 2 +- .../3d/driver/opengl/driver_opengl_vertex.cpp | 6 ++-- code/nel/src/misc/displayer.cpp | 4 +-- code/nel/src/misc/path.cpp | 20 +++++++----- code/nel/src/misc/win_displayer.cpp | 32 +++++++++---------- code/nel/src/misc/win_event_emitter.cpp | 6 ++-- code/ryzom/client/src/actions.cpp | 4 +-- code/ryzom/client/src/actions.h | 12 +------ code/ryzom/client/src/actions_client.h | 3 +- code/ryzom/client/src/animation.h | 5 --- code/ryzom/client/src/cdb.h | 7 +--- code/ryzom/client/src/client_chat_manager.cpp | 8 ++--- .../client/src/client_sheets/sbrick_sheet.cpp | 2 +- .../src/interface_v3/action_handler.cpp | 16 +++++----- .../client/src/interface_v3/group_editbox.h | 7 ++-- .../interface_v3/group_in_scene_bubble.cpp | 16 +++++----- .../src/interface_v3/sphrase_manager.cpp | 12 +++---- code/ryzom/client/src/login.cpp | 14 ++++---- code/ryzom/client/src/r2/tool_pick.cpp | 4 +-- .../ryzom/client/src/session_browser_impl.cpp | 4 +-- code/ryzom/client/src/stdpch.h | 10 ++++++ .../common/src/game_share/cst_loader.cpp | 14 ++++---- .../tools/sheets_packer/sheets_packer.cpp | 4 +-- 25 files changed, 106 insertions(+), 116 deletions(-) diff --git a/code/nel/include/nel/misc/win_event_emitter.h b/code/nel/include/nel/misc/win_event_emitter.h index cd08443b2..9a0dd8768 100644 --- a/code/nel/include/nel/misc/win_event_emitter.h +++ b/code/nel/include/nel/misc/win_event_emitter.h @@ -98,7 +98,7 @@ public: /** Process a win32 message. * Return true if the message must be trapped, false if DefWindowProc must be called afterwards */ - bool processMessage (HWND hWnd, uint32 msg, uint32 wParam, uint32 lParam, CEventServer *server=NULL); + bool processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPARAM lParam, CEventServer *server=NULL); private: CWinEventServer _InternalServer; HWND _HWnd; diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 901c5e3f3..ea4a07840 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -2308,13 +2308,13 @@ bool CDriverD3D::setMode (const GfxMode& mode) if( mode.Windowed ) { // Set windowed-mode style - SetWindowLongPtrW( _HWnd, GWL_STYLE, D3D_WINDOWED_STYLE|WS_VISIBLE); + SetWindowLongW( _HWnd, GWL_STYLE, D3D_WINDOWED_STYLE|WS_VISIBLE); _FullScreen = false; } else { // Set fullscreen-mode style - SetWindowLongPtrW( _HWnd, GWL_STYLE, D3D_FULLSCREEN_STYLE|WS_VISIBLE); + SetWindowLongW( _HWnd, GWL_STYLE, D3D_FULLSCREEN_STYLE|WS_VISIBLE); _FullScreen = true; } @@ -2332,7 +2332,7 @@ bool CDriverD3D::setMode (const GfxMode& mode) WndRect.top=_WindowY; WndRect.right=_WindowX+_CurrentMode.Width; WndRect.bottom=_WindowY+_CurrentMode.Height; - AdjustWindowRect(&WndRect, GetWindowLongPtrW (_HWnd, GWL_STYLE), FALSE); + AdjustWindowRect(&WndRect, GetWindowLongW (_HWnd, GWL_STYLE), FALSE); SetWindowPos( _HWnd, HWND_NOTOPMOST, std::max ((int)WndRect.left, 0), std::max ((int)WndRect.top, 0), @@ -3742,7 +3742,7 @@ void CDriverD3D::findNearestFullscreenVideoMode() { sint32 nbPixels = _CurrentMode.Width * _CurrentMode.Height; sint32 minError = nbPixels; - uint bestMode = modes.size(); + uint bestMode = (uint)modes.size(); for(uint i=0; i < modes.size(); i++) { if(!modes[i].Windowed) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 2f7e3ed24..3d9c40b31 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -3472,7 +3472,7 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra } nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, progID); GLint errorPos, isNative; - nglProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(prog), prog); + nglProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, (GLsizei)strlen(prog), prog); nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0); glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos); nglGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &isNative); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp index cdf4eef0d..93fcd4399 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp @@ -664,7 +664,7 @@ void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) { case CVertexBufferInfo::HwATI: nglArrayObjectATI(GL_TEXTURE_COORD_ARRAY, numTexCoord, GL_FLOAT, VB.VertexSize, VB.VertexObjectId, - /*(uint)*/ (ptrdiff_t) VB.ValuePtr[CVertexBuffer::TexCoord0+uvId]); + (ptrdiff_t) VB.ValuePtr[CVertexBuffer::TexCoord0+uvId]); break; case CVertexBufferInfo::HwARB: _DriverGLStates.bindARBVertexBuffer(VB.VertexObjectId); @@ -928,7 +928,7 @@ void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) nlassert (numVertexCoord >= 2); _DriverGLStates.enableVertexArray(true); - nglArrayObjectATI(GL_VERTEX_ARRAY, numVertexCoord, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Position]); + nglArrayObjectATI(GL_VERTEX_ARRAY, numVertexCoord, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Position]); // setup normal ptr. //----------- // Check for normal param in vertex buffer @@ -937,7 +937,7 @@ void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) // Check type nlassert (vb.Type[CVertexBuffer::Normal]==CVertexBuffer::Float3); _DriverGLStates.enableNormalArray(true); - nglArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Normal]); + nglArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Normal]); } else { diff --git a/code/nel/src/misc/displayer.cpp b/code/nel/src/misc/displayer.cpp index ddfa5fb63..bc45dc4ae 100644 --- a/code/nel/src/misc/displayer.cpp +++ b/code/nel/src/misc/displayer.cpp @@ -287,7 +287,7 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess OutputDebugString("\n");*/ sint count = 0; - uint n = strlen(message); + uint n = (uint)strlen(message); std::string s(&str2.c_str()[0], (str2.size() - n)); OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(s).c_str()); @@ -655,7 +655,7 @@ void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *m // procname is host/service_name-sid we only want the service_name to avoid redondant mail string procname; - sint pos = args.ProcessName.find ("/"); + string::size_type pos = args.ProcessName.find ("/"); if (pos == string::npos) { procname = args.ProcessName; diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index 891c924f4..ec65ab8be 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -387,11 +387,15 @@ void CFileContainer::loadRemappedFiles (const std::string &file) { f.getline(sTmp, 512); str = sTmp; - if (str.find(',')) + std::string::size_type pos = str.find(','); + if (pos != string::npos) { removeAllUnusedChar(str); if (!str.empty()) - remapFile( str.substr(0,str.find(',')), str.substr(str.find(',')+1, str.size()) ); + { + pos = str.find(','); + remapFile( str.substr(0,pos), str.substr(pos+1, str.size()) ); + } } } } @@ -1551,7 +1555,7 @@ void CFileContainer::memoryCompress() SSMext.memoryCompress(); SSMpath.memoryCompress(); - uint nDbg = _Files.size(); + uint nDbg = (uint)_Files.size(); nlinfo ("PATH: Number of file : %d", nDbg); nDbg = SSMext.getCount(); nlinfo ("PATH: Number of different extension : %d", nDbg); @@ -1570,7 +1574,7 @@ void CFileContainer::memoryCompress() } else { - nSize += it->second.Name.size() + 1; + nSize += (uint)it->second.Name.size() + 1; } nNb++; it++; @@ -1591,7 +1595,7 @@ void CFileContainer::memoryCompress() { strcpy(_AllFileNames+nSize, rFE.Name.c_str()); _MCFiles[nNb].Name = _AllFileNames+nSize; - nSize += rFE.Name.size() + 1; + nSize += (uint)rFE.Name.size() + 1; } else { @@ -1678,7 +1682,7 @@ int CFile::getLastSeparator (const string &filename) pos = filename.find_last_of ('@'); } } - return pos; + return (int)pos; } string CFile::getFilename (const string &filename) @@ -2122,7 +2126,7 @@ static bool CopyMoveFile(const char *dest, const char *src, bool copyFile, bool { if (progress) { - readSize += s; + readSize += (uint32)s; progress->progress((float) readSize / totalSize); } size_t ws = fwrite(buffer, s, 1, fp2); @@ -2314,7 +2318,7 @@ bool CPath::makePathRelative (const char *basePath, std::string &relativePath) if (strncmp (tmp.c_str (), src.c_str (), tmp.length ()) == 0) { // Truncate - uint size = tmp.length (); + uint size = (uint)tmp.length (); // Same path ? if (size == src.length ()) diff --git a/code/nel/src/misc/win_displayer.cpp b/code/nel/src/misc/win_displayer.cpp index 0539c2ca8..755332ba1 100644 --- a/code/nel/src/misc/win_displayer.cpp +++ b/code/nel/src/misc/win_displayer.cpp @@ -179,7 +179,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) access.value().push_back(str); } cwd->_History.push_back(str); - cwd->_PosInHistory = cwd->_History.size(); + cwd->_PosInHistory = (uint)cwd->_History.size(); } } } @@ -440,9 +440,9 @@ void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint _HInputEdit = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, RICHEDIT_CLASSW, L"", WS_CHILD | WS_VISIBLE /*| ES_MULTILINE*/ | ES_WANTRETURN | ES_NOHIDESEL | ES_AUTOHSCROLL, 0, h-_InputEditHeight, w, _InputEditHeight, _HWnd, NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); - SendMessage (_HInputEdit, WM_SETFONT, (LONG) _HFont, TRUE); + SendMessageW (_HInputEdit, WM_SETFONT, (LONG) _HFont, TRUE); - DWORD dwEvent = SendMessage(_HInputEdit, EM_GETEVENTMASK, (WPARAM)0, (LPARAM)0); + LRESULT dwEvent = SendMessageW(_HInputEdit, EM_GETEVENTMASK, (WPARAM)0, (LPARAM)0); dwEvent |= ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE; SendMessage(_HInputEdit, EM_SETEVENTMASK, (WPARAM)0, (LPARAM)dwEvent); @@ -481,23 +481,23 @@ void CWinDisplayer::clear () } // get number of line - sint nLine = SendMessage (_HEdit, EM_GETLINECOUNT, 0, 0) - 1; + LRESULT nLine = SendMessageW (_HEdit, EM_GETLINECOUNT, 0, 0) - 1; // get size of the last line - sint nIndex = SendMessage (_HEdit, EM_LINEINDEX, nLine, 0); + LRESULT nIndex = SendMessageW (_HEdit, EM_LINEINDEX, nLine, 0); // select all the text - SendMessage (_HEdit, EM_SETSEL, 0, nIndex); + SendMessageW (_HEdit, EM_SETSEL, 0, nIndex); // clear all the text - SendMessage (_HEdit, EM_REPLACESEL, FALSE, (LONG) ""); + SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LONG) ""); - SendMessage(_HEdit,EM_SETMODIFY,(WPARAM)TRUE,(LPARAM)0); + SendMessageW(_HEdit,EM_SETMODIFY,(WPARAM)TRUE,(LPARAM)0); if ( focus ) { - SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOVSCROLL); - SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOHSCROLL); + SendMessageW(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOVSCROLL); + SendMessageW(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOHSCROLL); } } @@ -544,7 +544,7 @@ void CWinDisplayer::display_main () // find how many lines we have to remove in the current output to add new lines // get number of line - sint nLine = SendMessage (_HEdit, EM_GETLINECOUNT, 0, 0) - 1; + LRESULT nLine = SendMessageW (_HEdit, EM_GETLINECOUNT, 0, 0) - 1; if (_HistorySize > 0 && nLine+vecSize > _HistorySize) { @@ -558,15 +558,15 @@ void CWinDisplayer::display_main () } else { - sint oldIndex1 = SendMessage (_HEdit, EM_LINEINDEX, 0, 0); + LRESULT oldIndex1 = SendMessageW (_HEdit, EM_LINEINDEX, 0, 0); //nlassert (oldIndex1 != -1); - sint oldIndex2 = SendMessage (_HEdit, EM_LINEINDEX, nblineremove, 0); + LRESULT oldIndex2 = SendMessageW (_HEdit, EM_LINEINDEX, nblineremove, 0); //nlassert (oldIndex2 != -1); - SendMessage (_HEdit, EM_SETSEL, oldIndex1, oldIndex2); - SendMessage (_HEdit, EM_REPLACESEL, FALSE, (LONG) ""); + SendMessageW (_HEdit, EM_SETSEL, oldIndex1, oldIndex2); + SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LONG) ""); // update the selection due to the erasing - sint dt = oldIndex2 - oldIndex1; + sint dt = (sint)(oldIndex2 - oldIndex1); if (startSel < 65000) { if ((sint)startSel-dt < 0) startSel = -1; diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index 243c6a79b..0c9a6ad3c 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -102,7 +102,7 @@ TMouseButton CWinEventEmitter::getButtons() const } -bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, uint32 wParam, uint32 lParam, CEventServer *server) +bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPARAM lParam, CEventServer *server) { if (!server) server=&_InternalServer; @@ -265,7 +265,7 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, uint32 wParam, uin server->postEvent (new CEventDestroyWindow (this)); break; case WM_DISPLAYCHANGE: - server->postEvent (new CEventDisplayChange (LOWORD(lParam), HIWORD(lParam), wParam, this)); + server->postEvent (new CEventDisplayChange (LOWORD(lParam), HIWORD(lParam), (uint)wParam, this)); break; case WM_MOUSEWHEEL: if (_MouseEventsEnabled) @@ -298,7 +298,7 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, uint32 wParam, uin case WM_INPUTLANGCHANGE: if ( _IMEEventsEnabled ) { - server->postEvent( new CEventIME( msg, wParam, lParam, this ) ); + server->postEvent( new CEventIME( msg, (uint32)wParam, (uint32)lParam, this ) ); return true; // trap message } break; diff --git a/code/ryzom/client/src/actions.cpp b/code/ryzom/client/src/actions.cpp index b758d1ff8..4b64851db 100644 --- a/code/ryzom/client/src/actions.cpp +++ b/code/ryzom/client/src/actions.cpp @@ -26,8 +26,6 @@ #include "events_listener.h" #include "interface_v3/interface_manager.h" -#include "nel/misc/algo.h" - using namespace std; using namespace NLMISC; @@ -520,7 +518,7 @@ void CActionsManager::addCategory (const CCategory &category) for (i=0; i -#include -#include -#include - /////////// // CLASS // diff --git a/code/ryzom/client/src/actions_client.h b/code/ryzom/client/src/actions_client.h index 5eeb22ef8..9d9ad5d9b 100644 --- a/code/ryzom/client/src/actions_client.h +++ b/code/ryzom/client/src/actions_client.h @@ -23,8 +23,7 @@ ///////////// // INCLUDE // ///////////// -// Misc. -#include "nel/misc/types_nl.h" + // Client #include "actions.h" // Manage Inputs diff --git a/code/ryzom/client/src/animation.h b/code/ryzom/client/src/animation.h index f15f2194e..188a71529 100644 --- a/code/ryzom/client/src/animation.h +++ b/code/ryzom/client/src/animation.h @@ -22,12 +22,7 @@ ///////////// // INCLUDE // ///////////// -#include "nel/misc/types_nl.h" -#include "nel/misc/string_mapper.h" -// 3d -#include "nel/3d/u_animation_set.h" -#include "nel/sound/sound_anim_manager.h" // #include "game_share/magic_fx.h" #include "client_sheets/animation_set_list_sheet.h" diff --git a/code/ryzom/client/src/cdb.h b/code/ryzom/client/src/cdb.h index c0d893d1d..97edfa2a5 100644 --- a/code/ryzom/client/src/cdb.h +++ b/code/ryzom/client/src/cdb.h @@ -19,11 +19,6 @@ #ifndef CDB_H #define CDB_H -// misc -#include "nel/misc/types_nl.h" -#include "nel/misc/smart_ptr.h" -#include "nel/misc/string_mapper.h" - #include namespace NLMISC @@ -162,7 +157,7 @@ public: /** * Return the count of strings composing this id */ - uint size() const { return _Ids.size(); } + uint size() const { return (uint)_Ids.size(); } /** Return an element. empty if bad index */ diff --git a/code/ryzom/client/src/client_chat_manager.cpp b/code/ryzom/client/src/client_chat_manager.cpp index b0f5ebfb6..aa438a989 100644 --- a/code/ryzom/client/src/client_chat_manager.cpp +++ b/code/ryzom/client/src/client_chat_manager.cpp @@ -707,10 +707,10 @@ ucstring CClientChatManager::getString( CBitMemStream& bms, ucstring& ucstr ) // search if a parameter exists in the string sprintf(chTmp,"$%d",dynParamIdx); ucstring ucstrTmp( chTmp ); - sint32 idx = ucstr.find(ucstrTmp); + ucstring::size_type idx = ucstr.find(ucstrTmp); // if there's a parameter in the string - if( idx != -1 ) + if( idx != ucstring::npos ) { char c = (char)ucstr[idx+ucstrTmp.size()]; switch( c ) @@ -856,10 +856,10 @@ bool CClientChatManager::getString( ucstring &result, std::vector& args, // search if a parameter exists in the string sprintf(chTmp,"$%d",dynParamIdx); ucstring ucstrTmp( chTmp ); - sint32 idx = result.find(ucstrTmp); + ucstring::size_type idx = result.find(ucstrTmp); // if there's a parameter in the string - if( idx != -1 ) + if( idx != ucstring::npos ) { ucstring rep; rep = "???"; diff --git a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp index 5699dd07e..2cdf281cf 100644 --- a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp @@ -102,7 +102,7 @@ void CSBrickSheet::build (const NLGEORGES::UFormElm &root) if(BrickFamily==BRICK_FAMILIES::Unknown) { string sheetName= Id.toString(); - sint end= sheetName.find(".sbrick")-2; + std::string::size_type end= sheetName.find(".sbrick")-2; BrickFamily = BRICK_FAMILIES::toSBrickFamily ( strupr(sheetName.substr(0,end)) ); if(BrickFamily==BRICK_FAMILIES::Unknown) nlwarning("Unknown Family for SBrick: %s", sheetName.c_str()); diff --git a/code/ryzom/client/src/interface_v3/action_handler.cpp b/code/ryzom/client/src/interface_v3/action_handler.cpp index 2926458c8..59c4f5130 100644 --- a/code/ryzom/client/src/interface_v3/action_handler.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler.cpp @@ -74,9 +74,9 @@ std::string IActionHandler::getParam (const string &Params, const string &ParamN string param = strlwr (ParamName); while (allparam.size() > 0) { - int e = allparam.find('='); - if (e <= 0) break; - int p = allparam.find('|'); + std::string::size_type e = allparam.find('='); + if (e == std::string::npos || e == 0) break; + std::string::size_type p = allparam.find('|'); string tmp = strlwr(allparam.substr(0,e)); skipBlankAtEnd(tmp); if (tmp == param) @@ -86,7 +86,7 @@ std::string IActionHandler::getParam (const string &Params, const string &ParamN skipBlankAtEnd(tmp2); return tmp2; } - if (p <= 0) break; + if (p == std::string::npos || p == 0) break; allparam = allparam.substr(p+1,allparam.size()); skipBlankAtStart (allparam); } @@ -100,9 +100,9 @@ void IActionHandler::getAllParams (const string &Params, vector< pair 0) { - int e = allparam.find('='); - if (e <= 0) break; - int p = allparam.find('|'); + std::string::size_type e = allparam.find('='); + if (e == std::string::npos || e == 0) break; + std::string::size_type p = allparam.find('|'); string tmp = strlwr(allparam.substr(0,e)); skipBlankAtEnd(tmp); @@ -112,7 +112,7 @@ void IActionHandler::getAllParams (const string &Params, vector< pair(tmp,tmp2)); - if (p <= 0) break; + if (p == std::string::npos || p == 0) break; allparam = allparam.substr(p+1,allparam.size()); skipBlankAtStart (allparam); } diff --git a/code/ryzom/client/src/interface_v3/group_editbox.h b/code/ryzom/client/src/interface_v3/group_editbox.h index bd99acfaa..d631a4d84 100644 --- a/code/ryzom/client/src/interface_v3/group_editbox.h +++ b/code/ryzom/client/src/interface_v3/group_editbox.h @@ -20,7 +20,6 @@ #define RZ_CTRL_EDITBOX_H #include "interface_group.h" -#include "nel/3d/u_texture.h" class CEventDescriptor; @@ -37,7 +36,7 @@ public: ~CGroupEditBox(); 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 draw(); @@ -109,7 +108,7 @@ public: sint32 getCurrentHistoricIndex () const {return _CurrentHistoricIndex;} void setCurrentHistoricIndex (sint32 index) {_CurrentHistoricIndex=index;} const ucstring &getHistoric(uint32 index) const {return _Historic[index];} - uint32 getNumHistoric() const {return _Historic.size ();} + uint32 getNumHistoric() const {return (uint32)_Historic.size ();} // Get on change action handler const std::string &getAHOnChange() const {return _AHOnChange;} @@ -345,7 +344,7 @@ private: // bool isFiltered(ucchar c) { - uint length = _NegativeFilter.size(); + uint length = (uint)_NegativeFilter.size(); for (uint k = 0; k < length; ++k) { if ((ucchar) _NegativeFilter[k] == c) return true; diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 51a748408..0209d3694 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -168,7 +168,7 @@ void CGroupInSceneBubbleManager::alignMessagePopup (vector &rList, bool CInterfaceGroup *pRoot = dynamic_cast(pIM->getElementFromId("ui:interface")); if (pRoot) { - sint i = rList.size ()-1; + sint i = (sint)rList.size ()-1; rList[i].Group->invalidateCoords(); rList[i].Group->updateCoords(); @@ -229,7 +229,7 @@ void CGroupInSceneBubbleManager::init () templateParams.push_back (std::pair("id", id)); CInterfaceGroup *group = pIM->createGroupInstance ("3dbulle_L", - "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { // Link to the interface @@ -457,7 +457,7 @@ void CGroupInSceneBubbleManager::update () ucstring finalString = res; for(;;) { - uint index = finalString.find (ucstring("{break}")); + std::string::size_type index = finalString.find (ucstring("{break}")); if (index == ucstring::npos) break; finalString = finalString.substr (0, index) + finalString.substr(index+7,finalString.size()); } @@ -509,7 +509,7 @@ void CGroupInSceneBubbleManager::addSkillPopup (uint skillId, sint delta, uint t templateParams.push_back (std::pair("delta", toString(delta))); CInterfaceGroup *group = pIM->createGroupInstance ("skill_popup", - "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { // Skill name @@ -575,7 +575,7 @@ void CGroupInSceneBubbleManager::addMessagePopup (const ucstring &message, CRGBA templateParams.push_back (std::pair("id", id)); CInterfaceGroup *group = pIM->createGroupInstance ("message_popup", - "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { // Skill name @@ -624,7 +624,7 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message, templateParams.push_back (std::pair("id", id)); CInterfaceGroup *group = pIM->createGroupInstance ("message_popup_center", - "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { // Skill name @@ -695,7 +695,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont templateParams.push_back (std::pair("id", id)); CInterfaceGroup *group = pIM->createGroupInstance (templateName+v+h, - "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), templateParams.size()); + "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { // Target available ? @@ -1331,7 +1331,7 @@ void CGroupInSceneBubble::next() void CGroupInSceneBubble::skip() { if (_TextParts.empty()) return; - _CurrentPart = _TextParts.size()-1; + _CurrentPart = (uint32)_TextParts.size()-1; _TimeOut = TimeInSec; } diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index fa1ad2b19..153dd8397 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -694,7 +694,7 @@ void CSPhraseManager::updateBookDB() // Fill All the book. TPhraseMap::const_iterator it= _PhraseMap.begin(); - sint numBookFill= _PhraseMap.size(); + sint numBookFill= (sint)_PhraseMap.size(); sint i= 0; while(iProperties.size(); ++prop) { - size_t endPos = brick->Properties[prop].Text.find(":"); + std::string::size_type endPos = brick->Properties[prop].Text.find(":"); if (endPos != std::string::npos) { std::string propName = brick->Properties[prop].Text.substr(0, endPos); @@ -3432,7 +3432,7 @@ void CSPhraseManager::updatePhraseProgressionDB() // Fill All the progression db. uint numProgressFill= 0; if(_BookSkillFitler!=SKILLS::unknown) - numProgressFill= _ProgressionPhrases[_BookSkillFitler].Phrases.size(); + numProgressFill= (uint)_ProgressionPhrases[_BookSkillFitler].Phrases.size(); uint i; uint progressIndex[NumProgressType]; for(i=0;iisVerboseLog()) { - nlinfo ("Exploded, with nl, %d res", lines.size()); + nlinfo ("Exploded, with nl, %zu res", lines.size()); /* for (uint i = 0; i < lines.size(); i++) { nlinfo (" > '%s'", lines[i].c_str()); @@ -2942,7 +2942,7 @@ string checkLogin(const string &login, const string &password, const string &cli if(lines.size() != nbs+1) { - nlwarning("bad shard lines number %d != %d", lines.size(), nbs+1); + nlwarning("bad shard lines number %zu != %d", lines.size(), nbs+1); nlwarning("'%s'", res.c_str()); return "bad lines numbers (error code 5)"; } @@ -2954,7 +2954,7 @@ string checkLogin(const string &login, const string &password, const string &cli if(pPM->isVerboseLog()) { - nlinfo ("Exploded with '%s', %d res", "|", res.size()); + nlinfo ("Exploded with '%s', %zu res", "|", res.size()); /* for (uint i = 0; i < res.size(); i++) { nlinfo (" > '%s'", res[i].c_str()); @@ -2963,7 +2963,7 @@ string checkLogin(const string &login, const string &password, const string &cli if (res.size() < 7 && res.size() > 8) { - nlwarning("bad | numbers %d != %d", res.size(), 8); + nlwarning("bad | numbers %zu != %d", res.size(), 8); nlwarning("'%s'", lines[i].c_str()); return "bad pipe numbers (error code 6)"; } diff --git a/code/ryzom/client/src/r2/tool_pick.cpp b/code/ryzom/client/src/r2/tool_pick.cpp index d1b3cd6a8..1030aeb08 100644 --- a/code/ryzom/client/src/r2/tool_pick.cpp +++ b/code/ryzom/client/src/r2/tool_pick.cpp @@ -50,9 +50,9 @@ void CToolPick::setIgnoreInstances(const std::string & ignoreInstances) string allKind = ignoreInstances; while (allKind.size() > 0) { - int e = allKind.find(','); + std::string::size_type e = allKind.find(','); string tmp; - if (e <= 0) + if (e == std::string::npos || e == 0) { tmp = allKind; allKind=""; diff --git a/code/ryzom/client/src/session_browser_impl.cpp b/code/ryzom/client/src/session_browser_impl.cpp index fba4260fb..6061d8e36 100644 --- a/code/ryzom/client/src/session_browser_impl.cpp +++ b/code/ryzom/client/src/session_browser_impl.cpp @@ -642,10 +642,10 @@ void CSessionBrowserImpl::charsFill(const std::vector &chars inline double ecoRingPoints(const std::string & ecoPoints, char * c) { - uint cPlace = ecoPoints.find(c); + std::string::size_type cPlace = ecoPoints.find(c); if(cPlace==string::npos) return 0; - uint sepPlace = ecoPoints.find(":", cPlace); + std::string::size_type sepPlace = ecoPoints.find(":", cPlace); std::string points = ecoPoints.substr(cPlace+1, sepPlace); double ret; fromString(points, ret); diff --git a/code/ryzom/client/src/stdpch.h b/code/ryzom/client/src/stdpch.h index 5eb1800e5..b7a816f56 100644 --- a/code/ryzom/client/src/stdpch.h +++ b/code/ryzom/client/src/stdpch.h @@ -36,7 +36,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -45,6 +52,7 @@ #include #include #include +#include #include #include @@ -54,6 +62,8 @@ #include #include +#include + #include "game_share/generic_xml_msg_mngr.h" #include "game_share/msg_client_server.h" #include "game_share/action_target_slot.h" diff --git a/code/ryzom/common/src/game_share/cst_loader.cpp b/code/ryzom/common/src/game_share/cst_loader.cpp index ea83ca220..ad89ce683 100644 --- a/code/ryzom/common/src/game_share/cst_loader.cpp +++ b/code/ryzom/common/src/game_share/cst_loader.cpp @@ -48,10 +48,10 @@ void CSTLoader::buildTableFormat( string fileName, list > // extract type from token string stoken = string( token ); - sint typeStart = stoken.find_last_of("<"); - nlassert(typeStart != -1); - sint typeEnd = stoken.find_first_of(">",typeStart); - nlassert(typeEnd != -1); + string::size_type typeStart = stoken.find_last_of("<"); + nlassert(typeStart != string::npos); + string::size_type typeEnd = stoken.find_first_of(">",typeStart); + nlassert(typeEnd != string::npos); string type_str = stoken.substr( typeStart+1, (typeEnd-typeStart-1) ); TDataType type_enum = convertType(type_str); @@ -75,9 +75,9 @@ void CSTLoader::buildTableFormat( string fileName, list > // extract type from token typeStart = stoken.find_last_of("<"); - nlassert(typeStart != -1); + nlassert(typeStart != string::npos); typeEnd = stoken.find_first_of(">",typeStart); - nlassert(typeEnd != -1); + nlassert(typeEnd != string::npos); type_str = stoken.substr( typeStart+1, (typeEnd-typeStart-1) ); type_enum = convertType(type_str); @@ -321,7 +321,7 @@ bool CSTLoader::readLine() return false; } - const uint nbColumn = _Columns.size(); + const uint nbColumn = (uint)_Columns.size(); char readBuffer[4096]; char * token; bool firstToken = true; diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.cpp b/code/ryzom/tools/sheets_packer/sheets_packer.cpp index 69545d2b8..da2b48001 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer.cpp @@ -72,8 +72,8 @@ int main(int argc, char **argv) // extract the 2 first param (argv[1] and argv[2]) it must be cookie and addr string cmd = cmdline; - int pos1 = cmd.find_first_not_of (' '); - int pos2; + std::string::size_type pos1 = cmd.find_first_not_of (' '); + std::string::size_type pos2; if (pos1 != string::npos) { pos2 = cmd.find (' ', pos1);