From 31a990fa600408d41a089b4680af5c3ffc4fc51d Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Oct 2010 17:27:20 +0200 Subject: [PATCH] Changed: #825 Remove all warning when compiling Ryzom --- code/nel/include/nel/3d/computed_string.h | 2 +- code/nel/include/nel/3d/packed_zone.h | 4 ++-- code/nel/include/nel/3d/quad_grid.h | 3 ++- code/nel/src/3d/driver/direct3d/driver_direct3d.cpp | 4 ++-- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 2 +- code/nel/src/3d/driver/opengl/driver_opengl_states.cpp | 4 ++-- code/nel/src/3d/packed_world.cpp | 4 ++-- code/nel/src/3d/packed_zone.cpp | 2 +- code/nel/src/3d/scene.cpp | 2 +- code/nel/src/3d/text_context_user.cpp | 2 +- code/nel/src/3d/transform.cpp | 2 +- code/nel/src/3d/water_env_map.cpp | 2 +- code/nel/src/3d/zone_manager.cpp | 4 +--- code/nel/src/georges/form_dfn.cpp | 2 +- code/nel/src/misc/sheet_id.cpp | 6 +++--- code/nel/src/net/unified_network.cpp | 2 +- code/nel/tools/logic/logic_editor_dll/ResizablePage.cpp | 2 +- code/nelns/admin_executor_service/log_report.cpp | 2 +- 18 files changed, 25 insertions(+), 26 deletions(-) diff --git a/code/nel/include/nel/3d/computed_string.h b/code/nel/include/nel/3d/computed_string.h index 0ec85431f..16fe70fcb 100644 --- a/code/nel/include/nel/3d/computed_string.h +++ b/code/nel/include/nel/3d/computed_string.h @@ -228,7 +228,7 @@ public: Vertices.setName("CComputedString"); } SelectStart= 0; - SelectSize= ~0; + SelectSize= std::numeric_limits::max(); } /** diff --git a/code/nel/include/nel/3d/packed_zone.h b/code/nel/include/nel/3d/packed_zone.h index 7ca5b93d2..343492ac3 100644 --- a/code/nel/include/nel/3d/packed_zone.h +++ b/code/nel/include/nel/3d/packed_zone.h @@ -124,7 +124,7 @@ public: static uint32 UndefIndex; // used as value for undefined index std::vector Verts; std::vector Tris; - std::vector TriLists; // lists of tri for each grid cell, all list are packed in a single vector. ~0 marks the end of a list + std::vector TriLists; // lists of tri for each grid cell, all list are packed in a single vector. std::numeric_limits::max() marks the end of a list NLMISC::CArray2D Grid; // grid of entries into TriLists (one list for each cell) float CellSize; public: @@ -176,7 +176,7 @@ public: friend class CPackedZone32; std::vector Verts; std::vector Tris; - std::vector TriLists; // lists of tri for each grid cell, all lists are packed in a single vector. ~0 marks the end of a list + std::vector TriLists; // lists of tri for each grid cell, all lists are packed in a single vector. std::numeric_limits::max() marks the end of a list NLMISC::CArray2D Grid; // grid of entries into TriLists (one list for each cell) float CellSize; public: diff --git a/code/nel/include/nel/3d/quad_grid.h b/code/nel/include/nel/3d/quad_grid.h index 26ba1c484..a47037088 100644 --- a/code/nel/include/nel/3d/quad_grid.h +++ b/code/nel/include/nel/3d/quad_grid.h @@ -28,6 +28,7 @@ #include "nel/misc/polygon.h" #include "nel/misc/grid_traversal.h" +#include #include #include @@ -308,7 +309,7 @@ private:// Methods. ++ _SelectStamp; if (_SelectStamp == 0) { - std::fill(_AlreadySelected.begin(), _AlreadySelected.end(), (uint) ~0); + std::fill(_AlreadySelected.begin(), _AlreadySelected.end(), std::numeric_limits::max()); } } diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index e096a4d00..d6af8cabc 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -244,11 +244,11 @@ CDriverD3D::CDriverD3D() _CurStencilTest = false; _CurStencilFunc = D3DCMP_ALWAYS; _CurStencilRef = 0; - _CurStencilMask = ~0; + _CurStencilMask = std::numeric_limits::max(); _CurStencilOpFail = D3DSTENCILOP_KEEP; _CurStencilOpZFail = D3DSTENCILOP_KEEP; _CurStencilOpZPass = D3DSTENCILOP_KEEP; - _CurStencilWriteMask = ~0; + _CurStencilWriteMask = std::numeric_limits::max(); for(uint k = 0; k < MaxTexture; ++k) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index cfe8788ca..f0d816f50 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -462,7 +462,7 @@ bool CDriverGL::setupDisplay() _AGPVertexArrayRange= new CVertexArrayRangeARB(this); _VRAMVertexArrayRange= new CVertexArrayRangeARB(this); _SupportVBHard= true; - _MaxVerticesByVBHard = ~0; // cant' know the value.. + _MaxVerticesByVBHard = std::numeric_limits::max(); // cant' know the value.. } // Reset VertexArrayRange. diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp index cecd9ed0e..6b0dccbea 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_states.cpp @@ -102,11 +102,11 @@ void CDriverGLStates::forceDefaults(uint nbStages) _CurDepthFunc= GL_LEQUAL; _CurStencilFunc = GL_ALWAYS; _CurStencilRef = 0; - _CurStencilMask = ~0; + _CurStencilMask = std::numeric_limits::max(); _CurStencilOpFail = GL_KEEP; _CurStencilOpZFail = GL_KEEP; _CurStencilOpZPass = GL_KEEP; - _CurStencilWriteMask = ~0; + _CurStencilWriteMask = std::numeric_limits::max(); _CurAlphaTestThreshold= 0.5f; // setup GLStates. glBlendFunc(_CurBlendSrc, _CurBlendDst); diff --git a/code/nel/src/3d/packed_world.cpp b/code/nel/src/3d/packed_world.cpp index b989e2cf9..ace734cea 100644 --- a/code/nel/src/3d/packed_world.cpp +++ b/code/nel/src/3d/packed_world.cpp @@ -74,7 +74,7 @@ void CPackedWorld::build(std::vector &packedZones) } } } - _RaytraceCounter = ~0; + _RaytraceCounter = std::numeric_limits::max(); } // ************************************************************************************************* @@ -86,7 +86,7 @@ bool CPackedWorld::raytrace(const NLMISC::CVector &start, const NLMISC::CVector CVector bestNormal(CVector::Null); CVector currEnd = end; CVector currInter; - if (_RaytraceCounter == (uint32) ~0) + if (_RaytraceCounter == std::numeric_limits::max()) { for(uint k = 0; k < _Zones.size(); ++k) { diff --git a/code/nel/src/3d/packed_zone.cpp b/code/nel/src/3d/packed_zone.cpp index 2cd2c8af0..f1b96b7a7 100644 --- a/code/nel/src/3d/packed_zone.cpp +++ b/code/nel/src/3d/packed_zone.cpp @@ -825,7 +825,7 @@ void CPackedZone32::build(std::vector &leaves, // remap tri lists for(uint k = 0; k < TriLists.size(); ++k) { - if (TriLists[k] != ~0) + if (TriLists[k] != std::numeric_limits::max()) { TriLists[k] = triListRemapping[TriLists[k]]; } diff --git a/code/nel/src/3d/scene.cpp b/code/nel/src/3d/scene.cpp index d00229061..a3b3e7e77 100644 --- a/code/nel/src/3d/scene.cpp +++ b/code/nel/src/3d/scene.cpp @@ -158,7 +158,7 @@ CScene::CScene(bool bSmallScene) : LightTrav(bSmallScene) _MaxSkeletonsInNotCLodForm= 20; - _FilterRenderFlags= ~0; + _FilterRenderFlags= std::numeric_limits::max(); _NextRenderProfile= false; diff --git a/code/nel/src/3d/text_context_user.cpp b/code/nel/src/3d/text_context_user.cpp index 3da0f26bd..29181337a 100644 --- a/code/nel/src/3d/text_context_user.cpp +++ b/code/nel/src/3d/text_context_user.cpp @@ -218,7 +218,7 @@ void CTextContextUser::resetStringSelection(uint32 i) if(str) { str->SelectStart= 0; - str->SelectSize= ~0; + str->SelectSize= std::numeric_limits::max(); } } void CTextContextUser::erase(uint32 i) diff --git a/code/nel/src/3d/transform.cpp b/code/nel/src/3d/transform.cpp index 135912bf3..fb85e5f65 100644 --- a/code/nel/src/3d/transform.cpp +++ b/code/nel/src/3d/transform.cpp @@ -113,7 +113,7 @@ CTransform::CTransform() _StateFlags= IsOpaque | IsUserLightable; // By default, always allow rendering of Transform Models. - _RenderFilterType= ~0; + _RenderFilterType= std::numeric_limits::max(); // By default, don't suport fast intersection detection _SupportFastIntersect= false; diff --git a/code/nel/src/3d/water_env_map.cpp b/code/nel/src/3d/water_env_map.cpp index 59b5f6725..4143bbec8 100644 --- a/code/nel/src/3d/water_env_map.cpp +++ b/code/nel/src/3d/water_env_map.cpp @@ -343,7 +343,7 @@ void CWaterEnvMap::invalidate() _StartRenderTime = -1; if (_UpdateTime == 0) { - _LastRenderTick = UINT64_CONSTANT(~0); + _LastRenderTick = std::numeric_limits::max(); } else { diff --git a/code/nel/src/3d/zone_manager.cpp b/code/nel/src/3d/zone_manager.cpp index 735d14624..f67d6e89e 100644 --- a/code/nel/src/3d/zone_manager.cpp +++ b/code/nel/src/3d/zone_manager.cpp @@ -16,8 +16,6 @@ #include "std3d.h" -#include - #include "nel/3d/zone_manager.h" #include "nel/misc/path.h" #include "nel/misc/file.h" @@ -40,7 +38,7 @@ CZoneManager::CZoneManager() _ZoneTileColorMono = true; _ZoneTileColorFactor = 1.0f; _LastArea= 0; - _LastX= _LastY= (uint32) ~0; + _LastX= _LastY= std::numeric_limits::max(); } // ------------------------------------------------------------------------------------------------ diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index 6f9cc42f5..ae9d364f1 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -687,7 +687,7 @@ bool CFormDfn::getEntryIndexByName (uint &entry, const std::string &name) const } entryIndex++; } - entry=~0; + entry=std::numeric_limits::max(); return false; } diff --git a/code/nel/src/misc/sheet_id.cpp b/code/nel/src/misc/sheet_id.cpp index 23f4cf82e..2d0f1d192 100644 --- a/code/nel/src/misc/sheet_id.cpp +++ b/code/nel/src/misc/sheet_id.cpp @@ -566,7 +566,7 @@ void CSheetId::buildIdVector(std::vector &result, std::vector &result,const std::string &fileExtension) { uint32 type=typeFromFileExtension(fileExtension); - if (type!=(uint32)~0) + if (type != std::numeric_limits::max()) buildIdVector(result, type); } // buildIdVector // @@ -578,7 +578,7 @@ void CSheetId::buildIdVector(std::vector &result,const std::string &f void CSheetId::buildIdVector(std::vector &result, std::vector &resultFilenames,const std::string &fileExtension) { uint32 type=typeFromFileExtension(fileExtension); - if (type != (uint32)~0) + if (type != std::numeric_limits::max()) buildIdVector(result,resultFilenames, type); } // buildIdVector // @@ -597,7 +597,7 @@ uint32 CSheetId::typeFromFileExtension(const std::string &fileExtension) if (toLower(fileExtension)==_FileExtensions[i]) return i; - return ~0; + return std::numeric_limits::max(); } // typeFromFileExtension // diff --git a/code/nel/src/net/unified_network.cpp b/code/nel/src/net/unified_network.cpp index bb01286c7..763ce68eb 100644 --- a/code/nel/src/net/unified_network.cpp +++ b/code/nel/src/net/unified_network.cpp @@ -62,7 +62,7 @@ CVariablePtr DefaultMaxSentBlockSize("nel", "DefaultMaxSentBlockSize", " #define AUTOCHECK_DISPLAY nlwarning //#define AUTOCHECK_DISPLAY CUnifiedNetwork::getInstance()->displayInternalTables (), nlerror -const TServiceId TServiceId::InvalidId = TServiceId(uint16(~0)); +const TServiceId TServiceId::InvalidId = TServiceId(std::numeric_limits::max()); // // Callbacks from NAMING SERVICE diff --git a/code/nel/tools/logic/logic_editor_dll/ResizablePage.cpp b/code/nel/tools/logic/logic_editor_dll/ResizablePage.cpp index c1f9fdb77..0ae19d613 100644 --- a/code/nel/tools/logic/logic_editor_dll/ResizablePage.cpp +++ b/code/nel/tools/logic/logic_editor_dll/ResizablePage.cpp @@ -175,7 +175,7 @@ void CResizablePage::ArrangeLayout() Layout *pl; POSITION pos = m_plLayoutList.GetHeadPosition(); - HDWP hdwp = BeginDeferWindowPos(m_plLayoutList.GetCount()); + HDWP hdwp = BeginDeferWindowPos((int)m_plLayoutList.GetCount()); while (pos != NULL) { diff --git a/code/nelns/admin_executor_service/log_report.cpp b/code/nelns/admin_executor_service/log_report.cpp index 46e27b77e..eac5f83c3 100644 --- a/code/nelns/admin_executor_service/log_report.cpp +++ b/code/nelns/admin_executor_service/log_report.cpp @@ -175,7 +175,7 @@ bool isOfLogDotLogFamily( const std::string& filename ) enum TVersionTargetMode { TTMAll, TTMMatchAllV, TTMMatchExactV, TTMMatchGreaterV, TTMMatchLowerV } targetMode; -const uint CurrentVersion = ~0; +const uint CurrentVersion = std::numeric_limits::max(); // Return true and logVersion, or false if not a log with version bool getLogVersion( const std::string& filename, uint& logVersion )