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
if (instrStr != 'ARL ')
if (instrStr != NELID("ARL"))
{
if (instr.Dest.Type == CVPOperand::AddressRegister)
{

View file

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

View file

@ -253,10 +253,7 @@
</layout>
</item>
</layout>
<zorder>horizontalLayoutWidget</zorder>
<zorder>dataDirLabel</zorder>
<zorder>horizontalLayoutWidget</zorder>
<zorder></zorder>
</widget>
</item>
</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)
{
f.serialCheck((uint32) '_GNM');
f.serialCheck((uint32) 'MHCS');
f.serialCheck(NELID("_GNM"));
f.serialCheck(NELID("MHCS"));
f.serialVersion(1);
if (!f.isReading())
{

View file

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

View file

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

View file

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

View file

@ -2277,7 +2277,7 @@ public:
sint32 xmax = (sint32) max.x();
sint32 ymin = (sint32) (sint16) min.y();
sint32 ymax = (sint32) (sint16) max.y();
output.serialCheck((uint32) 'OBSI');
output.serialCheck(NELID("OBSI"));
output.serial(xmin);
output.serial(xmax);
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;
}
static char* hexEncoderTcl =
static const char* hexEncoderTcl =
"proc copy_encoded {} {"
" # Get the args from the text fields"
" set group [ .group.name get 1.0 end ]"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -104,7 +104,7 @@ public:
FILE* fileHandle= fopen(DailyActivityLogFileName,"ab");
nlassert(fileHandle!=NULL);
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());
fclose(fileHandle);
}

View file

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

View file

@ -176,7 +176,7 @@ CTimestamp CDbManager::_LastUpdateTime;
*/
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
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)
{
CHECK_DB_MGR_INIT(loadDatabase, false);
CHECK_DB_MGR_INIT(loadDatabase, NULL);
nlinfo("CDbManager::loadDatabase(): load/setup database '%d'", id);

View file

@ -1195,7 +1195,7 @@ CDatabase* CDatabase::adapt(const string& description)
if (!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())
{
PDS_WARNING("getIndexName(): type is not an index");
return false;
return "";
}
if (isEnum())

View file

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

View file

@ -401,7 +401,7 @@ void CPackedWorldBuilder::fly(std::vector<CIslandInfo> &islands, float camSpeed
// fly into scene
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)
{

View file

@ -607,7 +607,7 @@ int main(int argc, char* argv[])
// fly into scene
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)
{