[9107] Fix most of the gcc warnings

* use UI64FMTD instead of "%u" for uint64 output
* on most *NIX systems, I64FMT is "%016lX" and not "%016llX"
* also fix typo: renamed GridMap::loadHeihgtData to GridMap::loadHeightData

Note: there are still many warnings from the 3rd party libraries g3dlite and ACE. Those warnings won't be fixed with that commit.
Also, a few warnings from MaNGOS are left, they'll be fixed later.

Signed-off-by: XTZGZoReX <xtzgzorex@gmail.com>
This commit is contained in:
DasBlub 2010-01-02 22:43:50 +01:00 committed by XTZGZoReX
parent e568293d2c
commit ebb063beb9
14 changed files with 53 additions and 48 deletions

View file

@ -896,7 +896,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
<< (m_isDeadByDefault ? 1 : 0) << "," //is_dead
<< GetDefaultMovementType() << ")"; //default movement generator type
WorldDatabase.PExecuteLog( ss.str( ).c_str( ) );
WorldDatabase.PExecuteLog("%s", ss.str().c_str());
WorldDatabase.CommitTransaction();
}

View file

@ -558,7 +558,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
WorldDatabase.BeginTransaction();
WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
WorldDatabase.PExecuteLog( ss.str( ).c_str( ) );
WorldDatabase.PExecuteLog("%s", ss.str().c_str());
WorldDatabase.CommitTransaction();
}

View file

@ -1212,7 +1212,7 @@ bool GridMap::loadData(char *filename)
return false;
}
// loadup height data
if (header.heightMapOffset && !loadHeihgtData(in, header.heightMapOffset, header.heightMapSize))
if (header.heightMapOffset && !loadHeightData(in, header.heightMapOffset, header.heightMapSize))
{
sLog.outError("Error loading map height data\n");
fclose(in);
@ -1265,7 +1265,7 @@ bool GridMap::loadAreaData(FILE *in, uint32 offset, uint32 size)
return true;
}
bool GridMap::loadHeihgtData(FILE *in, uint32 offset, uint32 size)
bool GridMap::loadHeightData(FILE *in, uint32 offset, uint32 size)
{
map_heightHeader header;
fseek(in, offset, SEEK_SET);

View file

@ -176,7 +176,7 @@ class GridMap
float *m_liquid_map;
bool loadAreaData(FILE *in, uint32 offset, uint32 size);
bool loadHeihgtData(FILE *in, uint32 offset, uint32 size);
bool loadHeightData(FILE *in, uint32 offset, uint32 size);
bool loadLiquidData(FILE *in, uint32 offset, uint32 size);
// Get height functions and pointers

View file

@ -845,7 +845,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
else if(missingKey)
GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
else if(missingQuest)
SendAreaTriggerMessage(at->requiredFailedText.c_str());
SendAreaTriggerMessage("%s", at->requiredFailedText.c_str());
else if(missingLevel)
SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED), missingLevel);
return;

View file

@ -4524,7 +4524,7 @@ void ObjectMgr::LoadPageTexts()
ss << *itr << " ";
ss << "create(s) a circular reference, which can cause the server to freeze. Changing Next_Page of page "
<< pageItr->Page_ID <<" to 0";
sLog.outErrorDb(ss.str().c_str());
sLog.outErrorDb("%s", ss.str().c_str());
const_cast<PageText*>(pageItr)->Next_Page = 0;
break;
}

View file

@ -16594,7 +16594,7 @@ void Player::SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint
<< "',position_z='"<<z<<"',orientation='"<<o<<"',map='"<<mapid
<< "',zone='"<<zone<<"',trans_x='0',trans_y='0',trans_z='0',"
<< "transguid='0',taxi_path='' WHERE guid='"<< GUID_LOPART(guid) <<"'";
sLog.outDebug(ss.str().c_str());
sLog.outDebug("%s", ss.str().c_str());
CharacterDatabase.Execute(ss.str().c_str());
}

View file

@ -605,7 +605,7 @@ void PoolManager::LoadFromDB()
ss << *itr << " ";
ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
<< poolItr->first << " and child pool " << poolItr->second;
sLog.outErrorDb(ss.str().c_str());
sLog.outErrorDb("%s", ss.str().c_str());
mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
mPoolSearchMap.erase(poolItr);
--count;

View file

