Changed: #825 Remove all warnings when compiling Ryzom

This commit is contained in:
kervala 2012-09-25 12:33:02 +02:00
parent fee5c0112e
commit f891634af9
31 changed files with 135 additions and 105 deletions

View file

@ -527,7 +527,7 @@ MACRO(NL_SETUP_BUILD)
ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64") ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
ENDIF(APPLE) ENDIF(APPLE)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing") SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_REENTRANT -pipe -Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -ansi") SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -ansi")
@ -581,7 +581,7 @@ MACRO(NL_SETUP_BUILD)
SET(PLATFORM_CFLAGS "-fPIC ${PLATFORM_CFLAGS}") SET(PLATFORM_CFLAGS "-fPIC ${PLATFORM_CFLAGS}")
ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS) ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS)
SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS}) SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} -ftemplate-depth-48")
IF(NOT APPLE) IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed") SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")

View file

@ -241,7 +241,7 @@ private:
LogicalXor, // ^^ LogicalXor, // ^^
OperatorCount, // OperatorCount, //
NotOperator, // This is not an operator NotOperator, // This is not an operator
ExtOperator, // This is a 2 charcters operator ExtOperator, // This is a 2 characters operator
}; };
// Functions // Functions

View file

@ -79,7 +79,7 @@ struct TMessageRecord
stream.serial( s_event ); stream.serial( s_event );
uint32 sockId; uint32 sockId;
stream.serialHex( sockId ); stream.serialHex( sockId );
SockId = (NLNET::TSockId)sockId; SockId = (NLNET::TSockId)(size_t)sockId;
len = Message.length(); len = Message.length();
stream.serial( len ); stream.serial( len );
stream.serialBuffer( const_cast<uint8*>(Message.buffer()), len ); // assumes the message contains plain text stream.serialBuffer( const_cast<uint8*>(Message.buffer()), len ); // assumes the message contains plain text

View file

@ -214,9 +214,9 @@ bool BuildTangentSpace(CMesh::CMeshBuild &outMeshBuild, const CMesh::CMeshBuild
if (!canShare) continue; if (!canShare) continue;
// Get indices of vertices of current tri // Get indices of vertices of current tri
const uint indices[] = { f.Corner[0].Vertex, const uint indices[] = { (uint)f.Corner[0].Vertex,
f.Corner[1].Vertex, (uint)f.Corner[1].Vertex,
f.Corner[2].Vertex }; (uint)f.Corner[2].Vertex };
NLMISC::CTriangle tri; NLMISC::CTriangle tri;
// Build it // Build it
BuildTriFromMB(outMeshBuild, indices, tri); BuildTriFromMB(outMeshBuild, indices, tri);

View file

@ -1309,7 +1309,7 @@ const int CEvalNumExpr::_OperatorPrecedence[]=
9, // LogicalAnd 9, // LogicalAnd
10, // LogicalOr 10, // LogicalOr
11, // LogicalXor 11, // LogicalXor
0xffffffff, // OperatorCount -1, // OperatorCount
20, // NotOperator 20, // NotOperator
}; };

View file

