From 4571c2b451f566d69b6600fbf97f8dda21452b09 Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 4 May 2006 23:23:18 +0000 Subject: [PATCH] Definitions of DWORD/SDWORD changed to 'int' which is compatible with 32- and 64-bit systems; reflecting this in printf()s git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2351 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/gameopt.c | 2 +- sc2/src/sc2code/libs/file/temp.c | 2 +- sc2/src/sc2code/libs/graphics/sdl/pure.c | 4 ++-- sc2/src/sc2code/libs/memory/w_memlib.c | 2 +- sc2/src/sc2code/libs/resource/getres.c | 2 +- sc2/src/sc2code/planets/scan.c | 4 ++-- sc2/src/sc2code/save.c | 2 +- sc2/src/sc2code/sis.c | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 264daf020..60d8efa51 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -797,7 +797,7 @@ ShowSummary (SUMMARY_DESC *pSD) SetContextClipRect (&OldRect); SetContext (SpaceContext); - sprintf (buf, "%lu", GLOBAL_SIS (ResUnits)); + sprintf (buf, "%u", GLOBAL_SIS (ResUnits)); t.baseline.y = 102; r.extent.width = 76; r.extent.height = SHIP_NAME_HEIGHT; diff --git a/sc2/src/sc2code/libs/file/temp.c b/sc2/src/sc2code/libs/file/temp.c index d22b7d6e4..517fcd62f 100644 --- a/sc2/src/sc2code/libs/file/temp.c +++ b/sc2/src/sc2code/libs/file/temp.c @@ -156,7 +156,7 @@ initTempDir (void) { tempPtr = tempDirName + len; for (i = 0; i < NUM_TEMP_RETRIES; i++) { - sprintf (tempPtr, "%08lx", num + i); + sprintf (tempPtr, "%08x", num + i); if (createDirectory (tempDirName, 0700) == -1) continue; diff --git a/sc2/src/sc2code/libs/graphics/sdl/pure.c b/sc2/src/sc2code/libs/graphics/sdl/pure.c index 78d8055fc..212e991f0 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/pure.c +++ b/sc2/src/sc2code/libs/graphics/sdl/pure.c @@ -395,13 +395,13 @@ Scale_PerfTest (void) if (i % 100 == 0) { Now = SDL_GetTicks (); - log_add (log_Debug, "%03ld(%04ld) ", 100*1000 / (Now - TimeIn), + log_add (log_Debug, "%03d(%04u) ", 100*1000 / (Now - TimeIn), Now - TimeIn); TimeIn = Now; } } - log_add (log_Always, "Full frames scaled: %d; over %ld ms; %ld fps\n", + log_add (log_Always, "Full frames scaled: %d; over %u ms; %d fps\n", (i - 1), Now - TimeStart, i * 1000 / (Now - TimeStart)); SDL_UnlockSurface (scaled_display); diff --git a/sc2/src/sc2code/libs/memory/w_memlib.c b/sc2/src/sc2code/libs/memory/w_memlib.c index 06cf81b05..8ee4638f9 100644 --- a/sc2/src/sc2code/libs/memory/w_memlib.c +++ b/sc2/src/sc2code/libs/memory/w_memlib.c @@ -246,7 +246,7 @@ mem_allocate (MEM_SIZE coreSize, MEM_FLAGS flags, MEM_PRIORITY priority, log_add (log_Always, "mem_allocate: out of extents."); else if ((node->memory = MallocWithRetry (coreSize, "mem_allocate:")) == 0 && coreSize) - log_add (log_Always, "mem_allocate: couldn't allocate %u bytes.", + log_add (log_Always, "mem_allocate: couldn't allocate %ld bytes.", coreSize); else { diff --git a/sc2/src/sc2code/libs/resource/getres.c b/sc2/src/sc2code/libs/resource/getres.c index b4b0ee5c9..6a991effe 100644 --- a/sc2/src/sc2code/libs/resource/getres.c +++ b/sc2/src/sc2code/libs/resource/getres.c @@ -138,7 +138,7 @@ res_GetResource (RESOURCE res) desc = lookupResourceDesc (resourceIndex, res); if (desc == NULL) { - log_add (log_Warning, "Trying to get undefined resource %08lx", + log_add (log_Warning, "Trying to get undefined resource %08x", (DWORD) res); return NULL_HANDLE; } diff --git a/sc2/src/sc2code/planets/scan.c b/sc2/src/sc2code/planets/scan.c index 4840464ee..b517b66e5 100644 --- a/sc2/src/sc2code/planets/scan.c +++ b/sc2/src/sc2code/planets/scan.c @@ -359,7 +359,7 @@ PrintCoarseScanPC (void) if (val < 0) val = -val; t.pStr = buf; - sprintf (buf, "%ld" STR_DEGREE_SIGN, val); + sprintf (buf, "%d" STR_DEGREE_SIGN, val); t.CharCount = (COUNT)~0; font_DrawText (&t); UnlockMutex (GraphicsLock); @@ -556,7 +556,7 @@ PrintCoarseScan3DO (void) val = pSolarSysState->SysInfo.PlanetInfo.AxialTilt; if (val < 0) val = -val; - sprintf (buf, "%ld" STR_DEGREE_SIGN, val); + sprintf (buf, "%d" STR_DEGREE_SIGN, val); t.CharCount = (COUNT)~0; font_DrawText (&t); t.baseline.y += SCAN_LEADING; diff --git a/sc2/src/sc2code/save.c b/sc2/src/sc2code/save.c index 9276821a5..d429b6d3a 100644 --- a/sc2/src/sc2code/save.c +++ b/sc2/src/sc2code/save.c @@ -484,7 +484,7 @@ RetrySave: // Write the memory file to the actual savegame file. sprintf (file, "starcon2.%02u", which_game); - log_add (log_Debug, "'%s' is %lu bytes long", file, + log_add (log_Debug, "'%s' is %u bytes long", file, flen + sizeof (*summary_desc)); if (flen && (out_fp = (PVOID)res_OpenResFile (saveDir, file, "wb"))) { diff --git a/sc2/src/sc2code/sis.c b/sc2/src/sc2code/sis.c index f63f225db..76f03ca5d 100644 --- a/sc2/src/sc2code/sis.c +++ b/sc2/src/sc2code/sis.c @@ -370,7 +370,7 @@ DrawStatusMessage (const UNICODE *pStr) GET_GAME_STATE (MELNORME_CREDIT1) ), GAME_STRING (STATUS_STRING_BASE + 0)); // "Cr" else if (GET_GAME_STATE (CHMMR_BOMB_STATE) < 2) - sprintf (buf, "%lu %s", GLOBAL_SIS (ResUnits), + sprintf (buf, "%u %s", GLOBAL_SIS (ResUnits), GAME_STRING (STATUS_STRING_BASE + 1)); // "RU" else sprintf (buf, "%s %s", @@ -647,7 +647,7 @@ DrawFlagshipStats (void) } font_DrawText (&t); t.baseline.y += leading; - sprintf (buf, "%4lu", (fuel / FUEL_TANK_SCALE)); + sprintf (buf, "%4u", (fuel / FUEL_TANK_SCALE)); font_DrawText (&t); SetContextFontEffect (OldFontEffect);