mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-17 04:51:48 +00:00
Changed: #825 Remove all warning when compiling Ryzom on Linux
This commit is contained in:
parent
dfc84cec6a
commit
1a8000f3f6
64 changed files with 228 additions and 227 deletions
|
@ -226,7 +226,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions)
|
|||
map<string,BNPFile>::iterator it = tempMap.begin();
|
||||
while (it != tempMap.end())
|
||||
{
|
||||
nSize += it->first.size() + 1;
|
||||
nSize += (uint)it->first.size() + 1;
|
||||
nNb++;
|
||||
it++;
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions)
|
|||
bnp.Files[nNb].Size = it->second.Size;
|
||||
bnp.Files[nNb].Pos = it->second.Pos;
|
||||
|
||||
nSize += it->first.size() + 1;
|
||||
nSize += (uint)it->first.size() + 1;
|
||||
nNb++;
|
||||
it++;
|
||||
}
|
||||
|
|
|
@ -515,7 +515,7 @@ void CBitMemStream::serial(std::string &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
len = b.size();
|
||||
len = (uint32)b.size();
|
||||
if (len>1000000)
|
||||
throw NLMISC::EInvalidDataStream( "BMS: Trying to write a string of %u bytes", len );
|
||||
serial( len );
|
||||
|
@ -556,7 +556,7 @@ inline void CBitMemStream::serial(ucstring &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
len= b.size();
|
||||
len= (uint32)b.size();
|
||||
if (len>1000000)
|
||||
throw NLMISC::EInvalidDataStream( "BMS: Trying to write an ucstring of %u bytes", len );
|
||||
serial(len);
|
||||
|
@ -664,7 +664,7 @@ void CBitMemStream::serialCont(std::vector<bool> &cont)
|
|||
}
|
||||
else
|
||||
{
|
||||
len= cont.size();
|
||||
len= (sint32)cont.size();
|
||||
serial(len);
|
||||
|
||||
std::vector<bool>::iterator it= cont.begin();
|
||||
|
|
|
@ -132,7 +132,7 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f )
|
|||
// at this point, the image must be converted to an 24bit image RGB
|
||||
|
||||
// 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);
|
||||
|
||||
// allocates buffer to copy image data
|
||||
|
@ -326,7 +326,7 @@ bool CBitmap::writePNG( NLMISC::IStream &f, uint32 d)
|
|||
png_set_packing(png_ptr);
|
||||
|
||||
// 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);
|
||||
|
||||
// get channels number of bitmap
|
||||
|
|
|
@ -118,7 +118,7 @@ void CBufFIFO::push(const std::vector<uint8> &buffer1, const std::vector<uint8>
|
|||
TTicks before = CTime::getPerformanceTime();
|
||||
#endif
|
||||
|
||||
TFifoSize s = buffer1.size() + buffer2.size();
|
||||
TFifoSize s = (TFifoSize)(buffer1.size() + buffer2.size());
|
||||
|
||||
#if DEBUG_FIFO
|
||||
nldebug("%p push2(%d)", this, s);
|
||||
|
@ -421,16 +421,16 @@ uint32 CBufFIFO::size ()
|
|||
if (_Rewinder == NULL)
|
||||
return _BufferSize;
|
||||
else
|
||||
return _Rewinder - _Buffer;
|
||||
return (uint32)(_Rewinder - _Buffer);
|
||||
}
|
||||
else if (_Head > _Tail)
|
||||
{
|
||||
return _Head - _Tail;
|
||||
return (uint32)(_Head - _Tail);
|
||||
}
|
||||
else if (_Head < _Tail)
|
||||
{
|
||||
nlassert (_Rewinder != NULL);
|
||||
return (_Rewinder - _Tail) + (_Head - _Buffer);
|
||||
return (uint32)((_Rewinder - _Tail) + (_Head - _Buffer));
|
||||
}
|
||||
nlstop;
|
||||
return 0;
|
||||
|
@ -489,9 +489,9 @@ void CBufFIFO::resize (uint32 s)
|
|||
{
|
||||
nlassert (_Rewinder != NULL);
|
||||
|
||||
uint size1 = _Rewinder - _Tail;
|
||||
uint size1 = (uint)(_Rewinder - _Tail);
|
||||
CFastMem::memcpy (NewBuffer, _Tail, size1);
|
||||
uint size2 = _Head - _Buffer;
|
||||
uint size2 = (uint)(_Head - _Buffer);
|
||||
CFastMem::memcpy (NewBuffer + size1, _Buffer, size2);
|
||||
|
||||
nlassert (size1+size2==UsedSize);
|
||||
|
@ -582,7 +582,7 @@ void CBufFIFO::display ()
|
|||
{
|
||||
if (strlen(str) < 1023)
|
||||
{
|
||||
uint32 p = strlen(str);
|
||||
uint32 p = (uint32)strlen(str);
|
||||
if (isprint(*pos))
|
||||
str[p] = *pos;
|
||||
else
|
||||
|
|
|
@ -128,7 +128,7 @@ string stringFromVector( const vector<uint8>& v, bool limited )
|
|||
|
||||
if (!v.empty())
|
||||
{
|
||||
int size = v.size ();
|
||||
int size = (int)v.size ();
|
||||
if (limited && size > 1000)
|
||||
{
|
||||
string middle = "...<buf too big,skip middle part>...";
|
||||
|
|
|
@ -56,13 +56,13 @@ int CConfigFile::CVar::asInt (int index) const
|
|||
switch (Type)
|
||||
{
|
||||
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());
|
||||
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];
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
@ -73,13 +73,13 @@ double CConfigFile::CVar::asDouble (int index) const
|
|||
switch (Type)
|
||||
{
|
||||
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];
|
||||
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());
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
@ -95,13 +95,13 @@ std::string CConfigFile::CVar::asString (int index) const
|
|||
switch (Type)
|
||||
{
|
||||
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]);
|
||||
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]);
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ bool CConfigFile::CVar::asBool (int index) const
|
|||
switch (Type)
|
||||
{
|
||||
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")
|
||||
{
|
||||
return true;
|
||||
|
@ -121,7 +121,7 @@ bool CConfigFile::CVar::asBool (int index) const
|
|||
return false;
|
||||
}
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
|
@ -131,7 +131,7 @@ bool CConfigFile::CVar::asBool (int index) const
|
|||
return false;
|
||||
}
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
|
@ -146,7 +146,7 @@ bool CConfigFile::CVar::asBool (int index) const
|
|||
void CConfigFile::CVar::setAsInt (int val, int index)
|
||||
{
|
||||
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 IntValues[index] = val;
|
||||
Root = false;
|
||||
|
@ -155,7 +155,7 @@ void CConfigFile::CVar::setAsInt (int val, int index)
|
|||
void CConfigFile::CVar::setAsDouble (double val, int index)
|
||||
{
|
||||
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 RealValues[index] = val;
|
||||
Root = false;
|
||||
|
@ -169,7 +169,7 @@ void CConfigFile::CVar::setAsFloat (float val, int index)
|
|||
void CConfigFile::CVar::setAsString (const std::string &val, int index)
|
||||
{
|
||||
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 StrValues[index] = val;
|
||||
Root = false;
|
||||
|
@ -277,9 +277,9 @@ uint CConfigFile::CVar::size () const
|
|||
{
|
||||
switch (Type)
|
||||
{
|
||||
case T_INT: return IntValues.size ();
|
||||
case T_REAL: return RealValues.size ();
|
||||
case T_STRING: return StrValues.size ();
|
||||
case T_INT: return (uint)IntValues.size ();
|
||||
case T_REAL: return (uint)RealValues.size ();
|
||||
case T_STRING: return (uint)StrValues.size ();
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ bool CConfigFile::loaded()
|
|||
|
||||
uint32 CConfigFile::getVarCount()
|
||||
{
|
||||
return _Vars.size();
|
||||
return (uint32)_Vars.size();
|
||||
}
|
||||
|
||||
|
||||
|
@ -396,7 +396,7 @@ void CConfigFile::reparse (bool lookupPaths)
|
|||
string utf8 = content.toUtf8();
|
||||
|
||||
CMemStream stream;
|
||||
stream.serialBuffer((uint8*)(utf8.data()), utf8.size());
|
||||
stream.serialBuffer((uint8*)(utf8.data()), (uint)utf8.size());
|
||||
cf_ifile = stream;
|
||||
if (!cf_ifile.isReading())
|
||||
{
|
||||
|
@ -856,7 +856,7 @@ void CConfigFile::clearVars ()
|
|||
|
||||
uint CConfigFile::getNumVar () const
|
||||
{
|
||||
return _Vars.size ();
|
||||
return (uint)_Vars.size ();
|
||||
}
|
||||
|
||||
CConfigFile::CVar *CConfigFile::getVar (uint varId)
|
||||
|
|
|
@ -449,7 +449,7 @@ public:
|
|||
{
|
||||
string shortExc, longExc, subject;
|
||||
string addr, ext;
|
||||
sint skipNFirst = 0;
|
||||
ULONG_PTR skipNFirst = 0;
|
||||
_Reason = "";
|
||||
|
||||
if (m_pexp == NULL)
|
||||
|
@ -555,7 +555,7 @@ public:
|
|||
}
|
||||
|
||||
// display the callstack
|
||||
void addStackAndLogToReason (sint /* skipNFirst */ = 0)
|
||||
void addStackAndLogToReason (ULONG_PTR /* skipNFirst */ = 0)
|
||||
{
|
||||
#ifdef NL_OS_WINDOWS
|
||||
// ace hack
|
||||
|
|
|
@ -366,7 +366,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi)
|
|||
if (_Buttons.size() < MaxNumButtons)
|
||||
{
|
||||
_Buttons.push_back(CButton());
|
||||
uint buttonIndex = _Buttons.size() - 1;
|
||||
uint buttonIndex = (uint)_Buttons.size() - 1;
|
||||
char defaultButtonName[32];
|
||||
smprintf(defaultButtonName, 32, "BUTTON %d", buttonIndex + 1);
|
||||
BuildCtrlName(lpddoi, _Buttons[buttonIndex].Name, defaultButtonName);
|
||||
|
@ -382,7 +382,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi)
|
|||
if (_Sliders.size() < MaxNumSliders)
|
||||
{
|
||||
_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);
|
||||
char defaultSliderName[32];
|
||||
smprintf(defaultSliderName, 32, "SLIDER %d", sliderIndex + 1);
|
||||
|
@ -400,7 +400,7 @@ BOOL CDIGameDevice::processEnumObject(LPCDIDEVICEOBJECTINSTANCE lpddoi)
|
|||
if (_POVs.size() < MaxNumPOVs)
|
||||
{
|
||||
_POVs.push_back(CPOV());
|
||||
uint povIndex = _POVs.size() - 1;
|
||||
uint povIndex = (uint)_POVs.size() - 1;
|
||||
char defaultPOVName[16];
|
||||
smprintf(defaultPOVName, 16, "POV %d", povIndex + 1);
|
||||
BuildCtrlName(lpddoi, _POVs[povIndex].Name, defaultPOVName);
|
||||
|
@ -435,7 +435,7 @@ uint CDIGameDevice::getBufferSize() 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
|
||||
{
|
||||
return _Sliders.size();
|
||||
return (uint)_Sliders.size();
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
uint CDIGameDevice::getNumPOV() const
|
||||
{
|
||||
return _POVs.size();
|
||||
return (uint)_POVs.size();
|
||||
}
|
||||
//============================================================================
|
||||
const char *CDIGameDevice::getButtonName(uint index) const
|
||||
|
|
|
@ -721,7 +721,7 @@ bool readExcelSheet(const ucstring &str, TWorksheet &worksheet, bool checkUnique
|
|||
|
||||
// enlarge Worksheet row size, as needed
|
||||
uint startLine= worksheet.size();
|
||||
worksheet.resize(startLine + lines.size());
|
||||
worksheet.resize(startLine + (uint)lines.size());
|
||||
|
||||
|
||||
// **** fill worksheet
|
||||
|
@ -850,7 +850,7 @@ void makeHashCode(TWorksheet &sheet, bool forceRehash)
|
|||
}
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
approxSize+= worksheet.Data[i][j].size() + 1;
|
||||
approxSize+= (uint)worksheet.Data[i][j].size() + 1;
|
||||
}
|
||||
approxSize++;
|
||||
}
|
||||
|
|
|
@ -449,7 +449,7 @@ CEvalNumExpr::TReturnState CEvalNumExpr::getNextToken (TToken &token)
|
|||
return MustBeDoubleQuote;
|
||||
|
||||
// This is a user string, copy the string
|
||||
uint size = _ExprPtr - start;
|
||||
uint size = (uint)(_ExprPtr - start);
|
||||
if (size >= (InternalStringLen-1))
|
||||
{
|
||||
_InternalStlString.resize (size);
|
||||
|
@ -496,7 +496,7 @@ CEvalNumExpr::TReturnState CEvalNumExpr::getNextToken (TToken &token)
|
|||
}
|
||||
|
||||
// This is a user string, copy the string
|
||||
uint size = _ExprPtr - start;
|
||||
uint size = (uint)(_ExprPtr - start);
|
||||
if (size >= (InternalStringLen-1))
|
||||
{
|
||||
_InternalStlString.resize (size);
|
||||
|
@ -590,14 +590,14 @@ CEvalNumExpr::TReturnState CEvalNumExpr::evalExpression (const char *expression,
|
|||
else
|
||||
{
|
||||
if (errorIndex)
|
||||
*errorIndex = _ExprPtr - expression;
|
||||
*errorIndex = (int)(_ExprPtr - expression);
|
||||
return MustBeEnd;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (errorIndex)
|
||||
*errorIndex = _ExprPtr - expression;
|
||||
*errorIndex = (int)(_ExprPtr - expression);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ void CIFile::loadIntoCache()
|
|||
if(!_IsAsyncLoading)
|
||||
{
|
||||
_ReadingFromFile += _FileSize;
|
||||
int read = fread (_Cache, _FileSize, 1, _F);
|
||||
int read = (int)fread (_Cache, _FileSize, 1, _F);
|
||||
_FileRead++;
|
||||
_ReadingFromFile -= _FileSize;
|
||||
_ReadFromFile += read * _FileSize;
|
||||
|
@ -113,7 +113,7 @@ void CIFile::loadIntoCache()
|
|||
sint n= READPACKETSIZE-_NbBytesLoaded;
|
||||
n= max(n, 1);
|
||||
_ReadingFromFile += n;
|
||||
int read = fread (_Cache+index, n, 1, _F);
|
||||
int read = (int)fread (_Cache+index, n, 1, _F);
|
||||
_FileRead++;
|
||||
_ReadingFromFile -= n;
|
||||
_ReadFromFile += read * n;
|
||||
|
@ -126,7 +126,7 @@ void CIFile::loadIntoCache()
|
|||
{
|
||||
uint n= _FileSize-index;
|
||||
_ReadingFromFile += n;
|
||||
int read = fread (_Cache+index, n, 1, _F);
|
||||
int read = (int)fread (_Cache+index, n, 1, _F);
|
||||
_FileRead++;
|
||||
_ReadingFromFile -= n;
|
||||
_ReadFromFile += read * n;
|
||||
|
@ -428,7 +428,7 @@ void CIFile::serialBuffer(uint8 *buf, uint len) throw(EReadError)
|
|||
{
|
||||
int read;
|
||||
_ReadingFromFile += len;
|
||||
read=fread(buf, len, 1, _F);
|
||||
read=(int)fread(buf, len, 1, _F);
|
||||
_FileRead++;
|
||||
_ReadingFromFile -= len;
|
||||
_ReadFromFile += /*read **/ len;
|
||||
|
@ -771,7 +771,7 @@ NLMISC_CATEGORISED_COMMAND(nel, iFileAccessLogDisplay, "Display file access logs
|
|||
uint32 count=0;
|
||||
while (it!=itEnd)
|
||||
{
|
||||
uint32 numTimes= it->second.size();
|
||||
uint32 numTimes= (uint32)it->second.size();
|
||||
CSString fileName= it->first;
|
||||
if (fileName.contains("@"))
|
||||
{
|
||||
|
|
|
@ -323,7 +323,7 @@ void CHTimer::display(CLog *log, TSortCriterion criterion, bool displayInline /*
|
|||
{
|
||||
statsPtr[k] = &stats[k];
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -521,7 +521,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool
|
|||
TNodeVect &execNodes = nodeMap[currTimer];
|
||||
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);
|
||||
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.
|
||||
resultName.resize(labelNumChar);
|
||||
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);
|
||||
if ((sint) (endIndex - startIndex) >= 1)
|
||||
{
|
||||
|
@ -759,7 +759,7 @@ void CHTimer::displayByExecutionPath(CLog *log, TSortCriterion criterion, bool
|
|||
// build the indented node name.
|
||||
resultName.resize(labelNumChar);
|
||||
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);
|
||||
if ((sint) (endIndex - startIndex) >= 1)
|
||||
{
|
||||
|
@ -849,7 +849,7 @@ void CHTimer::CStats::buildFromNodes(CNode **nodes, uint numNodes, double msPerT
|
|||
uint numMeasures = 0;
|
||||
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)
|
||||
{
|
||||
varianceSum += NLMISC::sqr(nodes[k]->Measures[l] - MeanTime);
|
||||
|
|
|
@ -481,18 +481,18 @@ void CI18N::_readTextFile(const string &filename,
|
|||
string text;
|
||||
text.resize(file.getFileSize());
|
||||
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
|
||||
if (!text.empty())
|
||||
readTextBuffer((uint8*)&text[0], text.size(), result, forceUtf8);
|
||||
readTextBuffer((uint8*)&text[0], (uint)text.size(), result, forceUtf8);
|
||||
|
||||
if (preprocess)
|
||||
{
|
||||
// a string to old the result of the preprocess
|
||||
ucstring final;
|
||||
// make rooms to reduce allocation cost
|
||||
final.reserve(raiseToNextPowerOf2(result.size()));
|
||||
final.reserve(raiseToNextPowerOf2((uint)result.size()));
|
||||
|
||||
// parse the file, looking for preprocessor command.
|
||||
ucstring::const_iterator it(result.begin()), end(result.end());
|
||||
|
|
|
@ -304,7 +304,7 @@ void CIXml::serialSeparatedBufferIn ( string &value, bool checkSeparator )
|
|||
else
|
||||
{
|
||||
// Content length
|
||||
uint length = _ContentString.length();
|
||||
uint length = (uint)_ContentString.length();
|
||||
|
||||
// String empty ?
|
||||
if (length==0)
|
||||
|
@ -352,7 +352,7 @@ void CIXml::serialSeparatedBufferIn ( string &value, bool checkSeparator )
|
|||
_ContentStringIndex = 0;
|
||||
|
||||
// New length
|
||||
length = _ContentString.length();
|
||||
length = (uint)_ContentString.length();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -501,7 +501,7 @@ namespace NLMISC
|
|||
dest.clear();
|
||||
}
|
||||
std::vector<uint8> &msgIn = _InMessageQueue.front().Msg;
|
||||
dest.serialBuffer(&(msgIn[0]), msgIn.size());
|
||||
dest.serialBuffer(&(msgIn[0]), (uint)msgIn.size());
|
||||
_InMessageQueue.pop_front();
|
||||
// make dest a read stream
|
||||
dest.invert();
|
||||
|
@ -519,13 +519,13 @@ namespace NLMISC
|
|||
uint CInterWindowMsgQueue::getSendQueueSize() const
|
||||
{
|
||||
CSynchronized<TMsgList>::CAccessor outMessageQueue(&const_cast<CSynchronized<TMsgList> &>(_OutMessageQueue));
|
||||
return outMessageQueue.value().size();
|
||||
return (uint)outMessageQueue.value().size();
|
||||
}
|
||||
|
||||
//**************************************************************************************************
|
||||
uint CInterWindowMsgQueue::getReceiveQueueSize() const
|
||||
{
|
||||
return _InMessageQueue.size();
|
||||
return (uint)_InMessageQueue.size();
|
||||
}
|
||||
|
||||
} // NLMISC
|
||||
|
|
|
@ -300,7 +300,7 @@ void CNoiseValue::serial(IStream &f)
|
|||
void CNoiseColorGradient::eval(const CVector &posInWorld, CRGBAF &result) const
|
||||
{
|
||||
// test if not null grads.
|
||||
uint nGrads= Gradients.size();
|
||||
uint nGrads= (uint)Gradients.size();
|
||||
if(nGrads==0)
|
||||
return;
|
||||
// if only one color, easy
|
||||
|
|
|
@ -91,7 +91,7 @@ inline void COXml::flushContentString ()
|
|||
nlassert (_CurrentNode);
|
||||
|
||||
// String size
|
||||
uint size=_ContentString.length();
|
||||
uint size=(uint)_ContentString.length();
|
||||
|
||||
// Some content to write ?
|
||||
if (size)
|
||||
|
@ -226,7 +226,7 @@ void COXml::serialSeparatedBufferOut( const char *value )
|
|||
else
|
||||
{
|
||||
// Get the content buffer size
|
||||
uint size=_ContentString.length();
|
||||
uint size=(uint)_ContentString.length();
|
||||
|
||||
// Add a separator
|
||||
if ((size) && (_ContentString[size-1]!='\n'))
|
||||
|
|
|
@ -104,7 +104,7 @@ void CPolygon::clip(const std::vector<CPlane> &planes)
|
|||
{
|
||||
if(planes.size()==0)
|
||||
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);
|
||||
uint i, j, k;
|
||||
float bestArea = 0.f;
|
||||
const uint numVerts = Vertices.size();
|
||||
const uint numVerts = (uint)Vertices.size();
|
||||
for (i = 0; i < numVerts; ++i)
|
||||
{
|
||||
for (j = 0; j < numVerts; ++j)
|
||||
|
@ -402,7 +402,7 @@ bool CPolygon::toConvexPolygonsInCone (const std::vector<CVector> &vertex, uint
|
|||
a0=0;
|
||||
uint a1;
|
||||
if (a==0)
|
||||
a1=vertex.size()-1;
|
||||
a1= (uint)vertex.size()-1;
|
||||
else
|
||||
a1= a-1;
|
||||
|
||||
|
@ -442,7 +442,7 @@ void CPolygon::toConvexPolygonsLocalAndBSP (std::vector<CVector> &localVertices,
|
|||
invert.invert ();
|
||||
|
||||
// Insert vertices in an ordered table
|
||||
uint vertexCount = Vertices.size();
|
||||
uint vertexCount = (uint)Vertices.size();
|
||||
TCConcavePolygonsVertexMap vertexMap;
|
||||
localVertices.resize (vertexCount);
|
||||
uint i, j;
|
||||
|
@ -456,7 +456,7 @@ void CPolygon::toConvexPolygonsLocalAndBSP (std::vector<CVector> &localVertices,
|
|||
|
||||
// Plane direction
|
||||
i=0;
|
||||
j=Vertices.size()-1;
|
||||
j=(uint)Vertices.size()-1;
|
||||
CVector normal = localVertices[i] - localVertices[j];
|
||||
normal = normal ^ CVector::K;
|
||||
CPlane clipPlane;
|
||||
|
@ -699,11 +699,11 @@ bool CPolygon::chain (const std::vector<CPolygon> &other, const CMatrix& basis)
|
|||
}
|
||||
|
||||
// Look for a couple..
|
||||
uint thisCount = Vertices.size();
|
||||
uint thisCount = (uint)Vertices.size();
|
||||
uint i, j;
|
||||
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
|
||||
for (i=0; i<thisCount; i++)
|
||||
|
@ -758,7 +758,7 @@ bool CPolygon::chain (const std::vector<CPolygon> &other, const CMatrix& basis)
|
|||
uint 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 (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*/)
|
||||
{
|
||||
uint size = src.Vertices.size();
|
||||
uint size = (uint)src.Vertices.size();
|
||||
Vertices.resize(size);
|
||||
for (uint k = 0; k < size; ++k)
|
||||
{
|
||||
|
@ -852,7 +852,7 @@ bool CPolygon2D::isConvex()
|
|||
bool Front = true, Back = false;
|
||||
// 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
|
||||
uint numVerts = Vertices.size();
|
||||
uint numVerts = (uint)Vertices.size();
|
||||
if (numVerts < 3) return true;
|
||||
CVector segStart, segEnd;
|
||||
CPlane clipPlane;
|
||||
|
@ -895,7 +895,7 @@ void CPolygon2D::buildConvexHull(CPolygon2D &dest) const
|
|||
return;
|
||||
}
|
||||
uint k, l;
|
||||
uint numVerts = Vertices.size();
|
||||
uint numVerts = (uint)Vertices.size();
|
||||
CVector2f p, curr, prev;
|
||||
uint pIndex, p1Index, p2Index, pCurr, pPrev;
|
||||
// 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);
|
||||
uint i, j, k;
|
||||
float bestArea = 0.f;
|
||||
const uint numVerts = Vertices.size();
|
||||
const uint numVerts = (uint)Vertices.size();
|
||||
for (i = 0; i < numVerts; ++i)
|
||||
{
|
||||
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();
|
||||
if ( norm2 > bestLength)
|
||||
{
|
||||
index = Vertices.size() - 1;
|
||||
index = (uint)Vertices.size() - 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2084,7 +2084,7 @@ bool CPolygon2D::contains(const CVector2f &p, bool hintIsConvex /*= true*/) con
|
|||
{
|
||||
if (hintIsConvex)
|
||||
{
|
||||
uint numVerts = Vertices.size();
|
||||
uint numVerts = (uint)Vertices.size();
|
||||
nlassert(numVerts >= 0.f);
|
||||
for (uint k = 0; k < numVerts; ++k)
|
||||
{
|
||||
|
@ -2163,7 +2163,7 @@ void CPolygon2D::getBoundingRect(CVector2f &minCorner, CVector2f &maxCorner) con
|
|||
{
|
||||
nlassert(!Vertices.empty());
|
||||
minCorner = maxCorner = Vertices[0];
|
||||
uint numVertices = Vertices.size();
|
||||
uint numVertices = (uint)Vertices.size();
|
||||
for(uint k = 0; k < numVertices; ++k)
|
||||
{
|
||||
minCorner.minof(minCorner, Vertices[k]);
|
||||
|
@ -2224,7 +2224,7 @@ static inline bool testSegmentIntersection(const CVector2f &a, const CVector2f &
|
|||
bool CPolygon2D::selfIntersect() const
|
||||
{
|
||||
if (Vertices.size() < 3) return false;
|
||||
uint numEdges = Vertices.size();
|
||||
uint numEdges = (uint)Vertices.size();
|
||||
for(uint k = 0; k < numEdges; ++k)
|
||||
{
|
||||
// test intersection with all other edges that don't share a vertex with this one
|
||||
|
|
|
@ -173,7 +173,7 @@ void CSheetId::loadSheetId ()
|
|||
if (_RemoveUnknownSheet)
|
||||
{
|
||||
uint32 removednbfiles = 0;
|
||||
uint32 nbfiles = tempMap.size();
|
||||
uint32 nbfiles = (uint32)tempMap.size();
|
||||
|
||||
// now we remove all files that not available
|
||||
map<uint32,string>::iterator itStr2;
|
||||
|
@ -204,7 +204,7 @@ void CSheetId::loadSheetId ()
|
|||
map<uint32,string>::const_iterator it = tempMap.begin();
|
||||
while (it != tempMap.end())
|
||||
{
|
||||
nSize += it->second.size()+1;
|
||||
nSize += (uint32)it->second.size()+1;
|
||||
nNb++;
|
||||
it++;
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ void CSheetId::loadSheetId ()
|
|||
tempVec[nNb].Ptr = _AllStrings.Ptr+nSize;
|
||||
strcpy(_AllStrings.Ptr+nSize, it->second.c_str());
|
||||
toLower(_AllStrings.Ptr+nSize);
|
||||
nSize += it->second.size()+1;
|
||||
nSize += (uint32)it->second.size()+1;
|
||||
nNb++;
|
||||
it++;
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ void CSheetId::loadSheetId ()
|
|||
|
||||
// Build the invert map (Name to Id) & file extension vector
|
||||
{
|
||||
uint32 nSize = _SheetIdToName.size();
|
||||
uint32 nSize = (uint32)_SheetIdToName.size();
|
||||
_SheetNameToId.reserve(nSize);
|
||||
CStaticMap<uint32,CChar>::iterator itStr;
|
||||
for( itStr = _SheetIdToName.begin(); itStr != _SheetIdToName.end(); ++itStr )
|
||||
|
|
|
@ -199,7 +199,7 @@ namespace NLMISC
|
|||
}
|
||||
|
||||
// scan the string for binary characters
|
||||
uint32 i=size();
|
||||
uint32 i=(uint32)size();
|
||||
// while (i && !tbl[i-1])
|
||||
// {
|
||||
// i--;
|
||||
|
@ -228,14 +228,14 @@ namespace NLMISC
|
|||
return false;
|
||||
|
||||
// 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]!=' ')
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// iterate from size-1 to 0
|
||||
for (uint32 i=size(); i--;)
|
||||
for (uint32 i=(uint32)size(); i--;)
|
||||
if (!isValidFileNameChar((*this)[i]))
|
||||
return false;
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ namespace NLMISC
|
|||
return false;
|
||||
|
||||
// iterate from size-1 to 1
|
||||
for (uint32 i=size(); --i;)
|
||||
for (uint32 i=(uint32)size(); --i;)
|
||||
if (!isValidKeywordChar((*this)[i]))
|
||||
return false;
|
||||
|
||||
|
@ -492,9 +492,9 @@ namespace NLMISC
|
|||
CSString s=strip();
|
||||
while(!s.empty())
|
||||
{
|
||||
uint32 pre=s.size();
|
||||
uint32 pre=(uint32)s.size();
|
||||
result.push_back(s.firstWord(true));
|
||||
uint32 post=s.size();
|
||||
uint32 post=(uint32)s.size();
|
||||
if (post>=pre)
|
||||
return false;
|
||||
}
|
||||
|
@ -506,9 +506,9 @@ namespace NLMISC
|
|||
CSString s=*this;
|
||||
while(!s.empty())
|
||||
{
|
||||
uint32 pre=s.size();
|
||||
uint32 pre=(uint32)s.size();
|
||||
result.push_back(s.firstWordOrWords(true,useSlashStringEscape,useRepeatQuoteStringEscape));
|
||||
uint32 post=s.size();
|
||||
uint32 post=(uint32)s.size();
|
||||
if (post>=pre)
|
||||
return false;
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ namespace NLMISC
|
|||
s=s.replace("\r","");
|
||||
|
||||
uint32 it=0;
|
||||
uint32 len= s.size();
|
||||
uint32 len= (uint32)s.size();
|
||||
while(it<len)
|
||||
{
|
||||
// extract the text up to the next '\n'character
|
||||
|
@ -545,12 +545,12 @@ namespace NLMISC
|
|||
CSString s=*this;
|
||||
while(!s.empty())
|
||||
{
|
||||
uint32 pre=s.size();
|
||||
uint32 pre=(uint32)s.size();
|
||||
result.push_back(s.splitToSeparator(separator,true,useAngleBrace,useSlashStringEscape,
|
||||
useRepeatQuoteStringEscape,true));
|
||||
if (skipBlankEntries && result.back().empty())
|
||||
result.pop_back();
|
||||
uint32 post=s.size();
|
||||
uint32 post=(uint32)s.size();
|
||||
if (post>=pre)
|
||||
return false;
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ namespace NLMISC
|
|||
|
||||
while(!s.empty())
|
||||
{
|
||||
uint32 pre=s.size();
|
||||
uint32 pre=(uint32)s.size();
|
||||
result.push_back(s.splitToOneOfSeparators( separators,true,useAngleBrace,useSlashStringEscape,
|
||||
useRepeatQuoteStringEscape,!retainSeparators ));
|
||||
|
||||
|
@ -589,7 +589,7 @@ namespace NLMISC
|
|||
}
|
||||
}
|
||||
|
||||
uint32 post=s.size();
|
||||
uint32 post=(uint32)s.size();
|
||||
if (post>=pre)
|
||||
return false;
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ namespace NLMISC
|
|||
{
|
||||
CSString result;
|
||||
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) {}
|
||||
result=substr(i,j-i+1);
|
||||
return result;
|
||||
|
@ -639,7 +639,7 @@ namespace NLMISC
|
|||
CSString CSString::leftStrip() const
|
||||
{
|
||||
CSString result;
|
||||
int i,j=size()-1;
|
||||
int i,j=(int)size()-1;
|
||||
for (i=0; i<j && isWhiteSpace((*this)[i]); ++i) {}
|
||||
result=substr(i,j-i+1);
|
||||
return result;
|
||||
|
@ -649,7 +649,7 @@ namespace NLMISC
|
|||
{
|
||||
CSString result;
|
||||
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);
|
||||
return result;
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ namespace NLMISC
|
|||
}
|
||||
else if ((*this)[0]=='\"' && isDelimitedMonoBlock(false,useSlashStringEscape,useRepeatQuoteStringEscape))
|
||||
{
|
||||
i=size();
|
||||
i=(uint32)size();
|
||||
}
|
||||
if (i!=size())
|
||||
return quote(useSlashStringEscape,useRepeatQuoteStringEscape);
|
||||
|
@ -1227,7 +1227,7 @@ namespace NLMISC
|
|||
{
|
||||
bool foundToken= false;
|
||||
|
||||
for (uint32 i=size();i--;)
|
||||
for (uint32 i=(uint32)size();i--;)
|
||||
{
|
||||
switch((*this)[i])
|
||||
{
|
||||
|
@ -1277,7 +1277,7 @@ namespace NLMISC
|
|||
|
||||
bool CSString::isXMLCompatible(bool isParameter) const
|
||||
{
|
||||
for (uint32 i=size();i--;)
|
||||
for (uint32 i=(uint32)size();i--;)
|
||||
{
|
||||
switch((*this)[i])
|
||||
{
|
||||
|
@ -1749,7 +1749,7 @@ namespace NLMISC
|
|||
return false;
|
||||
}
|
||||
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);
|
||||
if (bytesRead!=size())
|
||||
{
|
||||
|
@ -1769,7 +1769,7 @@ namespace NLMISC
|
|||
nlwarning("Failed to open file for writing: %s",fileName.c_str());
|
||||
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);
|
||||
if (recordsWritten!=1)
|
||||
{
|
||||
|
|
|
@ -342,7 +342,7 @@ void IStream::serialCont(vector<uint8> &cont)
|
|||
}
|
||||
else
|
||||
{
|
||||
len= cont.size();
|
||||
len= (sint32)cont.size();
|
||||
serial(len);
|
||||
if (len != 0)
|
||||
serialBuffer( (uint8*)&(*cont.begin()) , len);
|
||||
|
@ -366,7 +366,7 @@ void IStream::serialCont(vector<sint8> &cont)
|
|||
}
|
||||
else
|
||||
{
|
||||
len= cont.size();
|
||||
len= (sint32)cont.size();
|
||||
serial(len);
|
||||
if (len != 0)
|
||||
serialBuffer( (uint8*)&(*cont.begin()) , len);
|
||||
|
@ -403,7 +403,7 @@ void IStream::serialCont(vector<bool> &cont)
|
|||
}
|
||||
else
|
||||
{
|
||||
len= cont.size();
|
||||
len= (sint32)cont.size();
|
||||
serial(len);
|
||||
|
||||
if (len != 0)
|
||||
|
|
|
@ -155,7 +155,7 @@ void CStaticStringMapper::memoryCompress()
|
|||
uint32 nNbStrings = 0;
|
||||
while (it != _TempIdTable.end())
|
||||
{
|
||||
nTotalSize += it->second.size() + 1;
|
||||
nTotalSize += (uint)it->second.size() + 1;
|
||||
nNbStrings++;
|
||||
it++;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ void CStaticStringMapper::memoryCompress()
|
|||
{
|
||||
strcpy(_AllStrings + nTotalSize, it->second.c_str());
|
||||
_IdToStr[nNbStrings] = _AllStrings + nTotalSize;
|
||||
nTotalSize += it->second.size() + 1;
|
||||
nTotalSize += (uint)it->second.size() + 1;
|
||||
nNbStrings++;
|
||||
it++;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ bool CTaskManager::deleteTask(IRunnable *r)
|
|||
uint CTaskManager::taskListSize(void)
|
||||
{
|
||||
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()
|
||||
{
|
||||
CUnfairSynchronized<list<CWaitingTask> >::CAccessor acces(&_TaskQueue);
|
||||
return acces.value().size();
|
||||
return (uint)acces.value().size();
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -1907,8 +1907,8 @@ ucstring toLower (const ucstring &str)
|
|||
{
|
||||
uint i;
|
||||
ucstring temp = str;
|
||||
const uint size = temp.size();
|
||||
for (i=0; i<size; i++)
|
||||
const uint size = (uint)temp.size();
|
||||
for (i=0; i<(uint)size; i++)
|
||||
{
|
||||
// Search the key in the table
|
||||
ucchar *result = toLowerUpperSearch (&(temp[i]), UnicodeUpperToLower);
|
||||
|
@ -1949,7 +1949,7 @@ ucstring toUpper (const ucstring &str)
|
|||
{
|
||||
uint i;
|
||||
ucstring temp = str;
|
||||
const uint size = temp.size();
|
||||
const uint size = (uint)temp.size();
|
||||
for (i=0; i<size; i++)
|
||||
{
|
||||
// Search the key in the table
|
||||
|
|
|
@ -89,7 +89,7 @@ uint CWindowDisplayer::createLabel (const char *value)
|
|||
{
|
||||
CSynchronized<std::vector<CLabelEntry> >::CAccessor access (&_Labels);
|
||||
access.value().push_back (CLabelEntry(value));
|
||||
pos = access.value().size()-1;
|
||||
pos = (int)access.value().size()-1;
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
|
|
@ -179,8 +179,8 @@ namespace NLMISC
|
|||
|
||||
// ok, the file is parsed, store it
|
||||
fileInfo.FileName = CStringMapper::map(subFileName);
|
||||
fileInfo.FileOffset = beginOfFile - buffer.begin();
|
||||
fileInfo.FileSize = endOfFile - beginOfFile;
|
||||
fileInfo.FileOffset = (uint32)(beginOfFile - buffer.begin());
|
||||
fileInfo.FileSize = (uint32)(endOfFile - beginOfFile);
|
||||
// fileInfo.FileHandler = fopen(xmlPackFileName.c_str(), "rb");
|
||||
packInfo._XMLFiles.insert(make_pair(fileInfo.FileName, fileInfo));
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ void CCallbackNetBase::addCallbackArray (const TCallbackItem *callbackarray, sin
|
|||
}
|
||||
|
||||
// resize the array
|
||||
sint oldsize = _CallbackArray.size();
|
||||
sint oldsize = (sint)_CallbackArray.size();
|
||||
|
||||
_CallbackArray.resize (oldsize + arraysize);
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
string buffer = command + "\r\n";
|
||||
uint32 size = buffer.size();
|
||||
uint32 size = (uint32)buffer.size();
|
||||
if(!command.empty())
|
||||
{
|
||||
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);
|
||||
}
|
||||
/* Encode the buffer we just read in */
|
||||
uuencode(src_buf, dst_buf, size);
|
||||
uuencode(src_buf, dst_buf, (int)size);
|
||||
|
||||
formatedBody += dst_buf;
|
||||
formatedBody += "\r\n";
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
#include "stdnet.h"
|
||||
|
||||
#include "nel/net/listen_sock.h"
|
||||
#include "nel/net/net_log.h"
|
||||
#include "nel/net/net_log.h"
|
||||
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
|
||||
|
@ -122,8 +123,8 @@ CTcpSock *CListenSock::accept()
|
|||
{
|
||||
// Accept connection
|
||||
sockaddr_in saddr;
|
||||
socklen_t saddrlen = sizeof(saddr);
|
||||
SOCKET newsock = ::accept( _Sock, (sockaddr*)&saddr, &saddrlen );
|
||||
socklen_t saddrlen = (socklen_t)sizeof(saddr);
|
||||
SOCKET newsock = (SOCKET)::accept( _Sock, (sockaddr*)&saddr, &saddrlen );
|
||||
if ( newsock == INVALID_SOCKET )
|
||||
{
|
||||
if (_Sock == INVALID_SOCKET)
|
||||
|
|
|
@ -170,7 +170,7 @@ void cbWSChooseShard (CMessage &msgin, const std::string &/* serviceName */, TSe
|
|||
msgout.serial (reason);
|
||||
msgout.serial (cookie);
|
||||
msgout.serial (ListenAddr);
|
||||
uint32 nbPending = PendingUsers.size();
|
||||
uint32 nbPending = (uint32)PendingUsers.size();
|
||||
msgout.serial (nbPending);
|
||||
CUnifiedNetwork::getInstance()->send ("WS", msgout);
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ void CLoginServer::setListenAddress(const string &la)
|
|||
|
||||
uint32 CLoginServer::getNbPendingUsers()
|
||||
{
|
||||
return PendingUsers.size();
|
||||
return (uint32)PendingUsers.size();
|
||||
}
|
||||
|
||||
void cfcbListenAddress (CConfigFile::CVar &var)
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace NLNET
|
|||
|
||||
|
||||
|
||||
uint first = 0, last = copy.SubParams.size();
|
||||
uint first = 0, last = (uint)copy.SubParams.size();
|
||||
SubParams.resize( last );
|
||||
for (; first != last; ++first)
|
||||
{
|
||||
|
|
|
@ -540,12 +540,12 @@ namespace NLNET
|
|||
|
||||
virtual uint32 getTransportCount() const
|
||||
{
|
||||
return _Transports.size();
|
||||
return (uint32)_Transports.size();
|
||||
}
|
||||
|
||||
virtual uint32 getRouteCount() const
|
||||
{
|
||||
return _Routes.size();
|
||||
return (uint32)_Routes.size();
|
||||
}
|
||||
|
||||
virtual uint32 getReceivedPingCount() const
|
||||
|
@ -1279,7 +1279,7 @@ namespace NLNET
|
|||
|
||||
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.
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace NLNET
|
|||
|
||||
virtual uint32 getRouteCount() const
|
||||
{
|
||||
return _Routes.size();
|
||||
return (uint32)_Routes.size();
|
||||
}
|
||||
|
||||
void dump(NLMISC::CLog &log) const
|
||||
|
@ -566,7 +566,7 @@ namespace NLNET
|
|||
|
||||
virtual uint32 getRouteCount() const
|
||||
{
|
||||
return _Routes.size();
|
||||
return (uint32)_Routes.size();
|
||||
}
|
||||
|
||||
void dump(NLMISC::CLog &log) const
|
||||
|
@ -661,12 +661,12 @@ namespace NLNET
|
|||
// affect a connection id
|
||||
if (_FreeRoutesIds.empty())
|
||||
{
|
||||
connId = _RouteIds.size();
|
||||
connId = (uint32)_RouteIds.size();
|
||||
_RouteIds.push_back(InvalidSockId);
|
||||
}
|
||||
else
|
||||
{
|
||||
connId = _FreeRoutesIds.back();
|
||||
connId = (uint32)_FreeRoutesIds.back();
|
||||
_FreeRoutesIds.pop_back();
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ namespace NLNET
|
|||
|
||||
virtual uint32 getRouteCount() const
|
||||
{
|
||||
return _Routes.size();
|
||||
return (uint32)_Routes.size();
|
||||
}
|
||||
|
||||
void dump(NLMISC::CLog &log) const
|
||||
|
|
|
@ -260,7 +260,7 @@ namespace NLNET
|
|||
|
||||
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.
|
||||
|
|
|
@ -661,12 +661,12 @@ namespace NLNET
|
|||
|
||||
virtual uint32 getNbModule()
|
||||
{
|
||||
return _ModuleInstances.getAToBMap().size();
|
||||
return (uint32)_ModuleInstances.getAToBMap().size();
|
||||
}
|
||||
|
||||
virtual uint32 getNbModuleProxy()
|
||||
{
|
||||
return _ModuleProxyIds.getAToBMap().size();
|
||||
return (uint32)_ModuleProxyIds.getAToBMap().size();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ uint32 LastTimeInCallback = 0;
|
|||
|
||||
// this is the thread that initialized the signal redirection
|
||||
// we'll ignore other thread signals
|
||||
static uint SignalisedThread;
|
||||
static size_t SignalisedThread;
|
||||
|
||||
static CFileDisplayer fd;
|
||||
static CNetDisplayer commandDisplayer(false);
|
||||
|
@ -409,7 +409,7 @@ string IService::getArg (char argName) const
|
|||
begin++;
|
||||
|
||||
// End
|
||||
uint size = _Args[i].size();
|
||||
uint size = (uint)_Args[i].size();
|
||||
if (size && _Args[i][size-1] == '"')
|
||||
size--;
|
||||
size = (uint)(std::max((int)0, (int)size-(int)begin));
|
||||
|
|
|
@ -263,7 +263,7 @@ void CSock::createSocket( int type, int protocol )
|
|||
{
|
||||
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 )
|
||||
{
|
||||
throw ESocket( "Socket creation failed" );
|
||||
|
|
|
@ -377,7 +377,7 @@ void CTransportClass::createLocalRegisteredClassMessage ()
|
|||
TempMessage.invert();
|
||||
TempMessage.setType ("CT_LRC");
|
||||
|
||||
uint32 nbClass = LocalRegisteredClass.size ();
|
||||
uint32 nbClass = (uint32)LocalRegisteredClass.size ();
|
||||
TempMessage.serial (nbClass);
|
||||
|
||||
for (TRegisteredClass::iterator it = LocalRegisteredClass.begin(); it != LocalRegisteredClass.end (); it++)
|
||||
|
@ -386,7 +386,7 @@ void CTransportClass::createLocalRegisteredClassMessage ()
|
|||
|
||||
TempMessage.serial ((*it).second.Instance->Name);
|
||||
|
||||
uint32 nbProp = (*it).second.Instance->Prop.size ();
|
||||
uint32 nbProp = (uint32)(*it).second.Instance->Prop.size ();
|
||||
TempMessage.serial (nbProp);
|
||||
|
||||
for (uint j = 0; j < (*it).second.Instance->Prop.size (); j++)
|
||||
|
|
|
@ -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());
|
||||
|
||||
sint count = _NamedCnx.count(name);
|
||||
sint count = (sint)_NamedCnx.count(name);
|
||||
|
||||
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",
|
||||
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++)
|
||||
{
|
||||
|
|
|
@ -466,7 +466,7 @@ void buildExteriorMesh(CCollisionMeshBuild &cmb, CExteriorMesh &em)
|
|||
sint pivot = (edge+1)%3;
|
||||
sint nextEdge = edge;
|
||||
|
||||
uint firstExtEdge = edges.size();
|
||||
uint firstExtEdge = (uint)edges.size();
|
||||
|
||||
for(;;)
|
||||
{
|
||||
|
|
|
@ -87,14 +87,14 @@ void NLPACS::COrderedChain::traverse(sint from, sint to, bool forward, vector<NL
|
|||
if (forward)
|
||||
{
|
||||
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)
|
||||
path.push_back(_Vertices[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from < 0) from = _Vertices.size()-2;
|
||||
if (from < 0) from = (sint)_Vertices.size()-2;
|
||||
if (to < 0) to = -1;
|
||||
|
||||
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())
|
||||
{
|
||||
subChainId = chains.size();
|
||||
subChainId = (uint32)chains.size();
|
||||
if (subChainId > 65535)
|
||||
nlerror("in NLPACS::CChain::make(): reached the maximum number of ordered chains");
|
||||
|
||||
|
|
|
@ -322,7 +322,7 @@ inline void COrderedChain3f::unpack(const COrderedChain &chain)
|
|||
{
|
||||
uint i, mx;
|
||||
const std::vector<CVector2s> &vertices = chain.getVertices();
|
||||
mx = _Vertices.size();
|
||||
mx = (uint)_Vertices.size();
|
||||
_Vertices.resize(vertices.size());
|
||||
_Forward = chain.isForward();
|
||||
_ParentId = chain.getParentId();
|
||||
|
|
|
@ -207,7 +207,7 @@ void CChainQuad::build(const std::vector<COrderedChain> &ochains)
|
|||
// add an entry for Len.
|
||||
memSize+= sizeof(uint16);
|
||||
// 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
|
||||
{
|
||||
// len/resize.
|
||||
len= _Quad.size();
|
||||
len= (uint32)_Quad.size();
|
||||
f.serial(len);
|
||||
|
||||
// write offsets.
|
||||
|
|
|
@ -58,7 +58,7 @@ void CCollisionSurfaceTemp::resetEdgeCollideNodes()
|
|||
// ***************************************************************************
|
||||
uint32 CCollisionSurfaceTemp::allocEdgeCollideNode(uint32 size)
|
||||
{
|
||||
uint32 id= _EdgeCollideNodes.size();
|
||||
uint32 id= (uint32)_EdgeCollideNodes.size();
|
||||
_EdgeCollideNodes.resize(id+size);
|
||||
return id;
|
||||
}
|
||||
|
|
|
@ -357,7 +357,7 @@ void CEdgeQuad::build(const CExteriorMesh &em,
|
|||
// add an entry for Len.
|
||||
memSize+= sizeof(uint16);
|
||||
// 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
|
||||
{
|
||||
// len/resize.
|
||||
len= _Quad.size();
|
||||
len= (uint32)_Quad.size();
|
||||
f.serial(len);
|
||||
|
||||
// write offsets.
|
||||
|
|
|
@ -134,7 +134,7 @@ inline void CFaceGrid::create(const CFaceGrid::CFaceGridBuild &fgb)
|
|||
uint 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());
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ inline void CFaceGrid::select(const NLMISC::CVector &pos, std::vector<uint32> &s
|
|||
idx = x+(y<<_Log2Width);
|
||||
|
||||
start = _Grid[idx++];
|
||||
stop = (idx == _Grid.size()) ? _GridData.size() : _Grid[idx];
|
||||
stop = (idx == _Grid.size()) ? (uint)_GridData.size() : _Grid[idx];
|
||||
|
||||
for (; start<stop; ++start)
|
||||
selected.push_back(_GridData[start]);
|
||||
|
|
|
@ -1131,12 +1131,12 @@ void NLPACS::CGlobalRetriever::findPath(const NLPACS::UGlobalPosition &begin,
|
|||
{
|
||||
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
|
||||
{
|
||||
surf.End.Estimation = (ochain[ochain.getVertices().size()/2].unpack3f()+
|
||||
ochain[ochain.getVertices().size()/2-1].unpack3f())*0.5f;
|
||||
surf.End.Estimation = (ochain[(uint)ochain.getVertices().size()/2].unpack3f()+
|
||||
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.
|
||||
//================
|
||||
sint firstCollisionChain= cst.CollisionChains.size();
|
||||
sint firstCollisionChain= (sint)cst.CollisionChains.size();
|
||||
CVector2f transBase(-deltaOrigin.x, -deltaOrigin.y);
|
||||
// H_AFTER(PACS_GR_findCC_getAndComputeMove);
|
||||
|
||||
|
@ -1251,7 +1251,7 @@ void NLPACS::CGlobalRetriever::findCollisionChains(CCollisionSurfaceTemp &cst, c
|
|||
retrieverInstance.testExteriorCollision(cst, bboxMoveLocal, transBase, localRetriever);
|
||||
|
||||
// how many collision chains added? : nCollisionChain-firstCollisionChain.
|
||||
sint nCollisionChain= cst.CollisionChains.size();
|
||||
sint nCollisionChain= (sint)cst.CollisionChains.size();
|
||||
// H_AFTER(PACS_GR_findCC_testCollision);
|
||||
|
||||
|
||||
|
@ -1526,7 +1526,7 @@ void NLPACS::CGlobalRetriever::testCollisionWithCollisionChains(CCollisionSurfac
|
|||
|
||||
// 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.
|
||||
sint indexInsert= cst.CollisionDescs.size();
|
||||
sint indexInsert= (sint)cst.CollisionDescs.size();
|
||||
sint colFound= -1;
|
||||
|
||||
// start to search with nextCollisionSurfaceTested, because can't insert before.
|
||||
|
|
|
@ -317,7 +317,7 @@ sint32 NLPACS::CLocalRetriever::addSurface(uint8 normalq, uint8 orientationq,
|
|||
sint8 quantHeight)
|
||||
{
|
||||
// creates a new surface...
|
||||
sint32 newId = _Surfaces.size();
|
||||
sint32 newId = (sint32)_Surfaces.size();
|
||||
_Surfaces.resize(newId+1);
|
||||
CRetrievableSurface &surf = _Surfaces.back();
|
||||
|
||||
|
@ -409,7 +409,7 @@ sint32 NLPACS::CLocalRetriever::addChain(const vector<CVector> &verts,
|
|||
return -1;
|
||||
}
|
||||
|
||||
sint32 newId = _Chains.size();
|
||||
sint32 newId = (sint32)_Chains.size();
|
||||
_Chains.resize(newId+1);
|
||||
CChain &chain = _Chains.back();
|
||||
|
||||
|
@ -471,13 +471,13 @@ void NLPACS::CLocalRetriever::computeLoopsAndTips()
|
|||
if (j == chainFlags.size())
|
||||
break;
|
||||
|
||||
uint32 loopId = surface._Loops.size();
|
||||
uint32 loopId = (uint32)surface._Loops.size();
|
||||
surface._Loops.push_back(CRetrievableSurface::TLoop());
|
||||
CRetrievableSurface::TLoop &loop = surface._Loops.back();
|
||||
|
||||
CVector loopStart = getStartVector(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));
|
||||
chainFlags[j] = true;
|
||||
|
||||
|
@ -532,7 +532,7 @@ void NLPACS::CLocalRetriever::computeLoopsAndTips()
|
|||
}
|
||||
|
||||
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));
|
||||
chainFlags[bestChain] = true;
|
||||
++totalAdded;
|
||||
|
@ -673,21 +673,21 @@ void NLPACS::CLocalRetriever::buildSurfacePolygons(uint32 surface, list<CPolygon
|
|||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
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]];
|
||||
bool ochainforward = ochain.isForward();
|
||||
|
||||
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());
|
||||
}
|
||||
else
|
||||
|
@ -733,21 +733,21 @@ void NLPACS::CLocalRetriever::build3dSurfacePolygons(uint32 surface, list<CPolyg
|
|||
}
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
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]];
|
||||
bool ochainforward = ochain.isForward();
|
||||
|
||||
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]);
|
||||
}
|
||||
else
|
||||
|
@ -779,7 +779,7 @@ void NLPACS::CLocalRetriever::findBorderChains()
|
|||
for (chain=0; chain<_Chains.size(); ++chain)
|
||||
if (_Chains[chain].isBorderChain())
|
||||
{
|
||||
sint32 index = _BorderChains.size();
|
||||
sint32 index = (sint32)_BorderChains.size();
|
||||
_BorderChains.push_back(uint16(chain));
|
||||
_Chains[chain].setBorderChainIndex(index);
|
||||
}
|
||||
|
@ -1108,7 +1108,7 @@ void NLPACS::CLocalRetriever::retrievePosition(CVector estimated, CCollisionSurf
|
|||
else
|
||||
{
|
||||
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.
|
||||
while (stop-start > 1)
|
||||
|
@ -1282,7 +1282,7 @@ void NLPACS::CLocalRetriever::retrieveAccuratePosition(CVector2s estim, CCollisi
|
|||
else
|
||||
{
|
||||
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.
|
||||
while (stop-start > 1)
|
||||
|
@ -1705,7 +1705,7 @@ void NLPACS::CLocalRetriever::findPath(const NLPACS::CLocalRetriever::CLocalPosi
|
|||
sort(intersections.begin(), intersections.end());
|
||||
|
||||
uint intersStart = 0;
|
||||
uint intersEnd = intersections.size();
|
||||
uint intersEnd = (uint)intersections.size();
|
||||
|
||||
if (intersEnd > 0)
|
||||
{
|
||||
|
@ -1834,13 +1834,13 @@ void NLPACS::CLocalRetriever::findPath(const NLPACS::CLocalRetriever::CLocalPosi
|
|||
{
|
||||
loopIndex--;
|
||||
if (loopIndex < 0)
|
||||
loopIndex = loop.size()-1;
|
||||
loopIndex = (sint)loop.size()-1;
|
||||
}
|
||||
|
||||
thisChainId = surface._Chains[loop[loopIndex]].Chain;
|
||||
thisChainForward = (_Chains[thisChainId].getLeft() == surfaceId);
|
||||
thisOChainIndex = (thisChainForward && forward || !thisChainForward && !forward) ?
|
||||
0 : _Chains[thisChainId]._SubChains.size()-1;
|
||||
0 : (sint)_Chains[thisChainId]._SubChains.size()-1;
|
||||
}
|
||||
|
||||
thisOChainId = _Chains[thisChainId]._SubChains[thisOChainIndex];
|
||||
|
@ -1894,7 +1894,7 @@ void NLPACS::CLocalRetriever::testCollision(CCollisionSurfaceTemp &cst, const CA
|
|||
uint16 *chainLUT= cst.OChainLUT;
|
||||
|
||||
// bkup where we begin to add chains.
|
||||
uint firstChainAdded= cst.CollisionChains.size();
|
||||
uint firstChainAdded= (uint)cst.CollisionChains.size();
|
||||
|
||||
// For all edgechain entry.
|
||||
for(i=0;i<nEce;i++)
|
||||
|
@ -1927,7 +1927,7 @@ void NLPACS::CLocalRetriever::testCollision(CCollisionSurfaceTemp &cst, const CA
|
|||
{
|
||||
// H_AUTO(PACS_LR_testCol_addToLUT);
|
||||
// add a new CCollisionChain.
|
||||
ccId= cst.CollisionChains.size();
|
||||
ccId= (uint)cst.CollisionChains.size();
|
||||
cst.CollisionChains.push_back(CCollisionChain());
|
||||
// Fill it with default.
|
||||
cst.CollisionChains[ccId].Tested= false;
|
||||
|
@ -2232,7 +2232,7 @@ bool NLPACS::CLocalRetriever::checkSurfaceIntegrity(uint surf, NLMISC::CVector t
|
|||
|
||||
const CRetrievableSurface& surface = _Surfaces[surf];
|
||||
|
||||
uint nloops = surface.getLoops().size();
|
||||
uint nloops = (uint)surface.getLoops().size();
|
||||
|
||||
std::vector<std::pair<CVector2s, CVector2s> > edges;
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ bool CMoveContainer::evalOneTerrainCollision (double beginTime, CMovePrimitive *
|
|||
testMoveValid=true;
|
||||
|
||||
// Size of the array
|
||||
uint size=result->size();
|
||||
uint size=(uint)result->size();
|
||||
|
||||
// For each detected collisions
|
||||
for (uint c=0; c<size; c++)
|
||||
|
@ -1086,7 +1086,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, CMovePrimitive* second
|
|||
if (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);
|
||||
|
||||
|
@ -1197,7 +1197,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, const CCollisionSurfac
|
|||
if (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);
|
||||
|
||||
|
@ -1212,7 +1212,7 @@ void CMoveContainer::newCollision (CMovePrimitive* first, const CCollisionSurfac
|
|||
void CMoveContainer::newTrigger (CMovePrimitive* first, CMovePrimitive* second, const CCollisionDesc& desc, uint triggerType)
|
||||
{
|
||||
// Element index
|
||||
uint index=_Triggers.size();
|
||||
uint index=(uint)_Triggers.size();
|
||||
|
||||
// Add one element
|
||||
_Triggers.resize (index+1);
|
||||
|
@ -1503,7 +1503,7 @@ void CMoveContainer::removeNCFromModifiedList (CMovePrimitive* primitive, uint8
|
|||
{
|
||||
// For each world image
|
||||
uint i;
|
||||
uint worldImageCount = _ChangedRoot.size();
|
||||
uint worldImageCount = (uint)_ChangedRoot.size();
|
||||
for (i=0; i<worldImageCount; i++)
|
||||
{
|
||||
// For each changed primitives
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
/// Get number of trigger informations
|
||||
uint getNumTriggerInfo() const
|
||||
{
|
||||
return _Triggers.size();
|
||||
return (uint)_Triggers.size();
|
||||
}
|
||||
|
||||
/// Get the n-th trigger informations
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
//@{
|
||||
static UPrimitiveBlock *createPrimitiveBlock(NLMISC::IStream &src);
|
||||
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());
|
||||
return Primitives[nPrimNb].UserData; }
|
||||
//@}
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
const std::vector<CLocalRetriever> &getRetrievers() const { return _Retrievers; }
|
||||
|
||||
/// Returns the number of retrievers in the bank.
|
||||
uint size() const { return _Retrievers.size(); }
|
||||
uint size() const { return (uint)_Retrievers.size(); }
|
||||
|
||||
/// Gets nth retriever.
|
||||
const CLocalRetriever &getRetriever(uint n) const
|
||||
|
@ -79,7 +79,7 @@ public:
|
|||
}
|
||||
|
||||
/// 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.
|
||||
uint addRetriever(const std::string &filename)
|
||||
|
@ -92,7 +92,7 @@ public:
|
|||
localRetriever.serial(input);
|
||||
input.close();
|
||||
|
||||
return _Retrievers.size()-1;
|
||||
return (uint)_Retrievers.size()-1;
|
||||
}
|
||||
|
||||
/// Cleans the bank up.
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
uint32 num = _Retrievers.size();
|
||||
uint32 num = (uint32)_Retrievers.size();
|
||||
f.serial(num);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -637,7 +637,7 @@ void NLPACS::CRetrieverInstance::testExteriorCollision(NLPACS::CCollisionSurface
|
|||
uint16 *edgeLUT= cst.OChainLUT;
|
||||
|
||||
// bkup where we begin to add chains.
|
||||
uint firstChainAdded= cst.CollisionChains.size();
|
||||
uint firstChainAdded= (uint)cst.CollisionChains.size();
|
||||
|
||||
// For all exterioredge entry.
|
||||
for(i=0;i<nEei;i++)
|
||||
|
@ -660,7 +660,7 @@ void NLPACS::CRetrieverInstance::testExteriorCollision(NLPACS::CCollisionSurface
|
|||
if(edgeLUT[eei]==0xFFFF)
|
||||
{
|
||||
// add a new CCollisionChain.
|
||||
ccId= cst.CollisionChains.size();
|
||||
ccId= (uint)cst.CollisionChains.size();
|
||||
cst.CollisionChains.push_back(CCollisionChain());
|
||||
// Fill it with default.
|
||||
cst.CollisionChains[ccId].Tested= false;
|
||||
|
|
|
@ -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 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;
|
||||
|
||||
while (nlev > 0)
|
||||
|
|
|
@ -193,7 +193,7 @@ void CAsyncFileManagerSound::CLoadWavFile::run (void)
|
|||
}
|
||||
|
||||
_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 !");
|
||||
return;
|
||||
|
|
|
@ -181,12 +181,12 @@ void CAudioMixerUser::initClusteredSound(NL3D::CScene *scene, float minGain, flo
|
|||
|
||||
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)
|
||||
{
|
||||
_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;
|
||||
for (i=0; i<NbSoundPriorities; ++i)
|
||||
{
|
||||
_PriorityReserve[i] = _Tracks.size();
|
||||
_PriorityReserve[i] = (uint32)_Tracks.size();
|
||||
_ReserveUsage[i] = 0;
|
||||
}
|
||||
|
||||
|
@ -743,14 +743,14 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
|
|||
}
|
||||
|
||||
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");
|
||||
continue;
|
||||
}
|
||||
|
||||
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");
|
||||
continue;
|
||||
|
@ -763,7 +763,7 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
|
|||
adpcmBuffers[j].swap(adpcmData);
|
||||
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)
|
||||
|
@ -776,8 +776,8 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
|
|||
nlassert(mono16Buffers.size() == adpcmBuffers.size());
|
||||
for (uint j = 0; j < mono16Buffers.size(); ++j)
|
||||
{
|
||||
sbf.serialBuffer((uint8*)(&mono16Buffers[j][0]), mono16Buffers[j].size()*2);
|
||||
sbf.serialBuffer((uint8*)(&adpcmBuffers[j][0]), adpcmBuffers[j].size());
|
||||
sbf.serialBuffer((uint8*)(&mono16Buffers[j][0]), (uint)mono16Buffers[j].size()*2);
|
||||
sbf.serialBuffer((uint8*)(&adpcmBuffers[j][0]), (uint)adpcmBuffers[j].size());
|
||||
}
|
||||
|
||||
return filename;
|
||||
|
@ -1134,7 +1134,7 @@ void CAudioMixerUser::CControledSources::serial(NLMISC::IStream &s)
|
|||
s.serial(name);
|
||||
s.serialEnum(ParamId);
|
||||
|
||||
uint32 size = SoundNames.size();
|
||||
uint32 size = (uint32)SoundNames.size();
|
||||
s.serial(size);
|
||||
|
||||
for (uint i=0; i<size; ++i)
|
||||
|
@ -2159,12 +2159,12 @@ uint CAudioMixerUser::getPlayingSourcesCount() const
|
|||
|
||||
uint CAudioMixerUser::getAvailableTracksCount() const
|
||||
{
|
||||
return _FreeTracks.size();
|
||||
return (uint)_FreeTracks.size();
|
||||
}
|
||||
|
||||
uint CAudioMixerUser::getUsedTracksCount() const
|
||||
{
|
||||
return _Tracks.size() - _FreeTracks.size();
|
||||
return (uint)_Tracks.size() - (uint)_FreeTracks.size();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ void CBackgroundSoundManager::addSound(const std::string &rawSoundName, const st
|
|||
uint n = 0;
|
||||
string name;
|
||||
// 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)
|
||||
{
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
uint32 size;
|
||||
if (!s.isReading())
|
||||
{
|
||||
size = _SoundGroupAssoc.size();
|
||||
size = (uint32)_SoundGroupAssoc.size();
|
||||
}
|
||||
s.serial(size);
|
||||
|
||||
|
@ -1021,7 +1021,7 @@ float CClusteredSound::getPolyNearestPos(const std::vector<CVector> &poly, const
|
|||
CVector proj = plane.project(pos);
|
||||
float minDist = FLT_MAX;
|
||||
bool projIn = true;
|
||||
uint nbVertex = poly.size();
|
||||
uint nbVertex = (uint)poly.size();
|
||||
|
||||
// loop throw all vertex
|
||||
for (uint j=0; j<nbVertex; ++j)
|
||||
|
|
|
@ -227,7 +227,7 @@ void CComplexSound::serial(NLMISC::IStream &s)
|
|||
}
|
||||
else
|
||||
{
|
||||
uint32 nb = _Sounds.size();
|
||||
uint32 nb = (uint32)_Sounds.size();
|
||||
s.serial(nb);
|
||||
for (uint i=0; i<nb; ++i)
|
||||
{
|
||||
|
|
|
@ -532,7 +532,7 @@ uint CSoundDriverAL::countMaxSources()
|
|||
// software allows 256 sources (software audio ftw!)
|
||||
// cheap openal cards 32, expensive openal cards 128
|
||||
// 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 :(
|
||||
|
@ -569,7 +569,7 @@ ALuint CSoundDriverAL::createItem(TGenFunctionAL algenfunc, TTestFunctionAL alte
|
|||
index = nbalive;
|
||||
// FIXME assumption about inner workings of std::vector;
|
||||
// &(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() );
|
||||
return ibcompacted - names.begin();
|
||||
return (uint)(ibcompacted - names.begin());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@ IBuffer* CSampleBank::getSample(const NLMISC::TStringId &name)
|
|||
|
||||
uint CSampleBank::countSamples()
|
||||
{
|
||||
return _Samples.size();
|
||||
return (uint)_Samples.size();
|
||||
}
|
||||
|
||||
// ********************************************************
|
||||
|
|
|
@ -112,7 +112,7 @@ TSoundAnimId CSoundAnimManager::createAnimation(std::string& name)
|
|||
nlassert(!name.empty());
|
||||
|
||||
// create and insert animations
|
||||
TSoundAnimId id = _Animations.size();
|
||||
TSoundAnimId id = (TSoundAnimId)_Animations.size();
|
||||
CSoundAnimation* anim = new CSoundAnimation(name, id);
|
||||
_Animations.push_back(anim);
|
||||
|
||||
|
|
|
@ -358,7 +358,7 @@ void CSoundBank::getNames( std::vector<NLMISC::TStringId> &names )
|
|||
*/
|
||||
uint CSoundBank::countSounds()
|
||||
{
|
||||
return _Sounds.size();
|
||||
return (uint)_Sounds.size();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue