From 88bc352b2ba53d76719b7b8feeec69f8e4ff74e2 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 13 May 2010 22:23:34 +0200 Subject: [PATCH] Changed: #825 Remove all warning when compiling Ryzom on Linux --- code/nel/src/misc/big_file.cpp | 4 +- code/nel/src/misc/bit_mem_stream.cpp | 6 +-- code/nel/src/misc/bitmap_png.cpp | 4 +- code/nel/src/misc/buf_fifo.cpp | 14 +++---- code/nel/src/misc/common.cpp | 2 +- code/nel/src/misc/config_file/config_file.cpp | 42 +++++++++---------- code/nel/src/misc/debug.cpp | 4 +- code/nel/src/misc/di_game_device.cpp | 12 +++--- code/nel/src/misc/diff_tool.cpp | 6 +-- code/nel/src/misc/eval_num_expr.cpp | 8 ++-- code/nel/src/misc/file.cpp | 10 ++--- code/nel/src/misc/hierarchical_timer.cpp | 10 ++--- code/nel/src/misc/i18n.cpp | 6 +-- code/nel/src/misc/i_xml.cpp | 4 +- code/nel/src/misc/inter_window_msg_queue.cpp | 6 +-- code/nel/src/misc/noise_value.cpp | 2 +- code/nel/src/misc/o_xml.cpp | 4 +- code/nel/src/misc/polygon.cpp | 32 +++++++------- code/nel/src/misc/sheet_id.cpp | 8 ++-- code/nel/src/misc/sstring.cpp | 42 +++++++++---------- code/nel/src/misc/stream.cpp | 6 +-- code/nel/src/misc/string_mapper.cpp | 4 +- code/nel/src/misc/task_manager.cpp | 4 +- code/nel/src/misc/unicode.cpp | 6 +-- code/nel/src/misc/window_displayer.cpp | 2 +- code/nel/src/misc/xml_pack.cpp | 4 +- code/nel/src/net/callback_net_base.cpp | 2 +- code/nel/src/net/email.cpp | 4 +- code/nel/src/net/listen_sock.cpp | 7 ++-- code/nel/src/net/login_server.cpp | 4 +- code/nel/src/net/module_common.cpp | 2 +- code/nel/src/net/module_gateway.cpp | 6 +-- code/nel/src/net/module_gateway_transport.cpp | 8 ++-- code/nel/src/net/module_l5_transport.cpp | 2 +- code/nel/src/net/module_local_gateway.cpp | 2 +- code/nel/src/net/module_manager.cpp | 4 +- code/nel/src/net/service.cpp | 4 +- code/nel/src/net/sock.cpp | 2 +- code/nel/src/net/transport_class.cpp | 4 +- code/nel/src/net/unified_network.cpp | 4 +- code/nel/src/pacs/build_indoor.cpp | 2 +- code/nel/src/pacs/chain.cpp | 6 +-- code/nel/src/pacs/chain.h | 2 +- code/nel/src/pacs/chain_quad.cpp | 4 +- code/nel/src/pacs/collision_surface_temp.cpp | 2 +- code/nel/src/pacs/edge_quad.cpp | 4 +- code/nel/src/pacs/face_grid.h | 4 +- code/nel/src/pacs/global_retriever.cpp | 12 +++--- code/nel/src/pacs/local_retriever.cpp | 40 +++++++++--------- code/nel/src/pacs/move_container.cpp | 10 ++--- code/nel/src/pacs/move_container.h | 2 +- code/nel/src/pacs/primitive_block.h | 2 +- code/nel/src/pacs/retriever_bank.h | 8 ++-- code/nel/src/pacs/retriever_instance.cpp | 4 +- code/nel/src/pacs/surface_quad.cpp | 2 +- .../src/sound/async_file_manager_sound.cpp | 2 +- code/nel/src/sound/audio_mixer_user.cpp | 22 +++++----- .../src/sound/background_sound_manager.cpp | 2 +- code/nel/src/sound/clustered_sound.cpp | 4 +- code/nel/src/sound/complex_sound.cpp | 2 +- .../sound/driver/openal/sound_driver_al.cpp | 6 +-- code/nel/src/sound/sample_bank.cpp | 2 +- code/nel/src/sound/sound_anim_manager.cpp | 2 +- code/nel/src/sound/sound_bank.cpp | 2 +- 64 files changed, 228 insertions(+), 227 deletions(-) diff --git a/code/nel/src/misc/big_file.cpp b/code/nel/src/misc/big_file.cpp index 96b585e36..d6f9a41bd 100644 --- a/code/nel/src/misc/big_file.cpp +++ b/code/nel/src/misc/big_file.cpp @@ -226,7 +226,7 @@ bool CBigFile::add (const std::string &sBigFileName, uint32 nOptions) map::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++; } diff --git a/code/nel/src/misc/bit_mem_stream.cpp b/code/nel/src/misc/bit_mem_stream.cpp index 4e21fa6eb..2ce0e9fd0 100644 --- a/code/nel/src/misc/bit_mem_stream.cpp +++ b/code/nel/src/misc/bit_mem_stream.cpp @@ -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 &cont) } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); std::vector::iterator it= cont.begin(); diff --git a/code/nel/src/misc/bitmap_png.cpp b/code/nel/src/misc/bitmap_png.cpp index d98c1106e..a73e161ce 100644 --- a/code/nel/src/misc/bitmap_png.cpp +++ b/code/nel/src/misc/bitmap_png.cpp @@ -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 diff --git a/code/nel/src/misc/buf_fifo.cpp b/code/nel/src/misc/buf_fifo.cpp index d96cf8ebd..5c6624213 100644 --- a/code/nel/src/misc/buf_fifo.cpp +++ b/code/nel/src/misc/buf_fifo.cpp @@ -118,7 +118,7 @@ void CBufFIFO::push(const std::vector &buffer1, const std::vector 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 diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index f51ac4c71..8edb75057 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -128,7 +128,7 @@ string stringFromVector( const vector& v, bool limited ) if (!v.empty()) { - int size = v.size (); + int size = (int)v.size (); if (limited && size > 1000) { string middle = "......"; diff --git a/code/nel/src/misc/config_file/config_file.cpp b/code/nel/src/misc/config_file/config_file.cpp index ccade2081..2351a58f7 100644 --- a/code/nel/src/misc/config_file/config_file.cpp +++ b/code/nel/src/misc/config_file/config_file.cpp @@ -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) diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index b8054d20a..c3e5b1151 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -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 diff --git a/code/nel/src/misc/di_game_device.cpp b/code/nel/src/misc/di_game_device.cpp index 624994a39..e13b733e8 100644 --- a/code/nel/src/misc/di_game_device.cpp +++ b/code/nel/src/misc/di_game_device.cpp @@ -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 diff --git a/code/nel/src/misc/diff_tool.cpp b/code/nel/src/misc/diff_tool.cpp index c6e06b466..27621748f 100644 --- a/code/nel/src/misc/diff_tool.cpp +++ b/code/nel/src/misc/diff_tool.cpp @@ -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= (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; } } diff --git a/code/nel/src/misc/file.cpp b/code/nel/src/misc/file.cpp index acc9cf134..df36c17be 100644 --- a/code/nel/src/misc/file.cpp +++ b/code/nel/src/misc/file.cpp @@ -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("@")) { diff --git a/code/nel/src/misc/hierarchical_timer.cpp b/code/nel/src/misc/hierarchical_timer.cpp index 9137214e2..d56fab0b4 100644 --- a/code/nel/src/misc/hierarchical_timer.cpp +++ b/code/nel/src/misc/hierarchical_timer.cpp @@ -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); diff --git a/code/nel/src/misc/i18n.cpp b/code/nel/src/misc/i18n.cpp index 3f3407b2a..4f7c08693 100644 --- a/code/nel/src/misc/i18n.cpp +++ b/code/nel/src/misc/i18n.cpp @@ -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()); diff --git a/code/nel/src/misc/i_xml.cpp b/code/nel/src/misc/i_xml.cpp index 536358f81..91a32a225 100644 --- a/code/nel/src/misc/i_xml.cpp +++ b/code/nel/src/misc/i_xml.cpp @@ -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(); } } diff --git a/code/nel/src/misc/inter_window_msg_queue.cpp b/code/nel/src/misc/inter_window_msg_queue.cpp index df073099d..fa63c9069 100644 --- a/code/nel/src/misc/inter_window_msg_queue.cpp +++ b/code/nel/src/misc/inter_window_msg_queue.cpp @@ -501,7 +501,7 @@ namespace NLMISC dest.clear(); } std::vector &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::CAccessor outMessageQueue(&const_cast &>(_OutMessageQueue)); - return outMessageQueue.value().size(); + return (uint)outMessageQueue.value().size(); } //************************************************************************************************** uint CInterWindowMsgQueue::getReceiveQueueSize() const { - return _InMessageQueue.size(); + return (uint)_InMessageQueue.size(); } } // NLMISC diff --git a/code/nel/src/misc/noise_value.cpp b/code/nel/src/misc/noise_value.cpp index 0af58cc72..89b9a8ad4 100644 --- a/code/nel/src/misc/noise_value.cpp +++ b/code/nel/src/misc/noise_value.cpp @@ -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 diff --git a/code/nel/src/misc/o_xml.cpp b/code/nel/src/misc/o_xml.cpp index 2e2397e13..ce53b754d 100644 --- a/code/nel/src/misc/o_xml.cpp +++ b/code/nel/src/misc/o_xml.cpp @@ -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')) diff --git a/code/nel/src/misc/polygon.cpp b/code/nel/src/misc/polygon.cpp index 8e42570d0..b45e72ba0 100644 --- a/code/nel/src/misc/polygon.cpp +++ b/code/nel/src/misc/polygon.cpp @@ -104,7 +104,7 @@ void CPolygon::clip(const std::vector &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 &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 &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 &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 &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, const CMatrix& basis) uint otherToCheck; for (otherToCheck=o+1; otherToCheck= 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 diff --git a/code/nel/src/misc/sheet_id.cpp b/code/nel/src/misc/sheet_id.cpp index ba04daa87..5524bc721 100644 --- a/code/nel/src/misc/sheet_id.cpp +++ b/code/nel/src/misc/sheet_id.cpp @@ -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::iterator itStr2; @@ -204,7 +204,7 @@ void CSheetId::loadSheetId () map::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::iterator itStr; for( itStr = _SheetIdToName.begin(); itStr != _SheetIdToName.end(); ++itStr ) diff --git a/code/nel/src/misc/sstring.cpp b/code/nel/src/misc/sstring.cpp index 8ba147ba9..4c37b1f1a 100644 --- a/code/nel/src/misc/sstring.cpp +++ b/code/nel/src/misc/sstring.cpp @@ -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=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=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(data()),1,size(),file); + uint32 bytesRead=(uint32)fread(const_cast(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(data()),size(),1,file); + uint32 recordsWritten=(uint32)fwrite(const_cast(data()),size(),1,file); fclose(file); if (recordsWritten!=1) { diff --git a/code/nel/src/misc/stream.cpp b/code/nel/src/misc/stream.cpp index 79af32a8d..7eee72309 100644 --- a/code/nel/src/misc/stream.cpp +++ b/code/nel/src/misc/stream.cpp @@ -342,7 +342,7 @@ void IStream::serialCont(vector &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 &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 &cont) } else { - len= cont.size(); + len= (sint32)cont.size(); serial(len); if (len != 0) diff --git a/code/nel/src/misc/string_mapper.cpp b/code/nel/src/misc/string_mapper.cpp index b6c235be9..ea8409f54 100644 --- a/code/nel/src/misc/string_mapper.cpp +++ b/code/nel/src/misc/string_mapper.cpp @@ -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++; } diff --git a/code/nel/src/misc/task_manager.cpp b/code/nel/src/misc/task_manager.cpp index a75c931e9..4001c1744 100644 --- a/code/nel/src/misc/task_manager.cpp +++ b/code/nel/src/misc/task_manager.cpp @@ -149,7 +149,7 @@ bool CTaskManager::deleteTask(IRunnable *r) uint CTaskManager::taskListSize(void) { CUnfairSynchronized >::CAccessor acces(&_TaskQueue); - return acces.value().size(); + return (uint)acces.value().size(); } @@ -216,7 +216,7 @@ void CTaskManager::clearDump() uint CTaskManager::getNumWaitingTasks() { CUnfairSynchronized >::CAccessor acces(&_TaskQueue); - return acces.value().size(); + return (uint)acces.value().size(); } // *************************************************************************** diff --git a/code/nel/src/misc/unicode.cpp b/code/nel/src/misc/unicode.cpp index bcd905eb5..117ad1e26 100644 --- a/code/nel/src/misc/unicode.cpp +++ b/code/nel/src/misc/unicode.cpp @@ -1907,8 +1907,8 @@ ucstring toLower (const ucstring &str) { uint i; ucstring temp = str; - const uint size = temp.size(); - for (i=0; i >::CAccessor access (&_Labels); access.value().push_back (CLabelEntry(value)); - pos = access.value().size()-1; + pos = (int)access.value().size()-1; } return pos; } diff --git a/code/nel/src/misc/xml_pack.cpp b/code/nel/src/misc/xml_pack.cpp index 27c8bd0a9..dce0f72a1 100644 --- a/code/nel/src/misc/xml_pack.cpp +++ b/code/nel/src/misc/xml_pack.cpp @@ -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)); diff --git a/code/nel/src/net/callback_net_base.cpp b/code/nel/src/net/callback_net_base.cpp index a59dd3398..8620a75b3 100644 --- a/code/nel/src/net/callback_net_base.cpp +++ b/code/nel/src/net/callback_net_base.cpp @@ -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); diff --git a/code/nel/src/net/email.cpp b/code/nel/src/net/email.cpp index 428806fcd..7198215f9 100644 --- a/code/nel/src/net/email.cpp +++ b/code/nel/src/net/email.cpp @@ -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"; diff --git a/code/nel/src/net/listen_sock.cpp b/code/nel/src/net/listen_sock.cpp index bd0c48af8..52e5407a2 100644 --- a/code/nel/src/net/listen_sock.cpp +++ b/code/nel/src/net/listen_sock.cpp @@ -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) diff --git a/code/nel/src/net/login_server.cpp b/code/nel/src/net/login_server.cpp index 0515348d7..2ff2e3b88 100644 --- a/code/nel/src/net/login_server.cpp +++ b/code/nel/src/net/login_server.cpp @@ -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) diff --git a/code/nel/src/net/module_common.cpp b/code/nel/src/net/module_common.cpp index 7eee0048f..6bbd527e6 100644 --- a/code/nel/src/net/module_common.cpp +++ b/code/nel/src/net/module_common.cpp @@ -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) { diff --git a/code/nel/src/net/module_gateway.cpp b/code/nel/src/net/module_gateway.cpp index 7018f9961..f3933bb29 100644 --- a/code/nel/src/net/module_gateway.cpp +++ b/code/nel/src/net/module_gateway.cpp @@ -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. diff --git a/code/nel/src/net/module_gateway_transport.cpp b/code/nel/src/net/module_gateway_transport.cpp index b07b7421a..6088ab3e8 100644 --- a/code/nel/src/net/module_gateway_transport.cpp +++ b/code/nel/src/net/module_gateway_transport.cpp @@ -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(); } diff --git a/code/nel/src/net/module_l5_transport.cpp b/code/nel/src/net/module_l5_transport.cpp index f6b3530ec..c022150ee 100644 --- a/code/nel/src/net/module_l5_transport.cpp +++ b/code/nel/src/net/module_l5_transport.cpp @@ -177,7 +177,7 @@ namespace NLNET virtual uint32 getRouteCount() const { - return _Routes.size(); + return (uint32)_Routes.size(); } void dump(NLMISC::CLog &log) const diff --git a/code/nel/src/net/module_local_gateway.cpp b/code/nel/src/net/module_local_gateway.cpp index e64754f91..3c4e943e4 100644 --- a/code/nel/src/net/module_local_gateway.cpp +++ b/code/nel/src/net/module_local_gateway.cpp @@ -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. diff --git a/code/nel/src/net/module_manager.cpp b/code/nel/src/net/module_manager.cpp index e6442a362..c76989206 100644 --- a/code/nel/src/net/module_manager.cpp +++ b/code/nel/src/net/module_manager.cpp @@ -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(); } diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index 6e219de93..1fccea0ca 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -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)); diff --git a/code/nel/src/net/sock.cpp b/code/nel/src/net/sock.cpp index 94206494d..b8d116962 100644 --- a/code/nel/src/net/sock.cpp +++ b/code/nel/src/net/sock.cpp @@ -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" ); diff --git a/code/nel/src/net/transport_class.cpp b/code/nel/src/net/transport_class.cpp index 7c5171f03..1d9796dd2 100644 --- a/code/nel/src/net/transport_class.cpp +++ b/code/nel/src/net/transport_class.cpp @@ -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++) diff --git a/code/nel/src/net/unified_network.cpp b/code/nel/src/net/unified_network.cpp index 5e3e4689c..bb01286c7 100644 --- a/code/nel/src/net/unified_network.cpp +++ b/code/nel/src/net/unified_network.cpp @@ -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++) { diff --git a/code/nel/src/pacs/build_indoor.cpp b/code/nel/src/pacs/build_indoor.cpp index bd2d995a7..672088fa8 100644 --- a/code/nel/src/pacs/build_indoor.cpp +++ b/code/nel/src/pacs/build_indoor.cpp @@ -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(;;) { diff --git a/code/nel/src/pacs/chain.cpp b/code/nel/src/pacs/chain.cpp index bda615fc6..aaa631dea 100644 --- a/code/nel/src/pacs/chain.cpp +++ b/code/nel/src/pacs/chain.cpp @@ -87,14 +87,14 @@ void NLPACS::COrderedChain::traverse(sint from, sint to, bool forward, vectorto; --i) @@ -216,7 +216,7 @@ void NLPACS::CChain::make(const vector &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"); diff --git a/code/nel/src/pacs/chain.h b/code/nel/src/pacs/chain.h index c2432d382..c03a2d7ff 100644 --- a/code/nel/src/pacs/chain.h +++ b/code/nel/src/pacs/chain.h @@ -322,7 +322,7 @@ inline void COrderedChain3f::unpack(const COrderedChain &chain) { uint i, mx; const std::vector &vertices = chain.getVertices(); - mx = _Vertices.size(); + mx = (uint)_Vertices.size(); _Vertices.resize(vertices.size()); _Forward = chain.isForward(); _ParentId = chain.getParentId(); diff --git a/code/nel/src/pacs/chain_quad.cpp b/code/nel/src/pacs/chain_quad.cpp index c75ca9f3c..ad28aae7c 100644 --- a/code/nel/src/pacs/chain_quad.cpp +++ b/code/nel/src/pacs/chain_quad.cpp @@ -207,7 +207,7 @@ void CChainQuad::build(const std::vector &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. diff --git a/code/nel/src/pacs/collision_surface_temp.cpp b/code/nel/src/pacs/collision_surface_temp.cpp index 99e0e26cd..88ee4abb5 100644 --- a/code/nel/src/pacs/collision_surface_temp.cpp +++ b/code/nel/src/pacs/collision_surface_temp.cpp @@ -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; } diff --git a/code/nel/src/pacs/edge_quad.cpp b/code/nel/src/pacs/edge_quad.cpp index 8d1b2c0ce..68f3f6865 100644 --- a/code/nel/src/pacs/edge_quad.cpp +++ b/code/nel/src/pacs/edge_quad.cpp @@ -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. diff --git a/code/nel/src/pacs/face_grid.h b/code/nel/src/pacs/face_grid.h index 3eb369490..b1ab700f7 100644 --- a/code/nel/src/pacs/face_grid.h +++ b/code/nel/src/pacs/face_grid.h @@ -134,7 +134,7 @@ inline void CFaceGrid::create(const CFaceGrid::CFaceGridBuild &fgb) uint i; for (i=0; i &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 &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, list0; --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, list0; --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 &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 &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 > edges; diff --git a/code/nel/src/pacs/move_container.cpp b/code/nel/src/pacs/move_container.cpp index bf4bc1655..2d2473625 100644 --- a/code/nel/src/pacs/move_container.cpp +++ b/code/nel/src/pacs/move_container.cpp @@ -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= (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 &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); } } diff --git a/code/nel/src/pacs/retriever_instance.cpp b/code/nel/src/pacs/retriever_instance.cpp index c9b5c7328..3e4f87823 100644 --- a/code/nel/src/pacs/retriever_instance.cpp +++ b/code/nel/src/pacs/retriever_instance.cpp @@ -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 0) diff --git a/code/nel/src/sound/async_file_manager_sound.cpp b/code/nel/src/sound/async_file_manager_sound.cpp index 41b0e34fc..4f0beea53 100644 --- a/code/nel/src/sound/async_file_manager_sound.cpp +++ b/code/nel/src/sound/async_file_manager_sound.cpp @@ -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; diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index c7161b082..a524b39cc 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -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 &sampleL } vector 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 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 &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 &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 &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& names, TTestFunctionAL a } } nlassert( ibcompacted <= names.end() ); - return ibcompacted - names.begin(); + return (uint)(ibcompacted - names.begin()); } diff --git a/code/nel/src/sound/sample_bank.cpp b/code/nel/src/sound/sample_bank.cpp index 75795bac7..9cce83496 100644 --- a/code/nel/src/sound/sample_bank.cpp +++ b/code/nel/src/sound/sample_bank.cpp @@ -451,7 +451,7 @@ IBuffer* CSampleBank::getSample(const NLMISC::TStringId &name) uint CSampleBank::countSamples() { - return _Samples.size(); + return (uint)_Samples.size(); } // ******************************************************** diff --git a/code/nel/src/sound/sound_anim_manager.cpp b/code/nel/src/sound/sound_anim_manager.cpp index 04c32ddc4..7016764fe 100644 --- a/code/nel/src/sound/sound_anim_manager.cpp +++ b/code/nel/src/sound/sound_anim_manager.cpp @@ -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); diff --git a/code/nel/src/sound/sound_bank.cpp b/code/nel/src/sound/sound_bank.cpp index 3de9f6e79..9d8059e24 100644 --- a/code/nel/src/sound/sound_bank.cpp +++ b/code/nel/src/sound/sound_bank.cpp @@ -358,7 +358,7 @@ void CSoundBank::getNames( std::vector &names ) */ uint CSoundBank::countSounds() { - return _Sounds.size(); + return (uint)_Sounds.size(); }