From 256062307b853422c54223d1212156388bb167c1 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 16 Sep 2010 19:04:18 +0200 Subject: [PATCH] Changed: #825 Remove all warnings when compiling Ryzom (patch provided by Abelgar) --- code/nel/src/3d/zone_lighter.cpp | 4 ++-- code/nel/tools/3d/file_info/main.cpp | 6 +++--- .../tools/georges/georges2csv/georges2csv.cpp | 2 +- code/ryzom/client/src/http_client.cpp | 7 ++++++- code/ryzom/client/src/network_connection.cpp | 18 ++++++++++-------- code/ryzom/client/src/timed_fx_manager.cpp | 2 ++ .../client/src/weather_manager_client.cpp | 2 +- code/ryzom/common/src/game_share/rm_family.cpp | 8 ++++---- code/ryzom/tools/pd_parser/cpp_output.h | 8 ++++---- code/ryzom/tools/pd_parser/parse_node.h | 4 ++-- code/ryzom/tools/pd_parser/parser.cpp | 12 ++++++------ code/ryzom/tools/pd_parser/parser_rules.h | 6 +++--- code/ryzom/tools/pd_parser/templatizer.h | 2 +- 13 files changed, 45 insertions(+), 36 deletions(-) diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 5a8757605..4f1e53385 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -943,10 +943,10 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight _ProcessCount=MAX_CPU_PROCESS; // Number of obstacle polygones - nlinfo ("Obstacle polygones : %zu", obstacles.size ()); + nlinfo ("Obstacle polygones : %u", (uint)obstacles.size ()); // Number of CPUS used - nlinfo ("Number of CPU used: %d", _ProcessCount); + nlinfo ("Number of CPU used: %u", _ProcessCount); // Zone pointer CZone *pZone=landscape.getZone (_ZoneToLight); diff --git a/code/nel/tools/3d/file_info/main.cpp b/code/nel/tools/3d/file_info/main.cpp index 1e243a545..4a14a43c9 100644 --- a/code/nel/tools/3d/file_info/main.cpp +++ b/code/nel/tools/3d/file_info/main.cpp @@ -233,7 +233,7 @@ void displayInfoFileInStream(FILE *logStream, const char *fileName, const set bones; skel->retrieve(bones); // Display Bone Infos. - fprintf(logStream, "Num Bones: %zu\n", bones.size()); + fprintf(logStream, "Num Bones: %u\n", (uint)bones.size()); for(uint i=0; i &filenames, const std::string &fil filenames.push_back(files[i]); } } - printf("Found: %zu matching files (from %zu)\n",filenames.size(),files.size()); + printf("Found: %u matching files (from %u)\n",(uint)filenames.size(),(uint)files.size()); } diff --git a/code/ryzom/client/src/http_client.cpp b/code/ryzom/client/src/http_client.cpp index dd5220fc1..6a10034cd 100644 --- a/code/ryzom/client/src/http_client.cpp +++ b/code/ryzom/client/src/http_client.cpp @@ -78,8 +78,13 @@ bool CHttpClient::send(const std::string& buffer, bool verbose) { nlassert(_Sock.connected()); - if(verbose) nldebug("Sending '%s' to '%s'", buffer.c_str(), _Sock.remoteAddr().asString().c_str()); + if(verbose) + { + nldebug("Sending '%s' to '%s'", buffer.c_str(), _Sock.remoteAddr().asString().c_str()); + } + uint32 size = (uint32)buffer.size(); + if(!buffer.empty()) { if(_Sock.send((uint8 *)buffer.c_str(), size, false) != CSock::Ok) diff --git a/code/ryzom/client/src/network_connection.cpp b/code/ryzom/client/src/network_connection.cpp index 687b7d14a..d37e05eae 100644 --- a/code/ryzom/client/src/network_connection.cpp +++ b/code/ryzom/client/src/network_connection.cpp @@ -1025,7 +1025,7 @@ bool CNetworkConnection::stateLogin() { if (_SystemMode) { - uint8 message; + uint8 message = 0; msgin.serial(message); switch (message) @@ -1232,7 +1232,7 @@ bool CNetworkConnection::stateSynchronize() { if (_SystemMode) { - uint8 message; + uint8 message = 0; msgin.serial(message); switch (message) @@ -1774,7 +1774,7 @@ void CNetworkConnection::decodeDiscreetProperty( CBitMemStream& msgin, TPropInde CCDBNodeLeaf *nodeProp = NULL; uint i; - uint64 value; + uint64 value = 0; for (i=0; iTargetOrPickup = 0; break; case LHSTATE::LOOTABLE: ats->TargetOrPickup = 1; break; case LHSTATE::HARVESTABLE: ats->TargetOrPickup = 2; break; + default: + break; } ats->TargetOrPickup = (uint32)targetOrPickup; @@ -2816,7 +2818,7 @@ bool CNetworkConnection::stateQuit() { if (_SystemMode) { - uint8 message; + uint8 message = 0; msgin.serial(message); switch (message) @@ -2988,7 +2990,7 @@ void CNetworkConnection::displayAllocationStats() string CNetworkConnection::getAllocationStats() { char buf[128]; - sprintf(buf, "CNET[%p]: %d queued blocks, %d changes", this, _Actions.size(), _Changes.size()); + sprintf(buf, "CNET[%p]: %u queued blocks, %u changes", this, (uint)_Actions.size(), (uint)_Changes.size()); return string(buf); } diff --git a/code/ryzom/client/src/timed_fx_manager.cpp b/code/ryzom/client/src/timed_fx_manager.cpp index 60c88e868..3eb899c0d 100644 --- a/code/ryzom/client/src/timed_fx_manager.cpp +++ b/code/ryzom/client/src/timed_fx_manager.cpp @@ -868,6 +868,8 @@ void CTimedFXManager::displayFXBoxes(TDebugDisplayMode displayMode) const case CManagedFX::InRemoveList: textToDisplay = NLMISC::toString("day:%d, hour:%d:%d", (int) mf.SetHandle->Date.Day, (int) mf.SetHandle->Date.Hour, (int) (60.f * fmodf(mf.SetHandle->Date.Hour, 1.f))); break; + default: + break; } break; default: diff --git a/code/ryzom/client/src/weather_manager_client.cpp b/code/ryzom/client/src/weather_manager_client.cpp index f4b94d4a8..7ff6edfa7 100644 --- a/code/ryzom/client/src/weather_manager_client.cpp +++ b/code/ryzom/client/src/weather_manager_client.cpp @@ -44,9 +44,9 @@ extern NL3D::ULandscape *Landscape; CWeatherManagerClient::CWeatherManagerClient() : _WindDir(0, 0, 0), _WeatherValue(0), _ThunderLevel(0), + _ThunderStrike(false), _LastEvalHour(0), _LastEvalDay(0), - _ThunderStrike(false), _LocalPrecipitationFactor(0.f) { } diff --git a/code/ryzom/common/src/game_share/rm_family.cpp b/code/ryzom/common/src/game_share/rm_family.cpp index 2bef2bc24..ffae6cdc2 100644 --- a/code/ryzom/common/src/game_share/rm_family.cpp +++ b/code/ryzom/common/src/game_share/rm_family.cpp @@ -640,8 +640,8 @@ namespace RM_FABER_STAT_TYPE bool isMagicResistStat(TRMStatType fs) { // should have 5 magic resistances. Desert should be the 1st, and PrimRoot the last - const uint startMResist= DesertResistance; - const uint endMResist= PrimaryRootResistance+1; + const sint startMResist= DesertResistance; + const sint endMResist= PrimaryRootResistance+1; nlctassert(endMResist - startMResist == 5); return fs>=startMResist && fs=startMProt && fsgetClassNode(decl->Type, false)) + if ( (classNd = decl->getClassNode(decl->Type, false)) ) { if (classNd->IsBackReferenced || classNd->ForceReference) { @@ -1493,7 +1493,7 @@ void CClassNode::fillAttributes() decl->DeclarationType = ArrayClass; } } - else if (typeNd = decl->getTypeNode(decl->Type, false)) + else if ( (typeNd = decl->getTypeNode(decl->Type, false)) ) { decl->DeclarationType = ArrayType; } @@ -1512,7 +1512,7 @@ void CClassNode::fillAttributes() CClassNode *classNd = NULL; CTypeNode *typeNd = NULL; - if (classNd = decl->getClassNode(decl->Type, false)) + if ( (classNd = decl->getClassNode(decl->Type, false)) ) { if (classNd->IsBackReferenced || classNd->ForceReference) { @@ -1535,7 +1535,7 @@ void CClassNode::fillAttributes() decl->DeclarationType = SimpleClass; } } - else if (typeNd = decl->getTypeNode(decl->Type, false)) + else if ( (typeNd = decl->getTypeNode(decl->Type, false)) ) { decl->IsType = true; @@ -4707,7 +4707,7 @@ void CLogMsgNode::generateContent() CTypeNode *tnd; CClassNode *cnd; - if (tnd = getTypeNode(type, false)) + if ( (tnd = getTypeNode(type, false)) ) { pair::iterator, bool> res = params.insert(make_pair(name, tnd)); if (!res.second) @@ -4721,7 +4721,7 @@ void CLogMsgNode::generateContent() logfunc.Proto += tnd->getName()+" "+name; argcall += name; } - else if (cnd = getClassNode(type, false)) + else if ( (cnd = getClassNode(type, false)) ) { pair::iterator, bool> res = params.insert(make_pair(name, cnd)); if (!res.second) diff --git a/code/ryzom/tools/pd_parser/parser_rules.h b/code/ryzom/tools/pd_parser/parser_rules.h index 071cf53ca..ed3f0fec0 100644 --- a/code/ryzom/tools/pd_parser/parser_rules.h +++ b/code/ryzom/tools/pd_parser/parser_rules.h @@ -232,7 +232,7 @@ CParseNode *parse##nodename(CTokenizer &tokenizer) \ * PARSE_FAIL // parsing fails if neither Include can be parsed nor Type nor Class */ #define PARSE_ALTERNATIVE(nodename) \ - if (parsed = parse##nodename(tokenizer)) \ + if ( (parsed = parse##nodename(tokenizer)) ) \ { \ parsed->Parent = main; \ main->Nodes.push_back(parsed); \ @@ -250,7 +250,7 @@ CParseNode *parse##nodename(CTokenizer &tokenizer) \ * PARSE_NODE(Include) */ #define PARSE_NODE(nodename, savein) \ - if (main->savein = parse##nodename(tokenizer)) \ + if ( (main->savein = parse##nodename(tokenizer)) ) \ { \ main->savein->Parent = main; \ } \ @@ -413,4 +413,4 @@ CParseNode *parse##nodename(CTokenizer &tokenizer) \ } \ } -#endif \ No newline at end of file +#endif diff --git a/code/ryzom/tools/pd_parser/templatizer.h b/code/ryzom/tools/pd_parser/templatizer.h index c739bd586..70a98b5a4 100644 --- a/code/ryzom/tools/pd_parser/templatizer.h +++ b/code/ryzom/tools/pd_parser/templatizer.h @@ -305,7 +305,7 @@ class CTemplatizerRefEnv : public CTemplatizerEnv public: /// Constructor - CTemplatizerRefEnv(CTemplatizerEnv* ref) : Reference(ref), CTemplatizerEnv(NULL) { } + CTemplatizerRefEnv(CTemplatizerEnv* ref) : CTemplatizerEnv(NULL), Reference(ref) { } /// Clear Env virtual void clear()