master
an 2019-11-25 19:56:15 -05:00
parent 866148d531
commit 5368518173
54 changed files with 264 additions and 264 deletions

View File

@ -326,7 +326,7 @@ void BGM_PlayCDtrack (byte track, bool looping)
handler = handler->next; handler = handler->next;
} }
if (ext == NULL) if (ext == NULL)
Con_Printf("Couldn't find a cdrip for track %d\n", (int32_t)track); Con_Printf("Couldn't find a cdrip for track %" PRIi32 "\n", (int32_t)track);
else else
{ {
q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s", q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s",
@ -437,7 +437,7 @@ static void BGM_UpdateStream (void)
res = S_CodecRewindStream(bgmstream); res = S_CodecRewindStream(bgmstream);
if (res != 0) if (res != 0)
{ {
Con_Printf("Stream seek error (%i), stopping.\n", res); Con_Printf("Stream seek error (%" PRIi32 "), stopping.\n", res);
BGM_Stop(); BGM_Stop();
return; return;
} }
@ -451,7 +451,7 @@ static void BGM_UpdateStream (void)
} }
else /* res < 0: some read error */ else /* res < 0: some read error */
{ {
Con_Printf("Stream read error (%i), stopping.\n", res); Con_Printf("Stream read error (%" PRIi32 "), stopping.\n", res);
BGM_Stop(); BGM_Stop();
return; return;
} }

View File

@ -93,13 +93,13 @@ int32_t CDAudio_Play(byte track, bool looping)
if (track < 1 || track > cd_handle->numtracks) if (track < 1 || track > cd_handle->numtracks)
{ {
Con_Printf ("CDAudio_Play: Bad track number %d.\n", track); Con_Printf ("CDAudio_Play: Bad track number %" PRIi32 ".\n", track);
return -1; return -1;
} }
if (cd_handle->track[track-1].type == SDL_DATA_TRACK) if (cd_handle->track[track-1].type == SDL_DATA_TRACK)
{ {
Con_Printf ("CDAudio_Play: track %d is not audio\n", track); Con_Printf ("CDAudio_Play: track %" PRIi32 " is not audio\n", track);
return -1; return -1;
} }
@ -112,7 +112,7 @@ int32_t CDAudio_Play(byte track, bool looping)
if (SDL_CDPlay(cd_handle, cd_handle->track[track-1].offset, cd_handle->track[track-1].length) < 0) if (SDL_CDPlay(cd_handle, cd_handle->track[track-1].offset, cd_handle->track[track-1].length) < 0)
{ {
Con_Printf ("CDAudio_Play: Unable to play track %d: %s\n", track, SDL_GetError ()); Con_Printf ("CDAudio_Play: Unable to play track %" PRIi32 ": %s\n", track, SDL_GetError ());
return -1; return -1;
} }
@ -333,7 +333,7 @@ static void CD_f (void)
FRAMES_TO_MSF(cd_handle->cur_frame, &current_min, &current_sec, &current_frame); FRAMES_TO_MSF(cd_handle->cur_frame, &current_min, &current_sec, &current_frame);
FRAMES_TO_MSF(cd_handle->track[playTrack-1].length, &length_min, &length_sec, &length_frame); FRAMES_TO_MSF(cd_handle->track[playTrack-1].length, &length_min, &length_sec, &length_frame);
Con_Printf ("Current position: %d:%02d.%02d (of %d:%02d.%02d)\n", Con_Printf ("Current position: %" PRIi32 ":%02d.%02d (of %" PRIi32 ":%02d.%02d)\n",
current_min, current_sec, current_frame * 60 / CD_FPS, current_min, current_sec, current_frame * 60 / CD_FPS,
length_min, length_sec, length_frame * 60 / CD_FPS); length_min, length_sec, length_frame * 60 / CD_FPS);
} }
@ -502,7 +502,7 @@ int32_t CDAudio_Init(void)
} }
sdl_num_drives = SDL_CDNumDrives (); sdl_num_drives = SDL_CDNumDrives ();
Con_Printf ("SDL detected %d CD-ROM drive%c\n", sdl_num_drives, Con_Printf ("SDL detected %" PRIi32 " CD-ROM drive%c\n", sdl_num_drives,
sdl_num_drives == 1 ? ' ' : 's'); sdl_num_drives == 1 ? ' ' : 's');
if (sdl_num_drives < 1) if (sdl_num_drives < 1)

View File

@ -266,7 +266,7 @@ void CL_Record_f (void)
if (c == 4) if (c == 4)
{ {
track = atoi(Cmd_Argv(3)); track = atoi(Cmd_Argv(3));
Con_Printf ("Forcing CD track to %i\n", cls.forcetrack); Con_Printf ("Forcing CD track to %" PRIi32 "\n", cls.forcetrack);
} }
else else
{ {
@ -295,7 +295,7 @@ void CL_Record_f (void)
} }
cls.forcetrack = track; cls.forcetrack = track;
fprintf (cls.demofile, "%i\n", cls.forcetrack); fprintf (cls.demofile, "%" PRIi32 "\n", cls.forcetrack);
cls.demorecording = true; cls.demorecording = true;
@ -414,7 +414,7 @@ void CL_PlayDemo_f (void)
// ZOID, fscanf is evil // ZOID, fscanf is evil
// O.S.: if a space character e.g. 0x20 (' ') follows '\n', // O.S.: if a space character e.g. 0x20 (' ') follows '\n',
// fscanf skips that byte too and screws up further reads. // fscanf skips that byte too and screws up further reads.
// fscanf (cls.demofile, "%i\n", &cls.forcetrack); // fscanf (cls.demofile, "%" PRIi32 "\n", &cls.forcetrack);
cls.forcetrack = 0; cls.forcetrack = 0;
c = 0; /* silence pesky compiler warnings */ c = 0; /* silence pesky compiler warnings */
neg = false; neg = false;
@ -469,7 +469,7 @@ static void CL_FinishTimeDemo (void)
time = realtime - cls.td_starttime; time = realtime - cls.td_starttime;
if (!time) if (!time)
time = 1; time = 1;
Con_Printf ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time); Con_Printf ("%" PRIi32 " frames %5.1f seconds %5.1f fps\n", frames, time, frames/time);
} }
/* /*

View File

@ -181,7 +181,7 @@ void CL_SignonReply (void)
{ {
char str[8192]; char str[8192];
Con_DPrintf ("CL_SignonReply: %i\n", cls.signon); Con_DPrintf ("CL_SignonReply: %" PRIi32 "\n", cls.signon);
switch (cls.signon) switch (cls.signon)
{ {
@ -195,7 +195,7 @@ void CL_SignonReply (void)
MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string)); MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string));
MSG_WriteByte (&cls.message, clc_stringcmd); MSG_WriteByte (&cls.message, clc_stringcmd);
MSG_WriteString (&cls.message, va("color %i %i\n", ((int32_t)cl_color.value)>>4, ((int32_t)cl_color.value)&15)); MSG_WriteString (&cls.message, va("color %" PRIi32 " %" PRIi32 "\n", ((int32_t)cl_color.value)>>4, ((int32_t)cl_color.value)&15));
MSG_WriteByte (&cls.message, clc_stringcmd); MSG_WriteByte (&cls.message, clc_stringcmd);
sprintf (str, "spawn %s", cls.spawnparms); sprintf (str, "spawn %s", cls.spawnparms);
@ -626,13 +626,13 @@ int32_t CL_ReadFromServer (void)
//visedicts //visedicts
if (cl_numvisedicts > 256 && dev_peakstats.visedicts <= 256) if (cl_numvisedicts > 256 && dev_peakstats.visedicts <= 256)
Con_DWarning ("%i visedicts exceeds standard limit of 256 (max = %d).\n", cl_numvisedicts, MAX_VISEDICTS); Con_DWarning ("%" PRIi32 " visedicts exceeds standard limit of 256 (max = %" PRIi32 ").\n", cl_numvisedicts, MAX_VISEDICTS);
dev_stats.visedicts = cl_numvisedicts; dev_stats.visedicts = cl_numvisedicts;
dev_peakstats.visedicts = q_max(cl_numvisedicts, dev_peakstats.visedicts); dev_peakstats.visedicts = q_max(cl_numvisedicts, dev_peakstats.visedicts);
//temp entities //temp entities
if (num_temp_entities > 64 && dev_peakstats.tempents <= 64) if (num_temp_entities > 64 && dev_peakstats.tempents <= 64)
Con_DWarning ("%i tempentities exceeds standard limit of 64 (max = %d).\n", num_temp_entities, MAX_TEMP_ENTITIES); Con_DWarning ("%" PRIi32 " tempentities exceeds standard limit of 64 (max = %" PRIi32 ").\n", num_temp_entities, MAX_TEMP_ENTITIES);
dev_stats.tempents = num_temp_entities; dev_stats.tempents = num_temp_entities;
dev_peakstats.tempents = q_max(num_temp_entities, dev_peakstats.tempents); dev_peakstats.tempents = q_max(num_temp_entities, dev_peakstats.tempents);
@ -641,7 +641,7 @@ int32_t CL_ReadFromServer (void)
if (b->model && b->endtime >= cl.time) if (b->model && b->endtime >= cl.time)
num_beams++; num_beams++;
if (num_beams > 24 && dev_peakstats.beams <= 24) if (num_beams > 24 && dev_peakstats.beams <= 24)
Con_DWarning ("%i beams exceeded standard limit of 24 (max = %d).\n", num_beams, MAX_BEAMS); Con_DWarning ("%" PRIi32 " beams exceeded standard limit of 24 (max = %" PRIi32 ").\n", num_beams, MAX_BEAMS);
dev_stats.beams = num_beams; dev_stats.beams = num_beams;
dev_peakstats.beams = q_max(num_beams, dev_peakstats.beams); dev_peakstats.beams = q_max(num_beams, dev_peakstats.beams);
@ -650,7 +650,7 @@ int32_t CL_ReadFromServer (void)
if (l->die >= cl.time && l->radius) if (l->die >= cl.time && l->radius)
num_dlights++; num_dlights++;
if (num_dlights > 32 && dev_peakstats.dlights <= 32) if (num_dlights > 32 && dev_peakstats.dlights <= 32)
Con_DWarning ("%i dlights exceeded standard limit of 32 (max = %d).\n", num_dlights, MAX_DLIGHTS); Con_DWarning ("%" PRIi32 " dlights exceeded standard limit of 32 (max = %" PRIi32 ").\n", num_dlights, MAX_DLIGHTS);
dev_stats.dlights = num_dlights; dev_stats.dlights = num_dlights;
dev_peakstats.dlights = q_max(num_dlights, dev_peakstats.dlights); dev_peakstats.dlights = q_max(num_dlights, dev_peakstats.dlights);
@ -728,7 +728,7 @@ void CL_Tracepos_f (void)
if (VectorLength(w) == 0) if (VectorLength(w) == 0)
Con_Printf ("Tracepos: trace didn't hit anything\n"); Con_Printf ("Tracepos: trace didn't hit anything\n");
else else
Con_Printf ("Tracepos: (%i %i %i)\n", (int32_t)w[0], (int32_t)w[1], (int32_t)w[2]); Con_Printf ("Tracepos: (%" PRIi32 " %" PRIi32 " %" PRIi32 ")\n", (int32_t)w[0], (int32_t)w[1], (int32_t)w[2]);
} }
/* /*
@ -744,7 +744,7 @@ void CL_Viewpos_f (void)
return; return;
#if 0 #if 0
//camera position //camera position
Con_Printf ("Viewpos: (%i %i %i) %i %i %i\n", Con_Printf ("Viewpos: (%" PRIi32 " %" PRIi32 " %" PRIi32 ") %" PRIi32 " %" PRIi32 " %" PRIi32 "\n",
(int32_t)r_refdef.vieworg[0], (int32_t)r_refdef.vieworg[0],
(int32_t)r_refdef.vieworg[1], (int32_t)r_refdef.vieworg[1],
(int32_t)r_refdef.vieworg[2], (int32_t)r_refdef.vieworg[2],
@ -753,7 +753,7 @@ void CL_Viewpos_f (void)
(int32_t)r_refdef.viewangles[ROLL]); (int32_t)r_refdef.viewangles[ROLL]);
#else #else
//player position //player position
Con_Printf ("Viewpos: (%i %i %i) %i %i %i\n", Con_Printf ("Viewpos: (%" PRIi32 " %" PRIi32 " %" PRIi32 ") %" PRIi32 " %" PRIi32 " %" PRIi32 "\n",
(int32_t)cl_entities[cl.viewentity].origin[0], (int32_t)cl_entities[cl.viewentity].origin[0],
(int32_t)cl_entities[cl.viewentity].origin[1], (int32_t)cl_entities[cl.viewentity].origin[1],
(int32_t)cl_entities[cl.viewentity].origin[2], (int32_t)cl_entities[cl.viewentity].origin[2],

View File

@ -106,13 +106,13 @@ entity_t *CL_EntityNum (int32_t num)
{ {
//johnfitz -- check minimum number too //johnfitz -- check minimum number too
if (num < 0) if (num < 0)
Host_Error ("CL_EntityNum: %i is an invalid number",num); Host_Error ("CL_EntityNum: %" PRIi32 " is an invalid number",num);
//john //john
if (num >= cl.num_entities) if (num >= cl.num_entities)
{ {
if (num >= cl_max_edicts) //johnfitz -- no more MAX_EDICTS if (num >= cl_max_edicts) //johnfitz -- no more MAX_EDICTS
Host_Error ("CL_EntityNum: %i is an invalid number",num); Host_Error ("CL_EntityNum: %" PRIi32 " is an invalid number",num);
while (cl.num_entities<=num) while (cl.num_entities<=num)
{ {
cl_entities[cl.num_entities].colormap = vid.colormap; cl_entities[cl.num_entities].colormap = vid.colormap;
@ -173,11 +173,11 @@ void CL_ParseStartSoundPacket(void)
//johnfitz -- check soundnum //johnfitz -- check soundnum
if (sound_num >= MAX_SOUNDS) if (sound_num >= MAX_SOUNDS)
Host_Error ("CL_ParseStartSoundPacket: %i > MAX_SOUNDS", sound_num); Host_Error ("CL_ParseStartSoundPacket: %" PRIi32 " > MAX_SOUNDS", sound_num);
//johnfitz //johnfitz
if (ent > cl_max_edicts) //johnfitz -- no more MAX_EDICTS if (ent > cl_max_edicts) //johnfitz -- no more MAX_EDICTS
Host_Error ("CL_ParseStartSoundPacket: ent = %i", ent); Host_Error ("CL_ParseStartSoundPacket: ent = %" PRIi32 "", ent);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
pos[i] = MSG_ReadCoord (cl.protocolflags); pos[i] = MSG_ReadCoord (cl.protocolflags);
@ -278,7 +278,7 @@ void CL_ParseServerInfo (void)
//johnfitz -- support multiple protocols //johnfitz -- support multiple protocols
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ) { if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ) {
Con_Printf ("\n"); //because there's no newline after serverinfo print Con_Printf ("\n"); //because there's no newline after serverinfo print
Host_Error ("Server returned version %i, not %i or %i or %i", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ); Host_Error ("Server returned version %" PRIi32 ", not %" PRIi32 " or %" PRIi32 " or %" PRIi32 "", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ);
} }
cl.protocol = i; cl.protocol = i;
//johnfitz //johnfitz
@ -292,7 +292,7 @@ void CL_ParseServerInfo (void)
if (0 != (cl.protocolflags & (~supportedflags))) if (0 != (cl.protocolflags & (~supportedflags)))
{ {
Con_Warning("PROTOCOL_RMQ protocolflags %i contains unsupported flags\n", cl.protocolflags); Con_Warning("PROTOCOL_RMQ protocolflags %" PRIi32 " contains unsupported flags\n", cl.protocolflags);
} }
} }
else cl.protocolflags = 0; else cl.protocolflags = 0;
@ -317,7 +317,7 @@ void CL_ParseServerInfo (void)
Con_Printf ("%c%s\n", 2, str); Con_Printf ("%c%s\n", 2, str);
//johnfitz -- tell user which protocol this is //johnfitz -- tell user which protocol this is
Con_Printf ("Using protocol %i\n", i); Con_Printf ("Using protocol %" PRIi32 "\n", i);
// first we go through and touch all of the precache data that still // first we go through and touch all of the precache data that still
// happens to be in the cache, so precaching something else doesn't // happens to be in the cache, so precaching something else doesn't
@ -340,7 +340,7 @@ void CL_ParseServerInfo (void)
//johnfitz -- check for excessive models //johnfitz -- check for excessive models
if (nummodels >= 256) if (nummodels >= 256)
Con_DWarning ("%i models exceeds standard limit of 256 (max = %d).\n", nummodels, MAX_MODELS); Con_DWarning ("%" PRIi32 " models exceeds standard limit of 256 (max = %" PRIi32 ").\n", nummodels, MAX_MODELS);
//johnfitz //johnfitz
// precache sounds // precache sounds
@ -360,7 +360,7 @@ void CL_ParseServerInfo (void)
//johnfitz -- check for excessive sounds //johnfitz -- check for excessive sounds
if (numsounds >= 256) if (numsounds >= 256)
Con_DWarning ("%i sounds exceeds standard limit of 256 (max = %d).\n", numsounds, MAX_SOUNDS); Con_DWarning ("%" PRIi32 " sounds exceeds standard limit of 256 (max = %" PRIi32 ").\n", numsounds, MAX_SOUNDS);
//johnfitz //johnfitz
// //
@ -946,7 +946,7 @@ void CL_ParseServerMessage (void)
// if recording demos, copy the message out // if recording demos, copy the message out
// //
if (cl_shownet.value == 1) if (cl_shownet.value == 1)
Con_Printf ("%i ",net_message.cursize); Con_Printf ("%" PRIi32 " ",net_message.cursize);
else if (cl_shownet.value == 2) else if (cl_shownet.value == 2)
Con_Printf ("------------------\n"); Con_Printf ("------------------\n");
@ -1004,7 +1004,7 @@ void CL_ParseServerMessage (void)
i = MSG_ReadLong (); i = MSG_ReadLong ();
//johnfitz -- support multiple protocols //johnfitz -- support multiple protocols
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ) if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ)
Host_Error ("Server returned version %i, not %i or %i or %i", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ); Host_Error ("Server returned version %" PRIi32 ", not %" PRIi32 " or %" PRIi32 " or %" PRIi32 "", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ);
cl.protocol = i; cl.protocol = i;
//johnfitz //johnfitz
break; break;
@ -1132,13 +1132,13 @@ void CL_ParseServerMessage (void)
case svc_signonnum: case svc_signonnum:
i = MSG_ReadByte (); i = MSG_ReadByte ();
if (i <= cls.signon) if (i <= cls.signon)
Host_Error ("Received signon %i when at %i", i, cls.signon); Host_Error ("Received signon %" PRIi32 " when at %" PRIi32 "", i, cls.signon);
cls.signon = i; cls.signon = i;
//johnfitz -- if signonnum==2, signon packet has been fully parsed, so check for excessive static ents and efrags //johnfitz -- if signonnum==2, signon packet has been fully parsed, so check for excessive static ents and efrags
if (i == 2) if (i == 2)
{ {
if (cl.num_statics > 128) if (cl.num_statics > 128)
Con_DWarning ("%i static entities exceeds standard limit of 128 (max = %d).\n", cl.num_statics, MAX_STATIC_ENTITIES); Con_DWarning ("%" PRIi32 " static entities exceeds standard limit of 128 (max = %" PRIi32 ").\n", cl.num_statics, MAX_STATIC_ENTITIES);
R_CheckEfrags (); R_CheckEfrags ();
} }
//johnfitz //johnfitz
@ -1156,7 +1156,7 @@ void CL_ParseServerMessage (void)
case svc_updatestat: case svc_updatestat:
i = MSG_ReadByte (); i = MSG_ReadByte ();
if (i < 0 || i >= MAX_CL_STATS) if (i < 0 || i >= MAX_CL_STATS)
Sys_Error ("svc_updatestat: %i is invalid", i); Sys_Error ("svc_updatestat: %" PRIi32 " is invalid", i);
cl.stats[i] = MSG_ReadLong ();; cl.stats[i] = MSG_ReadLong ();;
break; break;

View File

@ -317,7 +317,7 @@ void Cmd_Alias_f (void)
for (a = cmd_alias, i = 0; a; a=a->next, i++) for (a = cmd_alias, i = 0; a; a=a->next, i++)
Con_SafePrintf (" %s: %s", a->name, a->value); Con_SafePrintf (" %s: %s", a->name, a->value);
if (i) if (i)
Con_SafePrintf ("%i alias command(s)\n", i); Con_SafePrintf ("%" PRIi32 " alias command(s)\n", i);
else else
Con_SafePrintf ("no alias commands found\n"); Con_SafePrintf ("no alias commands found\n");
break; break;
@ -491,7 +491,7 @@ void Cmd_List_f (void)
count++; count++;
} }
Con_SafePrintf ("%i commands", count); Con_SafePrintf ("%" PRIi32 " commands", count);
if (partial) if (partial)
{ {
Con_SafePrintf (" beginning with \"%s\"", partial); Con_SafePrintf (" beginning with \"%s\"", partial);

View File

@ -958,7 +958,7 @@ void *SZ_GetSpace (sizebuf_t *buf, int32_t length)
Host_Error ("SZ_GetSpace: overflow without allowoverflow set"); // ericw -- made Host_Error to be less annoying Host_Error ("SZ_GetSpace: overflow without allowoverflow set"); // ericw -- made Host_Error to be less annoying
if (length > buf->maxsize) if (length > buf->maxsize)
Sys_Error ("SZ_GetSpace: %i is > full buffer size", length); Sys_Error ("SZ_GetSpace: %" PRIi32 " is > full buffer size", length);
buf->overflowed = true; buf->overflowed = true;
Con_Printf ("SZ_GetSpace: overflow"); Con_Printf ("SZ_GetSpace: overflow");
@ -1522,7 +1522,7 @@ static void COM_Path_f (void)
{ {
if (s->pack) if (s->pack)
{ {
Con_Printf ("%s (%i files)\n", s->pack->filename, s->pack->numfiles); Con_Printf ("%s (%" PRIi32 " files)\n", s->pack->filename, s->pack->numfiles);
} }
else else
Con_Printf ("%s\n", s->filename); Con_Printf ("%s\n", s->filename);
@ -1915,7 +1915,7 @@ byte *COM_LoadMallocFile_TextMode_OSPath (const char *path, long *len_out)
const char *COM_ParseIntNewline(const char *buffer, int32_t *value) const char *COM_ParseIntNewline(const char *buffer, int32_t *value)
{ {
int32_t consumed = 0; int32_t consumed = 0;
sscanf (buffer, "%i\n%n", value, &consumed); sscanf (buffer, "%" PRIi32 "\n%n", value, &consumed);
return buffer + consumed; return buffer + consumed;
} }
@ -1969,7 +1969,7 @@ static pack_t *COM_LoadPackFile (const char *packfile)
if (header.dirlen < 0 || header.dirofs < 0) if (header.dirlen < 0 || header.dirofs < 0)
{ {
Sys_Error ("Invalid packfile %s (dirlen: %i, dirofs: %i)", Sys_Error ("Invalid packfile %s (dirlen: %" PRIi32 ", dirofs: %" PRIi32 ")",
packfile, header.dirlen, header.dirofs); packfile, header.dirlen, header.dirofs);
} }
if (!numpackfiles) if (!numpackfiles)
@ -1979,7 +1979,7 @@ static pack_t *COM_LoadPackFile (const char *packfile)
return NULL; return NULL;
} }
if (numpackfiles > MAX_FILES_IN_PACK) if (numpackfiles > MAX_FILES_IN_PACK)
Sys_Error ("%s has %i files", packfile, numpackfiles); Sys_Error ("%s has %" PRIi32 " files", packfile, numpackfiles);
if (numpackfiles != PAK0_COUNT) if (numpackfiles != PAK0_COUNT)
com_modified = true; // not the original file com_modified = true; // not the original file
@ -2010,7 +2010,7 @@ static pack_t *COM_LoadPackFile (const char *packfile)
pack->numfiles = numpackfiles; pack->numfiles = numpackfiles;
pack->files = newfiles; pack->files = newfiles;
//Sys_Printf ("Added packfile %s (%i files)\n", packfile, numpackfiles); //Sys_Printf ("Added packfile %s (%" PRIi32 " files)\n", packfile, numpackfiles);
return pack; return pack;
} }
@ -2046,7 +2046,7 @@ _add_path:
// add any pak files in the format pak0.pak pak1.pak, ... // add any pak files in the format pak0.pak pak1.pak, ...
for (i = 0; ; i++) for (i = 0; ; i++)
{ {
q_snprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", com_gamedir, i); q_snprintf (pakfile, sizeof(pakfile), "%s/pak%" PRIi32 ".pak", com_gamedir, i);
pak = COM_LoadPackFile (pakfile); pak = COM_LoadPackFile (pakfile);
if (i != 0 || path_id != 1 || fitzmode) if (i != 0 || path_id != 1 || fitzmode)
qspak = NULL; qspak = NULL;

View File

@ -1281,7 +1281,7 @@ void LOG_Init (quakeparms_t *parms)
return; return;
inittime = time (NULL); inittime = time (NULL);
strftime (session, sizeof(session), "%m/%d/%Y %H:%M:%S", localtime(&inittime)); strftime (session, sizeof(session), "%m/%" PRIi32 "/%Y %H:%M:%S", localtime(&inittime));
q_snprintf (logfilename, sizeof(logfilename), "%s/qconsole.log", parms->basedir); q_snprintf (logfilename, sizeof(logfilename), "%s/qconsole.log", parms->basedir);
// unlink (logfilename); // unlink (logfilename);

View File

@ -71,7 +71,7 @@ void Cvar_List_f (void)
count++; count++;
} }
Con_SafePrintf ("%i cvars", count); Con_SafePrintf ("%" PRIi32 " cvars", count);
if (partial) if (partial)
{ {
Con_SafePrintf (" beginning with \"%s\"", partial); Con_SafePrintf (" beginning with \"%s\"", partial);
@ -433,7 +433,7 @@ void Cvar_SetValueQuick (cvar_t *var, const float value)
char val[32], *ptr = val; char val[32], *ptr = val;
if (value == (float)((int32_t)value)) if (value == (float)((int32_t)value))
q_snprintf (val, sizeof(val), "%i", (int32_t)value); q_snprintf (val, sizeof(val), "%" PRIi32 "", (int32_t)value);
else else
{ {
q_snprintf (val, sizeof(val), "%f", value); q_snprintf (val, sizeof(val), "%f", value);
@ -476,7 +476,7 @@ void Cvar_SetValue (const char *var_name, const float value)
char val[32], *ptr = val; char val[32], *ptr = val;
if (value == (float)((int32_t)value)) if (value == (float)((int32_t)value))
q_snprintf (val, sizeof(val), "%i", (int32_t)value); q_snprintf (val, sizeof(val), "%" PRIi32 "", (int32_t)value);
else else
{ {
q_snprintf (val, sizeof(val), "%f", value); q_snprintf (val, sizeof(val), "%f", value);

View File

@ -200,7 +200,7 @@ void Scrap_Upload (void)
for (i=0; i<MAX_SCRAPS; i++) for (i=0; i<MAX_SCRAPS; i++)
{ {
sprintf (name, "scrap%i", i); sprintf (name, "scrap%" PRIi32 "", i);
scrap_textures[i] = TexMgr_LoadImage (NULL, name, BLOCK_WIDTH, BLOCK_HEIGHT, SRC_INDEXED, scrap_texels[i], scrap_textures[i] = TexMgr_LoadImage (NULL, name, BLOCK_WIDTH, BLOCK_HEIGHT, SRC_INDEXED, scrap_texels[i],
"", (src_offset_t)scrap_texels[i], TEXPREF_ALPHA | TEXPREF_OVERWRITE | TEXPREF_NOPICMIP); "", (src_offset_t)scrap_texels[i], TEXPREF_ALPHA | TEXPREF_OVERWRITE | TEXPREF_NOPICMIP);
} }

View File

@ -141,7 +141,7 @@ byte *Mod_DecompressVis (byte *in, qmodel_t *model)
mod_decompressed_capacity = row; mod_decompressed_capacity = row;
mod_decompressed = (byte *) realloc (mod_decompressed, mod_decompressed_capacity); mod_decompressed = (byte *) realloc (mod_decompressed, mod_decompressed_capacity);
if (!mod_decompressed) if (!mod_decompressed)
Sys_Error ("Mod_DecompressVis: realloc() failed on %d bytes", mod_decompressed_capacity); Sys_Error ("Mod_DecompressVis: realloc() failed on %" PRIi32 " bytes", mod_decompressed_capacity);
} }
out = mod_decompressed; out = mod_decompressed;
outend = mod_decompressed + row; outend = mod_decompressed + row;
@ -201,7 +201,7 @@ byte *Mod_NoVisPVS (qmodel_t *model)
mod_novis_capacity = pvsbytes; mod_novis_capacity = pvsbytes;
mod_novis = (byte *) realloc (mod_novis, mod_novis_capacity); mod_novis = (byte *) realloc (mod_novis, mod_novis_capacity);
if (!mod_novis) if (!mod_novis)
Sys_Error ("Mod_NoVisPVS: realloc() failed on %d bytes", mod_novis_capacity); Sys_Error ("Mod_NoVisPVS: realloc() failed on %" PRIi32 " bytes", mod_novis_capacity);
memset(mod_novis, 0xff, mod_novis_capacity); memset(mod_novis, 0xff, mod_novis_capacity);
} }
@ -673,7 +673,7 @@ void Mod_LoadTextures (lump_t *l)
{ {
tx2 = anims[j]; tx2 = anims[j];
if (!tx2) if (!tx2)
Sys_Error ("Missing frame %i of %s",j, tx->name); Sys_Error ("Missing frame %" PRIi32 " of %s",j, tx->name);
tx2->anim_total = maxanim * ANIM_CYCLE; tx2->anim_total = maxanim * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE; tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE; tx2->anim_max = (j+1) * ANIM_CYCLE;
@ -685,7 +685,7 @@ void Mod_LoadTextures (lump_t *l)
{ {
tx2 = altanims[j]; tx2 = altanims[j];
if (!tx2) if (!tx2)
Sys_Error ("Missing frame %i of %s",j, tx->name); Sys_Error ("Missing frame %" PRIi32 " of %s",j, tx->name);
tx2->anim_total = altmax * ANIM_CYCLE; tx2->anim_total = altmax * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE; tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE; tx2->anim_max = (j+1) * ANIM_CYCLE;
@ -738,7 +738,7 @@ void Mod_LoadLighting (lump_t *l)
else else
{ {
Hunk_FreeToLowMark(mark); Hunk_FreeToLowMark(mark);
Con_Printf("Unknown .lit file version (%d)\n", i); Con_Printf("Unknown .lit file version (%" PRIi32 ")\n", i);
} }
} }
else else
@ -978,7 +978,7 @@ void Mod_LoadTexinfo (lump_t *l)
//johnfitz: report missing textures //johnfitz: report missing textures
if (missing && loadmodel->numtextures > 1) if (missing && loadmodel->numtextures > 1)
Con_Printf ("Mod_LoadTexinfo: %d texture(s) missing from BSP file\n", missing); Con_Printf ("Mod_LoadTexinfo: %" PRIi32 " texture(s) missing from BSP file\n", missing);
//johnfitz //johnfitz
} }
@ -1169,7 +1169,7 @@ void Mod_LoadFaces (lump_t *l, bool bsp2)
//johnfitz -- warn mappers about exceeding old limits //johnfitz -- warn mappers about exceeding old limits
if (count > 32767 && !bsp2) if (count > 32767 && !bsp2)
Con_DWarning ("%i faces exceeds standard limit of 32767.\n", count); Con_DWarning ("%" PRIi32 " faces exceeds standard limit of 32767.\n", count);
//johnfitz //johnfitz
loadmodel->surfaces = out; loadmodel->surfaces = out;
@ -1297,7 +1297,7 @@ void Mod_LoadNodes_S (lump_t *l)
//johnfitz -- warn mappers about exceeding old limits //johnfitz -- warn mappers about exceeding old limits
if (count > 32767) if (count > 32767)
Con_DWarning ("%i nodes exceeds standard limit of 32767.\n", count); Con_DWarning ("%" PRIi32 " nodes exceeds standard limit of 32767.\n", count);
//johnfitz //johnfitz
loadmodel->nodes = out; loadmodel->nodes = out;
@ -1330,7 +1330,7 @@ void Mod_LoadNodes_S (lump_t *l)
out->children[j] = (mnode_t *)(loadmodel->leafs + p); out->children[j] = (mnode_t *)(loadmodel->leafs + p);
else else
{ {
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs); Con_Printf("Mod_LoadNodes: invalid leaf index %" PRIi32 " (file has only %" PRIi32 " leafs)\n", p, loadmodel->numleafs);
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
} }
} }
@ -1382,7 +1382,7 @@ void Mod_LoadNodes_L1 (lump_t *l)
out->children[j] = (mnode_t *)(loadmodel->leafs + p); out->children[j] = (mnode_t *)(loadmodel->leafs + p);
else else
{ {
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs); Con_Printf("Mod_LoadNodes: invalid leaf index %" PRIi32 " (file has only %" PRIi32 " leafs)\n", p, loadmodel->numleafs);
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
} }
} }
@ -1434,7 +1434,7 @@ void Mod_LoadNodes_L2 (lump_t *l)
out->children[j] = (mnode_t *)(loadmodel->leafs + p); out->children[j] = (mnode_t *)(loadmodel->leafs + p);
else else
{ {
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs); Con_Printf("Mod_LoadNodes: invalid leaf index %" PRIi32 " (file has only %" PRIi32 " leafs)\n", p, loadmodel->numleafs);
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
} }
} }
@ -1467,7 +1467,7 @@ void Mod_ProcessLeafs_S (dsleaf_t *in, int32_t filelen)
//johnfitz //johnfitz
if (count > 32767) if (count > 32767)
Host_Error ("Mod_LoadLeafs: %i leafs exceeds limit of 32767.\n", count); Host_Error ("Mod_LoadLeafs: %" PRIi32 " leafs exceeds limit of 32767.\n", count);
//johnfitz //johnfitz
loadmodel->leafs = out; loadmodel->leafs = out;
@ -1640,7 +1640,7 @@ void Mod_LoadClipnodes (lump_t *l, bool bsp2)
//johnfitz -- warn about exceeding old limits //johnfitz -- warn about exceeding old limits
if (count > 32767 && !bsp2) if (count > 32767 && !bsp2)
Con_DWarning ("%i clipnodes exceeds standard limit of 32767.\n", count); Con_DWarning ("%" PRIi32 " clipnodes exceeds standard limit of 32767.\n", count);
//johnfitz //johnfitz
loadmodel->clipnodes = out; loadmodel->clipnodes = out;
@ -1794,7 +1794,7 @@ void Mod_LoadMarksurfaces (lump_t *l, int32_t bsp2)
//johnfitz -- warn mappers about exceeding old limits //johnfitz -- warn mappers about exceeding old limits
if (count > 32767) if (count > 32767)
Con_DWarning ("%i marksurfaces exceeds standard limit of 32767.\n", count); Con_DWarning ("%" PRIi32 " marksurfaces exceeds standard limit of 32767.\n", count);
//johnfitz //johnfitz
for (i=0 ; i<count ; i++) for (i=0 ; i<count ; i++)
@ -1926,7 +1926,7 @@ void Mod_LoadSubmodels (lump_t *l)
out = loadmodel->submodels; out = loadmodel->submodels;
if (out->visleafs > 8192) if (out->visleafs > 8192)
Con_DWarning ("%i visleafs exceeds standard limit of 8192.\n", out->visleafs); Con_DWarning ("%" PRIi32 " visleafs exceeds standard limit of 8192.\n", out->visleafs);
//johnfitz //johnfitz
} }
@ -2013,7 +2013,7 @@ void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
bsp2 = 2; //sanitised revision bsp2 = 2; //sanitised revision
break; break;
default: default:
Sys_Error ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i)", mod->name, mod->bspversion, BSPVERSION); Sys_Error ("Mod_LoadBrushModel: %s has wrong version number (%" PRIi32 " should be %" PRIi32 ")", mod->name, mod->bspversion, BSPVERSION);
break; break;
} }
@ -2095,7 +2095,7 @@ void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
{ // duplicate the basic information { // duplicate the basic information
char name[10]; char name[10];
sprintf (name, "*%i", i+1); sprintf (name, "*%" PRIi32 "", i+1);
loadmodel = Mod_FindName (name); loadmodel = Mod_FindName (name);
*loadmodel = *mod; *loadmodel = *mod;
strcpy (loadmodel->name, name); strcpy (loadmodel->name, name);
@ -2262,7 +2262,7 @@ void Mod_FloodFillSkin( byte *skin, int32_t skinwidth, int32_t skinheight )
// can't fill to filled color or to transparent color (used as visited marker) // can't fill to filled color or to transparent color (used as visited marker)
if ((fillcolor == filledcolor) || (fillcolor == 255)) if ((fillcolor == filledcolor) || (fillcolor == 255))
{ {
//printf( "not filling skin from %d to %d\n", fillcolor, filledcolor ); //printf( "not filling skin from %" PRIi32 " to %" PRIi32 "\n", fillcolor, filledcolor );
return; return;
} }
@ -2304,7 +2304,7 @@ void *Mod_LoadAllSkins (int32_t numskins, daliasskintype_t *pskintype)
skin = (byte *)(pskintype + 1); skin = (byte *)(pskintype + 1);
if (numskins < 1 || numskins > MAX_SKINS) if (numskins < 1 || numskins > MAX_SKINS)
Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins); Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %" PRIi32 "\n", numskins);
size = pheader->skinwidth * pheader->skinheight; size = pheader->skinwidth * pheader->skinheight;
@ -2323,13 +2323,13 @@ void *Mod_LoadAllSkins (int32_t numskins, daliasskintype_t *pskintype)
memcpy (texels, (byte *)(pskintype + 1), size); memcpy (texels, (byte *)(pskintype + 1), size);
//johnfitz -- rewritten //johnfitz -- rewritten
q_snprintf (name, sizeof(name), "%s:frame%i", loadmodel->name, i); q_snprintf (name, sizeof(name), "%s:frame%" PRIi32 "", loadmodel->name, i);
offset = (src_offset_t)(pskintype+1) - (src_offset_t)mod_base; offset = (src_offset_t)(pskintype+1) - (src_offset_t)mod_base;
if (Mod_CheckFullbrights ((byte *)(pskintype+1), size)) if (Mod_CheckFullbrights ((byte *)(pskintype+1), size))
{ {
pheader->gltextures[i][0] = TexMgr_LoadImage (loadmodel, name, pheader->skinwidth, pheader->skinheight, pheader->gltextures[i][0] = TexMgr_LoadImage (loadmodel, name, pheader->skinwidth, pheader->skinheight,
SRC_INDEXED, (byte *)(pskintype+1), loadmodel->name, offset, texflags | TEXPREF_NOBRIGHT); SRC_INDEXED, (byte *)(pskintype+1), loadmodel->name, offset, texflags | TEXPREF_NOBRIGHT);
q_snprintf (fbr_mask_name, sizeof(fbr_mask_name), "%s:frame%i_glow", loadmodel->name, i); q_snprintf (fbr_mask_name, sizeof(fbr_mask_name), "%s:frame%" PRIi32 "_glow", loadmodel->name, i);
pheader->fbtextures[i][0] = TexMgr_LoadImage (loadmodel, fbr_mask_name, pheader->skinwidth, pheader->skinheight, pheader->fbtextures[i][0] = TexMgr_LoadImage (loadmodel, fbr_mask_name, pheader->skinwidth, pheader->skinheight,
SRC_INDEXED, (byte *)(pskintype+1), loadmodel->name, offset, texflags | TEXPREF_FULLBRIGHT); SRC_INDEXED, (byte *)(pskintype+1), loadmodel->name, offset, texflags | TEXPREF_FULLBRIGHT);
} }
@ -2366,13 +2366,13 @@ void *Mod_LoadAllSkins (int32_t numskins, daliasskintype_t *pskintype)
} }
//johnfitz -- rewritten //johnfitz -- rewritten
q_snprintf (name, sizeof(name), "%s:frame%i_%i", loadmodel->name, i,j); q_snprintf (name, sizeof(name), "%s:frame%" PRIi32 "_%" PRIi32 "", loadmodel->name, i,j);
offset = (src_offset_t)(pskintype) - (src_offset_t)mod_base; //johnfitz offset = (src_offset_t)(pskintype) - (src_offset_t)mod_base; //johnfitz
if (Mod_CheckFullbrights ((byte *)(pskintype), size)) if (Mod_CheckFullbrights ((byte *)(pskintype), size))
{ {
pheader->gltextures[i][j&3] = TexMgr_LoadImage (loadmodel, name, pheader->skinwidth, pheader->skinheight, pheader->gltextures[i][j&3] = TexMgr_LoadImage (loadmodel, name, pheader->skinwidth, pheader->skinheight,
SRC_INDEXED, (byte *)(pskintype), loadmodel->name, offset, texflags | TEXPREF_NOBRIGHT); SRC_INDEXED, (byte *)(pskintype), loadmodel->name, offset, texflags | TEXPREF_NOBRIGHT);
q_snprintf (fbr_mask_name, sizeof(fbr_mask_name), "%s:frame%i_%i_glow", loadmodel->name, i,j); q_snprintf (fbr_mask_name, sizeof(fbr_mask_name), "%s:frame%" PRIi32 "_%" PRIi32 "_glow", loadmodel->name, i,j);
pheader->fbtextures[i][j&3] = TexMgr_LoadImage (loadmodel, fbr_mask_name, pheader->skinwidth, pheader->skinheight, pheader->fbtextures[i][j&3] = TexMgr_LoadImage (loadmodel, fbr_mask_name, pheader->skinwidth, pheader->skinheight,
SRC_INDEXED, (byte *)(pskintype), loadmodel->name, offset, texflags | TEXPREF_FULLBRIGHT); SRC_INDEXED, (byte *)(pskintype), loadmodel->name, offset, texflags | TEXPREF_FULLBRIGHT);
} }
@ -2534,7 +2534,7 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
version = LittleLong (pinmodel->version); version = LittleLong (pinmodel->version);
if (version != ALIAS_VERSION) if (version != ALIAS_VERSION)
Sys_Error ("%s has wrong version number (%i should be %i)", Sys_Error ("%s has wrong version number (%" PRIi32 " should be %" PRIi32 ")",
mod->name, version, ALIAS_VERSION); mod->name, version, ALIAS_VERSION);
// //
@ -2556,7 +2556,7 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
pheader->skinheight = LittleLong (pinmodel->skinheight); pheader->skinheight = LittleLong (pinmodel->skinheight);
if (pheader->skinheight > MAX_LBM_HEIGHT) if (pheader->skinheight > MAX_LBM_HEIGHT)
Sys_Error ("model %s has a skin taller than %d", mod->name, Sys_Error ("model %s has a skin taller than %" PRIi32 "", mod->name,
MAX_LBM_HEIGHT); MAX_LBM_HEIGHT);
pheader->numverts = LittleLong (pinmodel->numverts); pheader->numverts = LittleLong (pinmodel->numverts);
@ -2575,7 +2575,7 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
pheader->numframes = LittleLong (pinmodel->numframes); pheader->numframes = LittleLong (pinmodel->numframes);
numframes = pheader->numframes; numframes = pheader->numframes;
if (numframes < 1) if (numframes < 1)
Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d\n", numframes); Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %" PRIi32 "\n", numframes);
pheader->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO; pheader->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO;
mod->synctype = (synctype_t) LittleLong (pinmodel->synctype); mod->synctype = (synctype_t) LittleLong (pinmodel->synctype);
@ -2705,7 +2705,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int32_t framen
pspriteframe->tmax = (float)height/(float)TexMgr_PadConditional(height); pspriteframe->tmax = (float)height/(float)TexMgr_PadConditional(height);
//johnfitz //johnfitz
q_snprintf (name, sizeof(name), "%s:frame%i", loadmodel->name, framenum); q_snprintf (name, sizeof(name), "%s:frame%" PRIi32 "", loadmodel->name, framenum);
offset = (src_offset_t)(pinframe+1) - (src_offset_t)mod_base; //johnfitz offset = (src_offset_t)(pinframe+1) - (src_offset_t)mod_base; //johnfitz
pspriteframe->gltexture = pspriteframe->gltexture =
TexMgr_LoadImage (loadmodel, name, width, height, SRC_INDEXED, TexMgr_LoadImage (loadmodel, name, width, height, SRC_INDEXED,
@ -2789,7 +2789,7 @@ void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer)
version = LittleLong (pin->version); version = LittleLong (pin->version);
if (version != SPRITE_VERSION) if (version != SPRITE_VERSION)
Sys_Error ("%s has wrong version number " Sys_Error ("%s has wrong version number "
"(%i should be %i)", mod->name, version, SPRITE_VERSION); "(%" PRIi32 " should be %" PRIi32 ")", mod->name, version, SPRITE_VERSION);
numframes = LittleLong (pin->numframes); numframes = LittleLong (pin->numframes);
@ -2815,7 +2815,7 @@ void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer)
// load the frames // load the frames
// //
if (numframes < 1) if (numframes < 1)
Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes); Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %" PRIi32 "\n", numframes);
mod->numframes = numframes; mod->numframes = numframes;
@ -2860,6 +2860,6 @@ void Mod_Print (void)
{ {
Con_SafePrintf ("%8p : %s\n", mod->cache.data, mod->name); //johnfitz -- safeprint instead of print Con_SafePrintf ("%8p : %s\n", mod->cache.data, mod->name); //johnfitz -- safeprint instead of print
} }
Con_Printf ("%i models\n",mod_numknown); //johnfitz -- print the total too Con_Printf ("%" PRIi32 " models\n",mod_numknown); //johnfitz -- print the total too
} }

View File

@ -155,7 +155,7 @@ void R_CheckEfrags (void)
return; //don't spam when still parsing signon packet full of static ents return; //don't spam when still parsing signon packet full of static ents
if (cl.num_efrags > 640 && dev_peakstats.efrags <= 640) if (cl.num_efrags > 640 && dev_peakstats.efrags <= 640)
Con_DWarning ("%i efrags exceeds standard limit of 640.\n", cl.num_efrags); Con_DWarning ("%" PRIi32 " efrags exceeds standard limit of 640.\n", cl.num_efrags);
dev_stats.efrags = cl.num_efrags; dev_stats.efrags = cl.num_efrags;
dev_peakstats.efrags = q_max(cl.num_efrags, dev_peakstats.efrags); dev_peakstats.efrags = q_max(cl.num_efrags, dev_peakstats.efrags);

View File

@ -1119,7 +1119,7 @@ void R_RenderView (void)
//johnfitz -- modified r_speeds output //johnfitz -- modified r_speeds output
time2 = Sys_DoubleTime (); time2 = Sys_DoubleTime ();
if (r_pos.value) if (r_pos.value)
Con_Printf ("x %i y %i z %i (pitch %i yaw %i roll %i)\n", Con_Printf ("x %" PRIi32 " y %" PRIi32 " z %" PRIi32 " (pitch %" PRIi32 " yaw %" PRIi32 " roll %" PRIi32 ")\n",
(int32_t)cl_entities[cl.viewentity].origin[0], (int32_t)cl_entities[cl.viewentity].origin[0],
(int32_t)cl_entities[cl.viewentity].origin[1], (int32_t)cl_entities[cl.viewentity].origin[1],
(int32_t)cl_entities[cl.viewentity].origin[2], (int32_t)cl_entities[cl.viewentity].origin[2],

View File

@ -298,14 +298,14 @@ void R_TranslateNewPlayerSkin (int32_t playernum)
//TODO: move these tests to the place where skinnum gets received from the server //TODO: move these tests to the place where skinnum gets received from the server
if (skinnum < 0 || skinnum >= paliashdr->numskins) if (skinnum < 0 || skinnum >= paliashdr->numskins)
{ {
Con_DPrintf("(%d): Invalid player skin #%d\n", playernum, skinnum); Con_DPrintf("(%" PRIi32 "): Invalid player skin #%" PRIi32 "\n", playernum, skinnum);
skinnum = 0; skinnum = 0;
} }
pixels = (byte *)paliashdr + paliashdr->texels[skinnum]; // This is not a persistent place! pixels = (byte *)paliashdr + paliashdr->texels[skinnum]; // This is not a persistent place!
//upload new image //upload new image
q_snprintf(name, sizeof(name), "player_%i", playernum); q_snprintf(name, sizeof(name), "player_%" PRIi32 "", playernum);
playertextures[playernum] = TexMgr_LoadImage (currententity->model, name, paliashdr->skinwidth, paliashdr->skinheight, playertextures[playernum] = TexMgr_LoadImage (currententity->model, name, paliashdr->skinwidth, paliashdr->skinheight,
SRC_INDEXED, pixels, paliashdr->gltextures[skinnum][0]->source_file, paliashdr->gltextures[skinnum][0]->source_offset, TEXPREF_PAD | TEXPREF_OVERWRITE); SRC_INDEXED, pixels, paliashdr->gltextures[skinnum][0]->source_file, paliashdr->gltextures[skinnum][0]->source_offset, TEXPREF_PAD | TEXPREF_OVERWRITE);
@ -625,7 +625,7 @@ void GL_BindBuffer (GLenum target, GLuint buffer)
cache = &current_element_array_buffer; cache = &current_element_array_buffer;
break; break;
default: default:
Host_Error("GL_BindBuffer: unsupported target %d", (int32_t)target); Host_Error("GL_BindBuffer: unsupported target %" PRIi32 "", (int32_t)target);
return; return;
} }

View File

@ -495,7 +495,7 @@ void SCR_DrawClock (void)
minutes = cl.time / 60; minutes = cl.time / 60;
seconds = ((int32_t)cl.time)%60; seconds = ((int32_t)cl.time)%60;
sprintf (str,"%i:%i%i", minutes, seconds/10, seconds%10); sprintf (str,"%" PRIi32 ":%" PRIi32 "%" PRIi32 "", minutes, seconds/10, seconds%10);
} }
else else
return; return;

View File

@ -84,7 +84,7 @@ static void TexMgr_DescribeTextureModes_f (void)
for (i = 0; i < NUM_GLMODES; i++) for (i = 0; i < NUM_GLMODES; i++)
Con_SafePrintf (" %2i: %s\n", i + 1, glmodes[i].name); Con_SafePrintf (" %2i: %s\n", i + 1, glmodes[i].name);
Con_Printf ("%i modes\n", i); Con_Printf ("%" PRIi32 " modes\n", i);
} }
/* /*
@ -220,7 +220,7 @@ static void TexMgr_Imagelist_f (void)
} }
mb = texels * (Cvar_VariableValue("vid_bpp") / 8.0f) / 0x100000; mb = texels * (Cvar_VariableValue("vid_bpp") / 8.0f) / 0x100000;
Con_Printf ("%i textures %i pixels %1.1f megabytes\n", numgltextures, (int32_t)texels, mb); Con_Printf ("%" PRIi32 " textures %" PRIi32 " pixels %1.1f megabytes\n", numgltextures, (int32_t)texels, mb);
} }
/* /*
@ -266,7 +266,7 @@ static void TexMgr_Imagedump_f (void)
free (buffer); free (buffer);
} }
Con_Printf ("dumped %i textures to %s\n", numgltextures, dirname); Con_Printf ("dumped %" PRIi32 " textures to %s\n", numgltextures, dirname);
} }
/* /*

View File

@ -605,7 +605,7 @@ static bool VID_SetMode (int32_t width, int32_t height, int32_t refreshrate, int
// fix the leftover Alt from any Alt-Tab or the like that switched us away // fix the leftover Alt from any Alt-Tab or the like that switched us away
ClearAllStates (); ClearAllStates ();
Con_SafePrintf ("Video mode %dx%dx%d %dHz (%d-bit z-buffer, %dx FSAA) initialized\n", Con_SafePrintf ("Video mode %" PRIi32 "x%" PRIi32 "x%" PRIi32 " %" PRIi32 "Hz (%" PRIi32 "-bit z-buffer, %" PRIi32 "x FSAA) initialized\n",
VID_GetCurrentWidth(), VID_GetCurrentWidth(),
VID_GetCurrentHeight(), VID_GetCurrentHeight(),
VID_GetCurrentBPP(), VID_GetCurrentBPP(),
@ -656,7 +656,7 @@ static void VID_Restart (void)
// //
if (!VID_ValidMode (width, height, refreshrate, bpp, fullscreen)) if (!VID_ValidMode (width, height, refreshrate, bpp, fullscreen))
{ {
Con_Printf ("%dx%dx%d %dHz %s is not a valid mode\n", Con_Printf ("%" PRIi32 "x%" PRIi32 "x%" PRIi32 " %" PRIi32 "Hz %s is not a valid mode\n",
width, height, bpp, refreshrate, fullscreen? "fullscreen" : "windowed"); width, height, bpp, refreshrate, fullscreen? "fullscreen" : "windowed");
return; return;
} }
@ -897,7 +897,7 @@ static void GL_CheckExtensions (void)
gl_mtexable = true; gl_mtexable = true;
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &gl_max_texture_units); glGetIntegerv(GL_MAX_TEXTURE_UNITS, &gl_max_texture_units);
Con_Printf("GL_MAX_TEXTURE_UNITS: %d\n", (int32_t)gl_max_texture_units); Con_Printf("GL_MAX_TEXTURE_UNITS: %" PRIi32 "\n", (int32_t)gl_max_texture_units);
} }
else else
{ {
@ -1162,7 +1162,7 @@ static void GL_Init (void)
Con_SafePrintf ("GL_RENDERER: %s\n", gl_renderer); Con_SafePrintf ("GL_RENDERER: %s\n", gl_renderer);
Con_SafePrintf ("GL_VERSION: %s\n", gl_version); Con_SafePrintf ("GL_VERSION: %s\n", gl_version);
if (gl_version == NULL || sscanf(gl_version, "%d.%d", &gl_version_major, &gl_version_minor) < 2) if (gl_version == NULL || sscanf(gl_version, "%" PRIi32 ".%" PRIi32 "", &gl_version_major, &gl_version_minor) < 2)
{ {
gl_version_major = 0; gl_version_major = 0;
gl_version_minor = 0; gl_version_minor = 0;
@ -1270,7 +1270,7 @@ VID_DescribeCurrentMode_f
static void VID_DescribeCurrentMode_f (void) static void VID_DescribeCurrentMode_f (void)
{ {
if (draw_context) if (draw_context)
Con_Printf("%dx%dx%d %dHz %s\n", Con_Printf("%" PRIi32 "x%" PRIi32 "x%" PRIi32 " %" PRIi32 "Hz %s\n",
VID_GetCurrentWidth(), VID_GetCurrentWidth(),
VID_GetCurrentHeight(), VID_GetCurrentHeight(),
VID_GetCurrentBPP(), VID_GetCurrentBPP(),
@ -1296,14 +1296,14 @@ static void VID_DescribeModes_f (void)
{ {
if (count > 0) if (count > 0)
Con_SafePrintf ("\n"); Con_SafePrintf ("\n");
Con_SafePrintf (" %4i x %4i x %i : %i", modelist[i].width, modelist[i].height, modelist[i].bpp, modelist[i].refreshrate); Con_SafePrintf (" %4i x %4i x %" PRIi32 " : %" PRIi32 "", modelist[i].width, modelist[i].height, modelist[i].bpp, modelist[i].refreshrate);
lastwidth = modelist[i].width; lastwidth = modelist[i].width;
lastheight = modelist[i].height; lastheight = modelist[i].height;
lastbpp = modelist[i].bpp; lastbpp = modelist[i].bpp;
count++; count++;
} }
} }
Con_Printf ("\n%i modes\n", count); Con_Printf ("\n%" PRIi32 " modes\n", count);
} }
/* /*
@ -1315,7 +1315,7 @@ static void VID_FSAA_f (cvar_t *var)
{ {
// don't print the warning if vid_fsaa is set during startup // don't print the warning if vid_fsaa is set during startup
if (vid_initialized) if (vid_initialized)
Con_Printf("%s %d requires engine restart to take effect\n", var->name, (int32_t)var->value); Con_Printf("%s %" PRIi32 " requires engine restart to take effect\n", var->name, (int32_t)var->value);
} }
//========================================================================== //==========================================================================
@ -2047,15 +2047,15 @@ static void VID_MenuDraw (void)
{ {
case VID_OPT_MODE: case VID_OPT_MODE:
M_Print (16, y, " Video mode"); M_Print (16, y, " Video mode");
M_Print (184, y, va("%ix%i", (int32_t)vid_width.value, (int32_t)vid_height.value)); M_Print (184, y, va("%" PRIi32 "x%" PRIi32 "", (int32_t)vid_width.value, (int32_t)vid_height.value));
break; break;
case VID_OPT_BPP: case VID_OPT_BPP:
M_Print (16, y, " Color depth"); M_Print (16, y, " Color depth");
M_Print (184, y, va("%i", (int32_t)vid_bpp.value)); M_Print (184, y, va("%" PRIi32 "", (int32_t)vid_bpp.value));
break; break;
case VID_OPT_REFRESHRATE: case VID_OPT_REFRESHRATE:
M_Print (16, y, " Refresh rate"); M_Print (16, y, " Refresh rate");
M_Print (184, y, va("%i", (int32_t)vid_refreshrate.value)); M_Print (184, y, va("%" PRIi32 "", (int32_t)vid_refreshrate.value));
break; break;
case VID_OPT_FULLSCREEN: case VID_OPT_FULLSCREEN:
M_Print (16, y, " Fullscreen"); M_Print (16, y, " Fullscreen");

View File

@ -83,7 +83,7 @@ void SubdividePolygon (int32_t numverts, float *verts)
float s, t; float s, t;
if (numverts > 60) if (numverts > 60)
Sys_Error ("numverts = %i", numverts); Sys_Error ("numverts = %" PRIi32 "", numverts);
BoundPoly (numverts, verts, mins, maxs); BoundPoly (numverts, verts, mins, maxs);

View File

@ -649,7 +649,7 @@ void Host_ServerFrame (void)
active++; active++;
} }
if (active > 600 && dev_peakstats.edicts <= 600) if (active > 600 && dev_peakstats.edicts <= 600)
Con_DWarning ("%i edicts exceeds standard limit of 600 (max = %d).\n", active, sv.max_edicts); Con_DWarning ("%" PRIi32 " edicts exceeds standard limit of 600 (max = %" PRIi32 ").\n", active, sv.max_edicts);
dev_stats.edicts = active; dev_stats.edicts = active;
dev_peakstats.edicts = q_max(active, dev_peakstats.edicts); dev_peakstats.edicts = q_max(active, dev_peakstats.edicts);
} }

View File

@ -209,7 +209,7 @@ void Host_Maps_f (void)
Con_SafePrintf (" %s\n", level->name); Con_SafePrintf (" %s\n", level->name);
if (i) if (i)
Con_SafePrintf ("%i map(s)\n", i); Con_SafePrintf ("%" PRIi32 " map(s)\n", i);
else else
Con_SafePrintf ("no maps found\n"); Con_SafePrintf ("no maps found\n");
} }
@ -385,7 +385,7 @@ void Host_Mods_f (void)
Con_SafePrintf (" %s\n", mod->name); Con_SafePrintf (" %s\n", mod->name);
if (i) if (i)
Con_SafePrintf ("%i mod(s)\n", i); Con_SafePrintf ("%" PRIi32 " mod(s)\n", i);
else else
Con_SafePrintf ("no mods found\n"); Con_SafePrintf ("no mods found\n");
} }
@ -448,7 +448,7 @@ void Host_Status_f (void)
if (ipxAvailable) if (ipxAvailable)
print_fn ("ipx: %s\n", my_ipx_address); print_fn ("ipx: %s\n", my_ipx_address);
print_fn ("map: %s\n", sv.name); print_fn ("map: %s\n", sv.name);
print_fn ("players: %i active (%i max)\n\n", net_activeconnections, svs.maxclients); print_fn ("players: %" PRIi32 " active (%" PRIi32 " max)\n\n", net_activeconnections, svs.maxclients);
for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++) for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++)
{ {
if (!client->active) if (!client->active)
@ -641,7 +641,7 @@ void Host_SetPos_f(void)
SV_ClientPrintf(" setpos <x> <y> <z>\n"); SV_ClientPrintf(" setpos <x> <y> <z>\n");
SV_ClientPrintf(" setpos <x> <y> <z> <pitch> <yaw> <roll>\n"); SV_ClientPrintf(" setpos <x> <y> <z> <pitch> <yaw> <roll>\n");
SV_ClientPrintf("current values:\n"); SV_ClientPrintf("current values:\n");
SV_ClientPrintf(" %i %i %i %i %i %i\n", SV_ClientPrintf(" %" PRIi32 " %" PRIi32 " %" PRIi32 " %" PRIi32 " %" PRIi32 " %" PRIi32 "\n",
(int32_t)sv_player->v.origin[0], (int32_t)sv_player->v.origin[0],
(int32_t)sv_player->v.origin[1], (int32_t)sv_player->v.origin[1],
(int32_t)sv_player->v.origin[2], (int32_t)sv_player->v.origin[2],
@ -1081,12 +1081,12 @@ void Host_Savegame_f (void)
return; return;
} }
fprintf (f, "%i\n", SAVEGAME_VERSION); fprintf (f, "%" PRIi32 "\n", SAVEGAME_VERSION);
Host_SavegameComment (comment); Host_SavegameComment (comment);
fprintf (f, "%s\n", comment); fprintf (f, "%s\n", comment);
for (i = 0; i < NUM_SPAWN_PARMS; i++) for (i = 0; i < NUM_SPAWN_PARMS; i++)
fprintf (f, "%f\n", svs.clients->spawn_parms[i]); fprintf (f, "%f\n", svs.clients->spawn_parms[i]);
fprintf (f, "%d\n", current_skill); fprintf (f, "%" PRIi32 "\n", current_skill);
fprintf (f, "%s\n", sv.name); fprintf (f, "%s\n", sv.name);
fprintf (f, "%f\n",sv.time); fprintf (f, "%f\n",sv.time);
@ -1174,7 +1174,7 @@ void Host_Loadgame_f (void)
{ {
free (start); free (start);
start = NULL; start = NULL;
Con_Printf ("Savegame is version %i, not %i\n", version, SAVEGAME_VERSION); Con_Printf ("Savegame is version %" PRIi32 ", not %" PRIi32 "\n", version, SAVEGAME_VERSION);
return; return;
} }
data = COM_ParseStringNewline (data); data = COM_ParseStringNewline (data);
@ -1477,7 +1477,7 @@ void Host_Color_f(void)
if (Cmd_Argc() == 1) if (Cmd_Argc() == 1)
{ {
Con_Printf ("\"color\" is \"%i %i\"\n", ((int32_t)cl_color.value) >> 4, ((int32_t)cl_color.value) & 0x0f); Con_Printf ("\"color\" is \"%" PRIi32 " %" PRIi32 "\"\n", ((int32_t)cl_color.value) >> 4, ((int32_t)cl_color.value) & 0x0f);
Con_Printf ("color <0-13> [0-13]\n"); Con_Printf ("color <0-13> [0-13]\n");
return; return;
} }
@ -2147,7 +2147,7 @@ void PrintFrameName (qmodel_t *m, int32_t frame)
return; return;
pframedesc = &hdr->frames[frame]; pframedesc = &hdr->frames[frame];
Con_Printf ("frame %i: %s\n", frame, pframedesc->name); Con_Printf ("frame %" PRIi32 ": %s\n", frame, pframedesc->name);
} }
/* /*
@ -2219,10 +2219,10 @@ void Host_Startdemos_f (void)
c = Cmd_Argc() - 1; c = Cmd_Argc() - 1;
if (c > MAX_DEMOS) if (c > MAX_DEMOS)
{ {
Con_Printf ("Max %i demos in demoloop\n", MAX_DEMOS); Con_Printf ("Max %" PRIi32 " demos in demoloop\n", MAX_DEMOS);
c = MAX_DEMOS; c = MAX_DEMOS;
} }
Con_Printf ("%i demo(s) in loop\n", c); Con_Printf ("%" PRIi32 " demo(s) in loop\n", c);
for (i = 1; i < c + 1; i++) for (i = 1; i < c + 1; i++)
q_strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof(cls.demos[0])); q_strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof(cls.demos[0]));

View File

@ -424,7 +424,7 @@ byte *Image_LoadPCX (FILE *f, int32_t *width, int32_t *height)
Sys_Error ("'%s' is not a valid PCX file", loadfilename); Sys_Error ("'%s' is not a valid PCX file", loadfilename);
if (pcx.version != 5) if (pcx.version != 5)
Sys_Error ("'%s' is version %i, should be 5", loadfilename, pcx.version); Sys_Error ("'%s' is version %" PRIi32 ", should be 5", loadfilename, pcx.version);
if (pcx.encoding != 1 || pcx.bits_per_pixel != 8 || pcx.color_planes != 1) if (pcx.encoding != 1 || pcx.bits_per_pixel != 8 || pcx.color_planes != 1)
Sys_Error ("'%s' has wrong encoding or bit depth", loadfilename); Sys_Error ("'%s' has wrong encoding or bit depth", loadfilename);

View File

@ -236,7 +236,7 @@ void IN_StartupJoystick (void)
q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir); q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir);
nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb); nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb);
if (nummappings > 0) if (nummappings > 0)
Con_Printf("%d mappings loaded from gamecontrollerdb.txt\n", nummappings); Con_Printf("%" PRIi32 " mappings loaded from gamecontrollerdb.txt\n", nummappings);
// Also try host_parms->userdir // Also try host_parms->userdir
if (host_parms->userdir != host_parms->basedir) if (host_parms->userdir != host_parms->basedir)
@ -244,7 +244,7 @@ void IN_StartupJoystick (void)
q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", host_parms->userdir); q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", host_parms->userdir);
nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb); nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb);
if (nummappings > 0) if (nummappings > 0)
Con_Printf("%d mappings loaded from gamecontrollerdb.txt\n", nummappings); Con_Printf("%" PRIi32 " mappings loaded from gamecontrollerdb.txt\n", nummappings);
} }
for (i = 0; i < SDL_NumJoysticks(); i++) for (i = 0; i < SDL_NumJoysticks(); i++)
@ -881,7 +881,7 @@ void IN_SendKeyEvents (void)
if (event.button.button < 1 || if (event.button.button < 1 ||
event.button.button > sizeof(buttonremap) / sizeof(buttonremap[0])) event.button.button > sizeof(buttonremap) / sizeof(buttonremap[0]))
{ {
Con_Printf ("Ignored event for mouse button %d\n", Con_Printf ("Ignored event for mouse button %" PRIi32 "\n",
event.button.button); event.button.button);
break; break;
} }

View File

@ -670,7 +670,7 @@ void Key_Bindlist_f (void)
count++; count++;
} }
} }
Con_SafePrintf ("%i bindings\n", count); Con_SafePrintf ("%" PRIi32 " bindings\n", count);
} }
/* /*
@ -1018,7 +1018,7 @@ void Key_Event (int32_t key, bool down)
kb = keybindings[key]; kb = keybindings[key];
if (kb && kb[0] == '+') if (kb && kb[0] == '+')
{ {
sprintf (cmd, "-%s %i\n", kb+1, key); sprintf (cmd, "-%s %" PRIi32 "\n", kb+1, key);
Cbuf_AddText (cmd); Cbuf_AddText (cmd);
} }
return; return;
@ -1041,7 +1041,7 @@ void Key_Event (int32_t key, bool down)
{ {
if (kb[0] == '+') if (kb[0] == '+')
{ // button commands add keynum as a parm { // button commands add keynum as a parm
sprintf (cmd, "%s %i\n", kb, key); sprintf (cmd, "%s %" PRIi32 "\n", kb, key);
Cbuf_AddText (cmd); Cbuf_AddText (cmd);
} }
else else

View File

@ -43,15 +43,15 @@ static void Sys_InitSDL (void)
SDL_version *sdl_version = &v; SDL_version *sdl_version = &v;
SDL_GetVersion(&v); SDL_GetVersion(&v);
Sys_Printf("Found SDL version %i.%i.%i\n",sdl_version->major,sdl_version->minor,sdl_version->patch); Sys_Printf("Found SDL version %" PRIi32 ".%" PRIi32 ".%" PRIi32 "\n",sdl_version->major,sdl_version->minor,sdl_version->patch);
if (SDL_VERSIONNUM(sdl_version->major,sdl_version->minor,sdl_version->patch) < SDL_REQUIREDVERSION) if (SDL_VERSIONNUM(sdl_version->major,sdl_version->minor,sdl_version->patch) < SDL_REQUIREDVERSION)
{ /*reject running under older SDL versions */ { /*reject running under older SDL versions */
Sys_Error("You need at least v%d.%d.%d of SDL to run this game.", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z); Sys_Error("You need at least v%" PRIi32 ".%" PRIi32 ".%" PRIi32 " of SDL to run this game.", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z);
} }
if (SDL_VERSIONNUM(sdl_version->major,sdl_version->minor,sdl_version->patch) >= SDL_NEW_VERSION_REJECT) if (SDL_VERSIONNUM(sdl_version->major,sdl_version->minor,sdl_version->patch) >= SDL_NEW_VERSION_REJECT)
{ /*reject running under newer (1.3.x) SDL */ { /*reject running under newer (1.3.x) SDL */
Sys_Error("Your version of SDL library is incompatible with me.\n" Sys_Error("Your version of SDL library is incompatible with me.\n"
"You need a library version in the line of %d.%d.%d\n", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z); "You need a library version in the line of %" PRIi32 ".%" PRIi32 ".%" PRIi32 "\n", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z);
} }
if (SDL_Init(0) < 0) if (SDL_Init(0) < 0)

View File

@ -267,7 +267,7 @@ void M_Main_Draw (void)
f = (int32_t)(realtime * 10)%6; f = (int32_t)(realtime * 10)%6;
M_DrawTransPic (54, 32 + m_main_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); M_DrawTransPic (54, 32 + m_main_cursor * 20,Draw_CachePic( va("gfx/menudot%" PRIi32 ".lmp", f+1 ) ) );
} }
@ -357,7 +357,7 @@ void M_SinglePlayer_Draw (void)
f = (int32_t)(realtime * 10)%6; f = (int32_t)(realtime * 10)%6;
M_DrawTransPic (54, 32 + m_singleplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); M_DrawTransPic (54, 32 + m_singleplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%" PRIi32 ".lmp", f+1 ) ) );
} }
@ -434,11 +434,11 @@ void M_ScanSaves (void)
{ {
strcpy (m_filenames[i], "--- UNUSED SLOT ---"); strcpy (m_filenames[i], "--- UNUSED SLOT ---");
loadable[i] = false; loadable[i] = false;
q_snprintf (name, sizeof(name), "%s/s%i.sav", com_gamedir, i); q_snprintf (name, sizeof(name), "%s/s%" PRIi32 ".sav", com_gamedir, i);
f = fopen (name, "r"); f = fopen (name, "r");
if (!f) if (!f)
continue; continue;
fscanf (f, "%i\n", &version); fscanf (f, "%" PRIi32 "\n", &version);
fscanf (f, "%79s\n", name); fscanf (f, "%79s\n", name);
strncpy (m_filenames[i], name, sizeof(m_filenames[i])-1); strncpy (m_filenames[i], name, sizeof(m_filenames[i])-1);
@ -537,7 +537,7 @@ void M_Load_Key (int32_t k)
SCR_BeginLoadingPlaque (); SCR_BeginLoadingPlaque ();
// issue the load command // issue the load command
Cbuf_AddText (va ("load s%i\n", load_cursor) ); Cbuf_AddText (va ("load s%" PRIi32 "\n", load_cursor) );
return; return;
case K_UPARROW: case K_UPARROW:
@ -574,7 +574,7 @@ void M_Save_Key (int32_t k)
m_state = m_none; m_state = m_none;
IN_Activate(); IN_Activate();
key_dest = key_game; key_dest = key_game;
Cbuf_AddText (va("save s%i\n", load_cursor)); Cbuf_AddText (va("save s%" PRIi32 "\n", load_cursor));
return; return;
case K_UPARROW: case K_UPARROW:
@ -623,7 +623,7 @@ void M_MultiPlayer_Draw (void)
f = (int32_t)(realtime * 10)%6; f = (int32_t)(realtime * 10)%6;
M_DrawTransPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); M_DrawTransPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%" PRIi32 ".lmp", f+1 ) ) );
if (ipxAvailable || tcpipAvailable) if (ipxAvailable || tcpipAvailable)
return; return;
@ -798,7 +798,7 @@ forward:
if (Q_strcmp(hostname.string, setup_hostname) != 0) if (Q_strcmp(hostname.string, setup_hostname) != 0)
Cvar_Set("hostname", setup_hostname); Cvar_Set("hostname", setup_hostname);
if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom) if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom)
Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) ); Cbuf_AddText( va ("color %" PRIi32 " %" PRIi32 "\n", setup_top, setup_bottom) );
m_entersound = true; m_entersound = true;
M_Menu_MultiPlayer_f (); M_Menu_MultiPlayer_f ();
break; break;
@ -928,7 +928,7 @@ void M_Net_Draw (void)
M_Print (f, 128, net_helpMessage[m_net_cursor*4+3]); M_Print (f, 128, net_helpMessage[m_net_cursor*4+3]);
f = (int32_t)(realtime * 10)%6; f = (int32_t)(realtime * 10)%6;
M_DrawTransPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); M_DrawTransPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%" PRIi32 ".lmp", f+1 ) ) );
} }
@ -1572,7 +1572,7 @@ void M_Menu_Help_f (void)
void M_Help_Draw (void) void M_Help_Draw (void)
{ {
M_DrawPic (0, 0, Draw_CachePic ( va("gfx/help%i.lmp", help_page)) ); M_DrawPic (0, 0, Draw_CachePic ( va("gfx/help%" PRIi32 ".lmp", help_page)) );
} }
@ -2111,7 +2111,7 @@ void M_GameOptions_Draw (void)
M_Print (160, 40, "begin game"); M_Print (160, 40, "begin game");
M_Print (0, 56, " Max players"); M_Print (0, 56, " Max players");
M_Print (160, 56, va("%i", maxplayers) ); M_Print (160, 56, va("%" PRIi32 "", maxplayers) );
M_Print (0, 64, " Game Type"); M_Print (0, 64, " Game Type");
if (coop.value) if (coop.value)
@ -2163,13 +2163,13 @@ void M_GameOptions_Draw (void)
if (fraglimit.value == 0) if (fraglimit.value == 0)
M_Print (160, 88, "none"); M_Print (160, 88, "none");
else else
M_Print (160, 88, va("%i frags", (int32_t)fraglimit.value)); M_Print (160, 88, va("%" PRIi32 " frags", (int32_t)fraglimit.value));
M_Print (0, 96, " Time Limit"); M_Print (0, 96, " Time Limit");
if (timelimit.value == 0) if (timelimit.value == 0)
M_Print (160, 96, "none"); M_Print (160, 96, "none");
else else
M_Print (160, 96, va("%i minutes", (int32_t)timelimit.value)); M_Print (160, 96, va("%" PRIi32 " minutes", (int32_t)timelimit.value));
M_Print (0, 112, " Episode"); M_Print (0, 112, " Episode");
// MED 01/06/97 added hipnotic episodes // MED 01/06/97 added hipnotic episodes

