From 8f860a594dce06b3cd138ef59f5adbfde9de2579 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 13 May 2010 23:29:42 +0200 Subject: [PATCH] Changed: #825 Remove all warning when compiling Ryzom on Linux --- code/nel/tools/3d/build_shadow_skin/main.cpp | 6 ++--- code/nel/tools/3d/cluster_viewer/view_cs.cpp | 2 +- code/nel/tools/3d/file_info/main.cpp | 2 +- code/nel/tools/3d/ig_lighter/ig_lighter.cpp | 2 +- .../3d/ig_lighter_lib/ig_lighter_lib.cpp | 4 +-- .../panoply_maker/hls_bank_texture_info.cpp | 2 +- .../tools/3d/panoply_maker/panoply_maker.cpp | 2 +- .../zone_dependencies/zone_dependencies.cpp | 2 +- code/nel/tools/3d/zviewer/zviewer.cpp | 4 +-- code/nel/tools/misc/bnp_make/main.cpp | 4 +-- .../misc/make_sheet_id/make_sheet_id.cpp | 4 +-- code/nel/tools/misc/xml_packer/xml_packer.cpp | 2 +- .../tools/pacs/build_indoor_rbank/mouline.cpp | 4 +-- .../tools/pacs/build_rbank/build_rbank.cpp | 26 +++++++++---------- .../nel/tools/pacs/build_rbank/build_surf.cpp | 14 +++++----- .../pacs/build_rbank/surface_splitter.cpp | 6 ++--- .../tools/pacs/build_rbank/surface_splitter.h | 4 +-- .../admin_executor_service/log_report.cpp | 8 +++--- .../nelns/admin_executor_service/log_report.h | 2 +- 19 files changed, 50 insertions(+), 50 deletions(-) diff --git a/code/nel/tools/3d/build_shadow_skin/main.cpp b/code/nel/tools/3d/build_shadow_skin/main.cpp index a8e57967a..cb9df595c 100644 --- a/code/nel/tools/3d/build_shadow_skin/main.cpp +++ b/code/nel/tools/3d/build_shadow_skin/main.cpp @@ -110,7 +110,7 @@ void addShadowMesh(T *meshIn, float paramFaceRatio, sint paramMaxFace, const st map shadowVertexMap; uint numMerged= 0; // Skip Geomorphs. - for(i=geomorphs.size();igetNbMaterial(); - uint nLms= meshBase->_LightInfos.size(); + uint nLms= (uint)meshBase->_LightInfos.size(); MaxNumLightMap= max(MaxNumLightMap, nLms); if(nLms) { diff --git a/code/nel/tools/3d/ig_lighter/ig_lighter.cpp b/code/nel/tools/3d/ig_lighter/ig_lighter.cpp index 0876d0cc3..bc00ba718 100644 --- a/code/nel/tools/3d/ig_lighter/ig_lighter.cpp +++ b/code/nel/tools/3d/ig_lighter/ig_lighter.cpp @@ -80,7 +80,7 @@ public: pgId= min(pgId, (uint)(BAR_LENGTH-1)); sprintf (msg, "\r%s: %s", message, progressbar[pgId]); uint i; - for (i=strlen(msg); i<79; i++) + for (i=(uint)strlen(msg); i<79; i++) msg[i]=' '; msg[i]=0; printf (msg); diff --git a/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp b/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp index 4095e2494..36f1c462f 100644 --- a/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp +++ b/code/nel/tools/3d/ig_lighter_lib/ig_lighter_lib.cpp @@ -256,7 +256,7 @@ void CIgLighterLib::lightIg(CInstanceLighter &instanceLighter, // For any retreiverInstance with this identifier. //---------------- - uint numInstances= globalRetriever->getInstances().size(); + uint numInstances= (uint)globalRetriever->getInstances().size(); for(uint instanceId=0; instanceIdgetInstance(instanceId); @@ -286,7 +286,7 @@ void CIgLighterLib::lightIg(CInstanceLighter &instanceLighter, CIGSurfaceLightBuild::CRetrieverLightGrid &rlg= itRgm->second; // Resize Grids. - uint numSurfaces= localRetriever.getSurfaces().size(); + uint numSurfaces= (uint)localRetriever.getSurfaces().size(); rlg.Grids.resize( numSurfaces ); // Compute the bbox for all surfaces. (NB: local to the localRetriever). diff --git a/code/nel/tools/3d/panoply_maker/hls_bank_texture_info.cpp b/code/nel/tools/3d/panoply_maker/hls_bank_texture_info.cpp index b16f3a724..443a62b3c 100644 --- a/code/nel/tools/3d/panoply_maker/hls_bank_texture_info.cpp +++ b/code/nel/tools/3d/panoply_maker/hls_bank_texture_info.cpp @@ -96,7 +96,7 @@ void CHLSBankTextureInfo::CDXTCBitmap::build(const NLMISC::CBitmap &src) void CHLSBankTextureInfo::CDXTCBitmap::buildBitmap(NLMISC::CBitmap &dst) { CMemStream memStream(true); - memStream.fill(&_Data[0], _Data.size()); + memStream.fill(&_Data[0], (uint32)_Data.size()); // load the DXTC5 from memStream dst.reset(); dst.load(memStream); diff --git a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp index a943f3168..fcc0e097f 100644 --- a/code/nel/tools/3d/panoply_maker/panoply_maker.cpp +++ b/code/nel/tools/3d/panoply_maker/panoply_maker.cpp @@ -760,7 +760,7 @@ static void BuildColoredVersionForOneBitmap(const CBuildInfo &bi, const std::str std::string outputFileName = fileName; // Add an instance entry to the hlsInfo - uint instId= hlsInfo.Instances.size(); + uint instId= (uint)hlsInfo.Instances.size(); hlsInfo.Instances.resize(instId+1); CHLSBankTextureInfo::CTextureInstance &hlsTextInstance= hlsInfo.Instances[instId]; hlsTextInstance.Mods.resize(masks.size()); diff --git a/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp b/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp index aa66d8abe..504058f07 100644 --- a/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp +++ b/code/nel/tools/3d/zone_dependencies/zone_dependencies.cpp @@ -79,7 +79,7 @@ void progress (const char *message, float progress) pgId= min(pgId, (uint)(BAR_LENGTH-1)); sprintf (msg, "\r%s: %s", message, progressbar[pgId]); uint i; - for (i=strlen(msg); i<79; i++) + for (i=(uint)strlen(msg); i<79; i++) msg[i]=' '; msg[i]=0; printf (msg); diff --git a/code/nel/tools/3d/zviewer/zviewer.cpp b/code/nel/tools/3d/zviewer/zviewer.cpp index fd149b84d..a89123af0 100644 --- a/code/nel/tools/3d/zviewer/zviewer.cpp +++ b/code/nel/tools/3d/zviewer/zviewer.cpp @@ -173,7 +173,7 @@ string getZoneNameByCoord(float x, float y) string zoneName; char ych[32]; sprintf(ych,"%d",(sint)ycount); - sint sz = strlen(ych); + sint sz = (sint)strlen(ych); for(sint i = 0; iLandscape.TileBank.makeAllPathRelative(); - sint idx = ViewerCfg.Bank.find("."); + sint idx = (sint)ViewerCfg.Bank.find("."); string farBank = ViewerCfg.Bank.substr(0,idx); farBank += ".farbank"; diff --git a/code/nel/tools/misc/bnp_make/main.cpp b/code/nel/tools/misc/bnp_make/main.cpp index e8b84fdee..c1fb19a65 100644 --- a/code/nel/tools/misc/bnp_make/main.cpp +++ b/code/nel/tools/misc/bnp_make/main.cpp @@ -78,11 +78,11 @@ struct BNPHeader FILE *f = fopen (filename.c_str(), "ab"); if (f == NULL) return false; - uint32 nNbFile = Files.size(); + uint32 nNbFile = (uint32)Files.size(); fwrite (&nNbFile, sizeof(uint32), 1, f); for (uint32 i = 0; i < nNbFile; ++i) { - uint8 nStringSize = Files[i].Name.size(); + uint8 nStringSize = (uint8)Files[i].Name.size(); fwrite (&nStringSize, 1, 1, f); fwrite (Files[i].Name.c_str(), 1, nStringSize, f); fwrite (&Files[i].Size, sizeof(uint32), 1, f); diff --git a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp index 57f66e751..2755e2a96 100644 --- a/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp +++ b/code/nel/tools/misc/make_sheet_id/make_sheet_id.cpp @@ -112,7 +112,7 @@ sint16 getFirstFreeFileTypeId() { for( sint16 id=0; id<256; ++id ) { - if( IdToFileType.find(id) == IdToFileType.end() ) + if( IdToFileType.find((uint8)id) == IdToFileType.end() ) { return id; } @@ -609,7 +609,7 @@ int main( int argc, char ** argv ) { //string outputLine = "type: " + toString((*it1).first.FormIDInfos.Type) +" id: " + toString((*it1).first.FormIDInfos.Id) + " file: " + (*it1).second +"\n"; string outputLine = " id: " + toString((*it1).first.Id) + " file: " + (*it1).second +"\n"; - output.serialBuffer((uint8*)(const_cast(outputLine.data())),outputLine.size()); + output.serialBuffer((uint8*)(const_cast(outputLine.data())),(uint)outputLine.size()); } nlinfo ("------------- results ----------------"); diff --git a/code/nel/tools/misc/xml_packer/xml_packer.cpp b/code/nel/tools/misc/xml_packer/xml_packer.cpp index 35a4bfbe8..f6f806e69 100644 --- a/code/nel/tools/misc/xml_packer/xml_packer.cpp +++ b/code/nel/tools/misc/xml_packer/xml_packer.cpp @@ -394,7 +394,7 @@ int main(int argc, char *argv[]) CPath::getPathContent(dirName, false, true, false, subDirs); // filter the directories - for (uint i=subDirs.size(); i>0; --i) + for (uint i=(uint)subDirs.size(); i>0; --i) { if (!isExcludedDir(subDirs[i-1])) dirStack.push_back(subDirs[i-1]); diff --git a/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp b/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp index cf5f00e0c..a33a9bfbd 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/mouline.cpp @@ -182,7 +182,7 @@ void buildExteriorMesh(CCollisionMeshBuild &cmb, CExteriorMesh &em) bool allowThis = true; uint numLink = 0; - uint firstEdge = edges.size(); + uint firstEdge = (uint)edges.size(); vector loop; @@ -224,7 +224,7 @@ void buildExteriorMesh(CCollisionMeshBuild &cmb, CExteriorMesh &em) // this way, collisions won't be checked in the pacs engine if (loop.size() >= 3) { - uint n = loop.size(); + uint n = (uint)loop.size(); while (loop.front().Link >= 0 && loop.back().Link >= 0 && n > 0) { loop.push_back(loop.front()); diff --git a/code/nel/tools/pacs/build_rbank/build_rbank.cpp b/code/nel/tools/pacs/build_rbank/build_rbank.cpp index 0abf61463..c2e997be5 100644 --- a/code/nel/tools/pacs/build_rbank/build_rbank.cpp +++ b/code/nel/tools/pacs/build_rbank/build_rbank.cpp @@ -629,7 +629,7 @@ void fixFaultyLinks(map &faultyInstances, CChainRef cr; cr.Chain = chain; cr.Previous = chain; - cr.From = fci.Vertices.size(); + cr.From = (uint)fci.Vertices.size(); cr.BorderId = NLPACS::CChain::convertBorderChainId(retriever.getChain(chain).getRight()); while (!it.end()) @@ -638,7 +638,7 @@ void fixFaultyLinks(map &faultyInstances, ++it; } - cr.To = fci.Vertices.size()-1; + cr.To = (uint)fci.Vertices.size()-1; if (l < inst.Reconstructed[j].Chains.size()-1) fci.Vertices.pop_back(); @@ -654,7 +654,7 @@ void fixFaultyLinks(map &faultyInstances, CChainRef cr; cr.Chain = chain; cr.Previous = chain; - cr.From = fcn.Vertices.size(); + cr.From = (uint)fcn.Vertices.size(); cr.BorderId = NLPACS::CChain::convertBorderChainId(nretriever.getChain(chain).getRight()); while (!it.end()) @@ -663,7 +663,7 @@ void fixFaultyLinks(map &faultyInstances, ++it; } - cr.To = fcn.Vertices.size()-1; + cr.To = (uint)fcn.Vertices.size()-1; if (l < neighb.Reconstructed[k].Chains.size()-1) fcn.Vertices.pop_back(); @@ -692,8 +692,8 @@ void fixFaultyLinks(map &faultyInstances, if (l ifreeBorderIds, nfreeBorderIds; @@ -701,18 +701,18 @@ void fixFaultyLinks(map &faultyInstances, for (l=0; l=0 && fcn.Chains[m].From>splitAt; --m) + for (m=(uint)fcn.Chains.size()-1; (sint)m>=0 && fcn.Chains[m].From>splitAt; --m) ; // no split ? @@ -729,9 +729,9 @@ void fixFaultyLinks(map &faultyInstances, // generate splits from second chain on first chain for (l=0; l=0 && fci.Chains[m].From>splitAt; --m) + for (m=(uint)fci.Chains.size()-1; (sint)m>=0 && fci.Chains[m].From>splitAt; --m) ; // no split ? @@ -862,7 +862,7 @@ void fixFaultyLinks(map &faultyInstances, // force links between instances (border chain links) for (l=0; l(instance)).forceBorderChainLink(fci.Chains[l].BorderId, neighb.Instance, fcn.Chains[m].BorderId, diff --git a/code/nel/tools/pacs/build_rbank/build_surf.cpp b/code/nel/tools/pacs/build_rbank/build_surf.cpp index 4e3d9d057..98e452a03 100644 --- a/code/nel/tools/pacs/build_rbank/build_surf.cpp +++ b/code/nel/tools/pacs/build_rbank/build_surf.cpp @@ -467,7 +467,7 @@ void NLPACS::CComputableSurfaceBorder::smooth(float val) } } - before = Vertices.size(); + before = (uint)Vertices.size(); while (Vertices.size()>3) // don't smooth blow 3 vertices to avoid degenrated surfaces { minArea = val; @@ -496,7 +496,7 @@ void NLPACS::CComputableSurfaceBorder::smooth(float val) break; } } - after = Vertices.size(); + after = (uint)Vertices.size(); if (Verbose) nlinfo("smoothed border %d-%d: %d -> %d", Left, Right, before, after); @@ -622,7 +622,7 @@ void NLPACS::CComputableSurface::buildBorders(CZoneTessellation *zoneTessel) if ((Elements[elem]->EdgeLinks[edge] == NULL || Elements[elem]->EdgeLinks[edge]->SurfaceId != SurfaceId) && !Elements[elem]->EdgeFlag[edge]) { - BorderIds.push_back(BorderKeeper->size()); + BorderIds.push_back((uint16)BorderKeeper->size()); BorderKeeper->resize(BorderKeeper->size()+1); CComputableSurfaceBorder &border = BorderKeeper->back(); @@ -1225,7 +1225,7 @@ void NLPACS::CZoneTessellation::build() // if doesn't exist, create a new vertex if ((vremapit = vremap.find(v[i])) == vremap.end()) { - element.Tri[i] = _Vertices.size(); + element.Tri[i] = (uint32)_Vertices.size(); _Vertices.push_back(*(v[i])); vremap.insert(make_pair(v[i], element.Tri[i])); } @@ -1633,13 +1633,13 @@ void NLPACS::CZoneTessellation::generateBorders(float smooth) } float smScale = (Borders[border].Right < 0) ? 0.2f : 1.0f; - uint before = Borders[border].Vertices.size(); + uint before = (uint)Borders[border].Vertices.size(); if (SmoothBorders && !Borders[border].DontSmooth) { Borders[border].smooth(smooth*smScale); } Borders[border].computeLength(); - uint after = Borders[border].Vertices.size(); + uint after = (uint)Borders[border].Vertices.size(); totalBefore += before; totalAfter += after; @@ -1678,7 +1678,7 @@ void NLPACS::CZoneTessellation::saveTessellation(COFile &output) for (i=0; i<_Tessellation.size(); ++i) _Tessellation[i].ElemId = i; - uint32 numTessel = _Tessellation.size(); + uint32 numTessel = (uint32)_Tessellation.size(); output.serial(numTessel); for (i=0; i<_Tessellation.size(); ++i) diff --git a/code/nel/tools/pacs/build_rbank/surface_splitter.cpp b/code/nel/tools/pacs/build_rbank/surface_splitter.cpp index 8f2eaba7f..a82cf66ec 100644 --- a/code/nel/tools/pacs/build_rbank/surface_splitter.cpp +++ b/code/nel/tools/pacs/build_rbank/surface_splitter.cpp @@ -49,8 +49,8 @@ void CSurfaceSplitter::build(CLocalRetriever &lr) buildSurface(lr, i); nlinfo("converted %d chains & %d surfaces", lr.getChains().size(), lr.getSurfaces().size()); - _NumSurfaces = lr.getSurfaces().size(); - _NumChains = lr.getChains().size(); + _NumSurfaces = (uint)lr.getSurfaces().size(); + _NumChains = (uint)lr.getChains().size(); //splitChains(); @@ -502,7 +502,7 @@ void CSurfaceSplitter::replaceChain(CChainId chainId, const vector &ch { it = ploop.Chains.erase(it); sint i; - for (i=chains.size()-1; i>=0; --i) + for (i=(sint)chains.size()-1; i>=0; --i) { it = ploop.Chains.insert(it, chains[i]); } diff --git a/code/nel/tools/pacs/build_rbank/surface_splitter.h b/code/nel/tools/pacs/build_rbank/surface_splitter.h index 237503d75..3d74659a4 100644 --- a/code/nel/tools/pacs/build_rbank/surface_splitter.h +++ b/code/nel/tools/pacs/build_rbank/surface_splitter.h @@ -367,7 +367,7 @@ public: Direction = forward ? +1 : -1; if (splitter == NULL || pLoop == NULL) return; - Chain = (Direction>0 ? 0 : pLoop->Chains.size()-1); + Chain = (Direction>0 ? 0 : (sint)pLoop->Chains.size()-1); resetChain(); } iterator(const iterator &it) @@ -420,7 +420,7 @@ public: } pChain = pSplitter->getChain(pLoop->Chains[Chain]); ChainDirection = (pChain->Left == pLoop->Surface ? Direction : -Direction); - ChainVertex = (ChainDirection>0 ? 0 : pChain->Vertices.size()-1); + ChainVertex = (ChainDirection>0 ? 0 : (sint)pChain->Vertices.size()-1); } CVector2s64 operator * () const diff --git a/code/nelns/admin_executor_service/log_report.cpp b/code/nelns/admin_executor_service/log_report.cpp index afcc39e7e..46e27b77e 100644 --- a/code/nelns/admin_executor_service/log_report.cpp +++ b/code/nelns/admin_executor_service/log_report.cpp @@ -37,7 +37,7 @@ enum TLogLineHeader { LHDate, LHTime, LHType, LHThread, LHService, LHCodeFile, L /// bool isLogFile( const std::string& filename ) { - uint len = filename.size(); + uint len = (uint)filename.size(); return (len >= 4 ) && (filename.substr( len-4 ) == ".log"); } @@ -180,7 +180,7 @@ const uint CurrentVersion = ~0; // Return true and logVersion, or false if not a log with version bool getLogVersion( const std::string& filename, uint& logVersion ) { - uint len = filename.size(); + uint len = (uint)filename.size(); if ( (len > 4) && (filename.substr( len-4 ) == ".log") ) { if ( filename.substr(0, 3) == "log" ) @@ -242,7 +242,7 @@ void CMakeLogTask::run() { // Parse log target uint targetVersion = CurrentVersion; - uint lts = _LogTarget.size(); + uint lts = (uint)_LogTarget.size(); if ( _LogTarget.empty() || (_LogTarget == "v") ) { targetMode = TTMMatchExactV; @@ -314,7 +314,7 @@ void CMakeLogTask::run() CIFile logfile; if ( logfile.open( *ilf, true ) ) { - _OutputLogReport->setProgress( ilf-filenames.begin(), filenames.size() ); + _OutputLogReport->setProgress( (uint)(ilf-filenames.begin()), (uint)filenames.size() ); while ( ! logfile.eof() ) { logfile.getline( line, MAX_LOG_LINE_SIZE ); diff --git a/code/nelns/admin_executor_service/log_report.h b/code/nelns/admin_executor_service/log_report.h index acd50d09c..e611f9761 100644 --- a/code/nelns/admin_executor_service/log_report.h +++ b/code/nelns/admin_executor_service/log_report.h @@ -149,7 +149,7 @@ public: std::string service() { return _Service; } - virtual uint getNbDistinctLines() const { return _LogLineInfo.size(); } + virtual uint getNbDistinctLines() const { return (uint)_LogLineInfo.size(); } virtual uint getNbTotalLines( NLMISC::CLog::TLogType logType );