Changed: #825 Remove all warnings when compiling Ryzom (patch provided by Abelgar)

This commit is contained in:
kervala 2010-09-16 19:04:18 +02:00
parent 608b688c54
commit 8c64d7ed76
13 changed files with 45 additions and 36 deletions

View file

@ -943,10 +943,10 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight
_ProcessCount=MAX_CPU_PROCESS; _ProcessCount=MAX_CPU_PROCESS;
// Number of obstacle polygones // Number of obstacle polygones
nlinfo ("Obstacle polygones : %zu", obstacles.size ()); nlinfo ("Obstacle polygones : %u", (uint)obstacles.size ());
// Number of CPUS used // Number of CPUS used
nlinfo ("Number of CPU used: %d", _ProcessCount); nlinfo ("Number of CPU used: %u", _ProcessCount);
// Zone pointer // Zone pointer
CZone *pZone=landscape.getZone (_ZoneToLight); CZone *pZone=landscape.getZone (_ZoneToLight);

View file

@ -233,7 +233,7 @@ void displayInfoFileInStream(FILE *logStream, const char *fileName, const set<st
// display Info on the zone: // display Info on the zone:
fprintf(logStream, " Num Patchs: %d\n", zone.getNumPatchs() ); fprintf(logStream, " Num Patchs: %d\n", zone.getNumPatchs() );
fprintf(logStream, " Num PointLights: %zu\n", zoneInfo.PointLights.size() ); fprintf(logStream, " Num PointLights: %u\n", (uint)zoneInfo.PointLights.size() );
if (vl) if (vl)
{ {
fprintf(logStream, " Lights\n"); fprintf(logStream, " Lights\n");
@ -299,7 +299,7 @@ void displayInfoFileInStream(FILE *logStream, const char *fileName, const set<st
CVector gpos = ig.getGlobalPos(); CVector gpos = ig.getGlobalPos();
fprintf(logStream, " Global pos : x = %.1f, y = %.1f, z =%.1f\n", gpos.x, gpos.y, gpos.z); fprintf(logStream, " Global pos : x = %.1f, y = %.1f, z =%.1f\n", gpos.x, gpos.y, gpos.z);
fprintf(logStream, " Num Instances: %d\n", ig.getNumInstance() ); fprintf(logStream, " Num Instances: %d\n", ig.getNumInstance() );
fprintf(logStream, " Num PointLights: %zu\n", ig.getPointLightList().size() ); fprintf(logStream, " Num PointLights: %u\n", (uint)ig.getPointLightList().size() );
fprintf(logStream, " Realtime sun contribution = %s\n", ig.getRealTimeSunContribution() ? "on" : "off"); fprintf(logStream, " Realtime sun contribution = %s\n", ig.getRealTimeSunContribution() ? "on" : "off");
if (vi) if (vi)
{ {
@ -387,7 +387,7 @@ void displayInfoFileInStream(FILE *logStream, const char *fileName, const set<st
vector<CBoneBase> bones; vector<CBoneBase> bones;
skel->retrieve(bones); skel->retrieve(bones);
// Display Bone Infos. // 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<bones.size(); i++) for(uint i=0; i<bones.size(); i++)
{ {

View file

@ -274,7 +274,7 @@ void buildFileVector(std::vector<std::string> &filenames, const std::string &fil
filenames.push_back(files[i]); 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());
} }

View file

@ -78,8 +78,13 @@ bool CHttpClient::send(const std::string& buffer, bool verbose)
{ {
nlassert(_Sock.connected()); 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(); uint32 size = (uint32)buffer.size();
if(!buffer.empty()) if(!buffer.empty())
{ {
if(_Sock.send((uint8 *)buffer.c_str(), size, false) != CSock::Ok) if(_Sock.send((uint8 *)buffer.c_str(), size, false) != CSock::Ok)

View file

@ -1025,7 +1025,7 @@ bool CNetworkConnection::stateLogin()
{ {
if (_SystemMode) if (_SystemMode)
{ {
uint8 message; uint8 message = 0;
msgin.serial(message); msgin.serial(message);
switch (message) switch (message)
@ -1232,7 +1232,7 @@ bool CNetworkConnection::stateSynchronize()
{ {
if (_SystemMode) if (_SystemMode)
{ {
uint8 message; uint8 message = 0;
msgin.serial(message); msgin.serial(message);
switch (message) switch (message)
@ -1774,7 +1774,7 @@ void CNetworkConnection::decodeDiscreetProperty( CBitMemStream& msgin, TPropInde
CCDBNodeLeaf *nodeProp = NULL; CCDBNodeLeaf *nodeProp = NULL;
uint i; uint i;
uint64 value; uint64 value = 0;
for (i=0; i<listSize; ++i) for (i=0; i<listSize; ++i)
{ {
if (place == 0) if (place == 0)
@ -2132,7 +2132,7 @@ bool CNetworkConnection::stateConnected()
{ {
if (_SystemMode) if (_SystemMode)
{ {
uint8 message; uint8 message = 0;
msgin.serial(message); msgin.serial(message);
switch (message) switch (message)
@ -2257,7 +2257,7 @@ bool CNetworkConnection::stateProbe()
{ {
if (_SystemMode) if (_SystemMode)
{ {
uint8 message; uint8 message = 0;
msgin.serial(message); msgin.serial(message);
switch (message) switch (message)
@ -2345,7 +2345,7 @@ bool CNetworkConnection::stateStalled()
{ {
if (_SystemMode) if (_SystemMode)
{ {
uint8 message; uint8 message = 0;
msgin.serial(message); msgin.serial(message);
switch (message) switch (message)
@ -2615,6 +2615,8 @@ void CNetworkConnection::pushTarget(TCLEntityId slot, LHSTATE::TLHState targetOr
case LHSTATE::NONE: ats->TargetOrPickup = 0; break; case LHSTATE::NONE: ats->TargetOrPickup = 0; break;
case LHSTATE::LOOTABLE: ats->TargetOrPickup = 1; break; case LHSTATE::LOOTABLE: ats->TargetOrPickup = 1; break;
case LHSTATE::HARVESTABLE: ats->TargetOrPickup = 2; break; case LHSTATE::HARVESTABLE: ats->TargetOrPickup = 2; break;
default:
break;
} }
ats->TargetOrPickup = (uint32)targetOrPickup; ats->TargetOrPickup = (uint32)targetOrPickup;
@ -2816,7 +2818,7 @@ bool CNetworkConnection::stateQuit()
{ {
if (_SystemMode) if (_SystemMode)
{ {
uint8 message; uint8 message = 0;
msgin.serial(message); msgin.serial(message);
switch (message) switch (message)
@ -2988,7 +2990,7 @@ void CNetworkConnection::displayAllocationStats()
string CNetworkConnection::getAllocationStats() string CNetworkConnection::getAllocationStats()
{ {
char buf[128]; 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); return string(buf);
} }

View file

@ -868,6 +868,8 @@ void CTimedFXManager::displayFXBoxes(TDebugDisplayMode displayMode) const
case CManagedFX::InRemoveList: 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))); 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; break;
default:
break;
} }
break; break;
default: default:

View file

@ -44,9 +44,9 @@ extern NL3D::ULandscape *Landscape;
CWeatherManagerClient::CWeatherManagerClient() : _WindDir(0, 0, 0), CWeatherManagerClient::CWeatherManagerClient() : _WindDir(0, 0, 0),
_WeatherValue(0), _WeatherValue(0),
_ThunderLevel(0), _ThunderLevel(0),
_ThunderStrike(false),
_LastEvalHour(0), _LastEvalHour(0),
_LastEvalDay(0), _LastEvalDay(0),
_ThunderStrike(false),
_LocalPrecipitationFactor(0.f) _LocalPrecipitationFactor(0.f)
{ {
} }

View file

@ -640,8 +640,8 @@ namespace RM_FABER_STAT_TYPE
bool isMagicResistStat(TRMStatType fs) bool isMagicResistStat(TRMStatType fs)
{ {
// should have 5 magic resistances. Desert should be the 1st, and PrimRoot the last // should have 5 magic resistances. Desert should be the 1st, and PrimRoot the last
const uint startMResist= DesertResistance; const sint startMResist= DesertResistance;
const uint endMResist= PrimaryRootResistance+1; const sint endMResist= PrimaryRootResistance+1;
nlctassert(endMResist - startMResist == 5); nlctassert(endMResist - startMResist == 5);
return fs>=startMResist && fs<endMResist; return fs>=startMResist && fs<endMResist;
@ -651,8 +651,8 @@ namespace RM_FABER_STAT_TYPE
bool isMagicProtectStat(TRMStatType fs) bool isMagicProtectStat(TRMStatType fs)
{ {
// should have 7 magic protection. Acid should be the 1st, and Electricity the last // should have 7 magic protection. Acid should be the 1st, and Electricity the last
const uint startMProt= AcidProtection; const sint startMProt= AcidProtection;
const uint endMProt= ElectricityProtection+1; const sint endMProt= ElectricityProtection+1;
nlctassert(endMProt - startMProt == 7); nlctassert(endMProt - startMProt == 7);
return fs>=startMProt && fs<endMProt; return fs>=startMProt && fs<endMProt;

View file

@ -88,7 +88,7 @@ public:
struct SMethod struct SMethod
{ {
SMethod() : IsConst(false), IsInline(false), IsStatic(false), IsAttribute(false), IsVirtual(false), IsSeparator(false) {} SMethod() : IsConst(false), IsInline(false), IsStatic(false), IsVirtual(false), IsAttribute(false), IsSeparator(false) {}
std::string Type; std::string Type;
std::string Name; std::string Name;
std::string Proto; std::string Proto;
@ -387,8 +387,8 @@ public:
/// Constructor /// Constructor
CCppOutput(bool cppmode = true) : _CppMode(cppmode), CCppOutput(bool cppmode = true) : _CppMode(cppmode),
_XmlMode(false), _XmlInNode(false), _XmlLastSlash(false), _XmlGetNodeName(false), _XmlCloseNode(false), _XmlMode(false), _NewLine(true), _Indent(0), _DescriptionMode(false), _Clean(true),
_DescriptionMode(false), _Indent(0), _NewLine(true), _Clean(true) {} _XmlInNode(false), _XmlLastSlash(false), _XmlGetNodeName(false), _XmlCloseNode(false), _XmlRootNode(false) {}
/// Clear /// Clear
void clear(); void clear();
@ -928,4 +928,4 @@ inline void CFunctionGenerator::flush(CCppOutput &hFile, CCppOutput &cppFile, CC
#endif #endif

View file

@ -241,7 +241,7 @@ class CFileNode : public CParseNode
{ {
public: public:
CFileNode() : IncludePDSLib(false), IncludeStandard(false), IncludeDbFile(false), Generate(true), SeparatedFlag(false) { } CFileNode() : SeparatedFlag(false), IncludeStandard(false), IncludePDSLib(false), IncludeDbFile(false), Generate(true) { }
std::string IncludeAs; std::string IncludeAs;
@ -547,11 +547,11 @@ public:
IsInArray(false), IsInArray(false),
IsInArrayRef(false), IsInArrayRef(false),
MappedFlag(false), MappedFlag(false),
PDSMapped(false),
DerivatedFlag(false), DerivatedFlag(false),
HasParent(false), HasParent(false),
ParentIsHidden(false), ParentIsHidden(false),
ForceReference(false), ForceReference(false),
PDSMapped(false),
MapClass(NULL), MapClass(NULL),
Columns(-1), Columns(-1),
Id(0), Id(0),

View file

@ -1467,7 +1467,7 @@ void CClassNode::fillAttributes()
CClassNode *classNd = NULL; CClassNode *classNd = NULL;
CTypeNode *typeNd = NULL; CTypeNode *typeNd = NULL;
if (classNd = decl->getClassNode(decl->Type, false)) if ( (classNd = decl->getClassNode(decl->Type, false)) )
{ {
if (classNd->IsBackReferenced || classNd->ForceReference) if (classNd->IsBackReferenced || classNd->ForceReference)
{ {
@ -1493,7 +1493,7 @@ void CClassNode::fillAttributes()
decl->DeclarationType = ArrayClass; decl->DeclarationType = ArrayClass;
} }
} }
else if (typeNd = decl->getTypeNode(decl->Type, false)) else if ( (typeNd = decl->getTypeNode(decl->Type, false)) )
{ {
decl->DeclarationType = ArrayType; decl->DeclarationType = ArrayType;
} }
@ -1512,7 +1512,7 @@ void CClassNode::fillAttributes()
CClassNode *classNd = NULL; CClassNode *classNd = NULL;
CTypeNode *typeNd = NULL; CTypeNode *typeNd = NULL;
if (classNd = decl->getClassNode(decl->Type, false)) if ( (classNd = decl->getClassNode(decl->Type, false)) )
{ {
if (classNd->IsBackReferenced || classNd->ForceReference) if (classNd->IsBackReferenced || classNd->ForceReference)
{ {
@ -1535,7 +1535,7 @@ void CClassNode::fillAttributes()
decl->DeclarationType = SimpleClass; decl->DeclarationType = SimpleClass;
} }
} }
else if (typeNd = decl->getTypeNode(decl->Type, false)) else if ( (typeNd = decl->getTypeNode(decl->Type, false)) )
{ {
decl->IsType = true; decl->IsType = true;
@ -4707,7 +4707,7 @@ void CLogMsgNode::generateContent()
CTypeNode *tnd; CTypeNode *tnd;
CClassNode *cnd; CClassNode *cnd;
if (tnd = getTypeNode(type, false)) if ( (tnd = getTypeNode(type, false)) )
{ {
pair<map<string, CParseNode*>::iterator, bool> res = params.insert(make_pair<string, CParseNode*>(name, tnd)); pair<map<string, CParseNode*>::iterator, bool> res = params.insert(make_pair<string, CParseNode*>(name, tnd));
if (!res.second) if (!res.second)
@ -4721,7 +4721,7 @@ void CLogMsgNode::generateContent()
logfunc.Proto += tnd->getName()+" "+name; logfunc.Proto += tnd->getName()+" "+name;
argcall += name; argcall += name;
} }
else if (cnd = getClassNode(type, false)) else if ( (cnd = getClassNode(type, false)) )
{ {
pair<map<string, CParseNode*>::iterator, bool> res = params.insert(make_pair<string, CParseNode*>(name, cnd)); pair<map<string, CParseNode*>::iterator, bool> res = params.insert(make_pair<string, CParseNode*>(name, cnd));
if (!res.second) if (!res.second)

View file

@ -232,7 +232,7 @@ CParseNode *parse##nodename(CTokenizer &tokenizer) \
* PARSE_FAIL // parsing fails if neither Include can be parsed nor Type nor Class * PARSE_FAIL // parsing fails if neither Include can be parsed nor Type nor Class
*/ */
#define PARSE_ALTERNATIVE(nodename) \ #define PARSE_ALTERNATIVE(nodename) \
if (parsed = parse##nodename(tokenizer)) \ if ( (parsed = parse##nodename(tokenizer)) ) \
{ \ { \
parsed->Parent = main; \ parsed->Parent = main; \
main->Nodes.push_back(parsed); \ main->Nodes.push_back(parsed); \
@ -250,7 +250,7 @@ CParseNode *parse##nodename(CTokenizer &tokenizer) \
* PARSE_NODE(Include) * PARSE_NODE(Include)
*/ */
#define PARSE_NODE(nodename, savein) \ #define PARSE_NODE(nodename, savein) \
if (main->savein = parse##nodename(tokenizer)) \ if ( (main->savein = parse##nodename(tokenizer)) ) \
{ \ { \
main->savein->Parent = main; \ main->savein->Parent = main; \
} \ } \
@ -413,4 +413,4 @@ CParseNode *parse##nodename(CTokenizer &tokenizer) \
} \ } \
} }
#endif #endif

View file

@ -305,7 +305,7 @@ class CTemplatizerRefEnv : public CTemplatizerEnv
public: public:
/// Constructor /// Constructor
CTemplatizerRefEnv(CTemplatizerEnv* ref) : Reference(ref), CTemplatizerEnv(NULL) { } CTemplatizerRefEnv(CTemplatizerEnv* ref) : CTemplatizerEnv(NULL), Reference(ref) { }
/// Clear Env /// Clear Env
virtual void clear() virtual void clear()