View File

@ -448,16 +448,16 @@ static void NET_Stats_f (void)
if (Cmd_Argc () == 1) if (Cmd_Argc () == 1)
{ {
Con_Printf("unreliable messages sent = %i\n", unreliableMessagesSent); Con_Printf("unreliable messages sent = %" PRIi32 "\n", unreliableMessagesSent);
Con_Printf("unreliable messages recv = %i\n", unreliableMessagesReceived); Con_Printf("unreliable messages recv = %" PRIi32 "\n", unreliableMessagesReceived);
Con_Printf("reliable messages sent = %i\n", messagesSent); Con_Printf("reliable messages sent = %" PRIi32 "\n", messagesSent);
Con_Printf("reliable messages received = %i\n", messagesReceived); Con_Printf("reliable messages received = %" PRIi32 "\n", messagesReceived);
Con_Printf("packetsSent = %i\n", packetsSent); Con_Printf("packetsSent = %" PRIi32 "\n", packetsSent);
Con_Printf("packetsReSent = %i\n", packetsReSent); Con_Printf("packetsReSent = %" PRIi32 "\n", packetsReSent);
Con_Printf("packetsReceived = %i\n", packetsReceived); Con_Printf("packetsReceived = %" PRIi32 "\n", packetsReceived);
Con_Printf("receivedDuplicateCount = %i\n", receivedDuplicateCount); Con_Printf("receivedDuplicateCount = %" PRIi32 "\n", receivedDuplicateCount);
Con_Printf("shortPacketCount = %i\n", shortPacketCount); Con_Printf("shortPacketCount = %" PRIi32 "\n", shortPacketCount);
Con_Printf("droppedDatagrams = %i\n", droppedDatagrams); Con_Printf("droppedDatagrams = %" PRIi32 "\n", droppedDatagrams);
} }
else if (Q_strcmp(Cmd_Argv(1), "*") == 0) else if (Q_strcmp(Cmd_Argv(1), "*") == 0)
{ {
@ -509,7 +509,7 @@ static const char *Strip_Port (const char *host)
if (port > 0 && port < 65536 && port != net_hostport) if (port > 0 && port < 65536 && port != net_hostport)
{ {
net_hostport = port; net_hostport = port;
Con_Printf("Port set to %d\n", net_hostport); Con_Printf("Port set to %" PRIi32 "\n", net_hostport);
} }
return noport; return noport;
} }
@ -566,7 +566,7 @@ static void Test_Poll (void *unused)
connectTime = MSG_ReadLong(); connectTime = MSG_ReadLong();
Q_strcpy(address, MSG_ReadString()); Q_strcpy(address, MSG_ReadString());
Con_Printf("%s\n frags:%3i colors:%d %d time:%d\n %s\n", name, frags, colors >> 4, colors & 0x0f, connectTime / 60, address); Con_Printf("%s\n frags:%3i colors:%" PRIi32 " %" PRIi32 " time:%" PRIi32 "\n %s\n", name, frags, colors >> 4, colors & 0x0f, connectTime / 60, address);
} }
testPollCount--; testPollCount--;

