Skip to content

Commit

Permalink
Got rid of warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ashdnazg committed Jul 26, 2015
1 parent 78df767 commit aeafb4b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
11 changes: 10 additions & 1 deletion rts/Sim/Path/Default/PathCache.cpp
Expand Up @@ -23,7 +23,12 @@ CPathCache::CPathCache(int blocksX, int blocksZ)

CPathCache::~CPathCache()
{
LOG("[%s(%ux%u)] cacheHits=%u hitPercentage=%.0f%% numHashColls=%u maxCacheSize=%lu",
LOG(
#ifdef _WIN32
"[%s(%ux%u)] cacheHits=%u hitPercentage=%.0f%% numHashColls=%u maxCacheSize=%I64u",
#else
"[%s(%ux%u)] cacheHits=%u hitPercentage=%.0f%% numHashColls=%u maxCacheSize=%lu",
#endif
__FUNCTION__, numBlocksX, numBlocksZ, numCacheHits, GetCacheHitPercentage(), numHashCollisions, maxCacheSize);

for (CachedPathConstIter iter = cachedPaths.begin(); iter != cachedPaths.end(); ++iter)
Expand Down Expand Up @@ -166,7 +171,11 @@ bool CPathCache::HashCollision(

if (hashColl) {
LOG_L(L_DEBUG,
#ifdef _WIN32
"[%s][f=%d][hash=%I64u] Hash(sb=<%d,%d> gb=<%d,%d> gr=%.2f pt=%d)==Hash(sb=<%d,%d> gb=<%d,%d> gr=%.2f pt=%d)",
#else
"[%s][f=%d][hash=%lu] Hash(sb=<%d,%d> gb=<%d,%d> gr=%.2f pt=%d)==Hash(sb=<%d,%d> gb=<%d,%d> gr=%.2f pt=%d)",
#endif
__FUNCTION__, gs->frameNum,
GetHash(strtBlk, goalBlk, goalRadius, pathType),
ci->strtBlock.x, ci->strtBlock.y,
Expand Down
15 changes: 7 additions & 8 deletions rts/System/Sync/SyncDebugger.cpp
Expand Up @@ -163,14 +163,7 @@ void CSyncDebugger::Backtrace(int index, const char* prefix) const
for (unsigned i = 0; i < historybt[index].bt_size; ++i) {
// the "{%p}" part is resolved to "functionname [filename:lineno]"
// by the CLogger class.
#ifndef _WIN32
logger.AddLine("%s#%u {%p}", prefix, i, historybt[index].bt[i]);
#else
if (sizeof(void*) == 8)
logger.AddLine("%s#%u {%llx}", prefix, i, (boost::uint64_t)historybt[index].bt[i]);
else
logger.AddLine("%s#%u {%x}", prefix, i, (boost::uint32_t)historybt[index].bt[i]);
#endif
}
}
}
Expand Down Expand Up @@ -316,7 +309,13 @@ void CSyncDebugger::ServerQueueBlockRequests()
for (int j = 0; j < playerHandler->ActivePlayers(); ++j) {
if (correctFlop) {
if (players[j].remoteFlop != correctFlop)
logger.AddLine("Server: bad flop# %llu instead of %llu for player %d", players[j].remoteFlop, correctFlop, j);
logger.AddLine(
#ifdef _WIN32
"Server: bad flop# %I64u instead of %I64u for player %d",
#else
"Server: bad flop# %llu instead of %llu for player %d",
#endif
players[j].remoteFlop, correctFlop, j);
} else {
correctFlop = players[j].remoteFlop;
}
Expand Down
2 changes: 1 addition & 1 deletion rts/System/ThreadPool.cpp
Expand Up @@ -262,7 +262,7 @@ void SetThreadCount(int num)
assert(thread_group.empty());
}

LOG("[ThreadPool::%s][2] #threads=%u", __FUNCTION__, thread_group.size());
LOG("[ThreadPool::%s][2] #threads=%u", __FUNCTION__, (unsigned) thread_group.size());
}

void SetThreadSpinTime(int milliSeconds)
Expand Down
4 changes: 3 additions & 1 deletion rts/System/creg/creg.h
Expand Up @@ -521,6 +521,7 @@ namespace creg {
creg::ClassStrong<TClass>* class_ = static_cast<creg::ClassStrong<TClass>*>(class_base_); \
Type* null=nullptr; \
(void)null; /*suppress compiler warning if this isn't used*/ \
(void)class_; /*suppress compiler warning if this isn't used*/ \
Members; } \
} static TClass##mreg;

Expand All @@ -537,7 +538,8 @@ namespace creg {
void RegisterMembers(creg::Class* class_base_) { \
creg::ClassStrong<TSubClass>* class_ = static_cast<creg::ClassStrong<TSubClass>*>(class_base_); \
Type* null=nullptr; \
(void)null; \
(void)null; /*suppress compiler warning if this isn't used*/ \
(void)class_; /*suppress compiler warning if this isn't used*/ \
Members; } \
} static TSuperClass##TSubClass##mreg;

Expand Down

0 comments on commit aeafb4b

Please sign in to comment.