From 73d568da62a7fc3f0b11bfbc6df304b796123c52 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 15:02:00 +0200 Subject: [PATCH] Changed: #825 Remove all warnings when compiling Ryzom --- code/nel/samples/net/login_system/client.cpp | 2 +- code/nel/samples/net/udp/client.cpp | 6 +++--- code/nel/samples/net/udp/graph.cpp | 2 +- code/nel/samples/pacs/main.cpp | 10 +++++----- code/nel/tools/3d/zone_dump/zone_dump.cpp | 2 +- code/nel/tools/3d/zone_lighter/zone_lighter.cpp | 2 +- .../client/src/client_sheets/client_sheets.vcproj | 2 +- code/ryzom/client/src/client_sheets/sbrick_sheet.cpp | 3 +-- code/ryzom/client/src/init.cpp | 1 + code/ryzom/client/src/interface_v3/action_handler.cpp | 2 +- code/ryzom/common/src/game_share/dir_light_setup.cpp | 9 +++++---- .../src/game_share/generate_module_interface.xslt | 6 +++--- code/ryzom/tools/client/client_config/cfg_file.cpp | 2 +- code/ryzom/tools/client/client_config/display_dlg.cpp | 3 +-- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/code/nel/samples/net/login_system/client.cpp b/code/nel/samples/net/login_system/client.cpp index 408baea65..22cf3e675 100644 --- a/code/nel/samples/net/login_system/client.cpp +++ b/code/nel/samples/net/login_system/client.cpp @@ -95,7 +95,7 @@ int main (int argc, char **argv) Password = fgets(buf, 256, stdin); } // crypt with md5 the password - CHashKeyMD5 hk = getMD5((uint8*)Password.c_str(), Password.size()); + CHashKeyMD5 hk = getMD5((uint8*)Password.c_str(), (uint32)Password.size()); string CPassword = hk.toString(); nlinfo("The crypted password is %s", CPassword.c_str()); diff --git a/code/nel/samples/net/udp/client.cpp b/code/nel/samples/net/udp/client.cpp index 51ed287ce..06f494138 100644 --- a/code/nel/samples/net/udp/client.cpp +++ b/code/nel/samples/net/udp/client.cpp @@ -213,8 +213,8 @@ void cbInfo (CMessage &msgin, TSockId from, CCallbackNetBase &netbase) #ifdef USE_3D string token = "MeanPongTime "; - uint pos=line.find (token); - uint pos2=line.find (" ", pos+token.size()); + string::size_type pos=line.find (token); + string::size_type pos2=line.find (" ", pos+token.size()); uint32 val = atoi(line.substr (pos+token.size(), pos2-pos-token.size()).c_str()); LagGraph.addOneValue ((float)val); #endif @@ -309,7 +309,7 @@ int main( int argc, char **argv ) UTextContext *TextContext= Driver->createTextContext(CPath::lookup("n019003l.pfb")); TextContext->setFontSize(18); - Camera.setPerspective(80*Pi/180, 1.33, 0.15, 1000); + Camera.setPerspective(80*(float)Pi/180, 1.33f, 0.15f, 1000); CEvent3dMouseListener MouseListener; MouseListener.addToServer(Driver->EventServer); diff --git a/code/nel/samples/net/udp/graph.cpp b/code/nel/samples/net/udp/graph.cpp index 3d52279dc..86255e826 100644 --- a/code/nel/samples/net/udp/graph.cpp +++ b/code/nel/samples/net/udp/graph.cpp @@ -81,7 +81,7 @@ void CGraph::render (NL3D::UDriver *Driver, NL3D::UTextContext *TextContext) CVertexBuffer vbuffer; vbuffer.setVertexFormat (CVertexBuffer::PositionFlag); - vbuffer.setNumVertices (Values.size() * 2); + vbuffer.setNumVertices ((uint32)Values.size() * 2); float pos = X+Width-1; uint i = 0; diff --git a/code/nel/samples/pacs/main.cpp b/code/nel/samples/pacs/main.cpp index 256acf9b3..d3d87a938 100644 --- a/code/nel/samples/pacs/main.cpp +++ b/code/nel/samples/pacs/main.cpp @@ -264,7 +264,7 @@ int main () } // Keyboard - if (arrayObj.size()) + if (!arrayObj.empty()) { // Manipulate selected primitive keyboard (pDriver, deltaTime, *(arrayObj[selected])); @@ -273,7 +273,8 @@ int main () if (pDriver->AsyncListener.isKeyDown (KeyDELETE)) { // remove all but one - if (arrayObj.size() > 1) { + if (arrayObj.size() > 1) + { arrayObj[arrayObj.size()-1]->remove (*container, *pScene); arrayObj.resize (arrayObj.size()-1); } @@ -281,7 +282,7 @@ int main () // Check selected if (selected>=arrayObj.size()) - selected=arrayObj.size()-1; + selected=(uint)arrayObj.size()-1; //if (selected<0) // selected=0; @@ -312,8 +313,7 @@ int main () clearColor=CRGBA::Black; // Setup view matrix - int size=arrayObj.size(); - if (size) + if (!arrayObj.empty()) { // Setup hotspot for the 3d listener plistener->setHotSpot (arrayObj[selected]->getPos()); diff --git a/code/nel/tools/3d/zone_dump/zone_dump.cpp b/code/nel/tools/3d/zone_dump/zone_dump.cpp index d8ea987fd..9e37aa0b3 100644 --- a/code/nel/tools/3d/zone_dump/zone_dump.cpp +++ b/code/nel/tools/3d/zone_dump/zone_dump.cpp @@ -177,7 +177,7 @@ int main(int argc, char* argv[]) } // Triangle count - triangles+=faces.size(); + triangles+=(uint32)faces.size(); } } else diff --git a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp index 6df94365d..8608958e0 100644 --- a/code/nel/tools/3d/zone_lighter/zone_lighter.cpp +++ b/code/nel/tools/3d/zone_lighter/zone_lighter.cpp @@ -82,7 +82,7 @@ class CMyZoneLighter : public CZoneLighter pgId= min(pgId, (uint)(BAR_LENGTH-1)); sprintf (msg, "\r%s: %s", message, progressbar[pgId]); uint i; - for (i=strlen(msg); i<79; i++) + for (i=(uint)strlen(msg); i<79; i++) msg[i]=' '; msg[i]=0; printf ("%s\r", msg); diff --git a/code/ryzom/client/src/client_sheets/client_sheets.vcproj b/code/ryzom/client/src/client_sheets/client_sheets.vcproj index 46037a090..666bd3449 100644 --- a/code/ryzom/client/src/client_sheets/client_sheets.vcproj +++ b/code/ryzom/client/src/client_sheets/client_sheets.vcproj @@ -114,7 +114,7 @@ Optimization="4" InlineFunctionExpansion="1" AdditionalIncludeDirectories="../../../common/src/" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LIBXML_STATIC" StringPooling="true" MinimalRebuild="true" ExceptionHandling="2" diff --git a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp index c9379e1ed..98640bbca 100644 --- a/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/sbrick_sheet.cpp @@ -404,8 +404,7 @@ void CSBrickSheet::build (const NLGEORGES::UFormElm &root) // **** Magic only: try to get a ResistType against this brick for(i=0;i 0) { std::string::size_type e = allparam.find('='); diff --git a/code/ryzom/common/src/game_share/dir_light_setup.cpp b/code/ryzom/common/src/game_share/dir_light_setup.cpp index 1f7998d5e..23f393227 100644 --- a/code/ryzom/common/src/game_share/dir_light_setup.cpp +++ b/code/ryzom/common/src/game_share/dir_light_setup.cpp @@ -25,10 +25,11 @@ //----------------------------------------------- -CDirLightSetup::CDirLightSetup() : Ambiant(0, 0, 0), - Diffuse(255, 255, 255), - Specular(0, 0, 0), - Direction(1.f, 0.f, 0.f) +CDirLightSetup::CDirLightSetup() : + Ambiant(0, 0, 0), + Diffuse(255, 255, 255), + Specular(0, 0, 0), + Direction(1.f, 0.f, 0.f) { } diff --git a/code/ryzom/common/src/game_share/generate_module_interface.xslt b/code/ryzom/common/src/game_share/generate_module_interface.xslt index 2a4f16e63..425e699a4 100644 --- a/code/ryzom/common/src/game_share/generate_module_interface.xslt +++ b/code/ryzom/common/src/game_share/generate_module_interface.xslt @@ -170,9 +170,9 @@ namespace // unused interceptors std::string fwdBuildModuleManifest() const { return std::string(); } - void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {}; - void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {}; - void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {}; + void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy) {} + void fwdOnModuleDown(NLNET::IModuleProxy *moduleProxy) {} + void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {} // process module message interceptor bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message); diff --git a/code/ryzom/tools/client/client_config/cfg_file.cpp b/code/ryzom/tools/client/client_config/cfg_file.cpp index 1af5083e1..6c7e13768 100644 --- a/code/ryzom/tools/client/client_config/cfg_file.cpp +++ b/code/ryzom/tools/client/client_config/cfg_file.cpp @@ -97,7 +97,7 @@ bool GetBool (const char *var) // Available ? if (variable) { - string _bool = strlwr (variable->asString ()); + string _bool = toLower (variable->asString ()); if (_bool == "true") return true; if (_bool == "false") diff --git a/code/ryzom/tools/client/client_config/display_dlg.cpp b/code/ryzom/tools/client/client_config/display_dlg.cpp index b5c15210b..3379d9d71 100644 --- a/code/ryzom/tools/client/client_config/display_dlg.cpp +++ b/code/ryzom/tools/client/client_config/display_dlg.cpp @@ -495,8 +495,7 @@ CDisplayDlg::TDriver CDisplayDlg::getActualDriver() const std::string deviceName; uint64 drvVersion; CSystemInfo::getVideoInfo(deviceName, drvVersion); - strlwr(deviceName); - return strstr(deviceName.c_str(), "radeon") != NULL ? Direct3D : OpenGL; + return strstr(toLower(deviceName).c_str(), "radeon") != NULL ? Direct3D : OpenGL; } } return OpenGL;