View File

@ -170,7 +170,7 @@ static void NET_Listen_f (void)
{ {
if (Cmd_Argc () != 2) if (Cmd_Argc () != 2)
{ {
Con_Printf ("\"listen\" is \"%d\"\n", listening ? 1 : 0); Con_Printf ("\"listen\" is \"%" PRIi32 "\"\n", listening ? 1 : 0);
return; return;
} }
@ -191,7 +191,7 @@ static void MaxPlayers_f (void)
if (Cmd_Argc () != 2) if (Cmd_Argc () != 2)
{ {
Con_Printf ("\"maxplayers\" is \"%d\"\n", svs.maxclients); Con_Printf ("\"maxplayers\" is \"%" PRIi32 "\"\n", svs.maxclients);
return; return;
} }
@ -207,7 +207,7 @@ static void MaxPlayers_f (void)
if (n > svs.maxclientslimit) if (n > svs.maxclientslimit)
{ {
n = svs.maxclientslimit; n = svs.maxclientslimit;
Con_Printf ("\"maxplayers\" set to \"%d\"\n", n); Con_Printf ("\"maxplayers\" set to \"%" PRIi32 "\"\n", n);
} }
if ((n == 1) && listening) if ((n == 1) && listening)
@ -230,7 +230,7 @@ static void NET_Port_f (void)
if (Cmd_Argc () != 2) if (Cmd_Argc () != 2)
{ {
Con_Printf ("\"port\" is \"%d\"\n", net_hostport); Con_Printf ("\"port\" is \"%" PRIi32 "\"\n", net_hostport);
return; return;
} }

View File

@ -68,7 +68,7 @@ static char *PF_VarString (int32_t first)
{ {
if (!dev_overflows.varstring || dev_overflows.varstring + CONSOLE_RESPAM_TIME < realtime) if (!dev_overflows.varstring || dev_overflows.varstring + CONSOLE_RESPAM_TIME < realtime)
{ {
Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n", (int32_t) s, (int32_t)(sizeof(out) - 1)); Con_DWarning("PF_VarString: %" PRIi32 " characters exceeds standard limit of 255 (max = %" PRIi32 ").\n", (int32_t) s, (int32_t)(sizeof(out) - 1));
dev_overflows.varstring = realtime; dev_overflows.varstring = realtime;
} }
} }
@ -639,13 +639,13 @@ static void PF_sound (void)
attenuation = G_FLOAT(OFS_PARM4); attenuation = G_FLOAT(OFS_PARM4);
if (volume < 0 || volume > 255) if (volume < 0 || volume > 255)
Host_Error ("SV_StartSound: volume = %i", volume); Host_Error ("SV_StartSound: volume = %" PRIi32 "", volume);
if (attenuation < 0 || attenuation > 4) if (attenuation < 0 || attenuation > 4)
Host_Error ("SV_StartSound: attenuation = %f", attenuation); Host_Error ("SV_StartSound: attenuation = %f", attenuation);
if (channel < 0 || channel > 7) if (channel < 0 || channel > 7)
Host_Error ("SV_StartSound: channel = %i", channel); Host_Error ("SV_StartSound: channel = %" PRIi32 "", channel);
SV_StartSound (entity, channel, sample, volume, attenuation); SV_StartSound (entity, channel, sample, volume, attenuation);
} }
@ -691,7 +691,7 @@ static void PF_traceline (void)
if (developer.value) { if (developer.value) {
if (IS_NAN(v1[0]) || IS_NAN(v1[1]) || IS_NAN(v1[2]) || if (IS_NAN(v1[0]) || IS_NAN(v1[1]) || IS_NAN(v1[2]) ||
IS_NAN(v2[0]) || IS_NAN(v2[1]) || IS_NAN(v2[2])) { IS_NAN(v2[0]) || IS_NAN(v2[1]) || IS_NAN(v2[2])) {
Con_Warning ("NAN in traceline:\nv1(%f %f %f) v2(%f %f %f)\nentity %d\n", Con_Warning ("NAN in traceline:\nv1(%f %f %f) v2(%f %f %f)\nentity %" PRIi32 "\n",
v1[0], v1[1], v1[2], v2[0], v2[1], v2[2], NUM_FOR_EDICT(ent)); v1[0], v1[1], v1[2], v2[0], v2[1], v2[2], NUM_FOR_EDICT(ent));
} }
} }
@ -791,7 +791,7 @@ static int32_t PF_newcheckclient (int32_t check)
checkpvs_capacity = pvsbytes; checkpvs_capacity = pvsbytes;
checkpvs = (byte *) realloc (checkpvs, checkpvs_capacity); checkpvs = (byte *) realloc (checkpvs, checkpvs_capacity);
if (!checkpvs) if (!checkpvs)
Sys_Error ("PF_newcheckclient: realloc() failed on %d bytes", checkpvs_capacity); Sys_Error ("PF_newcheckclient: realloc() failed on %" PRIi32 " bytes", checkpvs_capacity);
} }
memcpy (checkpvs, pvs, pvsbytes); memcpy (checkpvs, pvs, pvsbytes);
@ -992,7 +992,7 @@ static void PF_ftos (void)
v = G_FLOAT(OFS_PARM0); v = G_FLOAT(OFS_PARM0);
s = PR_GetTempString(); s = PR_GetTempString();
if (v == (int32_t)v) if (v == (int32_t)v)
sprintf (s, "%d",(int32_t)v); sprintf (s, "%" PRIi32 "",(int32_t)v);
else else
sprintf (s, "%5.1f",v); sprintf (s, "%5.1f",v);
G_INT(OFS_RETURN) = PR_SetEngineString(s); G_INT(OFS_RETURN) = PR_SetEngineString(s);
@ -1242,7 +1242,7 @@ static void PF_lightstyle (void)
// bounds check to avoid clobbering sv struct // bounds check to avoid clobbering sv struct
if (style < 0 || style >= MAX_LIGHTSTYLES) if (style < 0 || style >= MAX_LIGHTSTYLES)
{ {
Con_DWarning("PF_lightstyle: invalid style %d\n", style); Con_DWarning("PF_lightstyle: invalid style %" PRIi32 "\n", style);
return; return;
} }

View File