@ -914,9 +914,9 @@ void CI18N::_readTextFile(const string &filename,
void CI18N::readTextBuffer(uint8 *buffer, uint size, ucstring &result, bool forceUtf8) void CI18N::readTextBuffer(uint8 *buffer, uint size, ucstring &result, bool forceUtf8)
{ {
static uint8 utf16Header[] = {char(0xff), char(0xfe)}; static uint8 utf16Header[] = { 0xffu, 0xfeu };
static uint8 utf16RevHeader[] = {char(0xfe), char(0xff)}; static uint8 utf16RevHeader[] = { 0xfeu, 0xffu };
static uint8 utf8Header[] = {char(0xef), char(0xbb), char(0xbf)}; static uint8 utf8Header[] = { 0xefu, 0xbbu, 0xbfu };
if (forceUtf8) if (forceUtf8)
{ {

View file

@ -280,11 +280,17 @@ void CTime::probeTimerInfo(CTime::CTimerInfo &result)
else result.RequiresSingleCore = false; else result.RequiresSingleCore = false;
if (result.HighPrecisionResolution == 14318180) if (result.HighPrecisionResolution == 14318180)
{
nldebug("Detected known HPET era timer frequency"); nldebug("Detected known HPET era timer frequency");
}
if (result.HighPrecisionResolution == 3579545) if (result.HighPrecisionResolution == 3579545)
{
nldebug("Detected known AHCI era timer frequency"); nldebug("Detected known AHCI era timer frequency");
}
if (result.HighPrecisionResolution == 1193182) if (result.HighPrecisionResolution == 1193182)
{
nldebug("Detected known i8253/i8254 era timer frequency"); nldebug("Detected known i8253/i8254 era timer frequency");
}
} }
} }

View file

@ -317,6 +317,8 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm
case CTile::alpha: case CTile::alpha:
theList128[tile].alphaLoaded=0; theList128[tile].alphaLoaded=0;
break; break;
default:
break;
} }
Reload(tile, tile + 1, _128x128); Reload(tile, tile + 1, _128x128);
} }
@ -378,6 +380,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm
case CTile::alpha: case CTile::alpha:
theList256[tile].alphaLoaded=0; theList256[tile].alphaLoaded=0;
break; break;
default:
break;
} }
Reload(tile, tile + 1, _256x256); Reload(tile, tile + 1, _256x256);
} }
@ -442,6 +446,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile
case CTile::alpha: case CTile::alpha:
theListTransition[tile].alphaLoaded=0; theListTransition[tile].alphaLoaded=0;
break; break;
default:
break;
} }
Reload(tile, tile + 1, Transition); Reload(tile, tile + 1, Transition);
} }
@ -603,6 +609,8 @@ void TileList::clearTile128 (int index, CTile::TBitmap bitmap)
case CTile::alpha: case CTile::alpha:
nlassert(0); nlassert(0);
break; break;
default:
break;
} }
tileBankBrowser.getTileSet (_tileSet)->clearTile128 (index, bitmap, tileBankBrowser); tileBankBrowser.getTileSet (_tileSet)->clearTile128 (index, bitmap, tileBankBrowser);
} }
@ -622,6 +630,8 @@ void TileList::clearTile256 (int index, CTile::TBitmap bitmap)
case CTile::alpha: case CTile::alpha:
nlassert(0); nlassert(0);
break; break;
default:
break;
} }
tileBankBrowser.getTileSet (_tileSet)->clearTile256 (index, bitmap, tileBankBrowser); tileBankBrowser.getTileSet (_tileSet)->clearTile256 (index, bitmap, tileBankBrowser);
} }
@ -642,6 +652,8 @@ void TileList::clearTransition (int index, CTile::TBitmap bitmap)
theListTransition[index].alphaLoaded=0; theListTransition[index].alphaLoaded=0;
theListTransition[index].alphaBits.resize(0); theListTransition[index].alphaBits.resize(0);
break; break;
default:
break;
} }
tileBankBrowser.getTileSet (_tileSet)->clearTransition ((CTileSet::TTransition)index, bitmap, tileBankBrowser); tileBankBrowser.getTileSet (_tileSet)->clearTransition ((CTileSet::TTransition)index, bitmap, tileBankBrowser);
} }
@ -660,6 +672,8 @@ void TileList::clearDisplacement (int index, CTile::TBitmap bitmap)
case CTile::alpha: case CTile::alpha:
nlassert(0); nlassert(0);
break; break;
default:
break;
} }
tileBankBrowser.getTileSet (_tileSet)->clearDisplacement ((CTileSet::TDisplacement)index, tileBankBrowser); tileBankBrowser.getTileSet (_tileSet)->clearDisplacement ((CTileSet::TDisplacement)index, tileBankBrowser);
@ -717,7 +731,8 @@ void TileList::Reload(int first, int last, TileType n) //recharge en memoire une
theList[n][i].Load (index, NULL); theList[n][i].Load (index, NULL);
break; break;
} }
default:
break;
} }
} }
} }

View file

