Changed: #825 Remove all warning when compiling Ryzom on Linux

This commit is contained in:
kervala 2010-05-13 22:23:34 +02:00
parent ca1a6f95fe
commit 45c8adf72f
64 changed files with 228 additions and 227 deletions

View file

@ -226,7 +226,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions)
map<string,BNPFile>::iterator it = tempMap.begin(); map<string,BNPFile>::iterator it = tempMap.begin();
while (it != tempMap.end()) while (it != tempMap.end())
{ {
nSize += it->first.size() + 1; nSize += (uint)it->first.size() + 1;
nNb++; nNb++;
it++; it++;
} }
@ -246,7 +246,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions)
bnp.Files[nNb].Size = it->second.Size; bnp.Files[nNb].Size = it->second.Size;
bnp.Files[nNb].Pos = it->second.Pos; bnp.Files[nNb].Pos = it->second.Pos;
nSize += it->first.size() + 1; nSize += (uint)it->first.size() + 1;
nNb++; nNb++;
it++; it++;
} }

View file

@ -515,7 +515,7 @@ void CBitMemStream::serial(std::string &b)
} }
else else
{ {
len = b.size(); len = (uint32)b.size();
if (len>1000000) if (len>1000000)
throw NLMISC::EInvalidDataStream( "BMS: Trying to write a string of %u bytes", len ); throw NLMISC::EInvalidDataStream( "BMS: Trying to write a string of %u bytes", len );
serial( len ); serial( len );
@ -556,7 +556,7 @@ inline void CBitMemStream::serial(ucstring &b)
} }
else else
{ {
len= b.size(); len= (uint32)b.size();
if (len>1000000) if (len>1000000)
throw NLMISC::EInvalidDataStream( "BMS: Trying to write an ucstring of %u bytes", len ); throw NLMISC::EInvalidDataStream( "BMS: Trying to write an ucstring of %u bytes", len );
serial(len); serial(len);
@ -664,7 +664,7 @@ void CBitMemStream::serialCont(std::vector<bool> &cont)
} }
else else
{ {
len= cont.size(); len= (sint32)cont.size();
serial(len); serial(len);
std::vector<bool>::iterator it= cont.begin(); std::vector<bool>::iterator it= cont.begin();

View file

@ -132,7 +132,7 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f )
// at this point, the image must be converted to an 24bit image RGB // at this point, the image must be converted to an 24bit image RGB
// rowbytes is the width x number of channels // rowbytes is the width x number of channels
uint32 rowbytes = png_get_rowbytes(png_ptr, info_ptr); uint32 rowbytes = (uint32)png_get_rowbytes(png_ptr, info_ptr);
uint32 srcChannels = png_get_channels(png_ptr, info_ptr); uint32 srcChannels = png_get_channels(png_ptr, info_ptr);
// allocates buffer to copy image data // allocates buffer to copy image data
@ -326,7 +326,7 @@ bool CBitmap::writePNG( NLMISC::IStream &f, uint32 d)
png_set_packing(png_ptr); png_set_packing(png_ptr);
// rowbytes is the width x number of channels // rowbytes is the width x number of channels
uint32 rowbytes = png_get_rowbytes(png_ptr, info_ptr); uint32 rowbytes = (uint32)png_get_rowbytes(png_ptr, info_ptr);
uint32 dstChannels = png_get_channels(png_ptr, info_ptr); uint32 dstChannels = png_get_channels(png_ptr, info_ptr);
// get channels number of bitmap // get channels number of bitmap

View file

@ -118,7 +118,7 @@ void CBufFIFO::push(const std::vector<uint8> &buffer1, const std::vector<uint8>
TTicks before = CTime::getPerformanceTime(); TTicks before = CTime::getPerformanceTime();
#endif #endif
TFifoSize s = buffer1.size() + buffer2.size(); TFifoSize s = (TFifoSize)(buffer1.size() + buffer2.size());
#if DEBUG_FIFO #if DEBUG_FIFO
nldebug("%p push2(%d)", this, s); nldebug("%p push2(%d)", this, s);
@ -421,16 +421,16 @@ uint32 CBufFIFO::size ()
if (_Rewinder == NULL) if (_Rewinder == NULL)
return _BufferSize; return _BufferSize;
else else
return _Rewinder - _Buffer; return (uint32)(_Rewinder - _Buffer);
} }
else if (_Head > _Tail) else if (_Head > _Tail)
{ {
return _Head - _Tail; return (uint32)(_Head - _Tail);
} }
else if (_Head < _Tail) else if (_Head < _Tail)
{ {
nlassert (_Rewinder != NULL); nlassert (_Rewinder != NULL);
return (_Rewinder - _Tail) + (_Head - _Buffer); return (uint32)((_Rewinder - _Tail) + (_Head - _Buffer));
} }
nlstop; nlstop;
return 0; return 0;
@ -489,9 +489,9 @@ void CBufFIFO::resize (uint32 s)
{ {
nlassert (_Rewinder != NULL); nlassert (_Rewinder != NULL);
uint size1 = _Rewinder - _Tail; uint size1 = (uint)(_Rewinder - _Tail);
CFastMem::memcpy (NewBuffer, _Tail, size1); CFastMem::memcpy (NewBuffer, _Tail, size1);
uint size2 = _Head - _Buffer; uint size2 = (uint)(_Head - _Buffer);
CFastMem::memcpy (NewBuffer + size1, _Buffer, size2); CFastMem::memcpy (NewBuffer + size1, _Buffer, size2);
nlassert (size1+size2==UsedSize); nlassert (size1+size2==UsedSize);
@ -582,7 +582,7 @@ void CBufFIFO::display ()
{ {
if (strlen(str) < 1023) if (strlen(str) < 1023)
{ {
uint32 p = strlen(str); uint32 p = (uint32)strlen(str);
if (isprint(*pos)) if (isprint(*pos))
str[p] = *pos; str[p] = *pos;
else else

View file

@ -128,7 +128,7 @@ string stringFromVector( const vector<uint8>& v, bool limited )
if (!v.empty()) if (!v.empty())
{ {
int size = v.size (); int size = (int)v.size ();
if (limited && size > 1000) if (limited && size > 1000)
{ {
string middle = "...<buf too big,skip middle part>..."; string middle = "...<buf too big,skip middle part>...";

View file

@ -56,13 +56,13 @@ int CConfigFile::CVar::asInt (int index) const
switch (Type) switch (Type)
{ {
case T_STRING: case T_STRING:
if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index);
return atoi(StrValues[index].c_str()); return atoi(StrValues[index].c_str());
case T_REAL: case T_REAL:
if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index);
return (int)RealValues[index]; return (int)RealValues[index];
default: default:
if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index);
return IntValues[index]; return IntValues[index];
} }
} }
@ -73,13 +73,13 @@ double CConfigFile::CVar::asDouble (int index) const
switch (Type) switch (Type)
{ {
case T_INT: case T_INT:
if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index);
return (double)IntValues[index]; return (double)IntValues[index];
case T_STRING: case T_STRING:
if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index);
return atof(StrValues[index].c_str()); return atof(StrValues[index].c_str());
default: default:
if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index);
return RealValues[index]; return RealValues[index];
} }
} }
@ -95,13 +95,13 @@ std::string CConfigFile::CVar::asString (int index) const
switch (Type) switch (Type)
{ {
case T_INT: case T_INT:
if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index);
return toString(IntValues[index]); return toString(IntValues[index]);
case T_REAL: case T_REAL:
if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index);
return toString(RealValues[index]); return toString(RealValues[index]);
default: default:
if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index);
return StrValues[index]; return StrValues[index];
} }
} }
@ -111,7 +111,7 @@ bool CConfigFile::CVar::asBool (int index) const
switch (Type) switch (Type)
{ {
case T_STRING: case T_STRING:
if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); if (index >= (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index);
if(StrValues[index] == "true") if(StrValues[index] == "true")
{ {
return true; return true;
@ -121,7 +121,7 @@ bool CConfigFile::CVar::asBool (int index) const
return false; return false;
} }
case T_REAL: case T_REAL:
if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); if (index >= (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index);
if ((int)RealValues[index] == 1) if ((int)RealValues[index] == 1)
{ {
return true; return true;
@ -131,7 +131,7 @@ bool CConfigFile::CVar::asBool (int index) const
return false; return false;
} }
default: default:
if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); if (index >= (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index);
if (IntValues[index] == 1) if (IntValues[index] == 1)
{ {
return true; return true;
@ -146,7 +146,7 @@ bool CConfigFile::CVar::asBool (int index) const
void CConfigFile::CVar::setAsInt (int val, int index) void CConfigFile::CVar::setAsInt (int val, int index)
{ {
if (Type != T_INT) throw EBadType (Name, Type, T_INT); if (Type != T_INT) throw EBadType (Name, Type, T_INT);
else if (index > (int)IntValues.size () || index < 0) throw EBadSize (Name, IntValues.size (), index); else if (index > (int)IntValues.size () || index < 0) throw EBadSize (Name, (int)IntValues.size (), index);
else if (index == (int)IntValues.size ()) IntValues.push_back(val); else if (index == (int)IntValues.size ()) IntValues.push_back(val);
else IntValues[index] = val; else IntValues[index] = val;
Root = false; Root = false;
@ -155,7 +155,7 @@ void CConfigFile::CVar::setAsInt (int val, int index)
void CConfigFile::CVar::setAsDouble (double val, int index) void CConfigFile::CVar::setAsDouble (double val, int index)
{ {
if (Type != T_REAL) throw EBadType (Name, Type, T_REAL); if (Type != T_REAL) throw EBadType (Name, Type, T_REAL);
else if (index > (int)RealValues.size () || index < 0) throw EBadSize (Name, RealValues.size (), index); else if (index > (int)RealValues.size () || index < 0) throw EBadSize (Name, (int)RealValues.size (), index);
else if (index == (int)RealValues.size ()) RealValues.push_back(val); else if (index == (int)RealValues.size ()) RealValues.push_back(val);
else RealValues[index] = val; else RealValues[index] = val;
Root = false; Root = false;
@ -169,7 +169,7 @@ void CConfigFile::CVar::setAsFloat (float val, int index)
void CConfigFile::CVar::setAsString (const std::string &val, int index) void CConfigFile::CVar::setAsString (const std::string &val, int index)
{ {
if (Type != T_STRING) throw EBadType (Name, Type, T_STRING); if (Type != T_STRING) throw EBadType (Name, Type, T_STRING);
else if (index > (int)StrValues.size () || index < 0) throw EBadSize (Name, StrValues.size (), index); else if (index > (int)StrValues.size () || index < 0) throw EBadSize (Name, (int)StrValues.size (), index);
else if (index == (int)StrValues.size ()) StrValues.push_back(val); else if (index == (int)StrValues.size ()) StrValues.push_back(val);
else StrValues[index] = val; else StrValues[index] = val;
Root = false; Root = false;
@ -277,9 +277,9 @@ uint CConfigFile::CVar::size () const
{ {
switch (Type) switch (Type)
{ {
case T_INT: return IntValues.size (); case T_INT: return (uint)IntValues.size ();
case T_REAL: return RealValues.size (); case T_REAL: return (uint)RealValues.size ();
case T_STRING: return StrValues.size (); case T_STRING: return (uint)StrValues.size ();
default: return 0; default: return 0;
} }
} }
@ -356,7 +356,7 @@ bool CConfigFile::loaded()
uint32 CConfigFile::getVarCount() uint32 CConfigFile::getVarCount()
{ {
return _Vars.size(); return (uint32)_Vars.size();
} }
@ -396,7 +396,7 @@ void CConfigFile::reparse (bool lookupPaths)
string utf8 = content.toUtf8(); string utf8 = content.toUtf8();
CMemStream stream; CMemStream stream;
stream.serialBuffer((uint8*)(utf8.data()), utf8.size()); stream.serialBuffer((uint8*)(utf8.data()), (uint)utf8.size());
cf_ifile = stream; cf_ifile = stream;
if (!cf_ifile.isReading()) if (!cf_ifile.isReading())
{ {
@ -856,7 +856,7 @@ void CConfigFile::clearVars ()
uint CConfigFile::getNumVar () const uint CConfigFile::getNumVar () const
{ {
return _Vars.size (); return (uint)_Vars.size ();
} }
CConfigFile::CVar *CConfigFile::getVar (uint varId) CConfigFile::CVar *CConfigFile::getVar (uint varId)

View file

@ -449,7 +449,7 @@ public:
{ {
string shortExc, longExc, subject; string shortExc, longExc, subject;
string addr, ext; string addr, ext;
sint skipNFirst = 0; ULONG_PTR skipNFirst = 0;
_Reason = ""; _Reason = "";
if (m_pexp == NULL) if (m_pexp == NULL)
@ -555,7 +555,7 @@ public:
} }
// display the callstack // display the callstack
void addStackAndLogToReason (sint /* skipNFirst */ = 0) void addStackAndLogToReason (ULONG_PTR /* skipNFirst */ = 0)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// ace hack // ace hack

View file

@ -366,7 +366,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi)
if (_Buttons.size() < MaxNumButtons) if (_Buttons.size() < MaxNumButtons)
{ {
_Buttons.push_back(CButton()); _Buttons.push_back(CButton());
uint buttonIndex = _Buttons.size() - 1; uint buttonIndex = (uint)_Buttons.size() - 1;
char defaultButtonName[32]; char defaultButtonName[32];
smprintf(defaultButtonName, 32, "BUTTON %d", buttonIndex + 1); smprintf(defaultButtonName, 32, "BUTTON %d", buttonIndex + 1);
BuildCtrlName(lpddoi, _Buttons[buttonIndex].Name, defaultButtonName); BuildCtrlName(lpddoi, _Buttons[buttonIndex].Name, defaultButtonName);
@ -382,7 +382,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi)
if (_Sliders.size() < MaxNumSliders) if (_Sliders.size() < MaxNumSliders)
{ {
_Sliders.push_back(CSlider()); _Sliders.push_back(CSlider());
uint sliderIndex = _Sliders.size() - 1; uint sliderIndex = (uint)_Sliders.size() - 1;
GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Sliders[sliderIndex].Min, _Sliders[sliderIndex].Max); GetDIAxisRange(_Device, lpddoi->dwOfs, lpddoi->dwType, _Sliders[sliderIndex].Min, _Sliders[sliderIndex].Max);
char defaultSliderName[32]; char defaultSliderName[32];
smprintf(defaultSliderName, 32, "SLIDER %d", sliderIndex + 1); smprintf(defaultSliderName, 32, "SLIDER %d", sliderIndex + 1);
@ -400,7 +400,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi)
if (_POVs.size() < MaxNumPOVs) if (_POVs.size() < MaxNumPOVs)
{ {
_POVs.push_back(CPOV()); _POVs.push_back(CPOV());
uint povIndex = _POVs.size() - 1; uint povIndex = (uint)_POVs.size() - 1;
char defaultPOVName[16]; char defaultPOVName[16];
smprintf(defaultPOVName, 16, "POV %d", povIndex + 1); smprintf(defaultPOVName, 16, "POV %d", povIndex + 1);
BuildCtrlName(lpddoi, _POVs[povIndex].Name, defaultPOVName); BuildCtrlName(lpddoi, _POVs[povIndex].Name, defaultPOVName);
@ -435,7 +435,7 @@ uint CDIGameDevice::getBufferSize() const
//============================================================================ //============================================================================
uint CDIGameDevice::getNumButtons() const uint CDIGameDevice::getNumButtons() const
{ {
return _Buttons.size(); return (uint)_Buttons.size();
} }
//============================================================================ //============================================================================
@ -448,13 +448,13 @@ bool CDIGameDevice::hasAxis(TAxis axis) const
//============================================================================ //============================================================================
uint CDIGameDevice::getNumSliders() const uint CDIGameDevice::getNumSliders() const
{ {
return _Sliders.size(); return (uint)_Sliders.size();
} }
//============================================================================ //============================================================================
uint CDIGameDevice::getNumPOV() const uint CDIGameDevice::getNumPOV() const
{ {
return _POVs.size(); return (uint)_POVs.size();
} }
//============================================================================ //============================================================================
const char *CDIGameDevice::getButtonName(uint index) const const char *CDIGameDevice::getButtonName(uint index) const

View file

@ -721,7 +721,7 @@ bool readExcelSheet(const ucstring &str, TWorksheet &worksheet, bool checkUnique
// enlarge Worksheet row size, as needed // enlarge Worksheet row size, as needed
uint startLine= worksheet.size(); uint startLine= worksheet.size();
worksheet.resize(startLine + lines.size()); worksheet.resize(startLine + (uint)lines.size());
// **** fill worksheet // **** fill worksheet
@ -850,7 +850,7 @@ void makeHashCode(TWorksheet &sheet, bool forceRehash)
} }
else else
{ {
uint index = it - sheet.Data[0].begin(); uint index = (uint)(it - sheet.Data[0].begin());
for (uint j=1; j<sheet.Data.size(); ++j) for (uint j=1; j<sheet.Data.size(); ++j)
{ {
ucstring &field = sheet.Data[j][index]; ucstring &field = sheet.Data[j][index];
@ -873,7 +873,7 @@ ucstring prepareExcelSheet(const TWorksheet &worksheet)
{ {
for (uint j=0; j<worksheet.Data[i].size(); ++j) for (uint j=0; j<worksheet.Data[i].size(); ++j)
{ {
approxSize+= worksheet.Data[i][j].size() + 1; approxSize+= (uint)worksheet.Data[i][j].size() + 1;
} }
approxSize++; approxSize++;
} }

View file

@ -449,7 +449,7 @@ CEvalNumExpr::TReturnState CEvalNumExpr::getNextToken (TToken &token)
return MustBeDoubleQuote; return MustBeDoubleQuote;
// This is a user string, copy the string // This is a user string, copy the string
uint size = _ExprPtr - start; uint size = (uint)(_ExprPtr - start);
if (size >= (InternalStringLen-1)) if (size >= (InternalStringLen-1))
{ {
_InternalStlString.resize (size); _InternalStlString.resize (size);
@ -496,7 +496,7 @@ CEvalNumExpr::TReturnState CEvalNumExpr::getNextToken (TToken &token)
} }
// This is a user string, copy the string // This is a user string, copy the string
uint size = _ExprPtr - start; uint size = (uint)(_ExprPtr - start);
if (size >= (InternalStringLen-1)) if (size >= (InternalStringLen-1))
{ {
_InternalStlString.resize (size); _InternalStlString.resize (size);
@ -590,14 +590,14 @@ CEvalNumExpr::TReturnState CEvalNumExpr::evalExpression (const char *expression,
else else
{ {
if (errorIndex) if (errorIndex)
*errorIndex = _ExprPtr - expression; *errorIndex = (int)(_ExprPtr - expression);
return MustBeEnd; return MustBeEnd;
} }
} }
else else
{ {
if (errorIndex) if (errorIndex)
*errorIndex = _ExprPtr - expression; *errorIndex = (int)(_ExprPtr - expression);
return error; return error;
} }
} }

View file

@ -98,7 +98,7 @@ void CIFile::loadIntoCache()
if(!_IsAsyncLoading) if(!_IsAsyncLoading)
{ {
_ReadingFromFile += _FileSize; _ReadingFromFile += _FileSize;
int read = fread (_Cache, _FileSize, 1, _F); int read = (int)fread (_Cache, _FileSize, 1, _F);
_FileRead++; _FileRead++;
_ReadingFromFile -= _FileSize; _ReadingFromFile -= _FileSize;
_ReadFromFile += read * _FileSize; _ReadFromFile += read * _FileSize;
@ -113,7 +113,7 @@ void CIFile::loadIntoCache()
sint n= READPACKETSIZE-_NbBytesLoaded; sint n= READPACKETSIZE-_NbBytesLoaded;
n= max(n, 1); n= max(n, 1);
_ReadingFromFile += n; _ReadingFromFile += n;
int read = fread (_Cache+index, n, 1, _F); int read = (int)fread (_Cache+index, n, 1, _F);
_FileRead++; _FileRead++;
_ReadingFromFile -= n; _ReadingFromFile -= n;
_ReadFromFile += read * n; _ReadFromFile += read * n;
@ -126,7 +126,7 @@ void CIFile::loadIntoCache()
{ {
uint n= _FileSize-index; uint n= _FileSize-index;
_ReadingFromFile += n; _ReadingFromFile += n;
int read = fread (_Cache+index, n, 1, _F); int read = (int)fread (_Cache+index, n, 1, _F);
_FileRead++; _FileRead++;
_ReadingFromFile -= n; _ReadingFromFile -= n;
_ReadFromFile += read * n; _ReadFromFile += read * n;
@ -428,7 +428,7 @@ void CIFile::serialBuffer(uint8 *buf, uint len) throw(EReadError)
{ {
int read; int read;
_ReadingFromFile += len; _ReadingFromFile += len;
read=fread(buf, len, 1, _F); read=(int)fread(buf, len, 1, _F);
_FileRead++; _FileRead++;
_ReadingFromFile -= len; _ReadingFromFile -= len;
_ReadFromFile += /*read **/ len; _ReadFromFile += /*read **/ len;
@ -771,7 +771,7 @@ NLMISC_CATEGORISED_COMMAND(nel, iFileAccessLogDisplay, "Display file access logs
uint32 count=0; uint32 count=0;
while (it!=itEnd) while (it!=itEnd)
{ {
uint32 numTimes= it->second.size(); uint32 numTimes= (uint32)it->second.size();
CSString fileName= it->first; CSString fileName= it->first;
if (fileName.contains("@")) if (fileName.contains("@"))
{ {

View file

@ -323,7 +323,7 @@ void CHTimer::display(CLog *log, TSortCriterion criterion, bool displayInline /*
{ {
statsPtr[k] = &stats[k]; statsPtr[k] = &stats[k];
stats[k].Timer = it->first; stats[k].Timer = it->first;
stats[k].buildFromNodes(&(it->second[0]), it->second.size(), _MsPerTick); stats[k].buildFromNodes(&(it->second[0]), (uint)it->second.size(), _MsPerTick);
++k; ++k;
} }
@ -521,7 +521,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool
TNodeVect &execNodes = nodeMap[currTimer]; TNodeVect &execNodes = nodeMap[currTimer];
if (execNodes.size() > 0) if (execNodes.size() > 0)
{ {
currNodeStats.buildFromNodes(&execNodes[0], execNodes.size(), _MsPerTick); currNodeStats.buildFromNodes(&execNodes[0], (uint)execNodes.size(), _MsPerTick);
currNodeStats.getStats(resultStats, displayEx, rootStats.TotalTime, _WantStandardDeviation); currNodeStats.getStats(resultStats, displayEx, rootStats.TotalTime, _WantStandardDeviation);
log->displayRawNL("HTIMER: %s", (resultName + resultStats).c_str()); log->displayRawNL("HTIMER: %s", (resultName + resultStats).c_str());
} }
@ -639,7 +639,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool
// build the indented node name. // build the indented node name.
resultName.resize(labelNumChar); resultName.resize(labelNumChar);
std::fill(resultName.begin(), resultName.end(), '.'); std::fill(resultName.begin(), resultName.end(), '.');
uint startIndex = (examStack.size()-1) * indentationStep; uint startIndex = (uint)(examStack.size()-1) * indentationStep;
uint endIndex = std::min(startIndex + (uint)::strlen(node->Owner->_Name), labelNumChar); uint endIndex = std::min(startIndex + (uint)::strlen(node->Owner->_Name), labelNumChar);
if ((sint) (endIndex - startIndex) >= 1) if ((sint) (endIndex - startIndex) >= 1)
{ {
@ -759,7 +759,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool
// build the indented node name. // build the indented node name.
resultName.resize(labelNumChar); resultName.resize(labelNumChar);
std::fill(resultName.begin(), resultName.end(), '.'); std::fill(resultName.begin(), resultName.end(), '.');
uint startIndex = (examStack.size()-1) * indentationStep; uint startIndex = (uint)(examStack.size()-1) * indentationStep;
uint endIndex = std::min(startIndex + (uint)::strlen(node->Owner->_Name), labelNumChar); uint endIndex = std::min(startIndex + (uint)::strlen(node->Owner->_Name), labelNumChar);
if ((sint) (endIndex - startIndex) >= 1) if ((sint) (endIndex - startIndex) >= 1)
{ {
@ -849,7 +849,7 @@ void CHTimer::CStats::buildFromNodes(CNode **nodes, uint numNodes, double msPerT
uint numMeasures = 0; uint numMeasures = 0;
for(k = 0; k < numNodes; ++k) for(k = 0; k < numNodes; ++k)
{ {
numMeasures += nodes[k]->Measures.size(); numMeasures += (uint)nodes[k]->Measures.size();
for(l = 0; l < nodes[k]->Measures.size(); ++l) for(l = 0; l < nodes[k]->Measures.size(); ++l)
{ {
varianceSum += NLMISC::sqr(nodes[k]->Measures[l] - MeanTime); varianceSum += NLMISC::sqr(nodes[k]->Measures[l] - MeanTime);

View file

@ -481,18 +481,18 @@ void CI18N::_readTextFile(const string &filename,
string text; string text;
text.resize(file.getFileSize()); text.resize(file.getFileSize());
if (file.getFileSize() > 0) if (file.getFileSize() > 0)
file.serialBuffer((uint8*)(&text[0]), text.size()); file.serialBuffer((uint8*)(&text[0]), (uint)text.size());
// Transform the string in ucstring according to format header // Transform the string in ucstring according to format header
if (!text.empty()) if (!text.empty())
readTextBuffer((uint8*)&text[0], text.size(), result, forceUtf8); readTextBuffer((uint8*)&text[0], (uint)text.size(), result, forceUtf8);
if (preprocess) if (preprocess)
{ {
// a string to old the result of the preprocess // a string to old the result of the preprocess
ucstring final; ucstring final;
// make rooms to reduce allocation cost // make rooms to reduce allocation cost
final.reserve(raiseToNextPowerOf2(result.size())); final.reserve(raiseToNextPowerOf2((uint)result.size()));
// parse the file, looking for preprocessor command. // parse the file, looking for preprocessor command.
ucstring::const_iterator it(result.begin()), end(result.end()); ucstring::const_iterator it(result.begin()), end(result.end());

View file

@ -304,7 +304,7 @@ void CIXml::serialSeparatedBufferIn ( string &value, bool checkSeparator )
else else
{ {
// Content length // Content length
uint length = _ContentString.length(); uint length = (uint)_ContentString.length();
// String empty ? // String empty ?
if (length==0) if (length==0)
@ -352,7 +352,7 @@ void CIXml::serialSeparatedBufferIn ( string &value, bool checkSeparator )
_ContentStringIndex = 0; _ContentStringIndex = 0;
// New length // New length
length = _ContentString.length(); length = (uint)_ContentString.length();
} }
} }

View file

@ -501,7 +501,7 @@ namespace NLMISC
dest.clear(); dest.clear();
} }
std::vector<uint8> &msgIn = _InMessageQueue.front().Msg; std::vector<uint8> &msgIn = _InMessageQueue.front().Msg;
dest.serialBuffer(&(msgIn[0]), msgIn.size()); dest.serialBuffer(&(msgIn[0]), (uint)msgIn.size());
_InMessageQueue.pop_front(); _InMessageQueue.pop_front();
// make dest a read stream // make dest a read stream
dest.invert(); dest.invert();
@ -519,13 +519,13 @@ namespace NLMISC
uint CInterWindowMsgQueue::getSendQueueSize() const uint CInterWindowMsgQueue::getSendQueueSize() const
{ {
CSynchronized<TMsgList>::CAccessor outMessageQueue(&const_cast<CSynchronized<TMsgList> &>(_OutMessageQueue)); CSynchronized<TMsgList>::CAccessor outMessageQueue(&const_cast<CSynchronized<TMsgList> &>(_OutMessageQueue));
return outMessageQueue.value().size(); return (uint)outMessageQueue.value().size();
} }
//************************************************************************************************** //**************************************************************************************************
uint CInterWindowMsgQueue::getReceiveQueueSize() const uint CInterWindowMsgQueue::getReceiveQueueSize() const
{ {
return _InMessageQueue.size(); return (uint)_InMessageQueue.size();
} }
} // NLMISC } // NLMISC

View file

@ -300,7 +300,7 @@ void CNoiseValue::serial(IStream &f)
void CNoiseColorGradient::eval(const CVector &posInWorld, CRGBAF &result) const void CNoiseColorGradient::eval(const CVector &posInWorld, CRGBAF &result) const
{ {
// test if not null grads. // test if not null grads.
uint nGrads= Gradients.size(); uint nGrads= (uint)Gradients.size();
if(nGrads==0) if(nGrads==0)
return; return;
// if only one color, easy // if only one color, easy

View file

@ -91,7 +91,7 @@ inline void COXml::flushContentString ()
nlassert (_CurrentNode); nlassert (_CurrentNode);
// String size // String size
uint size=_ContentString.length(); uint size=(uint)_ContentString.length();
// Some content to write ? // Some content to write ?
if (size) if (size)
@ -226,7 +226,7 @@ void COXml::serialSeparatedBufferOut( const char *value )
else else
{ {
// Get the content buffer size // Get the content buffer size
uint size=_ContentString.length(); uint size=(uint)_ContentString.length();
// Add a separator // Add a separator
if ((size) && (_ContentString[size-1]!='\n')) if ((size) && (_ContentString[size-1]!='\n'))

View file

@ -104,7 +104,7 @@ void CPolygon::clip(const std::vector<CPlane> &planes)
{ {
if(planes.size()==0) if(planes.size()==0)
return; return;
clip(&(*planes.begin()), planes.size()); clip(&(*planes.begin()), (uint)planes.size());
} }
@ -122,7 +122,7 @@ void CPolygon::getBestTriplet(uint &index0,uint &index1,uint &index2)
nlassert(Vertices.size() >= 3); nlassert(Vertices.size() >= 3);
uint i, j, k; uint i, j, k;
float bestArea = 0.f; float bestArea = 0.f;
const uint numVerts = Vertices.size(); const uint numVerts = (uint)Vertices.size();
for (i = 0; i < numVerts; ++i) for (i = 0; i < numVerts; ++i)
{ {
for (j = 0; j < numVerts; ++j) for (j = 0; j < numVerts; ++j)
@ -402,7 +402,7 @@ bool CPolygon::toConvexPolygonsInCone (const std::vector<CVector> &vertex, uint
a0=0; a0=0;
uint a1; uint a1;
if (a==0) if (a==0)
a1=vertex.size()-1; a1= (uint)vertex.size()-1;
else else
a1= a-1; a1= a-1;
@ -442,7 +442,7 @@ void CPolygon::toConvexPolygonsLocalAndBSP (std::vector<CVector> &localVertices,
invert.invert (); invert.invert ();
// Insert vertices in an ordered table // Insert vertices in an ordered table
uint vertexCount = Vertices.size(); uint vertexCount = (uint)Vertices.size();
TCConcavePolygonsVertexMap vertexMap; TCConcavePolygonsVertexMap vertexMap;
localVertices.resize (vertexCount); localVertices.resize (vertexCount);
uint i, j; uint i, j;
@ -456,7 +456,7 @@ void CPolygon::toConvexPolygonsLocalAndBSP (std::vector<CVector> &localVertices,
// Plane direction // Plane direction
i=0; i=0;
j=Vertices.size()-1; j=(uint)Vertices.size()-1;
CVector normal = localVertices[i] - localVertices[j]; CVector normal = localVertices[i] - localVertices[j];
normal = normal ^ CVector::K; normal = normal ^ CVector::K;
CPlane clipPlane; CPlane clipPlane;
@ -699,11 +699,11 @@ bool CPolygon::chain (const std::vector<CPolygon> &other, const CMatrix& basis)
} }
// Look for a couple.. // Look for a couple..
uint thisCount = Vertices.size(); uint thisCount = (uint)Vertices.size();
uint i, j; uint i, j;
for (o=0; o<other.size(); o++) for (o=0; o<other.size(); o++)
{ {
uint otherCount = other[o].Vertices.size(); uint otherCount = (uint)other[o].Vertices.size();
// Try to link in the main polygon // Try to link in the main polygon
for (i=0; i<thisCount; i++) for (i=0; i<thisCount; i++)
@ -758,7 +758,7 @@ bool CPolygon::chain (const std::vector<CPolygon> &other, const CMatrix& basis)
uint otherToCheck; uint otherToCheck;
for (otherToCheck=o+1; otherToCheck<other.size(); otherToCheck++) for (otherToCheck=o+1; otherToCheck<other.size(); otherToCheck++)
{ {
uint otherToCheckCount = other[otherToCheck].Vertices.size(); uint otherToCheckCount = (uint)other[otherToCheck].Vertices.size();
for (i=0; i<otherToCheckCount; i++) for (i=0; i<otherToCheckCount; i++)
{ {
for (j=0; j<otherCount; j++) for (j=0; j<otherCount; j++)
@ -837,7 +837,7 @@ CPolygon2D::CPolygon2D(const CPolygon &src, const CMatrix &projMat)
// *************************************************************************** // ***************************************************************************
void CPolygon2D::fromPolygon(const CPolygon &src, const CMatrix &projMat /*=CMatrix::Identity*/) void CPolygon2D::fromPolygon(const CPolygon &src, const CMatrix &projMat /*=CMatrix::Identity*/)
{ {
uint size = src.Vertices.size(); uint size = (uint)src.Vertices.size();
Vertices.resize(size); Vertices.resize(size);
for (uint k = 0; k < size; ++k) for (uint k = 0; k < size; ++k)
{ {
@ -852,7 +852,7 @@ bool CPolygon2D::isConvex()
bool Front = true, Back = false; bool Front = true, Back = false;
// we apply a dummy algo for now : check whether every vertex is in the same side // we apply a dummy algo for now : check whether every vertex is in the same side
// of every plane defined by a segment of this poly // of every plane defined by a segment of this poly
uint numVerts = Vertices.size(); uint numVerts = (uint)Vertices.size();
if (numVerts < 3) return true; if (numVerts < 3) return true;
CVector segStart, segEnd; CVector segStart, segEnd;
CPlane clipPlane; CPlane clipPlane;
@ -895,7 +895,7 @@ void CPolygon2D::buildConvexHull(CPolygon2D &dest) const
return; return;
} }
uint k, l; uint k, l;
uint numVerts = Vertices.size(); uint numVerts = (uint)Vertices.size();
CVector2f p, curr, prev; CVector2f p, curr, prev;
uint pIndex, p1Index, p2Index, pCurr, pPrev; uint pIndex, p1Index, p2Index, pCurr, pPrev;
// this is not optimized, but not used in realtime.. =) // this is not optimized, but not used in realtime.. =)
@ -1021,7 +1021,7 @@ void CPolygon2D::getBestTriplet(uint &index0, uint &index1, uint &index2)
nlassert(Vertices.size() >= 3); nlassert(Vertices.size() >= 3);
uint i, j, k; uint i, j, k;
float bestArea = 0.f; float bestArea = 0.f;
const uint numVerts = Vertices.size(); const uint numVerts = (uint)Vertices.size();
for (i = 0; i < numVerts; ++i) for (i = 0; i < numVerts; ++i)
{ {
for (j = 0; j < numVerts; ++j) for (j = 0; j < numVerts; ++j)
@ -2011,7 +2011,7 @@ bool CPolygon2D::getNonNullSeg(uint &index) const
float norm2 = (Vertices[Vertices.size() - 1] - Vertices[0]).sqrnorm(); float norm2 = (Vertices[Vertices.size() - 1] - Vertices[0]).sqrnorm();
if ( norm2 > bestLength) if ( norm2 > bestLength)
{ {
index = Vertices.size() - 1; index = (uint)Vertices.size() - 1;
return true; return true;
} }
@ -2084,7 +2084,7 @@ bool CPolygon2D::contains(const CVector2f &p, bool hintIsConvex /*= true*/) con
{ {
if (hintIsConvex) if (hintIsConvex)
{ {
uint numVerts = Vertices.size(); uint numVerts = (uint)Vertices.size();
nlassert(numVerts >= 0.f); nlassert(numVerts >= 0.f);
for (uint k = 0; k < numVerts; ++k) for (uint k = 0; k < numVerts; ++k)
{ {
@ -2163,7 +2163,7 @@ void CPolygon2D::getBoundingRect(CVector2f &minCorner, CVector2f &maxCorner) con
{ {
nlassert(!Vertices.empty()); nlassert(!Vertices.empty());
minCorner = maxCorner = Vertices[0]; minCorner = maxCorner = Vertices[0];
uint numVertices = Vertices.size(); uint numVertices = (uint)Vertices.size();
for(uint k = 0; k < numVertices; ++k) for(uint k = 0; k < numVertices; ++k)
{ {
minCorner.minof(minCorner, Vertices[k]); minCorner.minof(minCorner, Vertices[k]);
@ -2224,7 +2224,7 @@ static inline bool testSegmentIntersection(const CVector2f &a, const CVector2f &
bool CPolygon2D::selfIntersect() const bool CPolygon2D::selfIntersect() const
{ {
if (Vertices.size() < 3) return false; if (Vertices.size() < 3) return false;
uint numEdges = Vertices.size(); uint numEdges = (uint)Vertices.size();
for(uint k = 0; k < numEdges; ++k) for(uint k = 0; k < numEdges; ++k)
{ {
// test intersection with all other edges that don't share a vertex with this one // test intersection with all other edges that don't share a vertex with this one

View file

@ -173,7 +173,7 @@ void CSheetId::loadSheetId ()
if (_RemoveUnknownSheet) if (_RemoveUnknownSheet)
{ {
uint32 removednbfiles = 0; uint32 removednbfiles = 0;
uint32 nbfiles = tempMap.size(); uint32 nbfiles = (uint32)tempMap.size();
// now we remove all files that not available // now we remove all files that not available
map<uint32,string>::iterator itStr2; map<uint32,string>::iterator itStr2;
@ -204,7 +204,7 @@ void CSheetId::loadSheetId ()
map<uint32,string>::const_iterator it = tempMap.begin(); map<uint32,string>::const_iterator it = tempMap.begin();
while (it != tempMap.end()) while (it != tempMap.end())
{ {
nSize += it->second.size()+1; nSize += (uint32)it->second.size()+1;
nNb++; nNb++;
it++; it++;
} }
@ -220,7 +220,7 @@ void CSheetId::loadSheetId ()
tempVec[nNb].Ptr = _AllStrings.Ptr+nSize; tempVec[nNb].Ptr = _AllStrings.Ptr+nSize;
strcpy(_AllStrings.Ptr+nSize, it->second.c_str()); strcpy(_AllStrings.Ptr+nSize, it->second.c_str());
toLower(_AllStrings.Ptr+nSize); toLower(_AllStrings.Ptr+nSize);
nSize += it->second.size()+1; nSize += (uint32)it->second.size()+1;
nNb++; nNb++;
it++; it++;
} }
@ -243,7 +243,7 @@ void CSheetId::loadSheetId ()
// Build the invert map (Name to Id) & file extension vector // Build the invert map (Name to Id) & file extension vector
{ {
uint32 nSize = _SheetIdToName.size(); uint32 nSize = (uint32)_SheetIdToName.size();
_SheetNameToId.reserve(nSize); _SheetNameToId.reserve(nSize);
CStaticMap<uint32,CChar>::iterator itStr; CStaticMap<uint32,CChar>::iterator itStr;
for( itStr = _SheetIdToName.begin(); itStr != _SheetIdToName.end(); ++itStr ) for( itStr = _SheetIdToName.begin(); itStr != _SheetIdToName.end(); ++itStr )

View file

@ -199,7 +199,7 @@ namespace NLMISC
} }
// scan the string for binary characters // scan the string for binary characters
uint32 i=size(); uint32 i=(uint32)size();
// while (i && !tbl[i-1]) // while (i && !tbl[i-1])
// { // {
// i--; // i--;
@ -228,14 +228,14 @@ namespace NLMISC
return false; return false;
// iterate from size-2 to 1 // iterate from size-2 to 1
for (uint32 i=size()-1; --i;) for (uint32 i=(uint32)size()-1; --i;)
if (!isValidFileNameChar((*this)[i]) && (*this)[i]!=' ') if (!isValidFileNameChar((*this)[i]) && (*this)[i]!=' ')
return false; return false;
} }
else else
{ {
// iterate from size-1 to 0 // iterate from size-1 to 0
for (uint32 i=size(); i--;) for (uint32 i=(uint32)size(); i--;)
if (!isValidFileNameChar((*this)[i])) if (!isValidFileNameChar((*this)[i]))
return false; return false;
} }
@ -256,7 +256,7 @@ namespace NLMISC
return false; return false;
// iterate from size-1 to 1 // iterate from size-1 to 1
for (uint32 i=size(); --i;) for (uint32 i=(uint32)size(); --i;)
if (!isValidKeywordChar((*this)[i])) if (!isValidKeywordChar((*this)[i]))
return false; return false;
@ -492,9 +492,9 @@ namespace NLMISC
CSString s=strip(); CSString s=strip();
while(!s.empty()) while(!s.empty())
{ {
uint32 pre=s.size(); uint32 pre=(uint32)s.size();
result.push_back(s.firstWord(true)); result.push_back(s.firstWord(true));
uint32 post=s.size(); uint32 post=(uint32)s.size();
if (post>=pre) if (post>=pre)
return false; return false;
} }
@ -506,9 +506,9 @@ namespace NLMISC
CSString s=*this; CSString s=*this;
while(!s.empty()) while(!s.empty())
{ {
uint32 pre=s.size(); uint32 pre=(uint32)s.size();
result.push_back(s.firstWordOrWords(true,useSlashStringEscape,useRepeatQuoteStringEscape)); result.push_back(s.firstWordOrWords(true,useSlashStringEscape,useRepeatQuoteStringEscape));
uint32 post=s.size(); uint32 post=(uint32)s.size();
if (post>=pre) if (post>=pre)
return false; return false;
} }
@ -524,7 +524,7 @@ namespace NLMISC
s=s.replace("\r",""); s=s.replace("\r","");
uint32 it=0; uint32 it=0;
uint32 len= s.size(); uint32 len= (uint32)s.size();
while(it<len) while(it<len)
{ {
// extract the text up to the next '\n'character // extract the text up to the next '\n'character
@ -545,12 +545,12 @@ namespace NLMISC
CSString s=*this; CSString s=*this;
while(!s.empty()) while(!s.empty())
{ {
uint32 pre=s.size(); uint32 pre=(uint32)s.size();
result.push_back(s.splitToSeparator(separator,true,useAngleBrace,useSlashStringEscape, result.push_back(s.splitToSeparator(separator,true,useAngleBrace,useSlashStringEscape,
useRepeatQuoteStringEscape,true)); useRepeatQuoteStringEscape,true));
if (skipBlankEntries && result.back().empty()) if (skipBlankEntries && result.back().empty())
result.pop_back(); result.pop_back();
uint32 post=s.size(); uint32 post=(uint32)s.size();
if (post>=pre) if (post>=pre)
return false; return false;
} }
@ -571,7 +571,7 @@ namespace NLMISC
while(!s.empty()) while(!s.empty())
{ {
uint32 pre=s.size(); uint32 pre=(uint32)s.size();
result.push_back(s.splitToOneOfSeparators( separators,true,useAngleBrace,useSlashStringEscape, result.push_back(s.splitToOneOfSeparators( separators,true,useAngleBrace,useSlashStringEscape,
useRepeatQuoteStringEscape,!retainSeparators )); useRepeatQuoteStringEscape,!retainSeparators ));
@ -589,7 +589,7 @@ namespace NLMISC
} }
} }
uint32 post=s.size(); uint32 post=(uint32)s.size();
if (post>=pre) if (post>=pre)
return false; return false;
} }
@ -630,7 +630,7 @@ namespace NLMISC
{ {
CSString result; CSString result;
int i,j; int i,j;
for (j=size()-1; j>=0 && isWhiteSpace((*this)[j]); --j) {} for (j=(int)size()-1; j>=0 && isWhiteSpace((*this)[j]); --j) {}
for (i=0; i<j && isWhiteSpace((*this)[i]); ++i) {} for (i=0; i<j && isWhiteSpace((*this)[i]); ++i) {}
result=substr(i,j-i+1); result=substr(i,j-i+1);
return result; return result;
@ -639,7 +639,7 @@ namespace NLMISC
CSString CSString::leftStrip() const CSString CSString::leftStrip() const
{ {
CSString result; CSString result;
int i,j=size()-1; int i,j=(int)size()-1;
for (i=0; i<j && isWhiteSpace((*this)[i]); ++i) {} for (i=0; i<j && isWhiteSpace((*this)[i]); ++i) {}
result=substr(i,j-i+1); result=substr(i,j-i+1);
return result; return result;
@ -649,7 +649,7 @@ namespace NLMISC
{ {
CSString result; CSString result;
int i=0,j; int i=0,j;
for (j=size()-1; j>=0 && isWhiteSpace((*this)[j]); --j) {} for (j=(int)size()-1; j>=0 && isWhiteSpace((*this)[j]); --j) {}
result=substr(i,j-i+1); result=substr(i,j-i+1);
return result; return result;
} }
@ -1025,7 +1025,7 @@ namespace NLMISC
} }
else if ((*this)[0]=='\"' && isDelimitedMonoBlock(false,useSlashStringEscape,useRepeatQuoteStringEscape)) else if ((*this)[0]=='\"' && isDelimitedMonoBlock(false,useSlashStringEscape,useRepeatQuoteStringEscape))
{ {
i=size(); i=(uint32)size();
} }
if (i!=size()) if (i!=size())
return quote(useSlashStringEscape,useRepeatQuoteStringEscape); return quote(useSlashStringEscape,useRepeatQuoteStringEscape);
@ -1227,7 +1227,7 @@ namespace NLMISC
{ {
bool foundToken= false; bool foundToken= false;
for (uint32 i=size();i--;) for (uint32 i=(uint32)size();i--;)
{ {
switch((*this)[i]) switch((*this)[i])
{ {
@ -1277,7 +1277,7 @@ namespace NLMISC
bool CSString::isXMLCompatible(bool isParameter) const bool CSString::isXMLCompatible(bool isParameter) const
{ {
for (uint32 i=size();i--;) for (uint32 i=(uint32)size();i--;)
{ {
switch((*this)[i]) switch((*this)[i])
{ {
@ -1749,7 +1749,7 @@ namespace NLMISC
return false; return false;
} }
resize(NLMISC::CFile::getFileSize(file)); resize(NLMISC::CFile::getFileSize(file));
uint32 bytesRead=fread(const_cast<char*>(data()),1,size(),file); uint32 bytesRead=(uint32)fread(const_cast<char*>(data()),1,size(),file);
fclose(file); fclose(file);
if (bytesRead!=size()) if (bytesRead!=size())
{ {
@ -1769,7 +1769,7 @@ namespace NLMISC
nlwarning("Failed to open file for writing: %s",fileName.c_str()); nlwarning("Failed to open file for writing: %s",fileName.c_str());
return false; return false;
} }
uint32 recordsWritten=fwrite(const_cast<char*>(data()),size(),1,file); uint32 recordsWritten=(uint32)fwrite(const_cast<char*>(data()),size(),1,file);
fclose(file); fclose(file);
if (recordsWritten!=1) if (recordsWritten!=1)
{ {

View file

@ -342,7 +342,7 @@ void IStream::serialCont(vector<uint8> &cont)
} }
else else
{ {
len= cont.size(); len= (sint32)cont.size();
serial(len); serial(len);
if (len != 0) if (len != 0)
serialBuffer( (uint8*)&(*cont.begin()) , len); serialBuffer( (uint8*)&(*cont.begin()) , len);
@ -366,7 +366,7 @@ void IStream::serialCont(vector<sint8> &cont)
} }
else else
{ {
len= cont.size(); len= (sint32)cont.size();
serial(len); serial(len);
if (len != 0) if (len != 0)
serialBuffer( (uint8*)&(*cont.begin()) , len); serialBuffer( (uint8*)&(*cont.begin()) , len);
@ -403,7 +403,7 @@ void IStream::serialCont(vector<bool> &cont)
} }
else else
{ {
len= cont.size(); len= (sint32)cont.size();
serial(len); serial(len);
if (len != 0) if (len != 0)

View file

@ -155,7 +155,7 @@ void CStaticStringMapper::memoryCompress()
uint32 nNbStrings = 0; uint32 nNbStrings = 0;
while (it != _TempIdTable.end()) while (it != _TempIdTable.end())
{ {
nTotalSize += it->second.size() + 1; nTotalSize += (uint)it->second.size() + 1;
nNbStrings++; nNbStrings++;
it++; it++;
} }
@ -169,7 +169,7 @@ void CStaticStringMapper::memoryCompress()
{ {
strcpy(_AllStrings + nTotalSize, it->second.c_str()); strcpy(_AllStrings + nTotalSize, it->second.c_str());
_IdToStr[nNbStrings] = _AllStrings + nTotalSize; _IdToStr[nNbStrings] = _AllStrings + nTotalSize;
nTotalSize += it->second.size() + 1; nTotalSize += (uint)it->second.size() + 1;
nNbStrings++; nNbStrings++;
it++; it++;
} }

View file

@ -149,7 +149,7 @@ bool CTaskManager::deleteTask(IRunnable *r)
uint CTaskManager::taskListSize(void) uint CTaskManager::taskListSize(void)
{ {
CUnfairSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue); CUnfairSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
return acces.value().size(); return (uint)acces.value().size();
} }
@ -216,7 +216,7 @@ void CTaskManager::clearDump()
uint CTaskManager::getNumWaitingTasks() uint CTaskManager::getNumWaitingTasks()
{ {
CUnfairSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue); CUnfairSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
return acces.value().size(); return (uint)acces.value().size();
} }
// *************************************************************************** // ***************************************************************************

View file

@ -1907,8 +1907,8 @@ ucstring toLower (const ucstring &str)
{ {
uint i; uint i;
ucstring temp = str; ucstring temp = str;
const uint size = temp.size(); const uint size = (uint)temp.size();
for (i=0; i<size; i++) for (i=0; i<(uint)size; i++)
{ {
// Search the key in the table // Search the key in the table
ucchar *result = toLowerUpperSearch (&(temp[i]), UnicodeUpperToLower); ucchar *result = toLowerUpperSearch (&(temp[i]), UnicodeUpperToLower);
@ -1949,7 +1949,7 @@ ucstring toUpper (const ucstring &str)
{ {
uint i; uint i;
ucstring temp = str; ucstring temp = str;
const uint size = temp.size(); const uint size = (uint)temp.size();
for (i=0; i<size; i++) for (i=0; i<size; i++)
{ {
// Search the key in the table // Search the key in the table

View file

@ -89,7 +89,7 @@ uint CWindowDisplayer::createLabel (const char *value)
{ {
CSynchronized<std::vector<CLabelEntry> >::CAccessor access (&_Labels); CSynchronized<std::vector<CLabelEntry> >::CAccessor access (&_Labels);
access.value().push_back (CLabelEntry(value)); access.value().push_back (CLabelEntry(value));
pos = access.value().size()-1; pos = (int)access.value().size()-1;
} }
return pos; return pos;
} }

View file

@ -179,8 +179,8 @@ namespace NLMISC
// ok, the file is parsed, store it // ok, the file is parsed, store it
fileInfo.FileName = CStringMapper::map(subFileName); fileInfo.FileName = CStringMapper::map(subFileName);
fileInfo.FileOffset = beginOfFile - buffer.begin(); fileInfo.FileOffset = (uint32)(beginOfFile - buffer.begin());
fileInfo.FileSize = endOfFile - beginOfFile; fileInfo.FileSize = (uint32)(endOfFile - beginOfFile);
// fileInfo.FileHandler = fopen(xmlPackFileName.c_str(), "rb"); // fileInfo.FileHandler = fopen(xmlPackFileName.c_str(), "rb");
packInfo._XMLFiles.insert(make_pair(fileInfo.FileName, fileInfo)); packInfo._XMLFiles.insert(make_pair(fileInfo.FileName, fileInfo));

View file

@ -121,7 +121,7 @@ void CCallbackNetBase::addCallbackArray (const TCallbackItem *callbackarray, sin
} }
// resize the array // resize the array
sint oldsize = _CallbackArray.size(); sint oldsize = (sint)_CallbackArray.size();
_CallbackArray.resize (oldsize + arraysize); _CallbackArray.resize (oldsize + arraysize);

View file

@ -77,7 +77,7 @@ static void uuencode (const char *s, const char *store, const int length)
bool sendEMailCommand (CTcpSock &sock, const std::string &command, uint32 code = 250) bool sendEMailCommand (CTcpSock &sock, const std::string &command, uint32 code = 250)
{ {
string buffer = command + "\r\n"; string buffer = command + "\r\n";
uint32 size = buffer.size(); uint32 size = (uint32)buffer.size();
if(!command.empty()) if(!command.empty())
{ {
if (sock.send ((uint8 *)buffer.c_str(), size) != CSock::Ok) if (sock.send ((uint8 *)buffer.c_str(), size) != CSock::Ok)
@ -285,7 +285,7 @@ bool sendEmail (const string &smtpServer, const string &from, const string &to,
memset(&src_buf[size], 0, src_buf_size - size); memset(&src_buf[size], 0, src_buf_size - size);
} }
/* Encode the buffer we just read in */ /* Encode the buffer we just read in */
uuencode(src_buf, dst_buf, size); uuencode(src_buf, dst_buf, (int)size);
formatedBody += dst_buf; formatedBody += dst_buf;
formatedBody += "\r\n"; formatedBody += "\r\n";

View file

@ -19,6 +19,7 @@
#include "nel/net/listen_sock.h" #include "nel/net/listen_sock.h"
#include "nel/net/net_log.h" #include "nel/net/net_log.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
#define NOMINMAX #define NOMINMAX
@ -122,8 +123,8 @@ CTcpSock *CListenSock::accept()
{ {
// Accept connection // Accept connection
sockaddr_in saddr; sockaddr_in saddr;
socklen_t saddrlen = sizeof(saddr); socklen_t saddrlen = (socklen_t)sizeof(saddr);
SOCKET newsock = ::accept( _Sock, (sockaddr*)&saddr, &saddrlen ); SOCKET newsock = (SOCKET)::accept( _Sock, (sockaddr*)&saddr, &saddrlen );
if ( newsock == INVALID_SOCKET ) if ( newsock == INVALID_SOCKET )
{ {
if (_Sock == INVALID_SOCKET) if (_Sock == INVALID_SOCKET)

View file

@ -170,7 +170,7 @@ void cbWSChooseShard (CMessage &msgin, const std::string &/* serviceName */, TSe
msgout.serial (reason); msgout.serial (reason);
msgout.serial (cookie); msgout.serial (cookie);
msgout.serial (ListenAddr); msgout.serial (ListenAddr);
uint32 nbPending = PendingUsers.size(); uint32 nbPending = (uint32)PendingUsers.size();
msgout.serial (nbPending); msgout.serial (nbPending);
CUnifiedNetwork::getInstance()->send ("WS", msgout); CUnifiedNetwork::getInstance()->send ("WS", msgout);
} }
@ -302,7 +302,7 @@ void CLoginServer::setListenAddress(const string &la)
uint32 CLoginServer::getNbPendingUsers() uint32 CLoginServer::getNbPendingUsers()
{ {
return PendingUsers.size(); return (uint32)PendingUsers.size();
} }
void cfcbListenAddress (CConfigFile::CVar &var) void cfcbListenAddress (CConfigFile::CVar &var)

View file

@ -31,7 +31,7 @@ namespace NLNET
uint first = 0, last = copy.SubParams.size(); uint first = 0, last = (uint)copy.SubParams.size();
SubParams.resize( last ); SubParams.resize( last );
for (; first != last; ++first) for (; first != last; ++first)
{ {

View file

@ -540,12 +540,12 @@ namespace NLNET
virtual uint32 getTransportCount() const virtual uint32 getTransportCount() const
{ {
return _Transports.size(); return (uint32)_Transports.size();
} }
virtual uint32 getRouteCount() const virtual uint32 getRouteCount() const
{ {
return _Routes.size(); return (uint32)_Routes.size();
} }
virtual uint32 getReceivedPingCount() const virtual uint32 getReceivedPingCount() const
@ -1279,7 +1279,7 @@ namespace NLNET
virtual uint32 getProxyCount() const virtual uint32 getProxyCount() const
{ {
return _ModuleProxies.size(); return (uint32)_ModuleProxies.size();
} }
/// Fill a vector with the list of proxies managed here. The module are filled in ascending proxy id order. /// Fill a vector with the list of proxies managed here. The module are filled in ascending proxy id order.

View file

@ -135,7 +135,7 @@ namespace NLNET
virtual uint32 getRouteCount() const virtual uint32 getRouteCount() const
{ {
return _Routes.size(); return (uint32)_Routes.size();
} }
void dump(NLMISC::CLog &log) const void dump(NLMISC::CLog &log) const
@ -566,7 +566,7 @@ namespace NLNET
virtual uint32 getRouteCount() const virtual uint32 getRouteCount() const
{ {
return _Routes.size(); return (uint32)_Routes.size();
} }
void dump(NLMISC::CLog &log) const void dump(NLMISC::CLog &log) const
@ -661,12 +661,12 @@ namespace NLNET
// affect a connection id // affect a connection id
if (_FreeRoutesIds.empty()) if (_FreeRoutesIds.empty())
{ {
connId = _RouteIds.size(); connId = (uint32)_RouteIds.size();
_RouteIds.push_back(InvalidSockId); _RouteIds.push_back(InvalidSockId);
} }
else else
{ {
connId = _FreeRoutesIds.back(); connId = (uint32)_FreeRoutesIds.back();
_FreeRoutesIds.pop_back(); _FreeRoutesIds.pop_back();
} }

View file

@ -177,7 +177,7 @@ namespace NLNET
virtual uint32 getRouteCount() const virtual uint32 getRouteCount() const
{ {
return _Routes.size(); return (uint32)_Routes.size();
} }
void dump(NLMISC::CLog &log) const void dump(NLMISC::CLog &log) const

View file

@ -260,7 +260,7 @@ namespace NLNET
virtual uint32 getProxyCount() const virtual uint32 getProxyCount() const
{ {
return _ModuleProxies.getAToBMap().size(); return (uint32)_ModuleProxies.getAToBMap().size();
} }
/// Fill a vector with the list of proxies managed here. The module are filled in ascending proxy id order. /// Fill a vector with the list of proxies managed here. The module are filled in ascending proxy id order.

View file

@ -661,12 +661,12 @@ namespace NLNET
virtual uint32 getNbModule() virtual uint32 getNbModule()
{ {
return _ModuleInstances.getAToBMap().size(); return (uint32)_ModuleInstances.getAToBMap().size();
} }
virtual uint32 getNbModuleProxy() virtual uint32 getNbModuleProxy()
{ {
return _ModuleProxyIds.getAToBMap().size(); return (uint32)_ModuleProxyIds.getAToBMap().size();
} }

View file

@ -124,7 +124,7 @@ uint32 LastTimeInCallback = 0;
// this is the thread that initialized the signal redirection // this is the thread that initialized the signal redirection
// we'll ignore other thread signals // we'll ignore other thread signals
static uint SignalisedThread; static size_t SignalisedThread;
static CFileDisplayer fd; static CFileDisplayer fd;
static CNetDisplayer commandDisplayer(false); static CNetDisplayer commandDisplayer(false);
@ -409,7 +409,7 @@ string IService::getArg (char argName) const
begin++; begin++;
// End // End
uint size = _Args[i].size(); uint size = (uint)_Args[i].size();
if (size && _Args[i][size-1] == '"') if (size && _Args[i][size-1] == '"')
size--; size--;
size = (uint)(std::max((int)0, (int)size-(int)begin)); size = (uint)(std::max((int)0, (int)size-(int)begin));

View file

@ -263,7 +263,7 @@ void CSock::createSocket( int type, int protocol )
{ {
nlassert( _Sock == INVALID_SOCKET ); nlassert( _Sock == INVALID_SOCKET );
_Sock = socket( AF_INET, type, protocol ); // or IPPROTO_IP (=0) ? _Sock = (SOCKET)socket( AF_INET, type, protocol ); // or IPPROTO_IP (=0) ?
if ( _Sock == INVALID_SOCKET ) if ( _Sock == INVALID_SOCKET )
{ {
throw ESocket( "Socket creation failed" ); throw ESocket( "Socket creation failed" );

View file

@ -377,7 +377,7 @@ void CTransportClass::createLocalRegisteredClassMessage ()
TempMessage.invert(); TempMessage.invert();
TempMessage.setType ("CT_LRC"); TempMessage.setType ("CT_LRC");
uint32 nbClass = LocalRegisteredClass.size (); uint32 nbClass = (uint32)LocalRegisteredClass.size ();
TempMessage.serial (nbClass); TempMessage.serial (nbClass);
for (TRegisteredClass::iterator it = LocalRegisteredClass.begin(); it != LocalRegisteredClass.end (); it++) for (TRegisteredClass::iterator it = LocalRegisteredClass.begin(); it != LocalRegisteredClass.end (); it++)
@ -386,7 +386,7 @@ void CTransportClass::createLocalRegisteredClassMessage ()
TempMessage.serial ((*it).second.Instance->Name); TempMessage.serial ((*it).second.Instance->Name);
uint32 nbProp = (*it).second.Instance->Prop.size (); uint32 nbProp = (uint32)(*it).second.Instance->Prop.size ();
TempMessage.serial (nbProp); TempMessage.serial (nbProp);
for (uint j = 0; j < (*it).second.Instance->Prop.size (); j++) for (uint j = 0; j < (*it).second.Instance->Prop.size (); j++)

View file

@ -1686,7 +1686,7 @@ CCallbackNetBase *CUnifiedNetwork::getNetBase(const std::string &name, TSockId &
if (ThreadCreator != NLMISC::getThreadId()) nlwarning ("HNETL5: Multithread access but this class is not thread safe thread creator = %u thread used = %u", ThreadCreator, NLMISC::getThreadId()); if (ThreadCreator != NLMISC::getThreadId()) nlwarning ("HNETL5: Multithread access but this class is not thread safe thread creator = %u thread used = %u", ThreadCreator, NLMISC::getThreadId());
sint count = _NamedCnx.count(name); sint count = (sint)_NamedCnx.count(name);
if (count <= 0) if (count <= 0)
{ {
@ -2132,7 +2132,7 @@ void CUnifiedNetwork::CUnifiedConnection::display (bool full, CLog *log)
log->displayNL ("> %s-%hu %s %s %s (%d ExtAddr %d Cnx) TotalCb %d", ServiceName.c_str (), ServiceId.get(), IsExternal?"External":"NotExternal", log->displayNL ("> %s-%hu %s %s %s (%d ExtAddr %d Cnx) TotalCb %d", ServiceName.c_str (), ServiceId.get(), IsExternal?"External":"NotExternal",
AutoRetry?"AutoRetry":"NoAutoRetry", SendId?"SendId":"NoSendId", ExtAddress.size (), Connections.size (), TotalCallbackCalled); AutoRetry?"AutoRetry":"NoAutoRetry", SendId?"SendId":"NoSendId", ExtAddress.size (), Connections.size (), TotalCallbackCalled);
uint maxc = std::max (ExtAddress.size (), Connections.size ()); uint maxc = (uint)std::max (ExtAddress.size (), Connections.size ());
for (uint j = 0; j < maxc; j++) for (uint j = 0; j < maxc; j++)
{ {

View file

@ -466,7 +466,7 @@ void buildExteriorMesh(CCollisionMeshBuild &cmb, CExteriorMesh &em)
sint pivot = (edge+1)%3; sint pivot = (edge+1)%3;
sint nextEdge = edge; sint nextEdge = edge;
uint firstExtEdge = edges.size(); uint firstExtEdge = (uint)edges.size();
for(;;) for(;;)
{ {

View file

@ -87,14 +87,14 @@ void NLPACS::COrderedChain::traverse(sint from, sint to, bool forward, vector<NL
if (forward) if (forward)
{ {
if (from < 0) from = 0; if (from < 0) from = 0;
if (to < 0) to = _Vertices.size()-1; if (to < 0) to = (sint)_Vertices.size()-1;
for (i=from+1; i<=to; ++i) for (i=from+1; i<=to; ++i)
path.push_back(_Vertices[i]); path.push_back(_Vertices[i]);
} }
else else
{ {
if (from < 0) from = _Vertices.size()-2; if (from < 0) from = (sint)_Vertices.size()-2;
if (to < 0) to = -1; if (to < 0) to = -1;
for (i=from; i>to; --i) for (i=from; i>to; --i)
@ -216,7 +216,7 @@ void NLPACS::CChain::make(const vector<CVector> &vertices, sint32 left, sint32 r
if (useOChainId.empty()) if (useOChainId.empty())
{ {
subChainId = chains.size(); subChainId = (uint32)chains.size();
if (subChainId > 65535) if (subChainId > 65535)
nlerror("in NLPACS::CChain::make(): reached the maximum number of ordered chains"); nlerror("in NLPACS::CChain::make(): reached the maximum number of ordered chains");

View file

@ -322,7 +322,7 @@ inline void COrderedChain3f::unpack(const COrderedChain &chain)
{ {
uint i, mx; uint i, mx;
const std::vector<CVector2s> &vertices = chain.getVertices(); const std::vector<CVector2s> &vertices = chain.getVertices();
mx = _Vertices.size(); mx = (uint)_Vertices.size();
_Vertices.resize(vertices.size()); _Vertices.resize(vertices.size());
_Forward = chain.isForward(); _Forward = chain.isForward();
_ParentId = chain.getParentId(); _ParentId = chain.getParentId();

View file

@ -207,7 +207,7 @@ void CChainQuad::build(const std::vector<COrderedChain> &ochains)
// add an entry for Len. // add an entry for Len.
memSize+= sizeof(uint16); memSize+= sizeof(uint16);
// add N entry of CEdgeChainEntry. // add N entry of CEdgeChainEntry.
memSize+= quadNode.size()*sizeof(CEdgeChainEntry); memSize+= (sint)quadNode.size()*sizeof(CEdgeChainEntry);
} }
} }
@ -516,7 +516,7 @@ void CChainQuad::serial(NLMISC::IStream &f)
else else
{ {
// len/resize. // len/resize.
len= _Quad.size(); len= (uint32)_Quad.size();
f.serial(len); f.serial(len);
// write offsets. // write offsets.

View file

@ -58,7 +58,7 @@ void CCollisionSurfaceTemp::resetEdgeCollideNodes()
// *************************************************************************** // ***************************************************************************
uint32 CCollisionSurfaceTemp::allocEdgeCollideNode(uint32 size) uint32 CCollisionSurfaceTemp::allocEdgeCollideNode(uint32 size)
{ {
uint32 id= _EdgeCollideNodes.size(); uint32 id= (uint32)_EdgeCollideNodes.size();
_EdgeCollideNodes.resize(id+size); _EdgeCollideNodes.resize(id+size);
return id; return id;
} }

View file

@ -357,7 +357,7 @@ void CEdgeQuad::build(const CExteriorMesh &em,
// add an entry for Len. // add an entry for Len.
memSize+= sizeof(uint16); memSize+= sizeof(uint16);
// add N entry of CEdgeChainEntry. // add N entry of CEdgeChainEntry.
memSize+= quadNode.size()*sizeof(uint16); memSize+= (sint)quadNode.size()*sizeof(uint16);
} }
} }
@ -614,7 +614,7 @@ void CEdgeQuad::serial(NLMISC::IStream &f)
else else
{ {
// len/resize. // len/resize.
len= _Quad.size(); len= (uint32)_Quad.size();
f.serial(len); f.serial(len);
// write offsets. // write offsets.

View file

@ -134,7 +134,7 @@ inline void CFaceGrid::create(const CFaceGrid::CFaceGridBuild &fgb)
uint i; uint i;
for (i=0; i<fgb.Grid.size(); ++i) for (i=0; i<fgb.Grid.size(); ++i)
{ {
_Grid.push_back(_GridData.size()); _Grid.push_back((uint)_GridData.size());
_GridData.insert(_GridData.end(), fgb.Grid[i].begin(), fgb.Grid[i].end()); _GridData.insert(_GridData.end(), fgb.Grid[i].begin(), fgb.Grid[i].end());
} }
} }
@ -152,7 +152,7 @@ inline void CFaceGrid::select(const NLMISC::CVector &pos, std::vector<uint32> &s
idx = x+(y<<_Log2Width); idx = x+(y<<_Log2Width);
start = _Grid[idx++]; start = _Grid[idx++];
stop = (idx == _Grid.size()) ? _GridData.size() : _Grid[idx]; stop = (idx == _Grid.size()) ? (uint)_GridData.size() : _Grid[idx];
for (; start<stop; ++start) for (; start<stop; ++start)
selected.push_back(_GridData[start]); selected.push_back(_GridData[start]);

View file

@ -1131,12 +1131,12 @@ void NLPACS::CGlobalRetriever::findPath(const NLPACS::UGlobalPosition &begin,
{ {
if (ochain.getVertices().size() & 1) if (ochain.getVertices().size() & 1)
{ {
surf.End.Estimation = ochain[ochain.getVertices().size()/2].unpack3f(); surf.End.Estimation = ochain[(uint)ochain.getVertices().size()/2].unpack3f();
} }
else else
{ {
surf.End.Estimation = (ochain[ochain.getVertices().size()/2].unpack3f()+ surf.End.Estimation = (ochain[(uint)ochain.getVertices().size()/2].unpack3f()+
ochain[ochain.getVertices().size()/2-1].unpack3f())*0.5f; ochain[(uint)ochain.getVertices().size()/2-1].unpack3f())*0.5f;
} }
} }
} }
@ -1239,7 +1239,7 @@ void NLPACS::CGlobalRetriever::findCollisionChains(CCollisionSurfaceTemp &cst, c
// add possible collision chains with movement. // add possible collision chains with movement.
//================ //================
sint firstCollisionChain= cst.CollisionChains.size(); sint firstCollisionChain= (sint)cst.CollisionChains.size();
CVector2f transBase(-deltaOrigin.x, -deltaOrigin.y); CVector2f transBase(-deltaOrigin.x, -deltaOrigin.y);
// H_AFTER(PACS_GR_findCC_getAndComputeMove); // H_AFTER(PACS_GR_findCC_getAndComputeMove);
@ -1251,7 +1251,7 @@ void NLPACS::CGlobalRetriever::findCollisionChains(CCollisionSurfaceTemp &cst, c
retrieverInstance.testExteriorCollision(cst, bboxMoveLocal, transBase, localRetriever); retrieverInstance.testExteriorCollision(cst, bboxMoveLocal, transBase, localRetriever);
// how many collision chains added? : nCollisionChain-firstCollisionChain. // how many collision chains added? : nCollisionChain-firstCollisionChain.
sint nCollisionChain= cst.CollisionChains.size(); sint nCollisionChain= (sint)cst.CollisionChains.size();
// H_AFTER(PACS_GR_findCC_testCollision); // H_AFTER(PACS_GR_findCC_testCollision);
@ -1526,7 +1526,7 @@ void NLPACS::CGlobalRetriever::testCollisionWithCollisionChains(CCollisionSurfac
// insert or replace this collision in collisionDescs. // insert or replace this collision in collisionDescs.
// NB: yes this looks like a N algorithm (so N^2). But not so many collisions may arise, so don't bother. // NB: yes this looks like a N algorithm (so N^2). But not so many collisions may arise, so don't bother.
sint indexInsert= cst.CollisionDescs.size(); sint indexInsert= (sint)cst.CollisionDescs.size();
sint colFound= -1; sint colFound= -1;
// start to search with nextCollisionSurfaceTested, because can't insert before. // start to search with nextCollisionSurfaceTested, because can't insert before.

View file

@ -317,7 +317,7 @@ sint32 NLPACS::CLocalRetriever::addSurface(uint8 normalq, uint8 orientationq,
sint8 quantHeight) sint8 quantHeight)
{ {
// creates a new surface... // creates a new surface...
sint32 newId = _Surfaces.size(); sint32 newId = (sint32)_Surfaces.size();
_Surfaces.resize(newId+1); _Surfaces.resize(newId+1);
CRetrievableSurface &surf = _Surfaces.back(); CRetrievableSurface &surf = _Surfaces.back();
@ -409,7 +409,7 @@ sint32 NLPACS::CLocalRetriever::addChain(const vector<CVector> &verts,
return -1; return -1;
} }
sint32 newId = _Chains.size(); sint32 newId = (sint32)_Chains.size();
_Chains.resize(newId+1); _Chains.resize(newId+1);
CChain &chain = _Chains.back(); CChain &chain = _Chains.back();
@ -471,13 +471,13 @@ void NLPACS::CLocalRetriever::computeLoopsAndTips()
if (j == chainFlags.size()) if (j == chainFlags.size())
break; break;
uint32 loopId = surface._Loops.size(); uint32 loopId = (uint32)surface._Loops.size();
surface._Loops.push_back(CRetrievableSurface::TLoop()); surface._Loops.push_back(CRetrievableSurface::TLoop());
CRetrievableSurface::TLoop &loop = surface._Loops.back(); CRetrievableSurface::TLoop &loop = surface._Loops.back();
CVector loopStart = getStartVector(surface._Chains[j].Chain, i); CVector loopStart = getStartVector(surface._Chains[j].Chain, i);
CVector currentEnd = getStopVector(surface._Chains[j].Chain, i); CVector currentEnd = getStopVector(surface._Chains[j].Chain, i);
_Chains[surface._Chains[j].Chain].setLoopIndexes(i, loopId, loop.size()); _Chains[surface._Chains[j].Chain].setLoopIndexes(i, loopId, (uint)loop.size());
loop.push_back(uint16(j)); loop.push_back(uint16(j));
chainFlags[j] = true; chainFlags[j] = true;
@ -532,7 +532,7 @@ void NLPACS::CLocalRetriever::computeLoopsAndTips()
} }
currentEnd = getStopVector(surface._Chains[bestChain].Chain, i); currentEnd = getStopVector(surface._Chains[bestChain].Chain, i);
_Chains[surface._Chains[bestChain].Chain].setLoopIndexes(i, loopId, loop.size()); _Chains[surface._Chains[bestChain].Chain].setLoopIndexes(i, loopId, (uint)loop.size());
loop.push_back(uint16(bestChain)); loop.push_back(uint16(bestChain));
chainFlags[bestChain] = true; chainFlags[bestChain] = true;
++totalAdded; ++totalAdded;
@ -673,21 +673,21 @@ void NLPACS::CLocalRetriever::buildSurfacePolygons(uint32 surface, list<CPolygon
} }
else else
{ {
for (l=ochain.getVertices().size()-1; l>0; --l) for (l=(uint)ochain.getVertices().size()-1; l>0; --l)
poly.Vertices.push_back(ochain[l].unpack3f()); poly.Vertices.push_back(ochain[l].unpack3f());
} }
} }
} }
else else
{ {
for (k=chain._SubChains.size(); (sint)k>0; --k) for (k=(uint)chain._SubChains.size(); (sint)k>0; --k)
{ {
const COrderedChain &ochain = _OrderedChains[chain._SubChains[k]]; const COrderedChain &ochain = _OrderedChains[chain._SubChains[k]];
bool ochainforward = ochain.isForward(); bool ochainforward = ochain.isForward();
if (ochainforward) if (ochainforward)
{ {
for (l=ochain.getVertices().size()-1; (sint)l>0; --l) for (l=(uint)ochain.getVertices().size()-1; (sint)l>0; --l)
poly.Vertices.push_back(ochain[l].unpack3f()); poly.Vertices.push_back(ochain[l].unpack3f());
} }
else else
@ -733,21 +733,21 @@ void NLPACS::CLocalRetriever::build3dSurfacePolygons(uint32 surface, list<CPolyg
} }
else else
{ {
for (l=ochain.getVertices().size()-1; l>0; --l) for (l=(uint)ochain.getVertices().size()-1; l>0; --l)
poly.Vertices.push_back(ochain[l]); poly.Vertices.push_back(ochain[l]);
} }
} }
} }
else else
{ {
for (k=chain._SubChains.size()-1; (sint)k>=0; --k) for (k=(uint)chain._SubChains.size()-1; (sint)k>=0; --k)
{ {
const COrderedChain3f &ochain = _FullOrderedChains[chain._SubChains[k]]; const COrderedChain3f &ochain = _FullOrderedChains[chain._SubChains[k]];
bool ochainforward = ochain.isForward(); bool ochainforward = ochain.isForward();
if (ochainforward) if (ochainforward)
{ {
for (l=ochain.getVertices().size()-1; (sint)l>0; --l) for (l=(uint)ochain.getVertices().size()-1; (sint)l>0; --l)
poly.Vertices.push_back(ochain[l]); poly.Vertices.push_back(ochain[l]);
} }
else else
@ -779,7 +779,7 @@ void NLPACS::CLocalRetriever::findBorderChains()
for (chain=0; chain<_Chains.size(); ++chain) for (chain=0; chain<_Chains.size(); ++chain)
if (_Chains[chain].isBorderChain()) if (_Chains[chain].isBorderChain())
{ {
sint32 index = _BorderChains.size(); sint32 index = (sint32)_BorderChains.size();
_BorderChains.push_back(uint16(chain)); _BorderChains.push_back(uint16(chain));
_Chains[chain].setBorderChainIndex(index); _Chains[chain].setBorderChainIndex(index);
} }
@ -1108,7 +1108,7 @@ void NLPACS::CLocalRetriever::retrievePosition(CVector estimated, CCollisionSurf
else else
{ {
const vector<CVector2s> &vertices = sub.getVertices(); const vector<CVector2s> &vertices = sub.getVertices();
uint start = 0, stop = vertices.size()-1; uint start = 0, stop = (uint)vertices.size()-1;
// then finds the smallest segment of the chain that includes the estimated position. // then finds the smallest segment of the chain that includes the estimated position.
while (stop-start > 1) while (stop-start > 1)
@ -1282,7 +1282,7 @@ void NLPACS::CLocalRetriever::retrieveAccuratePosition(CVector2s estim, CCollisi
else else
{ {
const vector<CVector2s> &vertices = sub.getVertices(); const vector<CVector2s> &vertices = sub.getVertices();
uint start = 0, stop = vertices.size()-1; uint start = 0, stop = (uint)vertices.size()-1;
// then finds the smallest segment of the chain that includes the estimated position. // then finds the smallest segment of the chain that includes the estimated position.
while (stop-start > 1) while (stop-start > 1)
@ -1705,7 +1705,7 @@ void NLPACS::CLocalRetriever::findPath(const NLPACS::CLocalRetriever::CLocalPosi
sort(intersections.begin(), intersections.end()); sort(intersections.begin(), intersections.end());
uint intersStart = 0; uint intersStart = 0;
uint intersEnd = intersections.size(); uint intersEnd = (uint)intersections.size();
if (intersEnd > 0) if (intersEnd > 0)
{ {
@ -1834,13 +1834,13 @@ void NLPACS::CLocalRetriever::findPath(const NLPACS::CLocalRetriever::CLocalPosi
{ {
loopIndex--; loopIndex--;
if (loopIndex < 0) if (loopIndex < 0)
loopIndex = loop.size()-1; loopIndex = (sint)loop.size()-1;
} }
thisChainId = surface._Chains[loop[loopIndex]].Chain; thisChainId = surface._Chains[loop[loopIndex]].Chain;
thisChainForward = (_Chains[thisChainId].getLeft() == surfaceId); thisChainForward = (_Chains[thisChainId].getLeft() == surfaceId);
thisOChainIndex = (thisChainForward && forward || !thisChainForward && !forward) ? thisOChainIndex = (thisChainForward && forward || !thisChainForward && !forward) ?
0 : _Chains[thisChainId]._SubChains.size()-1; 0 : (sint)_Chains[thisChainId]._SubChains.size()-1;
} }
thisOChainId = _Chains[thisChainId]._SubChains[thisOChainIndex]; thisOChainId = _Chains[thisChainId]._SubChains[thisOChainIndex];
@ -1894,7 +1894,7 @@ void NLPACS::CLocalRetriever::testCollision(CCollisionSurfaceTemp &cst, const CA
uint16 *chainLUT= cst.OChainLUT; uint16 *chainLUT= cst.OChainLUT;
// bkup where we begin to add chains. // bkup where we begin to add chains.
uint firstChainAdded= cst.CollisionChains.size(); uint firstChainAdded= (uint)cst.CollisionChains.size();
// For all edgechain entry. // For all edgechain entry.
for(i=0;i<nEce;i++) for(i=0;i<nEce;i++)
@ -1927,7 +1927,7 @@ void NLPACS::CLocalRetriever::testCollision(CCollisionSurfaceTemp &cst, const CA
{ {
// H_AUTO(PACS_LR_testCol_addToLUT); // H_AUTO(PACS_LR_testCol_addToLUT);
// add a new CCollisionChain. // add a new CCollisionChain.
ccId= cst.CollisionChains.size(); ccId= (uint)cst.CollisionChains.size();
cst.CollisionChains.push_back(CCollisionChain()); cst.CollisionChains.push_back(CCollisionChain());
// Fill it with default. // Fill it with default.
cst.CollisionChains[ccId].Tested= false; cst.CollisionChains[ccId].Tested= false;
@ -2232,7 +2232,7 @@ bool NLPACS::CLocalRetriever::checkSurfaceIntegrity(uint surf, NLMISC::CVector t
const CRetrievableSurface& surface = _Surfaces[surf]; const CRetrievableSurface& surface = _Surfaces[surf];
uint nloops = surface.getLoops().size(); uint nloops = (uint)surface.getLoops().size();
std::vector<std::pair<CVector2s, CVector2s> > edges; std::vector<std::pair<CVector2s, CVector2s> > edges;

View file

@ -684,7 +684,7 @@ bool CMoveContainer::evalOneTerrainCollision (double beginTime, CMovePrimitive *
testMoveValid=true; testMoveValid=true;
// Size of the array // Size of the array
uint size=result->size(); uint size=(uint)result->size();
// For each detected collisions // For each detected collisions
for (uint c=0; c<size; c++) for (uint c=0; c<size; c++)
@ -1086,7 +1086,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, CMovePrimitive* second
if (index >= (int)_TimeOT.size()) if (index >= (int)_TimeOT.size())
{ {
nlwarning("PACS: newCollision() failure, index [%d] >= (int)_TimeOT.size() [%d], clamped to max", index, (int)_TimeOT.size()); nlwarning("PACS: newCollision() failure, index [%d] >= (int)_TimeOT.size() [%d], clamped to max", index, (int)_TimeOT.size());
index = _TimeOT.size()-1; index = (int)_TimeOT.size()-1;
} }
_TimeOT[index].link (info); _TimeOT[index].link (info);
@ -1197,7 +1197,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, const CCollisionSurfac
if (index >= (int)_TimeOT.size()) if (index >= (int)_TimeOT.size())
{ {
nlwarning("PACS: newCollision() failure, index [%d] >= (int)_TimeOT.size() [%d], clamped to max", index, (int)_TimeOT.size()); nlwarning("PACS: newCollision() failure, index [%d] >= (int)_TimeOT.size() [%d], clamped to max", index, (int)_TimeOT.size());
index = _TimeOT.size()-1; index = (int)_TimeOT.size()-1;
} }
_TimeOT[index].link (info); _TimeOT[index].link (info);
@ -1212,7 +1212,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, const CCollisionSurfac
void CMoveContainer::newTrigger (CMovePrimitive* first, CMovePrimitive* second, const CCollisionDesc& desc, uint triggerType) void CMoveContainer::newTrigger (CMovePrimitive* first, CMovePrimitive* second, const CCollisionDesc& desc, uint triggerType)
{ {
// Element index // Element index
uint index=_Triggers.size(); uint index=(uint)_Triggers.size();
// Add one element // Add one element
_Triggers.resize (index+1); _Triggers.resize (index+1);
@ -1503,7 +1503,7 @@ void CMoveContainer::removeNCFromModifiedList (CMovePrimitive* primitive, uint8
{ {
// For each world image // For each world image
uint i; uint i;
uint worldImageCount = _ChangedRoot.size(); uint worldImageCount = (uint)_ChangedRoot.size();
for (i=0; i<worldImageCount; i++) for (i=0; i<worldImageCount; i++)
{ {
// For each changed primitives // For each changed primitives

View file

@ -120,7 +120,7 @@ public:
/// Get number of trigger informations /// Get number of trigger informations
uint getNumTriggerInfo() const uint getNumTriggerInfo() const
{ {
return _Triggers.size(); return (uint)_Triggers.size();
} }
/// Get the n-th trigger informations /// Get the n-th trigger informations

View file

@ -99,7 +99,7 @@ public:
//@{ //@{
static UPrimitiveBlock *createPrimitiveBlock(NLMISC::IStream &src); static UPrimitiveBlock *createPrimitiveBlock(NLMISC::IStream &src);
static UPrimitiveBlock *createPrimitiveBlockFromFile(const std::string &fileName); static UPrimitiveBlock *createPrimitiveBlockFromFile(const std::string &fileName);
uint getNbPrimitive() { return Primitives.size(); } uint getNbPrimitive() { return (uint)Primitives.size(); }
UMovePrimitive::TUserData getUserData(uint nPrimNb) { nlassert(nPrimNb < Primitives.size()); UMovePrimitive::TUserData getUserData(uint nPrimNb) { nlassert(nPrimNb < Primitives.size());
return Primitives[nPrimNb].UserData; } return Primitives[nPrimNb].UserData; }
//@} //@}

View file

@ -67,7 +67,7 @@ public:
const std::vector<CLocalRetriever> &getRetrievers() const { return _Retrievers; } const std::vector<CLocalRetriever> &getRetrievers() const { return _Retrievers; }
/// Returns the number of retrievers in the bank. /// Returns the number of retrievers in the bank.
uint size() const { return _Retrievers.size(); } uint size() const { return (uint)_Retrievers.size(); }
/// Gets nth retriever. /// Gets nth retriever.
const CLocalRetriever &getRetriever(uint n) const const CLocalRetriever &getRetriever(uint n) const
@ -79,7 +79,7 @@ public:
} }
/// Adds the given retriever to the bank. /// Adds the given retriever to the bank.
uint addRetriever(const CLocalRetriever &retriever) { _Retrievers.push_back(retriever); return _Retrievers.size()-1; } uint addRetriever(const CLocalRetriever &retriever) { _Retrievers.push_back(retriever); return (uint)_Retrievers.size()-1; }
/// Loads the retriever named 'filename' (using defined search paths) and adds it to the bank. /// Loads the retriever named 'filename' (using defined search paths) and adds it to the bank.
uint addRetriever(const std::string &filename) uint addRetriever(const std::string &filename)
@ -92,7 +92,7 @@ public:
localRetriever.serial(input); localRetriever.serial(input);
input.close(); input.close();
return _Retrievers.size()-1; return (uint)_Retrievers.size()-1;
} }
/// Cleans the bank up. /// Cleans the bank up.
@ -166,7 +166,7 @@ public:
} }
else else
{ {
uint32 num = _Retrievers.size(); uint32 num = (uint32)_Retrievers.size();
f.serial(num); f.serial(num);
} }
} }

View file

@ -637,7 +637,7 @@ void NLPACS::CRetrieverInstance::testExteriorCollision(NLPACS::CCollisionSurface
uint16 *edgeLUT= cst.OChainLUT; uint16 *edgeLUT= cst.OChainLUT;
// bkup where we begin to add chains. // bkup where we begin to add chains.
uint firstChainAdded= cst.CollisionChains.size(); uint firstChainAdded= (uint)cst.CollisionChains.size();
// For all exterioredge entry. // For all exterioredge entry.
for(i=0;i<nEei;i++) for(i=0;i<nEei;i++)
@ -660,7 +660,7 @@ void NLPACS::CRetrieverInstance::testExteriorCollision(NLPACS::CCollisionSurface
if(edgeLUT[eei]==0xFFFF) if(edgeLUT[eei]==0xFFFF)
{ {
// add a new CCollisionChain. // add a new CCollisionChain.
ccId= cst.CollisionChains.size(); ccId= (uint)cst.CollisionChains.size();
cst.CollisionChains.push_back(CCollisionChain()); cst.CollisionChains.push_back(CCollisionChain());
// Fill it with default. // Fill it with default.
cst.CollisionChains[ccId].Tested= false; cst.CollisionChains[ccId].Tested= false;

View file

@ -417,7 +417,7 @@ float NLPACS::CSurfaceQuadTree::getInterpZ(const CVector &v) const
static const sint ct[4][4] = { {-1, 1, 3,-1}, {-1,-1, 2, 0}, { 1,-1,-1, 3}, { 0, 2,-1,-1} }; // child table static const sint ct[4][4] = { {-1, 1, 3,-1}, {-1,-1, 2, 0}, { 1,-1,-1, 3}, { 0, 2,-1,-1} }; // child table
static const sint nt[4][4] = { { 3, 1, 3, 1}, { 2, 0, 2, 0}, { 1, 3, 1, 3}, { 0, 2, 0, 2} }; // neighbor table static const sint nt[4][4] = { { 3, 1, 3, 1}, { 2, 0, 2, 0}, { 1, 3, 1, 3}, { 0, 2, 0, 2} }; // neighbor table
sint nlev = nodes.size()-1; sint nlev = (sint)nodes.size()-1;
sint child = -1; sint child = -1;
while (nlev > 0) while (nlev > 0)

View file

@ -193,7 +193,7 @@ void CAsyncFileManagerSound::CLoadWavFile::run (void)
} }
_pDestbuffer->setFormat(bufferFormat, channels, bitsPerSample, frequency); _pDestbuffer->setFormat(bufferFormat, channels, bitsPerSample, frequency);
if (!_pDestbuffer->fill(&result[0], result.size())) if (!_pDestbuffer->fill(&result[0], (uint)result.size()))
{ {
nlwarning("CAsyncFileManagerSound::CLoadWavFile::run : _pDestbuffer->fill returned false !"); nlwarning("CAsyncFileManagerSound::CLoadWavFile::run : _pDestbuffer->fill returned false !");
return; return;

View file

@ -181,12 +181,12 @@ void CAudioMixerUser::initClusteredSound(NL3D::CScene *scene, float minGain, flo
void CAudioMixerUser::setPriorityReserve(TSoundPriority priorityChannel, size_t reserve) void CAudioMixerUser::setPriorityReserve(TSoundPriority priorityChannel, size_t reserve)
{ {
_PriorityReserve[priorityChannel] = min(_Tracks.size(), reserve); _PriorityReserve[priorityChannel] = (uint32)min(_Tracks.size(), reserve);
} }
void CAudioMixerUser::setLowWaterMark(size_t value) void CAudioMixerUser::setLowWaterMark(size_t value)
{ {
_LowWaterMark = min(_Tracks.size(), value); _LowWaterMark = (uint32)min(_Tracks.size(), value);
} }
@ -544,7 +544,7 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo
_LowWaterMark = 0; _LowWaterMark = 0;
for (i=0; i<NbSoundPriorities; ++i) for (i=0; i<NbSoundPriorities; ++i)
{ {
_PriorityReserve[i] = _Tracks.size(); _PriorityReserve[i] = (uint32)_Tracks.size();
_ReserveUsage[i] = 0; _ReserveUsage[i] = 0;
} }
@ -743,14 +743,14 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
} }
vector<sint16> mono16Data; vector<sint16> mono16Data;
if (!IBuffer::convertToMono16PCM(&result[0], result.size(), mono16Data, bufferFormat, channels, bitsPerSample)) if (!IBuffer::convertToMono16PCM(&result[0], (uint)result.size(), mono16Data, bufferFormat, channels, bitsPerSample))
{ {
nlwarning(" IBuffer::convertToMono16PCM returned false"); nlwarning(" IBuffer::convertToMono16PCM returned false");
continue; continue;
} }
vector<uint8> adpcmData; vector<uint8> adpcmData;
if (!IBuffer::convertMono16PCMToMonoADPCM(&mono16Data[0], mono16Data.size(), adpcmData)) if (!IBuffer::convertMono16PCMToMonoADPCM(&mono16Data[0], (uint)mono16Data.size(), adpcmData))
{ {
nlwarning(" IBuffer::convertMono16PCMToMonoADPCM returned false"); nlwarning(" IBuffer::convertMono16PCMToMonoADPCM returned false");
continue; continue;
@ -763,7 +763,7 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
adpcmBuffers[j].swap(adpcmData); adpcmBuffers[j].swap(adpcmData);
mono16Buffers[j].swap(mono16Data); mono16Buffers[j].swap(mono16Data);
hdr.addSample(CFile::getFilename(sampleList[j]), frequency, mono16Data.size(), mono16Buffers[j].size() * 2, adpcmBuffers[j].size()); hdr.addSample(CFile::getFilename(sampleList[j]), frequency, (uint32)mono16Data.size(), (uint32)mono16Buffers[j].size() * 2, (uint32)adpcmBuffers[j].size());
} }
// write the sample bank (if any sample available) // write the sample bank (if any sample available)
@ -776,8 +776,8 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
nlassert(mono16Buffers.size() == adpcmBuffers.size()); nlassert(mono16Buffers.size() == adpcmBuffers.size());
for (uint j = 0; j < mono16Buffers.size(); ++j) for (uint j = 0; j < mono16Buffers.size(); ++j)
{ {
sbf.serialBuffer((uint8*)(&mono16Buffers[j][0]), mono16Buffers[j].size()*2); sbf.serialBuffer((uint8*)(&mono16Buffers[j][0]), (uint)mono16Buffers[j].size()*2);
sbf.serialBuffer((uint8*)(&adpcmBuffers[j][0]), adpcmBuffers[j].size()); sbf.serialBuffer((uint8*)(&adpcmBuffers[j][0]), (uint)adpcmBuffers[j].size());
} }
return filename; return filename;
@ -1134,7 +1134,7 @@ void CAudioMixerUser::CControledSources::serial(NLMISC::IStream &s)
s.serial(name); s.serial(name);
s.serialEnum(ParamId); s.serialEnum(ParamId);
uint32 size = SoundNames.size(); uint32 size = (uint32)SoundNames.size();
s.serial(size); s.serial(size);
for (uint i=0; i<size; ++i) for (uint i=0; i<size; ++i)
@ -2159,12 +2159,12 @@ uint CAudioMixerUser::getPlayingSourcesCount() const
uint CAudioMixerUser::getAvailableTracksCount() const uint CAudioMixerUser::getAvailableTracksCount() const
{ {
return _FreeTracks.size(); return (uint)_FreeTracks.size();
} }
uint CAudioMixerUser::getUsedTracksCount() const uint CAudioMixerUser::getUsedTracksCount() const
{ {
return _Tracks.size() - _FreeTracks.size(); return (uint)_Tracks.size() - (uint)_FreeTracks.size();
} }

View file

@ -145,7 +145,7 @@ void CBackgroundSoundManager::addSound(const std::string &rawSoundName, const st
uint n = 0; uint n = 0;
string name; string name;
// count the number of '-' in the string. // count the number of '-' in the string.
n = std::count(rawSoundName.begin(), rawSoundName.end(), '-'); n = (uint)std::count(rawSoundName.begin(), rawSoundName.end(), '-');
if (n == 2) if (n == 2)
{ {

View file

@ -117,7 +117,7 @@ public:
uint32 size; uint32 size;
if (!s.isReading()) if (!s.isReading())
{ {
size = _SoundGroupAssoc.size(); size = (uint32)_SoundGroupAssoc.size();
} }
s.serial(size); s.serial(size);
@ -1021,7 +1021,7 @@ float CClusteredSound::getPolyNearestPos(const std::vector<CVector> &poly, const
CVector proj = plane.project(pos); CVector proj = plane.project(pos);
float minDist = FLT_MAX; float minDist = FLT_MAX;
bool projIn = true; bool projIn = true;
uint nbVertex = poly.size(); uint nbVertex = (uint)poly.size();
// loop throw all vertex // loop throw all vertex
for (uint j=0; j<nbVertex; ++j) for (uint j=0; j<nbVertex; ++j)

View file

@ -227,7 +227,7 @@ void CComplexSound::serial(NLMISC::IStream &s)
} }
else else
{ {
uint32 nb = _Sounds.size(); uint32 nb = (uint32)_Sounds.size();
s.serial(nb); s.serial(nb);
for (uint i=0; i<nb; ++i) for (uint i=0; i<nb; ++i)
{ {

View file

@ -532,7 +532,7 @@ uint CSoundDriverAL::countMaxSources()
// software allows 256 sources (software audio ftw!) // software allows 256 sources (software audio ftw!)
// cheap openal cards 32, expensive openal cards 128 // cheap openal cards 32, expensive openal cards 128
// trying to go too high is safely handled anyways // trying to go too high is safely handled anyways
return getMaxNumSourcesInternal() + _Sources.size(); return getMaxNumSourcesInternal() + (uint)_Sources.size();
} }
/// Return the maximum number of effects that can be created, which is only 1 in openal software mode :( /// Return the maximum number of effects that can be created, which is only 1 in openal software mode :(
@ -569,7 +569,7 @@ ALuint CSoundDriverAL::createItem(TGenFunctionAL algenfunc, TTestFunctionAL alte
index = nbalive; index = nbalive;
// FIXME assumption about inner workings of std::vector; // FIXME assumption about inner workings of std::vector;
// &(names[...]) only works with "names.size() - nbalive == 1" // &(names[...]) only works with "names.size() - nbalive == 1"
generateItems(algenfunc, altestfunc, names.size() - nbalive, &(names[nbalive])); generateItems(algenfunc, altestfunc, (uint)names.size() - nbalive, &(names[nbalive]));
} }
} }
@ -598,7 +598,7 @@ uint CSoundDriverAL::compactAliveNames( vector<ALuint>& names, TTestFunctionAL a
} }
} }
nlassert( ibcompacted <= names.end() ); nlassert( ibcompacted <= names.end() );
return ibcompacted - names.begin(); return (uint)(ibcompacted - names.begin());
} }

View file

@ -451,7 +451,7 @@ IBuffer* CSampleBank::getSample(const NLMISC::TStringId &name)
uint CSampleBank::countSamples() uint CSampleBank::countSamples()
{ {
return _Samples.size(); return (uint)_Samples.size();
} }
// ******************************************************** // ********************************************************

View file

@ -112,7 +112,7 @@ TSoundAnimId CSoundAnimManager::createAnimation(std::string& name)
nlassert(!name.empty()); nlassert(!name.empty());
// create and insert animations // create and insert animations
TSoundAnimId id = _Animations.size(); TSoundAnimId id = (TSoundAnimId)_Animations.size();
CSoundAnimation* anim = new CSoundAnimation(name, id); CSoundAnimation* anim = new CSoundAnimation(name, id);
_Animations.push_back(anim); _Animations.push_back(anim);

View file

@ -358,7 +358,7 @@ void CSoundBank::getNames( std::vector<NLMISC::TStringId> &names )
*/ */
uint CSoundBank::countSounds() uint CSoundBank::countSounds()
{ {
return _Sounds.size(); return (uint)_Sounds.size();
} }