@ -125,7 +125,7 @@ edict_t *ED_Alloc (void)
} }
if (i == sv.max_edicts) //johnfitz -- use sv.max_edicts instead of MAX_EDICTS if (i == sv.max_edicts) //johnfitz -- use sv.max_edicts instead of MAX_EDICTS
Host_Error ("ED_Alloc: no free edicts (max_edicts is %i)", sv.max_edicts); Host_Error ("ED_Alloc: no free edicts (max_edicts is %" PRIi32 ")", sv.max_edicts);
sv.num_edicts++; sv.num_edicts++;
e = EDICT_NUM(i); e = EDICT_NUM(i);
@ -320,7 +320,7 @@ static const char *PR_ValueString (int32_t type, eval_t *val)
sprintf (line, "%s", PR_GetString(val->string)); sprintf (line, "%s", PR_GetString(val->string));
break; break;
case ev_entity: case ev_entity:
sprintf (line, "entity %i", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict)) ); sprintf (line, "entity %" PRIi32 "", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict)) );
break; break;
case ev_function: case ev_function:
f = pr_functions + val->function; f = pr_functions + val->function;
@ -343,7 +343,7 @@ static const char *PR_ValueString (int32_t type, eval_t *val)
sprintf (line, "pointer"); sprintf (line, "pointer");
break; break;
default: default:
sprintf (line, "bad type %i", type); sprintf (line, "bad type %" PRIi32 "", type);
break; break;
} }
@ -373,7 +373,7 @@ static const char *PR_UglyValueString (int32_t type, eval_t *val)
sprintf (line, "%s", PR_GetString(val->string)); sprintf (line, "%s", PR_GetString(val->string));
break; break;
case ev_entity: case ev_entity:
sprintf (line, "%i", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict))); sprintf (line, "%" PRIi32 "", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict)));
break; break;
case ev_function: case ev_function:
f = pr_functions + val->function; f = pr_functions + val->function;
@ -393,7 +393,7 @@ static const char *PR_UglyValueString (int32_t type, eval_t *val)
sprintf (line, "%f %f %f", val->vector[0], val->vector[1], val->vector[2]); sprintf (line, "%f %f %f", val->vector[0], val->vector[1], val->vector[2]);
break; break;
default: default:
sprintf (line, "bad type %i", type); sprintf (line, "bad type %" PRIi32 "", type);
break; break;
} }
@ -419,11 +419,11 @@ const char *PR_GlobalString (int32_t ofs)
val = (void *)&pr_globals[ofs]; val = (void *)&pr_globals[ofs];
def = ED_GlobalAtOfs(ofs); def = ED_GlobalAtOfs(ofs);
if (!def) if (!def)
sprintf (line,"%i(?)", ofs); sprintf (line,"%" PRIi32 "(?)", ofs);
else else
{ {
s = PR_ValueString (def->type, (eval_t *)val); s = PR_ValueString (def->type, (eval_t *)val);
sprintf (line,"%i(%s)%s", ofs, PR_GetString(def->s_name), s); sprintf (line,"%" PRIi32 "(%s)%s", ofs, PR_GetString(def->s_name), s);
} }
i = strlen(line); i = strlen(line);
@ -442,9 +442,9 @@ const char *PR_GlobalStringNoContents (int32_t ofs)
def = ED_GlobalAtOfs(ofs); def = ED_GlobalAtOfs(ofs);
if (!def) if (!def)
sprintf (line,"%i(?)", ofs); sprintf (line,"%" PRIi32 "(?)", ofs);
else else
sprintf (line,"%i(%s)", ofs, PR_GetString(def->s_name)); sprintf (line,"%" PRIi32 "(%s)", ofs, PR_GetString(def->s_name));
i = strlen(line); i = strlen(line);
for ( ; i < 20; i++) for ( ; i < 20; i++)
@ -476,7 +476,7 @@ void ED_Print (edict_t *ed)
return; return;
} }
Con_SafePrintf("\nEDICT %i:\n", NUM_FOR_EDICT(ed)); //johnfitz -- was Con_Printf Con_SafePrintf("\nEDICT %" PRIi32 ":\n", NUM_FOR_EDICT(ed)); //johnfitz -- was Con_Printf
for (i = 1; i < progs->numfielddefs; i++) for (i = 1; i < progs->numfielddefs; i++)
{ {
d = &pr_fielddefs[i]; d = &pr_fielddefs[i];
@ -580,7 +580,7 @@ void ED_PrintEdicts (void)
if (!sv.active) if (!sv.active)
return; return;
Con_Printf ("%i entities\n", sv.num_edicts); Con_Printf ("%" PRIi32 " entities\n", sv.num_edicts);
for (i = 0; i < sv.num_edicts; i++) for (i = 0; i < sv.num_edicts; i++)
ED_PrintNum (i); ED_PrintNum (i);
} }
@ -1037,7 +1037,7 @@ void ED_LoadFromFile (const char *data)
PR_ExecuteProgram (func - pr_functions); PR_ExecuteProgram (func - pr_functions);
} }
Con_DPrintf ("%i entities inhibited\n", inhibit); Con_DPrintf ("%" PRIi32 " entities inhibited\n", inhibit);
} }
@ -1059,7 +1059,7 @@ void PR_LoadProgs (void)
progs = (dprograms_t *)COM_LoadHunkFile ("progs.dat", NULL); progs = (dprograms_t *)COM_LoadHunkFile ("progs.dat", NULL);
if (!progs) if (!progs)
Host_Error ("PR_LoadProgs: couldn't load progs.dat"); Host_Error ("PR_LoadProgs: couldn't load progs.dat");
Con_DPrintf ("Programs occupy %iK.\n", com_filesize/1024); Con_DPrintf ("Programs occupy %" PRIi32 "K.\n", com_filesize/1024);
for (i = 0; i < com_filesize; i++) for (i = 0; i < com_filesize; i++)
CRC_ProcessByte (&pr_crc, ((byte *)progs)[i]); CRC_ProcessByte (&pr_crc, ((byte *)progs)[i]);
@ -1069,7 +1069,7 @@ void PR_LoadProgs (void)
((int32_t *)progs)[i] = LittleLong ( ((int32_t *)progs)[i] ); ((int32_t *)progs)[i] = LittleLong ( ((int32_t *)progs)[i] );
if (progs->version != PROG_VERSION) if (progs->version != PROG_VERSION)
Host_Error ("progs.dat has wrong version number (%i should be %i)", progs->version, PROG_VERSION); Host_Error ("progs.dat has wrong version number (%" PRIi32 " should be %" PRIi32 ")", progs->version, PROG_VERSION);
if (progs->crc != PROGHEADER_CRC) if (progs->crc != PROGHEADER_CRC)
Host_Error ("progs.dat system vars have been modified, progdefs.h is out of date"); Host_Error ("progs.dat system vars have been modified, progdefs.h is out of date");
@ -1176,7 +1176,7 @@ void PR_Init (void)
edict_t *EDICT_NUM(int32_t n) edict_t *EDICT_NUM(int32_t n)
{ {
if (n < 0 || n >= sv.max_edicts) if (n < 0 || n >= sv.max_edicts)
Host_Error ("EDICT_NUM: bad number %i", n); Host_Error ("EDICT_NUM: bad number %" PRIi32 "", n);
return (edict_t *)((byte *)sv.edicts + (n)*pr_edict_size); return (edict_t *)((byte *)sv.edicts + (n)*pr_edict_size);
} }
@ -1200,7 +1200,7 @@ int32_t NUM_FOR_EDICT(edict_t *e)
static void PR_AllocStringSlots (void) static void PR_AllocStringSlots (void)
{ {
pr_maxknownstrings += PR_STRING_ALLOCSLOTS; pr_maxknownstrings += PR_STRING_ALLOCSLOTS;
Con_DPrintf2("PR_AllocStringSlots: realloc'ing for %d slots\n", pr_maxknownstrings); Con_DPrintf2("PR_AllocStringSlots: realloc'ing for %" PRIi32 " slots\n", pr_maxknownstrings);
pr_knownstrings = (const char **) Z_Realloc ((void *)pr_knownstrings, pr_maxknownstrings * sizeof(char *)); pr_knownstrings = (const char **) Z_Realloc ((void *)pr_knownstrings, pr_maxknownstrings * sizeof(char *));
} }
@ -1212,14 +1212,14 @@ const char *PR_GetString (int32_t num)
{ {
if (!pr_knownstrings[-1 - num]) if (!pr_knownstrings[-1 - num])
{ {
Host_Error ("PR_GetString: attempt to get a non-existant string %d\n", num); Host_Error ("PR_GetString: attempt to get a non-existant string %" PRIi32 "\n", num);
return ""; return "";
} }
return pr_knownstrings[-1 - num]; return pr_knownstrings[-1 - num];
} }
else else
{ {
Host_Error("PR_GetString: invalid string offset %d\n", num); Host_Error("PR_GetString: invalid string offset %" PRIi32 "\n", num);
return ""; return "";
} }
} }

View File

@ -153,10 +153,10 @@ static void PR_PrintStatement (dstatement_t *s)
} }
if (s->op == OP_IF || s->op == OP_IFNOT) if (s->op == OP_IF || s->op == OP_IFNOT)
Con_Printf("%sbranch %i", PR_GlobalString(s->a), s->b); Con_Printf("%sbranch %" PRIi32 "", PR_GlobalString(s->a), s->b);
else if (s->op == OP_GOTO) else if (s->op == OP_GOTO)
{ {
Con_Printf("branch %i", s->a); Con_Printf("branch %" PRIi32 "", s->a);
} }
else if ((uint32_t)(s->op-OP_STORE_F) < 6) else if ((uint32_t)(s->op-OP_STORE_F) < 6)
{ {
@ -612,7 +612,7 @@ void PR_ExecuteProgram (func_t fnum)
{ // Built-in function { // Built-in function
int32_t i = -newf->first_statement; int32_t i = -newf->first_statement;
if (i >= pr_numbuiltins) if (i >= pr_numbuiltins)
PR_RunError("Bad builtin call number %d", i); PR_RunError("Bad builtin call number %" PRIi32 "", i);
pr_builtins[i](); pr_builtins[i]();
break; break;
} }
@ -644,7 +644,7 @@ void PR_ExecuteProgram (func_t fnum)
default: default:
pr_xstatement = st - pr_statements; pr_xstatement = st - pr_statements;
PR_RunError("Bad opcode %i", st->op); PR_RunError("Bad opcode %" PRIi32 "", st->op);
} }
} /* end of while(1) loop */ } /* end of while(1) loop */
} }

View File

@ -415,7 +415,7 @@ void R_SetupAliasFrame (aliashdr_t *paliashdr, int32_t frame, lerpdata_t *lerpda
if ((frame >= paliashdr->numframes) || (frame < 0)) if ((frame >= paliashdr->numframes) || (frame < 0))
{ {
Con_DPrintf ("R_AliasSetupFrame: no such frame %d for '%s'\n", frame, e->model->name); Con_DPrintf ("R_AliasSetupFrame: no such frame %" PRIi32 " for '%s'\n", frame, e->model->name);
frame = 0; frame = 0;
} }
@ -693,7 +693,7 @@ void R_DrawAliasModel (entity_t *e)
skinnum = e->skinnum; skinnum = e->skinnum;
if ((skinnum >= paliashdr->numskins) || (skinnum < 0)) if ((skinnum >= paliashdr->numskins) || (skinnum < 0))
{ {
Con_DPrintf ("R_DrawAliasModel: no such skin # %d for '%s'\n", skinnum, e->model->name); Con_DPrintf ("R_DrawAliasModel: no such skin # %" PRIi32 " for '%s'\n", skinnum, e->model->name);
// ericw -- display skin 0 for winquake compatibility // ericw -- display skin 0 for winquake compatibility
skinnum = 0; skinnum = 0;
} }

View File

@ -947,7 +947,7 @@ void GL_BuildLightmaps (void)
//johnfitz -- warn about exceeding old limits //johnfitz -- warn about exceeding old limits
if (i >= 64) if (i >= 64)
Con_DWarning ("%i lightmaps exceeds standard limit of 64 (max = %d).\n", i, MAX_LIGHTMAPS); Con_DWarning ("%" PRIi32 " lightmaps exceeds standard limit of 64 (max = %" PRIi32 ").\n", i, MAX_LIGHTMAPS);
//johnfitz //johnfitz
} }

View File

@ -315,7 +315,7 @@ void R_ReadPointFile_f (void)
} }
fclose (f); fclose (f);
Con_Printf ("%i points read\n", c); Con_Printf ("%" PRIi32 " points read\n", c);
} }
/* /*

View File

@ -41,7 +41,7 @@ mspriteframe_t *R_GetSpriteFrame (entity_t *currentent)
if ((frame >= psprite->numframes) || (frame < 0)) if ((frame >= psprite->numframes) || (frame < 0))
{ {
Con_DPrintf ("R_DrawSprite: no such frame %d for '%s'\n", frame, currentent->model->name); Con_DPrintf ("R_DrawSprite: no such frame %" PRIi32 " for '%s'\n", frame, currentent->model->name);
frame = 0; frame = 0;
} }

View File

@ -116,8 +116,8 @@ void Sbar_LoadPics (void)
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
{ {
sb_nums[0][i] = Draw_PicFromWad (va("num_%i",i)); sb_nums[0][i] = Draw_PicFromWad (va("num_%" PRIi32 "",i));
sb_nums[1][i] = Draw_PicFromWad (va("anum_%i",i)); sb_nums[1][i] = Draw_PicFromWad (va("anum_%" PRIi32 "",i));
} }
sb_nums[0][10] = Draw_PicFromWad ("num_minus"); sb_nums[0][10] = Draw_PicFromWad ("num_minus");
@ -144,13 +144,13 @@ void Sbar_LoadPics (void)
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
sb_weapons[2+i][0] = Draw_PicFromWad (va("inva%i_shotgun",i+1)); sb_weapons[2+i][0] = Draw_PicFromWad (va("inva%" PRIi32 "_shotgun",i+1));
sb_weapons[2+i][1] = Draw_PicFromWad (va("inva%i_sshotgun",i+1)); sb_weapons[2+i][1] = Draw_PicFromWad (va("inva%" PRIi32 "_sshotgun",i+1));
sb_weapons[2+i][2] = Draw_PicFromWad (va("inva%i_nailgun",i+1)); sb_weapons[2+i][2] = Draw_PicFromWad (va("inva%" PRIi32 "_nailgun",i+1));
sb_weapons[2+i][3] = Draw_PicFromWad (va("inva%i_snailgun",i+1)); sb_weapons[2+i][3] = Draw_PicFromWad (va("inva%" PRIi32 "_snailgun",i+1));
sb_weapons[2+i][4] = Draw_PicFromWad (va("inva%i_rlaunch",i+1)); sb_weapons[2+i][4] = Draw_PicFromWad (va("inva%" PRIi32 "_rlaunch",i+1));
sb_weapons[2+i][5] = Draw_PicFromWad (va("inva%i_srlaunch",i+1)); sb_weapons[2+i][5] = Draw_PicFromWad (va("inva%" PRIi32 "_srlaunch",i+1));
sb_weapons[2+i][6] = Draw_PicFromWad (va("inva%i_lightng",i+1)); sb_weapons[2+i][6] = Draw_PicFromWad (va("inva%" PRIi32 "_lightng",i+1));
} }
sb_ammo[0] = Draw_PicFromWad ("sb_shells"); sb_ammo[0] = Draw_PicFromWad ("sb_shells");
@ -211,11 +211,11 @@ void Sbar_LoadPics (void)
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
hsb_weapons[2+i][0] = Draw_PicFromWad (va("inva%i_laser",i+1)); hsb_weapons[2+i][0] = Draw_PicFromWad (va("inva%" PRIi32 "_laser",i+1));
hsb_weapons[2+i][1] = Draw_PicFromWad (va("inva%i_mjolnir",i+1)); hsb_weapons[2+i][1] = Draw_PicFromWad (va("inva%" PRIi32 "_mjolnir",i+1));
hsb_weapons[2+i][2] = Draw_PicFromWad (va("inva%i_gren_prox",i+1)); hsb_weapons[2+i][2] = Draw_PicFromWad (va("inva%" PRIi32 "_gren_prox",i+1));
hsb_weapons[2+i][3] = Draw_PicFromWad (va("inva%i_prox_gren",i+1)); hsb_weapons[2+i][3] = Draw_PicFromWad (va("inva%" PRIi32 "_prox_gren",i+1));
hsb_weapons[2+i][4] = Draw_PicFromWad (va("inva%i_prox",i+1)); hsb_weapons[2+i][4] = Draw_PicFromWad (va("inva%" PRIi32 "_prox",i+1));
} }
hsb_items[0] = Draw_PicFromWad ("sb_wsuit"); hsb_items[0] = Draw_PicFromWad ("sb_wsuit");
@ -499,15 +499,15 @@ void Sbar_SoloScoreboard (void)
int32_t minutes, seconds, tens, units; int32_t minutes, seconds, tens, units;
int32_t len; int32_t len;
sprintf (str,"Kills: %i/%i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]); sprintf (str,"Kills: %" PRIi32 "/%" PRIi32 "", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
Sbar_DrawString (8, 12, str); Sbar_DrawString (8, 12, str);
sprintf (str,"Secrets: %i/%i", cl.stats[STAT_SECRETS], cl.stats[STAT_TOTALSECRETS]); sprintf (str,"Secrets: %" PRIi32 "/%" PRIi32 "", cl.stats[STAT_SECRETS], cl.stats[STAT_TOTALSECRETS]);
Sbar_DrawString (312 - strlen(str)*8, 12, str); Sbar_DrawString (312 - strlen(str)*8, 12, str);
if (!fitzmode) if (!fitzmode)
{ /* QuakeSpasm customization: */ { /* QuakeSpasm customization: */
q_snprintf (str, sizeof(str), "skill %i", (int32_t)(skill.value + 0.5)); q_snprintf (str, sizeof(str), "skill %" PRIi32 "", (int32_t)(skill.value + 0.5));
Sbar_DrawString (160 - strlen(str)*4, 12, str); Sbar_DrawString (160 - strlen(str)*4, 12, str);
q_snprintf (str, sizeof(str), "%s (%s)", cl.levelname, cl.mapname); q_snprintf (str, sizeof(str), "%s (%s)", cl.levelname, cl.mapname);
@ -522,7 +522,7 @@ void Sbar_SoloScoreboard (void)
seconds = cl.time - 60*minutes; seconds = cl.time - 60*minutes;
tens = seconds / 10; tens = seconds / 10;
units = seconds - 10*tens; units = seconds - 10*tens;
sprintf (str,"%i:%i%i", minutes, tens, units); sprintf (str,"%" PRIi32 ":%" PRIi32 "%" PRIi32 "", minutes, tens, units);
Sbar_DrawString (160 - strlen(str)*4, 12, str); Sbar_DrawString (160 - strlen(str)*4, 12, str);
len = strlen (cl.levelname); len = strlen (cl.levelname);
@ -1164,7 +1164,7 @@ void Sbar_DeathmatchOverlay (void)
tens = n/10; tens = n/10;
units = n%10; units = n%10;
sprintf (num, "%3i:%i%i", minutes, tens, units); sprintf (num, "%3i:%" PRIi32 "%" PRIi32 "", minutes, tens, units);
M_Print ( x+48 , y, num); //johnfitz -- was Draw_String, changed for stretched overlays M_Print ( x+48 , y, num); //johnfitz -- was Draw_String, changed for stretched overlays
} }