@ -31,7 +31,7 @@ typedef struct BMP_HEADER
/* ---------------------------------------------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------------------------------------------- */
unsigned long Pic_BMP_Write( unsigned char *FileName, unsigned long Pic_BMP_Write( const char *FileName,
unsigned char *pPal,unsigned char *pDatas, unsigned char *pPal,unsigned char *pDatas,
unsigned long w, unsigned long h, unsigned long d) unsigned long w, unsigned long h, unsigned long d)

View file

@ -504,7 +504,7 @@ static char* ConvPic(PIC_PICTURE *pic, unsigned long type, char* pErr)
/* ---------------------------------------- */ /* ---------------------------------------- */
unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, unsigned long qual) unsigned long PIC_Save(unsigned long id, const char* FileName, unsigned long type, unsigned long qual)
{ {
PIC_PICTURE *pic; PIC_PICTURE *pic;
unsigned char err; unsigned char err;

View file

@ -22,7 +22,7 @@ extern unsigned long PIC_Load(char* FileName, unsigned char Quantize);
extern unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned long w, unsigned long h, unsigned long d); extern unsigned long PIC_Create(unsigned char* pPal, unsigned char* pDatas, unsigned long w, unsigned long h, unsigned long d);
extern unsigned long PIC_Save(unsigned long id, char* FileName, unsigned long type, unsigned long qual); extern unsigned long PIC_Save(unsigned long id, const char* FileName, unsigned long type, unsigned long qual);
extern unsigned long PIC_GetInfos( unsigned long id, extern unsigned long PIC_GetInfos( unsigned long id,
unsigned char* *ppPal, unsigned char* *ppDatas, unsigned char* *ppPal, unsigned char* *ppDatas,

View file

@ -51,7 +51,7 @@ extern unsigned long Pic_BMP_Read( unsigned char *FileName,
unsigned long *pWidth, unsigned long *pHeight, unsigned long *pWidth, unsigned long *pHeight,
unsigned long *pDepth); unsigned long *pDepth);
extern unsigned long Pic_BMP_Write( unsigned char *FileName, extern unsigned long Pic_BMP_Write( const char *FileName,
unsigned char *pPal,unsigned char *pDatas, unsigned char *pPal,unsigned char *pDatas,
unsigned long w, unsigned long h, unsigned long d); unsigned long w, unsigned long h, unsigned long d);
/* /*

View file

@ -4522,7 +4522,7 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB
{ {
if(behaviour.DeltaHP != 0) if(behaviour.DeltaHP != 0)
{ {
CRGBA deltaHPColor; CRGBA deltaHPColor(0, 0, 0);
// if it's a hit // if it's a hit
if( behaviour.DeltaHP < 0 ) if( behaviour.DeltaHP < 0 )
{ {

View file

@ -787,7 +787,6 @@ void prelogInit()
CPath::remapExtension ("png", "tga", true); CPath::remapExtension ("png", "tga", true);
FPU_CHECKER_ONCE FPU_CHECKER_ONCE
uint i;
addPreDataPaths(ProgressBar); addPreDataPaths(ProgressBar);
FPU_CHECKER_ONCE FPU_CHECKER_ONCE
@ -1045,7 +1044,7 @@ void prelogInit()
// Set the monitor color properties // Set the monitor color properties
CMonitorColorProperties monitorColor; CMonitorColorProperties monitorColor;
for (i=0; i<3; i++) for (uint i=0; i<3; i++)
{ {
monitorColor.Contrast[i] = ClientCfg.Contrast; monitorColor.Contrast[i] = ClientCfg.Contrast;
monitorColor.Luminosity[i] = ClientCfg.Luminosity; monitorColor.Luminosity[i] = ClientCfg.Luminosity;

View file

@ -1827,7 +1827,7 @@ void getSkillModVsType(CDBCtrlSheet *item, const CItemSheet*pIS, ucstring &itemT
void getArmorBonus(CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS) void getArmorBonus(CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS)
{ {
ucstring armor_bonus(""); ucstring armor_bonus("");
sint32 level; sint32 level = 0;
if (pIS->Armor.ArmorType == ARMORTYPE::HEAVY) if (pIS->Armor.ArmorType == ARMORTYPE::HEAVY)
level = item->getQuality(); level = item->getQuality();
@ -3613,7 +3613,7 @@ public:
uint8 index; uint8 index;
fromString(Params, index); fromString(Params, index);
--index; // Param is 1-based so subtract 1 --index; // Param is 1-based so subtract 1
if (index < 0 || index >= MAX_INVENTORY_ANIMAL) if (index >= MAX_INVENTORY_ANIMAL)
{ {
return; return;
} }

View file

@ -255,7 +255,7 @@ void CAnimalPositionState::serial(NLMISC::IStream &f)
// *************************************************************************** // ***************************************************************************
CEntityCL *CNamedEntityPositionState::getEntity() CEntityCL *CNamedEntityPositionState::getEntity()
{ {
if (!dbOk()) return false; if (!dbOk()) return NULL;
return EntitiesMngr.getEntityByName(_Name->getValue32()); return EntitiesMngr.getEntityByName(_Name->getValue32());
} }

View file

@ -30,6 +30,7 @@
class IBrickLearnedCallback class IBrickLearnedCallback
{ {
public: public:
virtual ~IBrickLearnedCallback() { }
virtual void onBrickLearned() =0; virtual void onBrickLearned() =0;
}; };

View file

@ -153,7 +153,7 @@ protected:
// ctor // ctor
CChatWindow(); CChatWindow();
// dtor // dtor
~CChatWindow(); virtual ~CChatWindow();
protected: protected:
IChatWindowListener *_Listener; IChatWindowListener *_Listener;
NLMISC::CRefPtr<CGroupContainer> _Chat; NLMISC::CRefPtr<CGroupContainer> _Chat;

View file

@ -3221,7 +3221,7 @@ void CGroupHTML::handle ()
else else
{ {
/* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */ /* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */
HTNet_addAfter(requestTerminater, NULL, (void*)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); HTNet_addAfter(requestTerminater, NULL, (void*)(size_t)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST);
/* Set the timeout for long we are going to wait for a response */ /* Set the timeout for long we are going to wait for a response */
HTHost_setEventTimeout(60000); HTHost_setEventTimeout(60000);
@ -3367,7 +3367,7 @@ void CGroupHTML::handle ()
else else
{ {
/* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */ /* Add our own request terminate handler. Nb: pass as param a UID, not the ptr */
HTNet_addAfter(requestTerminater, NULL, (void*)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST); HTNet_addAfter(requestTerminater, NULL, (void*)(size_t)_GroupHtmlUID, HT_ALL, HT_FILTER_LAST);
/* Start the first request */ /* Start the first request */

View file

@ -102,7 +102,7 @@ void CViewTextMenu::setAlpha (sint32 a)
{ {
OldShadowColor.A = OldColor.A = (uint8)a; OldShadowColor.A = OldColor.A = (uint8)a;
OldShadowColorOver.A = OldColorOver.A = (uint8)a; OldShadowColorOver.A = OldColorOver.A = (uint8)a;
OldShadowColorGrayed.A = OldShadowColorGrayed.A = (uint8)a; OldShadowColorGrayed.A = OldColorGrayed.A = (uint8)a;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------

View file

@ -37,7 +37,7 @@ class CInterfaceTrack
public: public:
CInterfaceTrack(); CInterfaceTrack();
~CInterfaceTrack(); virtual ~CInterfaceTrack();
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
@ -90,7 +90,7 @@ class CInterfaceAnim
public: public:
CInterfaceAnim(); CInterfaceAnim();
~CInterfaceAnim(); virtual ~CInterfaceAnim();
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);

View file

@ -78,11 +78,11 @@ CInterfaceExprNode *CInterfaceExpr::buildExprTree(const std::string &expr)
{ {
std::string tempStr; std::string tempStr;
formatLuaCall(expr, tempStr); formatLuaCall(expr, tempStr);
if (!buildExprTree(tempStr.c_str(), node)) return false; if (buildExprTree(tempStr.c_str(), node) == NULL) return false;
} }
else else
{ {
if (!buildExprTree(expr.c_str(), node)) return false; if (buildExprTree(expr.c_str(), node) == NULL) return false;
} }
return node; return node;

View file

@ -222,6 +222,7 @@ public:
class IStringProcess class IStringProcess
{ {
public: public:
virtual ~IStringProcess() { }
virtual bool cbIDStringReceived(ucstring &inOut) = 0; // called when string or id is received (return true if valid the change) virtual bool cbIDStringReceived(ucstring &inOut) = 0; // called when string or id is received (return true if valid the change)
}; };

View file

@ -65,7 +65,7 @@ namespace R2
void loadFeatures(); void loadFeatures();
~CDynamicMapClient(); virtual ~CDynamicMapClient();
void loadDefaultPalette(); void loadDefaultPalette();

View file

@ -47,6 +47,10 @@ namespace R2
class IAiWrapper class IAiWrapper
{ {
public: public:
virtual ~IAiWrapper()
{
}
virtual void init(NLLIGO::CLigoConfig * ligoConfig) virtual void init(NLLIGO::CLigoConfig * ligoConfig)
{ {
} }

View file

@ -32,7 +32,7 @@ class CField {
public: public:
CField(); CField();
CField(std::string); CField(std::string);
~CField(); virtual ~CField();
virtual const std::vector<IValue *> &getPossibleValues() const; virtual const std::vector<IValue *> &getPossibleValues() const;
virtual void addPossibleValue(IValue *); virtual void addPossibleValue(IValue *);
virtual ICondNode *createNode(int, int, std::vector<CRecord *> &) = 0; virtual ICondNode *createNode(int, int, std::vector<CRecord *> &) = 0;

View file

@ -23,7 +23,7 @@ class INode
{ {
public: public:
INode(); INode();
~INode(); virtual ~INode();
virtual bool propagRecord(CRecord *) = 0; virtual bool propagRecord(CRecord *) = 0;
}; };

View file

@ -27,7 +27,7 @@ class CRecord {
public: public:
CRecord(); CRecord();
CRecord(std::vector<IValue *> &); CRecord(std::vector<IValue *> &);
~CRecord(); virtual ~CRecord();
const std::vector<IValue *> &getValues(); const std::vector<IValue *> &getValues();
void addValue(IValue *); void addValue(IValue *);
void addValue(std::string &); void addValue(std::string &);

View file

@ -126,6 +126,8 @@ namespace NLQT
} // end default } // end default
} // end switch valueFrom } // end switch valueFrom
} // end case nodeForm } // end case nodeForm
default:
break;
} // end switch nodeFrom } // end switch nodeFrom
return QVariant(); return QVariant();
} }

View file

@ -79,6 +79,8 @@ namespace NLQT
} }
} }
} }
default:
break;
} }
return true; return true;
} }

View file

@ -507,7 +507,7 @@ int extractBotNames(int argc, char *argv[])
map<string, TEntryInfo>::iterator first(SimpleNames.begin()), last(SimpleNames.end()); map<string, TEntryInfo>::iterator first(SimpleNames.begin()), last(SimpleNames.end());
for (; first != last; ++first) for (; first != last; ++first)
{ {
uint rowIdx; uint rowIdx = 0;
if (!botNames.findRow(botIdCol, first->first, rowIdx)) if (!botNames.findRow(botIdCol, first->first, rowIdx))
{ {
// we need to add the entry // we need to add the entry
@ -524,7 +524,7 @@ int extractBotNames(int argc, char *argv[])
{ {
// set/update the sheet name info // set/update the sheet name info
// try to restore the existing translation // try to restore the existing translation
uint transRowIdx; uint transRowIdx = 0;
if (transBotNames.findRow(transIdCol, first->first, transRowIdx)) if (transBotNames.findRow(transIdCol, first->first, transRowIdx))
{ {
ucstring wkBotName = botNames.getData(rowIdx, ucstring("bot name")); ucstring wkBotName = botNames.getData(rowIdx, ucstring("bot name"));