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
This commit is contained in:
avolkov
2006-05-04 23:23:18 +00:00
parent 862719008d
commit 4571c2b451
8 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -797,7 +797,7 @@ ShowSummary (SUMMARY_DESC *pSD)
SetContextClipRect (&OldRect); SetContextClipRect (&OldRect);
SetContext (SpaceContext); SetContext (SpaceContext);
sprintf (buf, "%lu", GLOBAL_SIS (ResUnits)); sprintf (buf, "%u", GLOBAL_SIS (ResUnits));
t.baseline.y = 102; t.baseline.y = 102;
r.extent.width = 76; r.extent.width = 76;
r.extent.height = SHIP_NAME_HEIGHT; r.extent.height = SHIP_NAME_HEIGHT;
+1 -1
View File
@@ -156,7 +156,7 @@ initTempDir (void) {
tempPtr = tempDirName + len; tempPtr = tempDirName + len;
for (i = 0; i < NUM_TEMP_RETRIES; i++) for (i = 0; i < NUM_TEMP_RETRIES; i++)
{ {
sprintf (tempPtr, "%08lx", num + i); sprintf (tempPtr, "%08x", num + i);
if (createDirectory (tempDirName, 0700) == -1) if (createDirectory (tempDirName, 0700) == -1)
continue; continue;
+2 -2
View File
@@ -395,13 +395,13 @@ Scale_PerfTest (void)
if (i % 100 == 0) if (i % 100 == 0)
{ {
Now = SDL_GetTicks (); 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); Now - TimeIn);
TimeIn = Now; 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)); (i - 1), Now - TimeStart, i * 1000 / (Now - TimeStart));
SDL_UnlockSurface (scaled_display); SDL_UnlockSurface (scaled_display);
+1 -1
View File
@@ -246,7 +246,7 @@ mem_allocate (MEM_SIZE coreSize, MEM_FLAGS flags, MEM_PRIORITY priority,
log_add (log_Always, "mem_allocate: out of extents."); log_add (log_Always, "mem_allocate: out of extents.");
else if ((node->memory = MallocWithRetry (coreSize, "mem_allocate:")) == 0 else if ((node->memory = MallocWithRetry (coreSize, "mem_allocate:")) == 0
&& coreSize) && coreSize)
log_add (log_Always, "mem_allocate: couldn't allocate %u bytes.", log_add (log_Always, "mem_allocate: couldn't allocate %ld bytes.",
coreSize); coreSize);
else else
{ {
+1 -1
View File
@@ -138,7 +138,7 @@ res_GetResource (RESOURCE res)
desc = lookupResourceDesc (resourceIndex, res); desc = lookupResourceDesc (resourceIndex, res);
if (desc == NULL) 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); (DWORD) res);
return NULL_HANDLE; return NULL_HANDLE;
} }
+2 -2
View File
@@ -359,7 +359,7 @@ PrintCoarseScanPC (void)
if (val < 0) if (val < 0)
val = -val; val = -val;
t.pStr = buf; t.pStr = buf;
sprintf (buf, "%ld" STR_DEGREE_SIGN, val); sprintf (buf, "%d" STR_DEGREE_SIGN, val);
t.CharCount = (COUNT)~0; t.CharCount = (COUNT)~0;
font_DrawText (&t); font_DrawText (&t);
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
@@ -556,7 +556,7 @@ PrintCoarseScan3DO (void)
val = pSolarSysState->SysInfo.PlanetInfo.AxialTilt; val = pSolarSysState->SysInfo.PlanetInfo.AxialTilt;
if (val < 0) if (val < 0)
val = -val; val = -val;
sprintf (buf, "%ld" STR_DEGREE_SIGN, val); sprintf (buf, "%d" STR_DEGREE_SIGN, val);
t.CharCount = (COUNT)~0; t.CharCount = (COUNT)~0;
font_DrawText (&t); font_DrawText (&t);
t.baseline.y += SCAN_LEADING; t.baseline.y += SCAN_LEADING;
+1 -1
View File
@@ -484,7 +484,7 @@ RetrySave:
// Write the memory file to the actual savegame file. // Write the memory file to the actual savegame file.
sprintf (file, "starcon2.%02u", which_game); 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)); flen + sizeof (*summary_desc));
if (flen && (out_fp = (PVOID)res_OpenResFile (saveDir, file, "wb"))) if (flen && (out_fp = (PVOID)res_OpenResFile (saveDir, file, "wb")))
{ {
+2 -2
View File
@@ -370,7 +370,7 @@ DrawStatusMessage (const UNICODE *pStr)
GET_GAME_STATE (MELNORME_CREDIT1) GET_GAME_STATE (MELNORME_CREDIT1)
), GAME_STRING (STATUS_STRING_BASE + 0)); // "Cr" ), GAME_STRING (STATUS_STRING_BASE + 0)); // "Cr"
else if (GET_GAME_STATE (CHMMR_BOMB_STATE) < 2) 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" GAME_STRING (STATUS_STRING_BASE + 1)); // "RU"
else else
sprintf (buf, "%s %s", sprintf (buf, "%s %s",
@@ -647,7 +647,7 @@ DrawFlagshipStats (void)
} }
font_DrawText (&t); font_DrawText (&t);
t.baseline.y += leading; t.baseline.y += leading;
sprintf (buf, "%4lu", (fuel / FUEL_TANK_SCALE)); sprintf (buf, "%4u", (fuel / FUEL_TANK_SCALE));
font_DrawText (&t); font_DrawText (&t);
SetContextFontEffect (OldFontEffect); SetContextFontEffect (OldFontEffect);