View File

@ -104,7 +104,7 @@ static void S_SoundInfo_f (void)
return; return;
} }
Con_Printf("%d bit, %s, %d Hz\n", shm->samplebits, Con_Printf("%" PRIi32 " bit, %s, %" PRIi32 " Hz\n", shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono", shm->speed); (shm->channels == 2) ? "stereo" : "mono", shm->speed);
Con_Printf("%5d samples\n", shm->samples); Con_Printf("%5d samples\n", shm->samples);
Con_Printf("%5d samplepos\n", shm->samplepos); Con_Printf("%5d samplepos\n", shm->samplepos);
@ -148,7 +148,7 @@ void S_Startup (void)
} }
else else
{ {
Con_Printf("Audio: %d bit, %s, %d Hz\n", Con_Printf("Audio: %" PRIi32 " bit, %s, %" PRIi32 " Hz\n",
shm->samplebits, shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono", (shm->channels == 2) ? "stereo" : "mono",
shm->speed); shm->speed);
@ -856,7 +856,7 @@ void S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
} }
} }
Con_Printf ("----(%i)----\n", total); Con_Printf ("----(%" PRIi32 ")----\n", total);
} }
// add raw data from streamed samples // add raw data from streamed samples
@ -1033,7 +1033,7 @@ static void S_SoundList (void)
Con_SafePrintf (" "); //johnfitz -- was Con_Printf Con_SafePrintf (" "); //johnfitz -- was Con_Printf
Con_SafePrintf("(%2db) %6i : %s\n", sc->width*8, size, sfx->name); //johnfitz -- was Con_Printf Con_SafePrintf("(%2db) %6i : %s\n", sc->width*8, size, sfx->name); //johnfitz -- was Con_Printf
} }
Con_Printf ("%i sounds, %i bytes\n", num_sfx, total); //johnfitz -- added count Con_Printf ("%" PRIi32 " sounds, %" PRIi32 " bytes\n", num_sfx, total); //johnfitz -- added count
} }

View File

@ -83,7 +83,7 @@ flac_error_func (const FLAC__StreamDecoder *decoder,
(void)decoder; (void)decoder;
flacfile_t *ff = (flacfile_t *) client_data; flacfile_t *ff = (flacfile_t *) client_data;
ff->error = -1; ff->error = -1;
Con_Printf ("FLAC: decoder error %i\n", status); Con_Printf ("FLAC: decoder error %" PRIi32 "\n", status);
} }
static FLAC__StreamDecoderReadStatus static FLAC__StreamDecoderReadStatus
@ -285,7 +285,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream)
#endif #endif
if (rc != FLAC__STREAM_DECODER_INIT_STATUS_OK) /* unlikely */ if (rc != FLAC__STREAM_DECODER_INIT_STATUS_OK) /* unlikely */
{ {
Con_Printf ("FLAC: decoder init error %i\n", rc); Con_Printf ("FLAC: decoder init error %" PRIi32 "\n", rc);
goto _fail; goto _fail;
} }
@ -293,7 +293,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream)
if (rc == false || ff->error) if (rc == false || ff->error)
{ {
rc = FLAC__stream_decoder_get_state(ff->decoder); rc = FLAC__stream_decoder_get_state(ff->decoder);
Con_Printf("%s not a valid flac file? (decoder state %i)\n", Con_Printf("%s not a valid flac file? (decoder state %" PRIi32 ")\n",
stream->name, rc); stream->name, rc);
goto _fail; goto _fail;
} }
@ -310,7 +310,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream)
} }
if (ff->info->channels != 1 && ff->info->channels != 2) if (ff->info->channels != 1 && ff->info->channels != 2)
{ {
Con_Printf("Unsupported number of channels %d in %s\n", Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n",
ff->info->channels, stream->name); ff->info->channels, stream->name);
goto _fail; goto _fail;
} }

View File

@ -212,7 +212,7 @@ static void FindNextChunk (const char *name)
if (iff_chunk_len < 0 || iff_chunk_len > iff_end - data_p) if (iff_chunk_len < 0 || iff_chunk_len > iff_end - data_p)
{ {
data_p = NULL; data_p = NULL;
Con_DPrintf2("bad \"%s\" chunk length (%d)\n", name, iff_chunk_len); Con_DPrintf2("bad \"%s\" chunk length (%" PRIi32 ")\n", name, iff_chunk_len);
return; return;
} }
last_chunk = data_p + ((iff_chunk_len + 1) & ~1); last_chunk = data_p + ((iff_chunk_len + 1) & ~1);
@ -240,7 +240,7 @@ static void DumpChunks (void)
memcpy (str, data_p, 4); memcpy (str, data_p, 4);
data_p += 4; data_p += 4;
iff_chunk_len = GetLittleLong(); iff_chunk_len = GetLittleLong();
Con_Printf ("0x%x : %s (%d)\n", (int32_t)(data_p - 4), str, iff_chunk_len); Con_Printf ("0x%x : %s (%" PRIi32 ")\n", (int32_t)(data_p - 4), str, iff_chunk_len);
data_p += (iff_chunk_len + 1) & ~1; data_p += (iff_chunk_len + 1) & ~1;
} while (data_p < iff_end); } while (data_p < iff_end);
} }
@ -308,7 +308,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int32_t wavlength)
{ {
data_p += 32; data_p += 32;
info.loopstart = GetLittleLong(); info.loopstart = GetLittleLong();
// Con_Printf("loopstart=%d\n", sfx->loopstart); // Con_Printf("loopstart=%" PRIi32 "\n", sfx->loopstart);
// if the next chunk is a LIST chunk, look for a cue length marker // if the next chunk is a LIST chunk, look for a cue length marker
FindNextChunk ("LIST"); FindNextChunk ("LIST");
@ -319,7 +319,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int32_t wavlength)
data_p += 24; data_p += 24;
i = GetLittleLong(); // samples in loop i = GetLittleLong(); // samples in loop
info.samples = info.loopstart + i; info.samples = info.loopstart + i;
// Con_Printf("looped length: %i\n", i); // Con_Printf("looped length: %" PRIi32 "\n", i);
} }
} }
} }

View File

@ -160,7 +160,7 @@ static bool S_MIKMOD_CodecOpenStream (snd_stream_t *stream)
stream->info.bits = (md_mode & DMODE_16BITS)? 16: 8; stream->info.bits = (md_mode & DMODE_16BITS)? 16: 8;
stream->info.width = stream->info.bits / 8; stream->info.width = stream->info.bits / 8;
stream->info.channels = (md_mode & DMODE_STEREO)? 2 : 1; stream->info.channels = (md_mode & DMODE_STEREO)? 2 : 1;
/* Con_DPrintf("Playing %s (%d chn)\n", priv->module->songname, priv->module->numchn);*/ /* Con_DPrintf("Playing %s (%" PRIi32 " chn)\n", priv->module->songname, priv->module->numchn);*/
return true; return true;
} }

View File

@ -414,7 +414,7 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
} }
else if (stream->info.channels != 1 && stream->info.channels != 2) else if (stream->info.channels != 1 && stream->info.channels != 2)
{ {
Con_Printf("Unsupported number of channels %d in %s\n", Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n",
stream->info.channels, stream->name); stream->info.channels, stream->name);
} }
else else

View File

@ -125,7 +125,7 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
stream->info.channels = 2; stream->info.channels = 2;
break; break;
default: default:
Con_Printf("Unsupported number of channels %d in %s\n", channels, stream->name); Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n", channels, stream->name);
goto _fail; goto _fail;
} }

View File

@ -94,7 +94,7 @@ static bool S_OPUS_CodecOpenStream (snd_stream_t *stream)
opFile = op_open_callbacks(&stream->fh, &opc_qfs, NULL, 0, &res); opFile = op_open_callbacks(&stream->fh, &opc_qfs, NULL, 0, &res);
if (!opFile) if (!opFile)
{ {
Con_Printf("%s is not a valid Opus file (error %i).\n", Con_Printf("%s is not a valid Opus file (error %" PRIi32 ").\n",
stream->name, res); stream->name, res);
goto _fail; goto _fail;
} }
@ -118,14 +118,14 @@ static bool S_OPUS_CodecOpenStream (snd_stream_t *stream)
numstreams = op_info->stream_count; numstreams = op_info->stream_count;
if (numstreams != 1) if (numstreams != 1)
{ {
Con_Printf("More than one (%ld) stream in %s\n", Con_Printf("More than one (%" PRIi64 ") stream in %s\n",
(long)op_info->stream_count, stream->name); (long)op_info->stream_count, stream->name);
goto _fail; goto _fail;
} }
if (op_info->channel_count != 1 && op_info->channel_count != 2) if (op_info->channel_count != 1 && op_info->channel_count != 2)
{ {
Con_Printf("Unsupported number of channels %d in %s\n", Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n",
op_info->channel_count, stream->name); op_info->channel_count, stream->name);
goto _fail; goto _fail;
} }

View File

@ -131,7 +131,7 @@ bool SNDDMA_Init (dma_t *dma)
shm->samplebits = (obtained.format & 0xFF); /* first byte of format is bits */ shm->samplebits = (obtained.format & 0xFF); /* first byte of format is bits */
shm->signed8 = (obtained.format == AUDIO_S8); shm->signed8 = (obtained.format == AUDIO_S8);
if (obtained.freq != tmp) if (obtained.freq != tmp)
Con_Printf ("Warning: Rate set (%d) didn't match requested rate (%d)!\n", obtained.freq, tmp); Con_Printf ("Warning: Rate set (%" PRIi32 ") didn't match requested rate (%" PRIi32 ")!\n", obtained.freq, tmp);
shm->speed = obtained.freq; shm->speed = obtained.freq;
shm->channels = obtained.channels; shm->channels = obtained.channels;
tmp = (obtained.samples * obtained.channels) * 10; tmp = (obtained.samples * obtained.channels) * 10;
@ -147,7 +147,7 @@ bool SNDDMA_Init (dma_t *dma)
shm->samplepos = 0; shm->samplepos = 0;
shm->submission_chunk = 1; shm->submission_chunk = 1;
Con_Printf ("SDL audio spec : %d Hz, %d samples, %d channels\n", Con_Printf ("SDL audio spec : %" PRIi32 " Hz, %" PRIi32 " samples, %" PRIi32 " channels\n",
obtained.freq, obtained.samples, obtained.channels); obtained.freq, obtained.samples, obtained.channels);
{ {
const char *driver = SDL_GetCurrentAudioDriver(); const char *driver = SDL_GetCurrentAudioDriver();
@ -157,7 +157,7 @@ bool SNDDMA_Init (dma_t *dma)
device != NULL ? device : "(UNKNOWN)"); device != NULL ? device : "(UNKNOWN)");
} }
buffersize = shm->samples * (shm->samplebits / 8); buffersize = shm->samples * (shm->samplebits / 8);
Con_Printf ("SDL audio driver: %s, %d bytes buffer\n", drivername, buffersize); Con_Printf ("SDL audio driver: %s, %" PRIi32 " bytes buffer\n", drivername, buffersize);
shm->buffer = (uint8_t *) calloc (1, buffersize); shm->buffer = (uint8_t *) calloc (1, buffersize);
if (!shm->buffer) if (!shm->buffer)

View File

@ -318,7 +318,7 @@ static int32_t probe_header (void *header)
return 0; return 0;
} }
Con_DPrintf("Unknown upkg version %d\n", hdr->file_version); Con_DPrintf("Unknown upkg version %" PRIi32 "\n", hdr->file_version);
return -1; return -1;
} }
@ -354,7 +354,7 @@ static bool S_UMX_CodecOpenStream (snd_stream_t *stream)
return false; return false;
} }
Con_DPrintf("%s: %s data @ 0x%x, %d bytes\n", stream->name, mustype[type], ofs, size); Con_DPrintf("%s: %s data @ 0x%x, %" PRIi32 " bytes\n", stream->name, mustype[type], ofs, size);
/* hack the fshandle_t start pos and length members so /* hack the fshandle_t start pos and length members so
* that only the relevant data is accessed from now on */ * that only the relevant data is accessed from now on */
stream->fh.start += ofs; stream->fh.start += ofs;

View File

@ -86,7 +86,7 @@ static bool S_VORBIS_CodecOpenStream (snd_stream_t *stream)
res = ov_open_callbacks(&stream->fh, ovFile, NULL, 0, ovc_qfs); res = ov_open_callbacks(&stream->fh, ovFile, NULL, 0, ovc_qfs);
if (res != 0) if (res != 0)
{ {
Con_Printf("%s is not a valid Ogg Vorbis file (error %i).\n", Con_Printf("%s is not a valid Ogg Vorbis file (error %" PRIi32 ").\n",
stream->name, res); stream->name, res);
goto _fail; goto _fail;
} }
@ -108,14 +108,14 @@ static bool S_VORBIS_CodecOpenStream (snd_stream_t *stream)
numstreams = ov_streams(ovFile); numstreams = ov_streams(ovFile);
if (numstreams != 1) if (numstreams != 1)
{ {
Con_Printf("More than one (%ld) stream in %s.\n", Con_Printf("More than one (%" PRIi64 ") stream in %s.\n",
numstreams, stream->name); numstreams, stream->name);
goto _fail; goto _fail;
} }
if (ovf_info->channels != 1 && ovf_info->channels != 2) if (ovf_info->channels != 1 && ovf_info->channels != 2)
{ {
Con_Printf("Unsupported number of channels %d in %s\n", Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n",
ovf_info->channels, stream->name); ovf_info->channels, stream->name);
goto _fail; goto _fail;
} }

View File

