Changed: #853 Compilation on 64-bits platforms

This commit is contained in:
kervala 2010-05-13 22:53:14 +02:00
parent 737427674c
commit a970ad675c
25 changed files with 106 additions and 116 deletions

View file

@ -98,7 +98,7 @@ public:
/** Process a win32 message. /** Process a win32 message.
* Return true if the message must be trapped, false if DefWindowProc must be called afterwards * 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: private:
CWinEventServer _InternalServer; CWinEventServer _InternalServer;
HWND _HWnd; HWND _HWnd;

View file

@ -2308,13 +2308,13 @@ bool CDriverD3D::setMode (const GfxMode& mode)
if( mode.Windowed ) if( mode.Windowed )
{ {
// Set windowed-mode style // Set windowed-mode style
SetWindowLongPtrW( _HWnd, GWL_STYLE, D3D_WINDOWED_STYLE|WS_VISIBLE); SetWindowLongW( _HWnd, GWL_STYLE, D3D_WINDOWED_STYLE|WS_VISIBLE);
_FullScreen = false; _FullScreen = false;
} }
else else
{ {
// Set fullscreen-mode style // Set fullscreen-mode style
SetWindowLongPtrW( _HWnd, GWL_STYLE, D3D_FULLSCREEN_STYLE|WS_VISIBLE); SetWindowLongW( _HWnd, GWL_STYLE, D3D_FULLSCREEN_STYLE|WS_VISIBLE);
_FullScreen = true; _FullScreen = true;
} }
@ -2332,7 +2332,7 @@ bool CDriverD3D::setMode (const GfxMode& mode)
WndRect.top=_WindowY; WndRect.top=_WindowY;
WndRect.right=_WindowX+_CurrentMode.Width; WndRect.right=_WindowX+_CurrentMode.Width;
WndRect.bottom=_WindowY+_CurrentMode.Height; WndRect.bottom=_WindowY+_CurrentMode.Height;
AdjustWindowRect(&WndRect, GetWindowLongPtrW (_HWnd, GWL_STYLE), FALSE); AdjustWindowRect(&WndRect, GetWindowLongW (_HWnd, GWL_STYLE), FALSE);
SetWindowPos( _HWnd, HWND_NOTOPMOST, SetWindowPos( _HWnd, HWND_NOTOPMOST,
std::max ((int)WndRect.left, 0), std::max ((int)WndRect.top, 0), 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 nbPixels = _CurrentMode.Width * _CurrentMode.Height;
sint32 minError = nbPixels; sint32 minError = nbPixels;
uint bestMode = modes.size(); uint bestMode = (uint)modes.size();
for(uint i=0; i < modes.size(); i++) for(uint i=0; i < modes.size(); i++)
{ {
if(!modes[i].Windowed) if(!modes[i].Windowed)

View file

@ -3472,7 +3472,7 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra
} }
nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, progID); nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, progID);
GLint errorPos, isNative; 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); nglBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0);
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos); glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
nglGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &isNative); nglGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &isNative);

View file

@ -664,7 +664,7 @@ void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId)
{ {
case CVertexBufferInfo::HwATI: case CVertexBufferInfo::HwATI:
nglArrayObjectATI(GL_TEXTURE_COORD_ARRAY, numTexCoord, GL_FLOAT, VB.VertexSize, VB.VertexObjectId, 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; break;
case CVertexBufferInfo::HwARB: case CVertexBufferInfo::HwARB:
_DriverGLStates.bindARBVertexBuffer(VB.VertexObjectId); _DriverGLStates.bindARBVertexBuffer(VB.VertexObjectId);

View file

@ -287,7 +287,7 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess
OutputDebugString("\n");*/ OutputDebugString("\n");*/
sint count = 0; sint count = 0;
uint n = strlen(message); uint n = (uint)strlen(message);
std::string s(&str2.c_str()[0], (str2.size() - n)); std::string s(&str2.c_str()[0], (str2.size() - n));
OutputDebugStringW((LPCWSTR)ucstring::makeFromUtf8(s).c_str()); 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 // procname is host/service_name-sid we only want the service_name to avoid redondant mail
string procname; string procname;
sint pos = args.ProcessName.find ("/"); string::size_type pos = args.ProcessName.find ("/");
if (pos == string::npos) if (pos == string::npos)
{ {
procname = args.ProcessName; procname = args.ProcessName;

View file

@ -387,11 +387,15 @@ void CFileContainer::loadRemappedFiles (const std::string &file)
{ {
f.getline(sTmp, 512); f.getline(sTmp, 512);
str = sTmp; str = sTmp;
if (str.find(',')) std::string::size_type pos = str.find(',');
if (pos != string::npos)
{ {
removeAllUnusedChar(str); removeAllUnusedChar(str);
if (!str.empty()) 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(); SSMext.memoryCompress();
SSMpath.memoryCompress(); SSMpath.memoryCompress();
uint nDbg = _Files.size(); uint nDbg = (uint)_Files.size();
nlinfo ("PATH: Number of file : %d", nDbg); nlinfo ("PATH: Number of file : %d", nDbg);
nDbg = SSMext.getCount(); nDbg = SSMext.getCount();
nlinfo ("PATH: Number of different extension : %d", nDbg); nlinfo ("PATH: Number of different extension : %d", nDbg);
@ -1570,7 +1574,7 @@ void CFileContainer::memoryCompress()
} }
else else
{ {
nSize += it->second.Name.size() + 1; nSize += (uint)it->second.Name.size() + 1;
} }
nNb++; nNb++;
it++; it++;
@ -1591,7 +1595,7 @@ void CFileContainer::memoryCompress()
{ {
strcpy(_AllFileNames+nSize, rFE.Name.c_str()); strcpy(_AllFileNames+nSize, rFE.Name.c_str());
_MCFiles[nNb].Name = _AllFileNames+nSize; _MCFiles[nNb].Name = _AllFileNames+nSize;
nSize += rFE.Name.size() + 1; nSize += (uint)rFE.Name.size() + 1;
} }
else else
{ {
@ -1678,7 +1682,7 @@ int CFile::getLastSeparator (const string &filename)
pos = filename.find_last_of ('@'); pos = filename.find_last_of ('@');
} }
} }
return pos; return (int)pos;
} }
string CFile::getFilename (const string &filename) string CFile::getFilename (const string &filename)
@ -2122,7 +2126,7 @@ static bool CopyMoveFile(const char *dest, const char *src, bool copyFile, bool
{ {
if (progress) if (progress)
{ {
readSize += s; readSize += (uint32)s;
progress->progress((float) readSize / totalSize); progress->progress((float) readSize / totalSize);
} }
size_t ws = fwrite(buffer, s, 1, fp2); 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) if (strncmp (tmp.c_str (), src.c_str (), tmp.length ()) == 0)
{ {
// Truncate // Truncate
uint size = tmp.length (); uint size = (uint)tmp.length ();
// Same path ? // Same path ?
if (size == src.length ()) if (size == src.length ())

View file

@ -179,7 +179,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
access.value().push_back(str); access.value().push_back(str);
} }
cwd->_History.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 _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, /*| ES_MULTILINE*/ | ES_WANTRETURN | ES_NOHIDESEL | ES_AUTOHSCROLL, 0, h-_InputEditHeight, w, _InputEditHeight,
_HWnd, NULL, (HINSTANCE) GetWindowLongPtr(_HWnd, GWLP_HINSTANCE), NULL); _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; dwEvent |= ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE;
SendMessage(_HInputEdit, EM_SETEVENTMASK, (WPARAM)0, (LPARAM)dwEvent); SendMessage(_HInputEdit, EM_SETEVENTMASK, (WPARAM)0, (LPARAM)dwEvent);
@ -481,23 +481,23 @@ void CWinDisplayer::clear ()
} }
// get number of line // 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 // 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 // select all the text
SendMessage (_HEdit, EM_SETSEL, 0, nIndex); SendMessageW (_HEdit, EM_SETSEL, 0, nIndex);
// clear all the text // 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 ) if ( focus )
{ {
SendMessage(_HEdit,EM_SETOPTIONS,ECOOP_OR,(LPARAM)ECO_AUTOVSCROLL); SendMessageW(_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_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 // find how many lines we have to remove in the current output to add new lines
// get number of line // 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) if (_HistorySize > 0 && nLine+vecSize > _HistorySize)
{ {
@ -558,15 +558,15 @@ void CWinDisplayer::display_main ()
} }
else else
{ {
sint oldIndex1 = SendMessage (_HEdit, EM_LINEINDEX, 0, 0); LRESULT oldIndex1 = SendMessageW (_HEdit, EM_LINEINDEX, 0, 0);
//nlassert (oldIndex1 != -1); //nlassert (oldIndex1 != -1);
sint oldIndex2 = SendMessage (_HEdit, EM_LINEINDEX, nblineremove, 0); LRESULT oldIndex2 = SendMessageW (_HEdit, EM_LINEINDEX, nblineremove, 0);
//nlassert (oldIndex2 != -1); //nlassert (oldIndex2 != -1);
SendMessage (_HEdit, EM_SETSEL, oldIndex1, oldIndex2); SendMessageW (_HEdit, EM_SETSEL, oldIndex1, oldIndex2);
SendMessage (_HEdit, EM_REPLACESEL, FALSE, (LONG) ""); SendMessageW (_HEdit, EM_REPLACESEL, FALSE, (LONG) "");
// update the selection due to the erasing // update the selection due to the erasing
sint dt = oldIndex2 - oldIndex1; sint dt = (sint)(oldIndex2 - oldIndex1);
if (startSel < 65000) if (startSel < 65000)
{ {
if ((sint)startSel-dt < 0) startSel = -1; if ((sint)startSel-dt < 0) startSel = -1;

View file

@ -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) if (!server)
server=&_InternalServer; server=&_InternalServer;
@ -265,7 +265,7 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, uint32 wParam, uin
server->postEvent (new CEventDestroyWindow (this)); server->postEvent (new CEventDestroyWindow (this));
break; break;
case WM_DISPLAYCHANGE: 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; break;
case WM_MOUSEWHEEL: case WM_MOUSEWHEEL:
if (_MouseEventsEnabled) if (_MouseEventsEnabled)
@ -298,7 +298,7 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, uint32 wParam, uin
case WM_INPUTLANGCHANGE: case WM_INPUTLANGCHANGE:
if ( _IMEEventsEnabled ) if ( _IMEEventsEnabled )
{ {
server->postEvent( new CEventIME( msg, wParam, lParam, this ) ); server->postEvent( new CEventIME( msg, (uint32)wParam, (uint32)lParam, this ) );
return true; // trap message return true; // trap message
} }
break; break;

View file

@ -26,8 +26,6 @@
#include "events_listener.h" #include "events_listener.h"
#include "interface_v3/interface_manager.h" #include "interface_v3/interface_manager.h"
#include "nel/misc/algo.h"
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
@ -520,7 +518,7 @@ void CActionsManager::addCategory (const CCategory &category)
for (i=0; i<category.BaseActions.size (); i++) for (i=0; i<category.BaseActions.size (); i++)
{ {
CCategoryLocator locator; CCategoryLocator locator;
locator.CategoryId = _Categories.size ()-1; locator.CategoryId = (uint)_Categories.size ()-1;
locator.BaseActionId = i; locator.BaseActionId = i;
_ActionCategory.insert (TActionBaseActionMap::value_type (category.BaseActions[i].Name, locator)); _ActionCategory.insert (TActionBaseActionMap::value_type (category.BaseActions[i].Name, locator));
} }

View file

@ -23,19 +23,9 @@
///////////// /////////////
// INCLUDE // // INCLUDE //
///////////// /////////////
// misc
#include "nel/misc/types_nl.h"
#include "nel/misc/events.h"
#include "nel/misc/stream.h"
#include "nel/misc/file.h"
// client // client
#include "events_listener.h" #include "events_listener.h"
// std
#include <string>
#include <list>
#include <map>
#include <set>
/////////// ///////////
// CLASS // // CLASS //

View file

@ -23,8 +23,7 @@
///////////// /////////////
// INCLUDE // // INCLUDE //
///////////// /////////////
// Misc.
#include "nel/misc/types_nl.h"
// Client // Client
#include "actions.h" // Manage Inputs #include "actions.h" // Manage Inputs

View file

@ -22,12 +22,7 @@
///////////// /////////////
// INCLUDE // // 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 "game_share/magic_fx.h"
#include "client_sheets/animation_set_list_sheet.h" #include "client_sheets/animation_set_list_sheet.h"

View file

@ -19,11 +19,6 @@
#ifndef CDB_H #ifndef CDB_H
#define 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 <libxml/parser.h> #include <libxml/parser.h>
namespace NLMISC namespace NLMISC
@ -162,7 +157,7 @@ public:
/** /**
* Return the count of strings composing this id * 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 /** Return an element. empty if bad index
*/ */

View file

@ -707,10 +707,10 @@ ucstring CClientChatManager::getString( CBitMemStream& bms, ucstring& ucstr )
// search if a parameter exists in the string // search if a parameter exists in the string
sprintf(chTmp,"$%d",dynParamIdx); sprintf(chTmp,"$%d",dynParamIdx);
ucstring ucstrTmp( chTmp ); ucstring ucstrTmp( chTmp );
sint32 idx = ucstr.find(ucstrTmp); ucstring::size_type idx = ucstr.find(ucstrTmp);
// if there's a parameter in the string // if there's a parameter in the string
if( idx != -1 ) if( idx != ucstring::npos )
{ {
char c = (char)ucstr[idx+ucstrTmp.size()]; char c = (char)ucstr[idx+ucstrTmp.size()];
switch( c ) switch( c )
@ -856,10 +856,10 @@ bool CClientChatManager::getString( ucstring &result, std::vector<uint64>& args,
// search if a parameter exists in the string // search if a parameter exists in the string
sprintf(chTmp,"$%d",dynParamIdx); sprintf(chTmp,"$%d",dynParamIdx);
ucstring ucstrTmp( chTmp ); ucstring ucstrTmp( chTmp );
sint32 idx = result.find(ucstrTmp); ucstring::size_type idx = result.find(ucstrTmp);
// if there's a parameter in the string // if there's a parameter in the string
if( idx != -1 ) if( idx != ucstring::npos )
{ {
ucstring rep; ucstring rep;
rep = "???"; rep = "???";

View file

@ -102,7 +102,7 @@ void CSBrickSheet::build (const NLGEORGES::UFormElm &root)
if(BrickFamily==BRICK_FAMILIES::Unknown) if(BrickFamily==BRICK_FAMILIES::Unknown)
{ {
string sheetName= Id.toString(); 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)) ); BrickFamily = BRICK_FAMILIES::toSBrickFamily ( strupr(sheetName.substr(0,end)) );
if(BrickFamily==BRICK_FAMILIES::Unknown) if(BrickFamily==BRICK_FAMILIES::Unknown)
nlwarning("Unknown Family for SBrick: %s", sheetName.c_str()); nlwarning("Unknown Family for SBrick: %s", sheetName.c_str());

View file

@ -74,9 +74,9 @@ std::string IActionHandler::getParam (const string &Params, const string &ParamN
string param = strlwr (ParamName); string param = strlwr (ParamName);
while (allparam.size() > 0) while (allparam.size() > 0)
{ {
int e = allparam.find('='); std::string::size_type e = allparam.find('=');
if (e <= 0) break; if (e == std::string::npos || e == 0) break;
int p = allparam.find('|'); std::string::size_type p = allparam.find('|');
string tmp = strlwr(allparam.substr(0,e)); string tmp = strlwr(allparam.substr(0,e));
skipBlankAtEnd(tmp); skipBlankAtEnd(tmp);
if (tmp == param) if (tmp == param)
@ -86,7 +86,7 @@ std::string IActionHandler::getParam (const string &Params, const string &ParamN
skipBlankAtEnd(tmp2); skipBlankAtEnd(tmp2);
return tmp2; return tmp2;
} }
if (p <= 0) break; if (p == std::string::npos || p == 0) break;
allparam = allparam.substr(p+1,allparam.size()); allparam = allparam.substr(p+1,allparam.size());
skipBlankAtStart (allparam); skipBlankAtStart (allparam);
} }
@ -100,9 +100,9 @@ void IActionHandler::getAllParams (const string &Params, vector< pair<string,str
skipBlankAtStart (allparam); skipBlankAtStart (allparam);
while (allparam.size() > 0) while (allparam.size() > 0)
{ {
int e = allparam.find('='); std::string::size_type e = allparam.find('=');
if (e <= 0) break; if (e == std::string::npos || e == 0) break;
int p = allparam.find('|'); std::string::size_type p = allparam.find('|');
string tmp = strlwr(allparam.substr(0,e)); string tmp = strlwr(allparam.substr(0,e));
skipBlankAtEnd(tmp); skipBlankAtEnd(tmp);
@ -112,7 +112,7 @@ void IActionHandler::getAllParams (const string &Params, vector< pair<string,str
vAllParams.push_back(pair<string,string>(tmp,tmp2)); vAllParams.push_back(pair<string,string>(tmp,tmp2));
if (p <= 0) break; if (p == std::string::npos || p == 0) break;
allparam = allparam.substr(p+1,allparam.size()); allparam = allparam.substr(p+1,allparam.size());
skipBlankAtStart (allparam); skipBlankAtStart (allparam);
} }

View file

@ -20,7 +20,6 @@
#define RZ_CTRL_EDITBOX_H #define RZ_CTRL_EDITBOX_H
#include "interface_group.h" #include "interface_group.h"
#include "nel/3d/u_texture.h"
class CEventDescriptor; class CEventDescriptor;
@ -37,7 +36,7 @@ public:
~CGroupEditBox(); ~CGroupEditBox();
bool parse(xmlNodePtr cur,CInterfaceGroup * parentGroup); 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(); virtual void draw();
@ -109,7 +108,7 @@ public:
sint32 getCurrentHistoricIndex () const {return _CurrentHistoricIndex;} sint32 getCurrentHistoricIndex () const {return _CurrentHistoricIndex;}
void setCurrentHistoricIndex (sint32 index) {_CurrentHistoricIndex=index;} void setCurrentHistoricIndex (sint32 index) {_CurrentHistoricIndex=index;}
const ucstring &getHistoric(uint32 index) const {return _Historic[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 // Get on change action handler
const std::string &getAHOnChange() const {return _AHOnChange;} const std::string &getAHOnChange() const {return _AHOnChange;}
@ -345,7 +344,7 @@ private:
// //
bool isFiltered(ucchar c) bool isFiltered(ucchar c)
{ {
uint length = _NegativeFilter.size(); uint length = (uint)_NegativeFilter.size();
for (uint k = 0; k < length; ++k) for (uint k = 0; k < length; ++k)
{ {
if ((ucchar) _NegativeFilter[k] == c) return true; if ((ucchar) _NegativeFilter[k] == c) return true;

View file

@ -168,7 +168,7 @@ void CGroupInSceneBubbleManager::alignMessagePopup (vector<CPopup> &rList, bool
CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(pIM->getElementFromId("ui:interface")); CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(pIM->getElementFromId("ui:interface"));
if (pRoot) if (pRoot)
{ {
sint i = rList.size ()-1; sint i = (sint)rList.size ()-1;
rList[i].Group->invalidateCoords(); rList[i].Group->invalidateCoords();
rList[i].Group->updateCoords(); rList[i].Group->updateCoords();
@ -229,7 +229,7 @@ void CGroupInSceneBubbleManager::init ()
templateParams.push_back (std::pair<std::string,std::string>("id", id)); templateParams.push_back (std::pair<std::string,std::string>("id", id));
CInterfaceGroup *group = pIM->createGroupInstance ("3dbulle_L", 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) if (group)
{ {
// Link to the interface // Link to the interface
@ -457,7 +457,7 @@ void CGroupInSceneBubbleManager::update ()
ucstring finalString = res; ucstring finalString = res;
for(;;) for(;;)
{ {
uint index = finalString.find (ucstring("{break}")); std::string::size_type index = finalString.find (ucstring("{break}"));
if (index == ucstring::npos) break; if (index == ucstring::npos) break;
finalString = finalString.substr (0, index) + finalString.substr(index+7,finalString.size()); 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<std::string,std::string>("delta", toString(delta))); templateParams.push_back (std::pair<std::string,std::string>("delta", toString(delta)));
CInterfaceGroup *group = pIM->createGroupInstance ("skill_popup", 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) if (group)
{ {
// Skill name // Skill name
@ -575,7 +575,7 @@ void CGroupInSceneBubbleManager::addMessagePopup (const ucstring &message, CRGBA
templateParams.push_back (std::pair<std::string,std::string>("id", id)); templateParams.push_back (std::pair<std::string,std::string>("id", id));
CInterfaceGroup *group = pIM->createGroupInstance ("message_popup", 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) if (group)
{ {
// Skill name // Skill name
@ -624,7 +624,7 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message,
templateParams.push_back (std::pair<std::string,std::string>("id", id)); templateParams.push_back (std::pair<std::string,std::string>("id", id));
CInterfaceGroup *group = pIM->createGroupInstance ("message_popup_center", 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) if (group)
{ {
// Skill name // Skill name
@ -695,7 +695,7 @@ CGroupInSceneBubbleManager::CPopupContext *CGroupInSceneBubbleManager::buildCont
templateParams.push_back (std::pair<std::string,std::string>("id", id)); templateParams.push_back (std::pair<std::string,std::string>("id", id));
CInterfaceGroup *group = pIM->createGroupInstance (templateName+v+h, 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) if (group)
{ {
// Target available ? // Target available ?
@ -1331,7 +1331,7 @@ void CGroupInSceneBubble::next()
void CGroupInSceneBubble::skip() void CGroupInSceneBubble::skip()
{ {
if (_TextParts.empty()) return; if (_TextParts.empty()) return;
_CurrentPart = _TextParts.size()-1; _CurrentPart = (uint32)_TextParts.size()-1;
_TimeOut = TimeInSec; _TimeOut = TimeInSec;
} }

View file

@ -694,7 +694,7 @@ void CSPhraseManager::updateBookDB()
// Fill All the book. // Fill All the book.
TPhraseMap::const_iterator it= _PhraseMap.begin(); TPhraseMap::const_iterator it= _PhraseMap.begin();
sint numBookFill= _PhraseMap.size(); sint numBookFill= (sint)_PhraseMap.size();
sint i= 0; sint i= 0;
while(i<numBookFill) while(i<numBookFill)
{ {
@ -2731,7 +2731,7 @@ NLMISC::TGameCycle CSPhraseManager::getPowerDisableTime(const CSPhraseCom &phras
{ {
for (uint prop = 0; prop < brick->Properties.size(); ++prop) for (uint prop = 0; prop < brick->Properties.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) if (endPos != std::string::npos)
{ {
std::string propName = brick->Properties[prop].Text.substr(0, endPos); std::string propName = brick->Properties[prop].Text.substr(0, endPos);
@ -3432,7 +3432,7 @@ void CSPhraseManager::updatePhraseProgressionDB()
// Fill All the progression db. // Fill All the progression db.
uint numProgressFill= 0; uint numProgressFill= 0;
if(_BookSkillFitler!=SKILLS::unknown) if(_BookSkillFitler!=SKILLS::unknown)
numProgressFill= _ProgressionPhrases[_BookSkillFitler].Phrases.size(); numProgressFill= (uint)_ProgressionPhrases[_BookSkillFitler].Phrases.size();
uint i; uint i;
uint progressIndex[NumProgressType]; uint progressIndex[NumProgressType];
for(i=0;i<NumProgressType;i++) for(i=0;i<NumProgressType;i++)
@ -3756,7 +3756,7 @@ void CSPhraseManager::computePhraseProgression()
ucstring newNumber= toString("%3d", number); ucstring newNumber= toString("%3d", number);
pse.Text.replace(start, k-start, newNumber); pse.Text.replace(start, k-start, newNumber);
// and skip this number // and skip this number
k= start + newNumber.size(); k= start + (uint)newNumber.size();
} }
} }
} }
@ -4035,9 +4035,9 @@ void CSPhraseManager::getCombatWeaponRestriction(ucstring &text, const CSPhra
if(i<skills.size()-1) if(i<skills.size()-1)
idName+= "_"; idName+= "_";
if( skillName.find("SFM") != -1 ) if( skillName.find("SFM") != std::string::npos )
usableWithMelee = true; usableWithMelee = true;
if( skillName.find("SFR") != -1 ) if( skillName.find("SFR") != std::string::npos )
usableWithRange = true; usableWithRange = true;
} }

View file

@ -969,7 +969,7 @@ void setRegKey(const string &ValueName, const string &Value)
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, RootKey.c_str(), 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwDisp) == ERROR_SUCCESS) if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, RootKey.c_str(), 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwDisp) == ERROR_SUCCESS)
{ {
RegSetValueEx(hkey, ValueName.c_str(), 0L, REG_SZ, (const BYTE *)Value.c_str(), (Value.size())+1); RegSetValueEx(hkey, ValueName.c_str(), 0L, REG_SZ, (const BYTE *)Value.c_str(), (DWORD)(Value.size())+1);
RegCloseKey(hkey); RegCloseKey(hkey);
} }
else else
@ -1922,7 +1922,7 @@ class CAHOpenURL : public IActionHandler
return; return;
} }
size_t pos_lang = url.find("/en/"); string::size_type pos_lang = url.find("/en/");
if(pos_lang!=string::npos) if(pos_lang!=string::npos)
url.replace(pos_lang+1, 2, ClientCfg.getHtmlLanguageCode()); url.replace(pos_lang+1, 2, ClientCfg.getHtmlLanguageCode());
@ -2579,7 +2579,7 @@ class CAHOnCreateAccountSubmit : public IActionHandler
params += "&TaC=1"; params += "&TaC=1";
std::string md5 = results[0] + results[1] + "" + results[3]; std::string md5 = results[0] + results[1] + "" + results[3];
md5 = NLMISC::getMD5((uint8*)md5.data(), md5.size()).toString(); md5 = NLMISC::getMD5((uint8*)md5.data(), (uint32)md5.size()).toString();
params += "&SC=" + md5; params += "&SC=" + md5;
std::string lang = ClientCfg.LanguageCode; std::string lang = ClientCfg.LanguageCode;
@ -2933,7 +2933,7 @@ string checkLogin(const string &login, const string &password, const string &cli
if(pPM->isVerboseLog()) if(pPM->isVerboseLog())
{ {
nlinfo ("Exploded, with nl, %d res", lines.size()); nlinfo ("Exploded, with nl, %zu res", lines.size());
/* for (uint i = 0; i < lines.size(); i++) /* for (uint i = 0; i < lines.size(); i++)
{ {
nlinfo (" > '%s'", lines[i].c_str()); 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) 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()); nlwarning("'%s'", res.c_str());
return "bad lines numbers (error code 5)"; 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()) 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++) /* for (uint i = 0; i < res.size(); i++)
{ {
nlinfo (" > '%s'", res[i].c_str()); 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) 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()); nlwarning("'%s'", lines[i].c_str());
return "bad pipe numbers (error code 6)"; return "bad pipe numbers (error code 6)";
} }

View file

@ -50,9 +50,9 @@ void CToolPick::setIgnoreInstances(const std::string & ignoreInstances)
string allKind = ignoreInstances; string allKind = ignoreInstances;
while (allKind.size() > 0) while (allKind.size() > 0)
{ {
int e = allKind.find(','); std::string::size_type e = allKind.find(',');
string tmp; string tmp;
if (e <= 0) if (e == std::string::npos || e == 0)
{ {
tmp = allKind; tmp = allKind;
allKind=""; allKind="";

View file

@ -642,10 +642,10 @@ void CSessionBrowserImpl::charsFill(const std::vector <RSMGR::TCharDesc > &chars
inline double ecoRingPoints(const std::string & ecoPoints, char * c) 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) if(cPlace==string::npos)
return 0; return 0;
uint sepPlace = ecoPoints.find(":", cPlace); std::string::size_type sepPlace = ecoPoints.find(":", cPlace);
std::string points = ecoPoints.substr(cPlace+1, sepPlace); std::string points = ecoPoints.substr(cPlace+1, sepPlace);
double ret; double ret;
fromString(points, ret); fromString(points, ret);

View file

@ -36,7 +36,14 @@
#include <nel/misc/command.h> #include <nel/misc/command.h>
#include <nel/misc/variable.h> #include <nel/misc/variable.h>
#include <nel/misc/hierarchical_timer.h> #include <nel/misc/hierarchical_timer.h>
#include <nel/misc/algo.h>
#include <nel/misc/types_nl.h>
#include <nel/misc/events.h>
#include <nel/misc/file.h>
#include <nel/misc/string_mapper.h>
#include <nel/misc/smart_ptr.h>
#include <nel/3d/u_animation_set.h>
#include <nel/3d/u_driver.h> #include <nel/3d/u_driver.h>
#include <nel/3d/u_text_context.h> #include <nel/3d/u_text_context.h>
#include <nel/3d/u_scene.h> #include <nel/3d/u_scene.h>
@ -45,6 +52,7 @@
#include <nel/3d/u_material.h> #include <nel/3d/u_material.h>
#include <nel/3d/u_instance_group.h> #include <nel/3d/u_instance_group.h>
#include <nel/3d/u_instance.h> #include <nel/3d/u_instance.h>
#include <nel/3d/u_texture.h>
#include <nel/net/callback_client.h> #include <nel/net/callback_client.h>
#include <nel/net/udp_sock.h> #include <nel/net/udp_sock.h>
@ -54,6 +62,8 @@
#include <nel/pacs/u_global_position.h> #include <nel/pacs/u_global_position.h>
#include <nel/pacs/u_move_primitive.h> #include <nel/pacs/u_move_primitive.h>
#include <nel/sound/sound_anim_manager.h>
#include "game_share/generic_xml_msg_mngr.h" #include "game_share/generic_xml_msg_mngr.h"
#include "game_share/msg_client_server.h" #include "game_share/msg_client_server.h"
#include "game_share/action_target_slot.h" #include "game_share/action_target_slot.h"

View file

@ -48,10 +48,10 @@ void CSTLoader::buildTableFormat( string fileName, list<pair<string,TDataType> >
// extract type from token // extract type from token
string stoken = string( token ); string stoken = string( token );
sint typeStart = stoken.find_last_of("<"); string::size_type typeStart = stoken.find_last_of("<");
nlassert(typeStart != -1); nlassert(typeStart != string::npos);
sint typeEnd = stoken.find_first_of(">",typeStart); string::size_type typeEnd = stoken.find_first_of(">",typeStart);
nlassert(typeEnd != -1); nlassert(typeEnd != string::npos);
string type_str = stoken.substr( typeStart+1, (typeEnd-typeStart-1) ); string type_str = stoken.substr( typeStart+1, (typeEnd-typeStart-1) );
TDataType type_enum = convertType(type_str); TDataType type_enum = convertType(type_str);
@ -75,9 +75,9 @@ void CSTLoader::buildTableFormat( string fileName, list<pair<string,TDataType> >
// extract type from token // extract type from token
typeStart = stoken.find_last_of("<"); typeStart = stoken.find_last_of("<");
nlassert(typeStart != -1); nlassert(typeStart != string::npos);
typeEnd = stoken.find_first_of(">",typeStart); typeEnd = stoken.find_first_of(">",typeStart);
nlassert(typeEnd != -1); nlassert(typeEnd != string::npos);
type_str = stoken.substr( typeStart+1, (typeEnd-typeStart-1) ); type_str = stoken.substr( typeStart+1, (typeEnd-typeStart-1) );
type_enum = convertType(type_str); type_enum = convertType(type_str);
@ -321,7 +321,7 @@ bool CSTLoader::readLine()
return false; return false;
} }
const uint nbColumn = _Columns.size(); const uint nbColumn = (uint)_Columns.size();
char readBuffer[4096]; char readBuffer[4096];
char * token; char * token;
bool firstToken = true; bool firstToken = true;

View file

@ -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 // extract the 2 first param (argv[1] and argv[2]) it must be cookie and addr
string cmd = cmdline; string cmd = cmdline;
int pos1 = cmd.find_first_not_of (' '); std::string::size_type pos1 = cmd.find_first_not_of (' ');
int pos2; std::string::size_type pos2;
if (pos1 != string::npos) if (pos1 != string::npos)
{ {
pos2 = cmd.find (' ', pos1); pos2 = cmd.find (' ', pos1);