diff --git a/mpshared/netmessage.h b/mpshared/netmessage.h index b03c00f..383f264 100644 --- a/mpshared/netmessage.h +++ b/mpshared/netmessage.h @@ -284,7 +284,7 @@ public: #ifdef LOGGING void ToString(char *psz, int cb) { snprintf(psz, cb, - "CsUpdateResult(cUpdatesBlock: %ld, hash %08lx, cmsLatency: %ld)", + "CsUpdateResult(cUpdatesBlock: %ld, hash %08x, cmsLatency: %ld)", ur.cUpdatesBlock, ur.hash, ur.cmsLatency); } #endif @@ -384,7 +384,7 @@ public: void ToString(char *psz, int cb) { snprintf(psz, cb, "WinStatsNetMessage(" "sidm: %08x, sidmAllies: %08x, " - "cCreditsAcquired: %ld, cCreditsConsumed: %ld, " + "cCreditsAcquired: %u, cCreditsConsumed: %u, " "cEnemyMobileUnitsKilled: %d, cEnemyStructuresKilled: %d, " "cMobileUnitsLost: %d, cStructuresLost: %d, ff: %08x)", ws.sidm, ws.sidmAllies, diff --git a/server/Makefile b/server/Makefile index 3b865a0..58d514f 100644 --- a/server/Makefile +++ b/server/Makefile @@ -1,13 +1,14 @@ # Compiler command line # Add warning check for implicit data type resolution loss, otherwise # gcc is silent. -PRE_CC=g++ -m32 UNAME := $(shell uname) ifeq ($(UNAME), Darwin) +PRE_CC=g++ -m32 CC=$(PRE_CC) -Wshorten-64-to-32 endif ifeq ($(UNAME), Linux) -CC=$(PRE_CC) +PRE_CC=g++-4.2 -m32 +CC=$(PRE_CC) -Wconversion endif LD=$(CC) diff --git a/server/logger.cpp b/server/logger.cpp index 33b0ee8..7b0a769 100644 --- a/server/logger.cpp +++ b/server/logger.cpp @@ -14,7 +14,7 @@ Logger::Logger(const char *pszDir, dword server_id) : rotating_(false) { char szPrefix[64]; - sprintf(szPrefix, "server-%lu-%lu", base::GetSecondsUnixEpocUTC(), server_id); + sprintf(szPrefix, "server-%u-%u", base::GetSecondsUnixEpocUTC(), server_id); prefix_ = szPrefix; worker_.Start(this, &Logger::ThreadStart); } diff --git a/server/ncpdbreader.cpp b/server/ncpdbreader.cpp index cf7a698..a5de3fa 100644 --- a/server/ncpdbreader.cpp +++ b/server/ncpdbreader.cpp @@ -157,7 +157,7 @@ bool NoCachePdbReader::ReadRecord(word nRec, word n, word cb, void *pv) return true; } -byte *NoCachePdbReader::MapRecord(word nRec, dword *pdwCookie, word *pcb) +byte *NoCachePdbReader::MapRecord(word nRec, void **ppvCookie, word *pcb) { // First see if the record is cached @@ -182,18 +182,18 @@ byte *NoCachePdbReader::MapRecord(word nRec, dword *pdwCookie, word *pcb) } m_cMapped++; - *pdwCookie = (dword)pbT; + *ppvCookie = pbT; *pcb = cbT; return pbT; } -void NoCachePdbReader::UnmapRecord(word nRec, dword dwCookie) +void NoCachePdbReader::UnmapRecord(word nRec, void *pvCookie) { Assert(m_pb != NULL); Assert(nRec < m_cRecs); Assert(m_cMapped > 0); m_cMapped--; - byte *pb = (byte *)dwCookie; + byte *pb = (byte *)pvCookie; delete[] pb; } diff --git a/server/ncpdbreader.h b/server/ncpdbreader.h index 8bd6109..cd9d618 100644 --- a/server/ncpdbreader.h +++ b/server/ncpdbreader.h @@ -22,8 +22,8 @@ public: virtual void Close(); virtual bool GetRecordSize(word nRec, word *pcb); virtual bool ReadRecord(word nRec, word n, word cb, void *pv); - virtual byte *MapRecord(word nRec, dword *pdwCookie, word *pcb = NULL); - virtual void UnmapRecord(word nRec, dword dwCookie); + virtual byte *MapRecord(word nRec, void **ppvCookie, word *pcb = NULL); + virtual void UnmapRecord(word nRec, void *pvCookie); private: bool GetRecordEntry(word nRec, int cRec, RecordEntryType *prece, diff --git a/server/player.cpp b/server/player.cpp index 5acaf87..2ade0f9 100644 --- a/server/player.cpp +++ b/server/player.cpp @@ -16,7 +16,7 @@ Player::Player() { Init(0); } -bool Player::Init(Pid pid) { +void Player::Init(Pid pid) { anonymous_ = false; havestats_ = false; cur_ = 0; diff --git a/server/player.h b/server/player.h index 6c8d57e..34ae8a5 100644 --- a/server/player.h +++ b/server/player.h @@ -31,7 +31,7 @@ class Player { public: Player(); - bool Init(Pid pid); + void Init(Pid pid); Pid pid() const { return pid_; } void SetEndpoint(Endpoint *endpoint); Endpoint *endpoint() const { return endpoint_; }