Fixed: Some warnings

This commit is contained in:
kervala 2013-09-29 16:26:24 +02:00
parent de42e4d7ff
commit de43ea8d86
23 changed files with 30 additions and 34 deletions

View file

@ -885,7 +885,7 @@ bool CVPParser::parseInstruction(CVPInstruction &instr, std::string &errorOutput
} }
// it is not allowed to write to an adress register except for ARL // it is not allowed to write to an adress register except for ARL
if (instrStr != 'ARL ') if (instrStr != NELID("ARL"))
{ {
if (instr.Dest.Type == CVPOperand::AddressRegister) if (instr.Dest.Type == CVPOperand::AddressRegister)
{ {

View file

@ -16,6 +16,7 @@
#include "stdpacs.h" #include "stdpacs.h"
#include "nel/misc/i_xml.h" #include "nel/misc/i_xml.h"
#include "nel/misc/stream.h"
#include "nel/pacs/primitive_block.h" #include "nel/pacs/primitive_block.h"

View file

@ -253,10 +253,7 @@
</layout> </layout>
</item> </item>
</layout> </layout>
<zorder>horizontalLayoutWidget</zorder>
<zorder>dataDirLabel</zorder> <zorder>dataDirLabel</zorder>
<zorder>horizontalLayoutWidget</zorder>
<zorder></zorder>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -50,8 +50,8 @@ void CSchemeManager::getSchemes(const std::string &type, std::vector<TSchemeInfo
void CSchemeManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream) void CSchemeManager::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{ {
f.serialCheck((uint32) '_GNM'); f.serialCheck(NELID("_GNM"));
f.serialCheck((uint32) 'MHCS'); f.serialCheck(NELID("MHCS"));
f.serialVersion(1); f.serialVersion(1);
if (!f.isReading()) if (!f.isReading())
{ {

View file

@ -42,15 +42,15 @@ static void compressMipMap(uint8 *pixSrc, sint width, sint height, vector<uint8
case DXT1: case DXT1:
case DXT1A: case DXT1A:
flags |= squish::kDxt1; flags |= squish::kDxt1;
dest.ddpf.dwFourCC = MAKEFOURCC('D','X', 'T', '1'); dest.ddpf.dwFourCC = MAKEFOURCC('D', 'X', 'T', '1');
break; break;
case DXT3: case DXT3:
flags |= squish::kDxt3; flags |= squish::kDxt3;
dest.ddpf.dwFourCC = MAKEFOURCC('D','X', 'T', '3'); dest.ddpf.dwFourCC = MAKEFOURCC('D', 'X', 'T', '3');
break; break;
case DXT5: case DXT5:
flags |= squish::kDxt5; flags |= squish::kDxt5;
dest.ddpf.dwFourCC = MAKEFOURCC('D','X', 'T', '5'); dest.ddpf.dwFourCC = MAKEFOURCC('D', 'X', 'T', '5');
break; break;
} }

View file

@ -154,7 +154,7 @@ private:
/// Serializes /// Serializes
void serial(NLMISC::IStream &f) void serial(NLMISC::IStream &f)
{ {
f.serialCheck((uint32)('PCHK')); f.serialCheck(NELID("PCHK"));
f.serialVersion(0); f.serialVersion(0);
if (f.isReading()) if (f.isReading())

View file

@ -591,7 +591,7 @@ bool CDBCtrlSheet::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
return false; return false;
prop = (char*) xmlGetProp( cur, (xmlChar*)"dragable" ); prop = (char*) xmlGetProp( cur, (xmlChar*)"dragable" );
if( prop != NULL ) if (prop)
setDraggable( CInterfaceElement::convertBool(prop) ); setDraggable( CInterfaceElement::convertBool(prop) );
else else
setDraggable( false ); setDraggable( false );

View file

@ -2277,7 +2277,7 @@ public:
sint32 xmax = (sint32) max.x(); sint32 xmax = (sint32) max.x();
sint32 ymin = (sint32) (sint16) min.y(); sint32 ymin = (sint32) (sint16) min.y();
sint32 ymax = (sint32) (sint16) max.y(); sint32 ymax = (sint32) (sint16) max.y();
output.serialCheck((uint32) 'OBSI'); output.serialCheck(NELID("OBSI"));
output.serial(xmin); output.serial(xmin);
output.serial(xmax); output.serial(xmax);
output.serial(ymin); output.serial(ymin);

View file

@ -1700,7 +1700,7 @@ NLMISC_COMMAND(scriptHex,"execute a hex-encoded script for a group in the given
return true; return true;
} }
static char* hexEncoderTcl = static const char* hexEncoderTcl =
"proc copy_encoded {} {" "proc copy_encoded {} {"
" # Get the args from the text fields" " # Get the args from the text fields"
" set group [ .group.name get 1.0 end ]" " set group [ .group.name get 1.0 end ]"

View file

@ -21,7 +21,7 @@
namespace EGSPD namespace EGSPD
{ {
static const struct { char* Name; CFameTrend::TFameTrend Value; } TFameTrendConvert[] = static const struct { const char* Name; CFameTrend::TFameTrend Value; } TFameTrendConvert[] =
{ {
{ "FameUpward", CFameTrend::FameUpward }, { "FameUpward", CFameTrend::FameUpward },
{ "FameDownward", CFameTrend::FameDownward }, { "FameDownward", CFameTrend::FameDownward },

View file

@ -494,7 +494,7 @@ bool CGuildMemberModule::canAffectGrade(EGSPD::CGuildGrade::TGuildGrade)const
CMissionGuild * CGuildMemberModule::pickMission( TAIAlias alias ) CMissionGuild * CGuildMemberModule::pickMission( TAIAlias alias )
{ {
/// todo guild mission /// todo guild mission
return false; return NULL;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View file

@ -349,13 +349,13 @@ static std::string getActiveOutputPath()
if (TheCharScanScriptFile==NULL) if (TheCharScanScriptFile==NULL)
{ {
nlwarning("There is no active script file right now from which to extract output directory"); nlwarning("There is no active script file right now from which to extract output directory");
return false; return "";
} }
bool isOK=true; bool isOK=true;
// write the current script file to a tmp file // write the current script file to a tmp file
isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName); isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName);
if (!isOK) return false; if (!isOK) return "";
// create a new script object and assign the tmp file to it // create a new script object and assign the tmp file to it
CCharScanScript script; CCharScanScript script;

View file

@ -336,7 +336,7 @@ void cbImpulsionFilter( CMessage& msgin, const string &serviceName, TServiceId s
} // impulsionFilter // } // impulsionFilter //
static char*DebugChatModeName[] = static const char* DebugChatModeName[] =
{ {
"say", "say",
"shout", "shout",

View file

@ -42,7 +42,7 @@ extern CVariable<bool> VerboseStringManager;
#define LOG if (!VerboseStringManager) {} else nlinfo #define LOG if (!VerboseStringManager) {} else nlinfo
char *OperatorNames[] = const char *OperatorNames[] =
{ {
"equal", "equal",
"notEqual", "notEqual",

View file

@ -521,9 +521,7 @@ public:
BsiGlobal); BsiGlobal);
saveFile.FileName = threadResult.OutputFilename; saveFile.FileName = threadResult.OutputFilename;
char *newLine="\n"; const char *newLine="\n";
list<string>::const_iterator first(threadResult.Lines->begin()), last(threadResult.Lines->end()); list<string>::const_iterator first(threadResult.Lines->begin()), last(threadResult.Lines->end());
for (uint32 localCounter = 0; first != last; ++first, ++localCounter) for (uint32 localCounter = 0; first != last; ++first, ++localCounter)

View file

@ -104,7 +104,7 @@ public:
FILE* fileHandle= fopen(DailyActivityLogFileName,"ab"); FILE* fileHandle= fopen(DailyActivityLogFileName,"ab");
nlassert(fileHandle!=NULL); nlassert(fileHandle!=NULL);
fprintf(fileHandle,"%02u/%02u/%u CDailyTaskScheduler: Started: %02u:%02u, Finished: %02u:%02u, Executed %u commands Started %u Jobs\n", fprintf(fileHandle,"%02u/%02u/%u CDailyTaskScheduler: Started: %02u:%02u, Finished: %02u:%02u, Executed %u commands Started %u Jobs\n",
ptm->tm_mday, ptm->tm_mon+1, ptm->tm_year+1900, startTime/3600%24, startTime/60%60, endTime/3600%24, endTime/60%60, commandsVar==NULL?0:commandsVar->size(), jobsRemaining ); ptm->tm_mday, ptm->tm_mon+1, ptm->tm_year+1900, (uint)startTime/3600%24, (uint)startTime/60%60, (uint)endTime/3600%24, (uint)endTime/60%60, commandsVar==NULL?0:commandsVar->size(), jobsRemaining );
nlinfo("JobManager state: %s",CJobManager::getInstance()->getStatus().c_str()); nlinfo("JobManager state: %s",CJobManager::getInstance()->getStatus().c_str());
fclose(fileHandle); fclose(fileHandle);
} }

View file

@ -518,13 +518,13 @@ static std::string getActiveOutputPath()
if (TheCharScanScriptFile==NULL) if (TheCharScanScriptFile==NULL)
{ {
nlwarning("There is no active script file right now from which to extract output directory"); nlwarning("There is no active script file right now from which to extract output directory");
return false; return "";
} }
bool isOK=true; bool isOK=true;
// write the current script file to a tmp file // write the current script file to a tmp file
isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName); isOK=TheCharScanScriptFile->writeToFile(TmpScriptFileName);
if (!isOK) return false; if (!isOK) return "";
// create a new script object and assign the tmp file to it // create a new script object and assign the tmp file to it
CCharScanScriptFile script; CCharScanScriptFile script;

View file

@ -176,7 +176,7 @@ CTimestamp CDbManager::_LastUpdateTime;
*/ */
CDatabase* CDbManager::createDatabase(TDatabaseId id, CLog* log) CDatabase* CDbManager::createDatabase(TDatabaseId id, CLog* log)
{ {
CHECK_DB_MGR_INIT(createDatabase, false); CHECK_DB_MGR_INIT(createDatabase, NULL);
// check db doesn't exist yet // check db doesn't exist yet
CDatabase* db = getDatabase(id); CDatabase* db = getDatabase(id);
@ -229,7 +229,7 @@ bool CDbManager::deleteDatabase(TDatabaseId id, CLog* log)
*/ */
CDatabase* CDbManager::loadDatabase(TDatabaseId id, const string& description, CLog* log) CDatabase* CDbManager::loadDatabase(TDatabaseId id, const string& description, CLog* log)
{ {
CHECK_DB_MGR_INIT(loadDatabase, false); CHECK_DB_MGR_INIT(loadDatabase, NULL);
nlinfo("CDbManager::loadDatabase(): load/setup database '%d'", id); nlinfo("CDbManager::loadDatabase(): load/setup database '%d'", id);

View file

@ -1195,7 +1195,7 @@ CDatabase* CDatabase::adapt(const string& description)
if (!buildReference()) if (!buildReference())
{ {
PDS_WARNING("adapt(): failed to buildReference()"); PDS_WARNING("adapt(): failed to buildReference()");
return false; return NULL;
} }
} }

View file

@ -194,7 +194,7 @@ string CType::getIndexName(TEnumValue value, bool verbose) const
if (!isIndex()) if (!isIndex())
{ {
PDS_WARNING("getIndexName(): type is not an index"); PDS_WARNING("getIndexName(): type is not an index");
return false; return "";
} }
if (isEnum()) if (isEnum())

View file

@ -276,7 +276,7 @@ int main(int argc, char* argv[])
try try
{ {
CIFile f(builderConfig.CWMapCachePath + "/" + shortname + ".cw_height"); CIFile f(builderConfig.CWMapCachePath + "/" + shortname + ".cw_height");
f.serialCheck((uint32) 'OBSI'); f.serialCheck(NELID("OBSI"));
f.serial(xmin); f.serial(xmin);
f.serial(xmax); f.serial(xmax);
f.serial(ymin); f.serial(ymin);
@ -322,7 +322,7 @@ int main(int argc, char* argv[])
// now extract each island height // now extract each island height
// read back coordinates // read back coordinates
CIFile f(builderConfig.CWMapCachePath + "/" + shortname + ".cw_height"); CIFile f(builderConfig.CWMapCachePath + "/" + shortname + ".cw_height");
f.serialCheck((uint32) 'OBSI'); f.serialCheck(NELID("OBSI"));
f.serial(xmin); f.serial(xmin);
f.serial(xmax); f.serial(xmax);
f.serial(ymin); f.serial(ymin);
@ -349,7 +349,7 @@ int main(int argc, char* argv[])
try try
{ {
COFile f(builderConfig.OutputPath + "/" + completeIslands[l]->Island + ".island_hm"); COFile f(builderConfig.OutputPath + "/" + completeIslands[l]->Island + ".island_hm");
f.serialCheck((uint32) 'MHSI'); f.serialCheck(NELID("MHSI"));
f.serial(island); f.serial(island);
// export tga for check // export tga for check
if (builderConfig.HeightMapsAsTga) if (builderConfig.HeightMapsAsTga)

View file

@ -401,7 +401,7 @@ void CPackedWorldBuilder::fly(std::vector<CIslandInfo> &islands, float camSpeed
// fly into scene // fly into scene
try try
{ {
CNELU::init(1024, 768, CViewport(), 32, true, NULL, false, true); CNELU::init(1024, 768, CViewport(), 32, true, EmptyWindow, false, true);
} }
catch(const Exception &e) catch(const Exception &e)
{ {

View file

@ -607,7 +607,7 @@ int main(int argc, char* argv[])
// fly into scene // fly into scene
try try
{ {
CNELU::init(1024, 768, CViewport(), 32, true, NULL, false, true); CNELU::init(1024, 768, CViewport(), 32, true, EmptyWindow, false, true);
} }
catch(const Exception &e) catch(const Exception &e)
{ {