@ -149,7 +149,7 @@ void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char *reason)
/// Logging helper for unexpected opcodes
void WorldSession::LogUnprocessedTail(WorldPacket *packet)
{
sLog.outError( "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)",
sLog.outError( "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at " SIZEFMTD " from " SIZEFMTD ")",
LookupOpcodeName(packet->GetOpcode()),
packet->GetOpcode(),
packet->rpos(),packet->wpos());

View file

@ -45,9 +45,9 @@ void utf8print(const char* str)
char temp_buf[6000];
CharToOemBuffW(&wtemp_buf[0],&temp_buf[0],wtemp_len+1);
printf(temp_buf);
printf("%s", temp_buf);
#else
printf(str);
printf("%s", str);
#endif
}

View file

@ -128,8 +128,13 @@
# define stricmp strcasecmp
# define strnicmp strncasecmp
# define I32FMT "%08X"
# if ACE_SIZEOF_LONG == 8
# define I64FMT "%016lX"
# else
# define I64FMT "%016llX"
# endif /* ACE_SIZEOF_LONG == 8 */
#endif

View file

@ -95,13 +95,13 @@ bool SqlQueryHolder::SetQuery(size_t index, const char *sql)
{
if(m_queries.size() <= index)
{
sLog.outError("Query index (%u) out of range (size: %u) for query: %s",index,(uint32)m_queries.size(),sql);
sLog.outError("Query index (" SIZEFMTD ") out of range (size: " SIZEFMTD ") for query: %s",index,(uint32)m_queries.size(),sql);
return false;
}
if(m_queries[index].first != NULL)
{
sLog.outError("Attempt assign query to holder index (%u) where other query stored (Old: [%s] New: [%s])",
sLog.outError("Attempt assign query to holder index (" SIZEFMTD ") where other query stored (Old: [%s] New: [%s])",
index,m_queries[index].first,sql);
return false;
}
@ -115,7 +115,7 @@ bool SqlQueryHolder::SetPQuery(size_t index, const char *format, ...)
{
if(!format)
{
sLog.outError("Query (index: %u) is empty.",index);
sLog.outError("Query (index: " SIZEFMTD ") is empty.",index);
return false;
}

View file

@ -329,7 +329,7 @@ void Log::outTitle( const char * str)
SetColor(true,WHITE);
// not expected utf8 and then send as-is
printf( str );
printf("%s", str);
if(m_colored)
ResetColor(true);
@ -337,7 +337,7 @@ void Log::outTitle( const char * str)
printf("\n");
if(logfile)
{
fprintf(logfile, str);
fprintf(logfile, "%s", str);
fprintf(logfile, "\n" );
fflush(logfile);
}
@ -706,7 +706,7 @@ void Log::outWorldPacketDump( uint32 socket, uint32 opcode, char const* opcodeNa
outTimestamp(worldLogfile);
fprintf(worldLogfile,"\n%s:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
fprintf(worldLogfile,"\n%s:\nSOCKET: %u\nLENGTH: " SIZEFMTD "\nOPCODE: %s (0x%.4X)\nDATA:\n",
incoming ? "CLIENT" : "SERVER",
socket, packet->size(), opcodeName, opcode);
@ -792,7 +792,7 @@ void outstring_log(const char * str, ...)
vsnprintf(buf, 256, str, ap);
va_end(ap);
sLog.outString(buf);
sLog.outString("%s", buf);
}
void detail_log(const char * str, ...)
@ -806,7 +806,7 @@ void detail_log(const char * str, ...)
vsnprintf(buf,256, str, ap);
va_end(ap);
sLog.outDetail(buf);
sLog.outDetail("%s", buf);
}
void debug_log(const char * str, ...)
@ -820,7 +820,7 @@ void debug_log(const char * str, ...)
vsnprintf(buf,256, str, ap);
va_end(ap);
sLog.outDebug(buf);
sLog.outDebug("%s", buf);
}
void error_log(const char * str, ...)
@ -834,7 +834,7 @@ void error_log(const char * str, ...)
vsnprintf(buf,256, str, ap);
va_end(ap);
sLog.outError(buf);
sLog.outError("%s", buf);
}
void error_db_log(const char * str, ...)
@ -848,5 +848,5 @@ void error_db_log(const char * str, ...)
vsnprintf(buf,256, str, ap);
va_end(ap);
sLog.outErrorDb(buf);
sLog.outErrorDb("%s", buf);
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9106"
#define REVISION_NR "9107"
#endif // __REVISION_NR_H__