Changed: #825 Remove all warning when compiling Ryzom

This commit is contained in:
kervala 2010-10-02 17:27:20 +02:00
parent 6fb3465433
commit 8b1aa9cff9
18 changed files with 25 additions and 26 deletions

View file

@ -228,7 +228,7 @@ public:
Vertices.setName("CComputedString"); Vertices.setName("CComputedString");
} }
SelectStart= 0; SelectStart= 0;
SelectSize= ~0; SelectSize= std::numeric_limits<uint32>::max();
} }
/** /**

View file

@ -124,7 +124,7 @@ public:
static uint32 UndefIndex; // used as value for undefined index static uint32 UndefIndex; // used as value for undefined index
std::vector<CPackedVertex> Verts; std::vector<CPackedVertex> Verts;
std::vector<CPackedTri> Tris; std::vector<CPackedTri> Tris;
std::vector<uint32> 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<uint32> TriLists; // lists of tri for each grid cell, all list are packed in a single vector. std::numeric_limits<uint32>::max() marks the end of a list
NLMISC::CArray2D<uint32> Grid; // grid of entries into TriLists (one list for each cell) NLMISC::CArray2D<uint32> Grid; // grid of entries into TriLists (one list for each cell)
float CellSize; float CellSize;
public: public:
@ -176,7 +176,7 @@ public:
friend class CPackedZone32; friend class CPackedZone32;
std::vector<CPackedVertex> Verts; std::vector<CPackedVertex> Verts;
std::vector<CPackedTri16> Tris; std::vector<CPackedTri16> Tris;
std::vector<uint16> 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<uint16> TriLists; // lists of tri for each grid cell, all lists are packed in a single vector. std::numeric_limits<uint16>::max() marks the end of a list
NLMISC::CArray2D<uint16> Grid; // grid of entries into TriLists (one list for each cell) NLMISC::CArray2D<uint16> Grid; // grid of entries into TriLists (one list for each cell)
float CellSize; float CellSize;
public: public:

View file

@ -28,6 +28,7 @@
#include "nel/misc/polygon.h" #include "nel/misc/polygon.h"
#include "nel/misc/grid_traversal.h" #include "nel/misc/grid_traversal.h"
#include <limits>
#include <vector> #include <vector>
#include <map> #include <map>
@ -308,7 +309,7 @@ private:// Methods.
++ _SelectStamp; ++ _SelectStamp;
if (_SelectStamp == 0) if (_SelectStamp == 0)
{ {
std::fill(_AlreadySelected.begin(), _AlreadySelected.end(), (uint) ~0); std::fill(_AlreadySelected.begin(), _AlreadySelected.end(), std::numeric_limits<uint>::max());
} }
} }

View file

@ -244,11 +244,11 @@ CDriverD3D::CDriverD3D()
_CurStencilTest = false; _CurStencilTest = false;
_CurStencilFunc = D3DCMP_ALWAYS; _CurStencilFunc = D3DCMP_ALWAYS;
_CurStencilRef = 0; _CurStencilRef = 0;
_CurStencilMask = ~0; _CurStencilMask = std::numeric_limits<DWORD>::max();
_CurStencilOpFail = D3DSTENCILOP_KEEP; _CurStencilOpFail = D3DSTENCILOP_KEEP;
_CurStencilOpZFail = D3DSTENCILOP_KEEP; _CurStencilOpZFail = D3DSTENCILOP_KEEP;
_CurStencilOpZPass = D3DSTENCILOP_KEEP; _CurStencilOpZPass = D3DSTENCILOP_KEEP;
_CurStencilWriteMask = ~0; _CurStencilWriteMask = std::numeric_limits<DWORD>::max();
for(uint k = 0; k < MaxTexture; ++k) for(uint k = 0; k < MaxTexture; ++k)

View file

@ -462,7 +462,7 @@ bool CDriverGL::setupDisplay()
_AGPVertexArrayRange= new CVertexArrayRangeARB(this); _AGPVertexArrayRange= new CVertexArrayRangeARB(this);
_VRAMVertexArrayRange= new CVertexArrayRangeARB(this); _VRAMVertexArrayRange= new CVertexArrayRangeARB(this);
_SupportVBHard= true; _SupportVBHard= true;
_MaxVerticesByVBHard = ~0; // cant' know the value.. _MaxVerticesByVBHard = std::numeric_limits<uint32>::max(); // cant' know the value..
} }
// Reset VertexArrayRange. // Reset VertexArrayRange.

View file

@ -102,11 +102,11 @@ void CDriverGLStates::forceDefaults(uint nbStages)
_CurDepthFunc= GL_LEQUAL; _CurDepthFunc= GL_LEQUAL;
_CurStencilFunc = GL_ALWAYS; _CurStencilFunc = GL_ALWAYS;
_CurStencilRef = 0; _CurStencilRef = 0;
_CurStencilMask = ~0; _CurStencilMask = std::numeric_limits<GLuint>::max();
_CurStencilOpFail = GL_KEEP; _CurStencilOpFail = GL_KEEP;
_CurStencilOpZFail = GL_KEEP; _CurStencilOpZFail = GL_KEEP;
_CurStencilOpZPass = GL_KEEP; _CurStencilOpZPass = GL_KEEP;
_CurStencilWriteMask = ~0; _CurStencilWriteMask = std::numeric_limits<GLuint>::max();
_CurAlphaTestThreshold= 0.5f; _CurAlphaTestThreshold= 0.5f;
// setup GLStates. // setup GLStates.
glBlendFunc(_CurBlendSrc, _CurBlendDst); glBlendFunc(_CurBlendSrc, _CurBlendDst);

View file

@ -74,7 +74,7 @@ void CPackedWorld::build(std::vector<TPackedZoneBaseSPtr> &packedZones)
} }
} }
} }
_RaytraceCounter = ~0; _RaytraceCounter = std::numeric_limits<uint32>::max();
} }
// ************************************************************************************************* // *************************************************************************************************
@ -86,7 +86,7 @@ bool CPackedWorld::raytrace(const NLMISC::CVector &start, const NLMISC::CVector
CVector bestNormal(CVector::Null); CVector bestNormal(CVector::Null);
CVector currEnd = end; CVector currEnd = end;
CVector currInter; CVector currInter;
if (_RaytraceCounter == (uint32) ~0) if (_RaytraceCounter == std::numeric_limits<uint32>::max())
{ {
for(uint k = 0; k < _Zones.size(); ++k) for(uint k = 0; k < _Zones.size(); ++k)
{ {

View file

@ -825,7 +825,7 @@ void CPackedZone32::build(std::vector<const CTessFace*> &leaves,
// remap tri lists // remap tri lists
for(uint k = 0; k < TriLists.size(); ++k) for(uint k = 0; k < TriLists.size(); ++k)
{ {
if (TriLists[k] != ~0) if (TriLists[k] != std::numeric_limits<uint32>::max())
{ {
TriLists[k] = triListRemapping[TriLists[k]]; TriLists[k] = triListRemapping[TriLists[k]];
} }

View file

@ -158,7 +158,7 @@ CScene::CScene(bool bSmallScene) : LightTrav(bSmallScene)
_MaxSkeletonsInNotCLodForm= 20; _MaxSkeletonsInNotCLodForm= 20;
_FilterRenderFlags= ~0; _FilterRenderFlags= std::numeric_limits<uint32>::max();
_NextRenderProfile= false; _NextRenderProfile= false;

View file

@ -218,7 +218,7 @@ void CTextContextUser::resetStringSelection(uint32 i)
if(str) if(str)
{ {
str->SelectStart= 0; str->SelectStart= 0;
str->SelectSize= ~0; str->SelectSize= std::numeric_limits<uint32>::max();
} }
} }
void CTextContextUser::erase(uint32 i) void CTextContextUser::erase(uint32 i)

View file

@ -113,7 +113,7 @@ CTransform::CTransform()
_StateFlags= IsOpaque | IsUserLightable; _StateFlags= IsOpaque | IsUserLightable;
// By default, always allow rendering of Transform Models. // By default, always allow rendering of Transform Models.
_RenderFilterType= ~0; _RenderFilterType= std::numeric_limits<uint32>::max();
// By default, don't suport fast intersection detection // By default, don't suport fast intersection detection
_SupportFastIntersect= false; _SupportFastIntersect= false;

View file

@ -343,7 +343,7 @@ void CWaterEnvMap::invalidate()
_StartRenderTime = -1; _StartRenderTime = -1;
if (_UpdateTime == 0) if (_UpdateTime == 0)
{ {
_LastRenderTick = UINT64_CONSTANT(~0); _LastRenderTick = std::numeric_limits<uint64>::max();
} }
else else
{ {

View file

@ -16,8 +16,6 @@
#include "std3d.h" #include "std3d.h"
#include <iostream>
#include "nel/3d/zone_manager.h" #include "nel/3d/zone_manager.h"
#include "nel/misc/path.h" #include "nel/misc/path.h"
#include "nel/misc/file.h" #include "nel/misc/file.h"
@ -40,7 +38,7 @@ CZoneManager::CZoneManager()
_ZoneTileColorMono = true; _ZoneTileColorMono = true;
_ZoneTileColorFactor = 1.0f; _ZoneTileColorFactor = 1.0f;
_LastArea= 0; _LastArea= 0;
_LastX= _LastY= (uint32) ~0; _LastX= _LastY= std::numeric_limits<uint32>::max();
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View file

@ -687,7 +687,7 @@ bool CFormDfn::getEntryIndexByName (uint &entry, const std::string &name) const
} }
entryIndex++; entryIndex++;
} }
entry=~0; entry=std::numeric_limits<uint>::max();
return false; return false;
} }

View file

@ -566,7 +566,7 @@ void CSheetId::buildIdVector(std::vector <CSheetId> &result, std::vector <std::s
void CSheetId::buildIdVector(std::vector <CSheetId> &result,const std::string &fileExtension) void CSheetId::buildIdVector(std::vector <CSheetId> &result,const std::string &fileExtension)
{ {
uint32 type=typeFromFileExtension(fileExtension); uint32 type=typeFromFileExtension(fileExtension);
if (type!=(uint32)~0) if (type != std::numeric_limits<uint32>::max())
buildIdVector(result, type); buildIdVector(result, type);
} // buildIdVector // } // buildIdVector //
@ -578,7 +578,7 @@ void CSheetId::buildIdVector(std::vector <CSheetId> &result,const std::string &f
void CSheetId::buildIdVector(std::vector <CSheetId> &result, std::vector <std::string> &resultFilenames,const std::string &fileExtension) void CSheetId::buildIdVector(std::vector <CSheetId> &result, std::vector <std::string> &resultFilenames,const std::string &fileExtension)
{ {
uint32 type=typeFromFileExtension(fileExtension); uint32 type=typeFromFileExtension(fileExtension);
if (type != (uint32)~0) if (type != std::numeric_limits<uint32>::max())
buildIdVector(result,resultFilenames, type); buildIdVector(result,resultFilenames, type);
} // buildIdVector // } // buildIdVector //
@ -597,7 +597,7 @@ uint32 CSheetId::typeFromFileExtension(const std::string &fileExtension)
if (toLower(fileExtension)==_FileExtensions[i]) if (toLower(fileExtension)==_FileExtensions[i])
return i; return i;
return ~0; return std::numeric_limits<uint32>::max();
} // typeFromFileExtension // } // typeFromFileExtension //

View file

@ -62,7 +62,7 @@ CVariablePtr<uint32> DefaultMaxSentBlockSize("nel", "DefaultMaxSentBlockSize", "
#define AUTOCHECK_DISPLAY nlwarning #define AUTOCHECK_DISPLAY nlwarning
//#define AUTOCHECK_DISPLAY CUnifiedNetwork::getInstance()->displayInternalTables (), nlerror //#define AUTOCHECK_DISPLAY CUnifiedNetwork::getInstance()->displayInternalTables (), nlerror
const TServiceId TServiceId::InvalidId = TServiceId(uint16(~0)); const TServiceId TServiceId::InvalidId = TServiceId(std::numeric_limits<uint16>::max());
// //
// Callbacks from NAMING SERVICE // Callbacks from NAMING SERVICE

View file

@ -175,7 +175,7 @@ void CResizablePage::ArrangeLayout()
Layout *pl; Layout *pl;
POSITION pos = m_plLayoutList.GetHeadPosition(); POSITION pos = m_plLayoutList.GetHeadPosition();
HDWP hdwp = BeginDeferWindowPos(m_plLayoutList.GetCount()); HDWP hdwp = BeginDeferWindowPos((int)m_plLayoutList.GetCount());
while (pos != NULL) while (pos != NULL)
{ {

View file

@ -175,7 +175,7 @@ bool isOfLogDotLogFamily( const std::string& filename )
enum TVersionTargetMode { TTMAll, TTMMatchAllV, TTMMatchExactV, TTMMatchGreaterV, TTMMatchLowerV } targetMode; enum TVersionTargetMode { TTMAll, TTMMatchAllV, TTMMatchExactV, TTMMatchGreaterV, TTMMatchLowerV } targetMode;
const uint CurrentVersion = ~0; const uint CurrentVersion = std::numeric_limits<uint>::max();
// Return true and logVersion, or false if not a log with version // Return true and logVersion, or false if not a log with version
bool getLogVersion( const std::string& filename, uint& logVersion ) bool getLogVersion( const std::string& filename, uint& logVersion )