@ -46,12 +46,12 @@ void SV_Protocol_f (void)
switch (Cmd_Argc()) switch (Cmd_Argc())
{ {
case 1: case 1:
Con_Printf ("\"sv_protocol\" is \"%i\"\n", sv_protocol); Con_Printf ("\"sv_protocol\" is \"%" PRIi32 "\"\n", sv_protocol);
break; break;
case 2: case 2:
i = atoi(Cmd_Argv(1)); i = atoi(Cmd_Argv(1));
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ) if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ)
Con_Printf ("sv_protocol must be %i or %i or %i\n", PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ); Con_Printf ("sv_protocol must be %" PRIi32 " or %" PRIi32 " or %" PRIi32 "\n", PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ);
else else
{ {
sv_protocol = i; sv_protocol = i;
@ -108,7 +108,7 @@ void SV_Init (void)
Cmd_AddCommand ("sv_protocol", &SV_Protocol_f); //johnfitz Cmd_AddCommand ("sv_protocol", &SV_Protocol_f); //johnfitz
for (i=0 ; i<MAX_MODELS ; i++) for (i=0 ; i<MAX_MODELS ; i++)
sprintf (localmodels[i], "*%i", i); sprintf (localmodels[i], "*%" PRIi32 "", i);
i = COM_CheckParm ("-protocol"); i = COM_CheckParm ("-protocol");
if (i && i < com_argc - 1) if (i && i < com_argc - 1)
@ -125,11 +125,11 @@ void SV_Init (void)
p = "RMQ"; p = "RMQ";
break; break;
default: default:
Sys_Error ("Bad protocol version request %i. Accepted values: %i, %i, %i.", Sys_Error ("Bad protocol version request %" PRIi32 ". Accepted values: %" PRIi32 ", %" PRIi32 ", %" PRIi32 ".",
sv_protocol, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ); sv_protocol, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ);
return; /* silence compiler */ return; /* silence compiler */
} }
Sys_Printf ("Server using protocol %i (%s)\n", sv_protocol, p); Sys_Printf ("Server using protocol %" PRIi32 " (%s)\n", sv_protocol, p);
} }
/* /*
@ -191,13 +191,13 @@ void SV_StartSound (edict_t *entity, int32_t channel, const char *sample, int32_
int32_t i, field_mask; int32_t i, field_mask;
if (volume < 0 || volume > 255) if (volume < 0 || volume > 255)
Host_Error ("SV_StartSound: volume = %i", volume); Host_Error ("SV_StartSound: volume = %" PRIi32 "", volume);
if (attenuation < 0 || attenuation > 4) if (attenuation < 0 || attenuation > 4)
Host_Error ("SV_StartSound: attenuation = %f", attenuation); Host_Error ("SV_StartSound: attenuation = %f", attenuation);
if (channel < 0 || channel > 7) if (channel < 0 || channel > 7)
Host_Error ("SV_StartSound: channel = %i", channel); Host_Error ("SV_StartSound: channel = %" PRIi32 "", channel);
if (sv.datagram.cursize > MAX_DATAGRAM-16) if (sv.datagram.cursize > MAX_DATAGRAM-16)
return; return;
@ -289,7 +289,7 @@ void SV_SendServerinfo (client_t *client)
int32_t i; //johnfitz int32_t i; //johnfitz
MSG_WriteByte (&client->message, svc_print); MSG_WriteByte (&client->message, svc_print);
sprintf (message, "%c\nFITZQUAKE " FITZQUAKE_VERSION " SERVER (%i CRC)\n", 2, pr_crc); //johnfitz -- include fitzquake version sprintf (message, "%c\nFITZQUAKE " FITZQUAKE_VERSION " SERVER (%" PRIi32 " CRC)\n", 2, pr_crc); //johnfitz -- include fitzquake version
MSG_WriteString (&client->message,message); MSG_WriteString (&client->message,message);
MSG_WriteByte (&client->message, svc_serverinfo); MSG_WriteByte (&client->message, svc_serverinfo);
@ -515,7 +515,7 @@ byte *SV_FatPVS (vec3_t org, qmodel_t *worldmodel) //johnfitz -- added worldmode
fatpvs_capacity = fatbytes; fatpvs_capacity = fatbytes;
fatpvs = (byte *) realloc (fatpvs, fatpvs_capacity); fatpvs = (byte *) realloc (fatpvs, fatpvs_capacity);
if (!fatpvs) if (!fatpvs)
Sys_Error ("SV_FatPVS: realloc() failed on %d bytes", fatpvs_capacity); Sys_Error ("SV_FatPVS: realloc() failed on %" PRIi32 " bytes", fatpvs_capacity);
} }
Q_memset (fatpvs, 0, fatbytes); Q_memset (fatpvs, 0, fatbytes);
@ -740,7 +740,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
//johnfitz -- devstats //johnfitz -- devstats
stats: stats:
if (msg->cursize > 1024 && dev_peakstats.packetsize <= 1024) if (msg->cursize > 1024 && dev_peakstats.packetsize <= 1024)
Con_DWarning ("%i byte packet exceeds standard limit of 1024 (max = %d).\n", msg->cursize, msg->maxsize); Con_DWarning ("%" PRIi32 " byte packet exceeds standard limit of 1024 (max = %" PRIi32 ").\n", msg->cursize, msg->maxsize);
dev_stats.packetsize = msg->cursize; dev_stats.packetsize = msg->cursize;
dev_peakstats.packetsize = q_max(msg->cursize, dev_peakstats.packetsize); dev_peakstats.packetsize = q_max(msg->cursize, dev_peakstats.packetsize);
//johnfitz //johnfitz
@ -1471,7 +1471,7 @@ void SV_SpawnServer (const char *server)
//johnfitz -- warn if signon buffer larger than standard server can handle //johnfitz -- warn if signon buffer larger than standard server can handle
if (sv.signon.cursize > 8000-2) //max size that will fit into 8000-sized client->message buffer with 2 extra bytes on the end if (sv.signon.cursize > 8000-2) //max size that will fit into 8000-sized client->message buffer with 2 extra bytes on the end
Con_DWarning ("%i byte signon buffer exceeds standard limit of 7998 (max = %d).\n", sv.signon.cursize, sv.signon.maxsize); Con_DWarning ("%" PRIi32 " byte signon buffer exceeds standard limit of 7998 (max = %" PRIi32 ").\n", sv.signon.cursize, sv.signon.maxsize);
//johnfitz //johnfitz
// send serverinfo to all connected clients // send serverinfo to all connected clients

View File

@ -353,7 +353,7 @@ int32_t SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
{ // go along the crease { // go along the crease
if (numplanes != 2) if (numplanes != 2)
{ {
// Con_Printf ("clip velocity, numplanes == %i\n",numplanes); // Con_Printf ("clip velocity, numplanes == %" PRIi32 "\n",numplanes);
VectorCopy (vec3_origin, ent->v.velocity); VectorCopy (vec3_origin, ent->v.velocity);
return 7; return 7;
} }
@ -956,7 +956,7 @@ void SV_Physics_Client (edict_t *ent, int32_t num)
break; break;
default: default:
Sys_Error ("SV_Physics_client: bad movetype %i", (int32_t)ent->v.movetype); Sys_Error ("SV_Physics_client: bad movetype %" PRIi32 "", (int32_t)ent->v.movetype);
} }
// //
@ -1221,7 +1221,7 @@ void SV_Physics (void)
|| ent->v.movetype == MOVETYPE_FLYMISSILE) || ent->v.movetype == MOVETYPE_FLYMISSILE)
SV_Physics_Toss (ent); SV_Physics_Toss (ent);
else else
Sys_Error ("SV_Physics: bad movetype %i", (int32_t)ent->v.movetype); Sys_Error ("SV_Physics: bad movetype %" PRIi32 "", (int32_t)ent->v.movetype);
} }
if (pr_global_struct->force_retouch) if (pr_global_struct->force_retouch)

View File

@ -349,7 +349,7 @@ const char *UDP_AddrToString (struct qsockaddr *addr)
int32_t haddr; int32_t haddr;
haddr = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr); haddr = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr);
q_snprintf (buffer, sizeof(buffer), "%d.%d.%d.%d:%d", (haddr >> 24) & 0xff, q_snprintf (buffer, sizeof(buffer), "%" PRIi32 ".%" PRIi32 ".%" PRIi32 ".%" PRIi32 ":%" PRIi32 "", (haddr >> 24) & 0xff,
(haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff, (haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff,
ntohs(((struct sockaddr_in *)addr)->sin_port)); ntohs(((struct sockaddr_in *)addr)->sin_port));
return buffer; return buffer;
@ -361,7 +361,7 @@ int32_t UDP_StringToAddr (const char *string, struct qsockaddr *addr)
{ {
int32_t ha1, ha2, ha3, ha4, hp, ipaddr; int32_t ha1, ha2, ha3, ha4, hp, ipaddr;
sscanf(string, "%d.%d.%d.%d:%d", &ha1, &ha2, &ha3, &ha4, &hp); sscanf(string, "%" PRIi32 ".%" PRIi32 ".%" PRIi32 ".%" PRIi32 ":%" PRIi32 "", &ha1, &ha2, &ha3, &ha4, &hp);
ipaddr = (ha1 << 24) | (ha2 << 16) | (ha3 << 8) | ha4; ipaddr = (ha1 << 24) | (ha2 << 16) | (ha3 << 8) | ha4;
addr->qsa_family = AF_INET; addr->qsa_family = AF_INET;

View File

@ -352,7 +352,7 @@ void Sys_Init (void)
host_parms->userdir = host_parms->basedir; host_parms->userdir = host_parms->basedir;
host_parms->numcpus = Sys_NumCPUs(); host_parms->numcpus = Sys_NumCPUs();
Sys_Printf("Detected %d CPUs.\n", host_parms->numcpus); Sys_Printf("Detected %" PRIi32 " CPUs.\n", host_parms->numcpus);
} }
void Sys_mkdir (const char *path) void Sys_mkdir (const char *path)

View File

@ -145,7 +145,7 @@ void *W_GetLumpNum (int32_t num)
lumpinfo_t *lump; lumpinfo_t *lump;
if (num < 0 || num > wad_numlumps) if (num < 0 || num > wad_numlumps)
Sys_Error ("W_GetLumpNum: bad number: %i", num); Sys_Error ("W_GetLumpNum: bad number: %" PRIi32 "", num);
lump = wad_lumps + num; lump = wad_lumps + num;

View File

@ -108,7 +108,7 @@ static void WINS_GetLocalAddress (void)
myAddr = *(in_addr_t *)local->h_addr_list[0]; myAddr = *(in_addr_t *)local->h_addr_list[0];
addr = ntohl(myAddr); addr = ntohl(myAddr);
sprintf(my_tcpip_address, "%ld.%ld.%ld.%ld", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff); sprintf(my_tcpip_address, "%" PRIi64 ".%" PRIi64 ".%" PRIi64 ".%" PRIi64 "", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
} }
@ -431,7 +431,7 @@ const char *WINS_AddrToString (struct qsockaddr *addr)
int32_t haddr; int32_t haddr;
haddr = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr); haddr = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr);
sprintf(buffer, "%d.%d.%d.%d:%d", (haddr >> 24) & 0xff, sprintf(buffer, "%" PRIi32 ".%" PRIi32 ".%" PRIi32 ".%" PRIi32 ":%" PRIi32 "", (haddr >> 24) & 0xff,
(haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff, (haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff,
ntohs(((struct sockaddr_in *)addr)->sin_port)); ntohs(((struct sockaddr_in *)addr)->sin_port));
return buffer; return buffer;
@ -443,7 +443,7 @@ int32_t WINS_StringToAddr (const char *string, struct qsockaddr *addr)
{ {
int32_t ha1, ha2, ha3, ha4, hp, ipaddr; int32_t ha1, ha2, ha3, ha4, hp, ipaddr;
sscanf(string, "%d.%d.%d.%d:%d", &ha1, &ha2, &ha3, &ha4, &hp); sscanf(string, "%" PRIi32 ".%" PRIi32 ".%" PRIi32 ".%" PRIi32 ":%" PRIi32 "", &ha1, &ha2, &ha3, &ha4, &hp);
ipaddr = (ha1 << 24) | (ha2 << 16) | (ha3 << 8) | ha4; ipaddr = (ha1 << 24) | (ha2 << 16) | (ha3 << 8) | ha4;
addr->qsa_family = AF_INET; addr->qsa_family = AF_INET;

View File

@ -257,7 +257,7 @@ void Sys_Init (void)
Win95old = true; Win95old = true;
} }
} }
Sys_Printf("Detected %d CPUs.\n", host_parms->numcpus); Sys_Printf("Detected %" PRIi32 " CPUs.\n", host_parms->numcpus);
if (isDedicated) if (isDedicated)
{ {

View File

@ -83,7 +83,7 @@ __wsaerr_static const char *__WSAE_StrError (int32_t err)
default: default:
{ {
static char _err_unknown[64]; static char _err_unknown[64];
sprintf(_err_unknown, "Unknown WSAE error (%d)", err); sprintf(_err_unknown, "Unknown WSAE error (%" PRIi32 ")", err);
return _err_unknown; return _err_unknown;
} }
} }

View File

@ -202,7 +202,7 @@ void *Z_Malloc (int32_t size)
Z_CheckHeap (); // DEBUG Z_CheckHeap (); // DEBUG
buf = Z_TagMalloc (size, 1); buf = Z_TagMalloc (size, 1);
if (!buf) if (!buf)
Sys_Error ("Z_Malloc: failed on allocation of %i bytes",size); Sys_Error ("Z_Malloc: failed on allocation of %" PRIi32 " bytes",size);
Q_memset (buf, 0, size); Q_memset (buf, 0, size);
return buf; return buf;
@ -235,7 +235,7 @@ void *Z_Realloc(void *ptr, int32_t size)
Z_Free (ptr); Z_Free (ptr);
ptr = Z_TagMalloc (size, 1); ptr = Z_TagMalloc (size, 1);
if (!ptr) if (!ptr)
Sys_Error ("Z_Realloc: failed on allocation of %i bytes", size); Sys_Error ("Z_Realloc: failed on allocation of %" PRIi32 " bytes", size);
if (ptr != old_ptr) if (ptr != old_ptr)
memmove (ptr, old_ptr, q_min(old_size, size)); memmove (ptr, old_ptr, q_min(old_size, size));
@ -263,7 +263,7 @@ void Z_Print (memzone_t *zone)
{ {
memblock_t *block; memblock_t *block;
Con_Printf ("zone size: %i location: %p\n",mainzone->size,mainzone); Con_Printf ("zone size: %" PRIi32 " location: %p\n",mainzone->size,mainzone);
for (block = zone->blocklist.next ; ; block = block->next) for (block = zone->blocklist.next ; ; block = block->next)
{ {
@ -434,12 +434,12 @@ void *Hunk_AllocName (int32_t size, const char *name)
#endif #endif
if (size < 0) if (size < 0)
Sys_Error ("Hunk_Alloc: bad size: %i", size); Sys_Error ("Hunk_Alloc: bad size: %" PRIi32 "", size);
size = sizeof(hunk_t) + ((size+15)&~15); size = sizeof(hunk_t) + ((size+15)&~15);
if (hunk_size - hunk_low_used - hunk_high_used < size) if (hunk_size - hunk_low_used - hunk_high_used < size)
Sys_Error ("Hunk_Alloc: failed on %i bytes",size); Sys_Error ("Hunk_Alloc: failed on %" PRIi32 " bytes",size);
h = (hunk_t *)(hunk_base + hunk_low_used); h = (hunk_t *)(hunk_base + hunk_low_used);
hunk_low_used += size; hunk_low_used += size;
@ -473,7 +473,7 @@ int32_t Hunk_LowMark (void)
void Hunk_FreeToLowMark (int32_t mark) void Hunk_FreeToLowMark (int32_t mark)
{ {
if (mark < 0 || mark > hunk_low_used) if (mark < 0 || mark > hunk_low_used)
Sys_Error ("Hunk_FreeToLowMark: bad mark %i", mark); Sys_Error ("Hunk_FreeToLowMark: bad mark %" PRIi32 "", mark);
memset (hunk_base + mark, 0, hunk_low_used - mark); memset (hunk_base + mark, 0, hunk_low_used - mark);
hunk_low_used = mark; hunk_low_used = mark;
} }
@ -497,7 +497,7 @@ void Hunk_FreeToHighMark (int32_t mark)
Hunk_FreeToHighMark (hunk_tempmark); Hunk_FreeToHighMark (hunk_tempmark);
} }
if (mark < 0 || mark > hunk_high_used) if (mark < 0 || mark > hunk_high_used)
Sys_Error ("Hunk_FreeToHighMark: bad mark %i", mark); Sys_Error ("Hunk_FreeToHighMark: bad mark %" PRIi32 "", mark);
memset (hunk_base + hunk_size - hunk_high_used, 0, hunk_high_used - mark); memset (hunk_base + hunk_size - hunk_high_used, 0, hunk_high_used - mark);
hunk_high_used = mark; hunk_high_used = mark;
} }
@ -513,7 +513,7 @@ void *Hunk_HighAllocName (int32_t size, const char *name)
hunk_t *h; hunk_t *h;
if (size < 0) if (size < 0)
Sys_Error ("Hunk_HighAllocName: bad size: %i", size); Sys_Error ("Hunk_HighAllocName: bad size: %" PRIi32 "", size);
if (hunk_tempactive) if (hunk_tempactive)
{ {
@ -529,7 +529,7 @@ void *Hunk_HighAllocName (int32_t size, const char *name)
if (hunk_size - hunk_low_used - hunk_high_used < size) if (hunk_size - hunk_low_used - hunk_high_used < size)
{ {
Con_Printf ("Hunk_HighAlloc: failed on %i bytes\n",size); Con_Printf ("Hunk_HighAlloc: failed on %" PRIi32 " bytes\n",size);
return NULL; return NULL;
} }
@ -724,7 +724,7 @@ cache_system_t *Cache_TryAlloc (int32_t size, bool nobottom)
if (!nobottom && cache_head.prev == &cache_head) if (!nobottom && cache_head.prev == &cache_head)
{ {
if (hunk_size - hunk_high_used - hunk_low_used < size) if (hunk_size - hunk_high_used - hunk_low_used < size)
Sys_Error ("Cache_TryAlloc: %i is greater then free hunk", size); Sys_Error ("Cache_TryAlloc: %" PRIi32 " is greater then free hunk", size);
new_cs = (cache_system_t *) (hunk_base + hunk_low_used); new_cs = (cache_system_t *) (hunk_base + hunk_low_used);
memset (new_cs, 0, sizeof(*new_cs)); memset (new_cs, 0, sizeof(*new_cs));
@ -909,7 +909,7 @@ void *Cache_Alloc (cache_user_t *c, int32_t size, const char *name)
Sys_Error ("Cache_Alloc: allready allocated"); Sys_Error ("Cache_Alloc: allready allocated");
if (size <= 0) if (size <= 0)
Sys_Error ("Cache_Alloc: size %i", size); Sys_Error ("Cache_Alloc: size %" PRIi32 "", size);
size = (size + sizeof(cache_system_t) + 15) & ~15; size = (size + sizeof(cache_system_t) + 15) & ~15;