From 5368518173afe107a44f6022fb3e87cfe59b54e4 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Mon, 25 Nov 2019 19:56:15 -0500 Subject: [PATCH] PRIiXX --- source/bgmusic.c | 6 ++-- source/cd_sdl.c | 10 +++--- source/cl_demo.c | 8 ++--- source/cl_main.c | 18 +++++------ source/cl_parse.c | 28 ++++++++--------- source/cmd.c | 4 +-- source/common.c | 14 ++++----- source/console.c | 2 +- source/cvar.c | 6 ++-- source/gl_draw.c | 2 +- source/gl_model.c | 60 ++++++++++++++++++------------------ source/gl_refrag.c | 2 +- source/gl_rmain.c | 2 +- source/gl_rmisc.c | 6 ++-- source/gl_screen.c | 2 +- source/gl_texmgr.c | 6 ++-- source/gl_vidsdl.c | 22 ++++++------- source/gl_warp.c | 2 +- source/host.c | 2 +- source/host_cmd.c | 22 ++++++------- source/image.c | 2 +- source/in_sdl.c | 6 ++-- source/keys.c | 6 ++-- source/main_sdl.c | 6 ++-- source/menu.c | 26 ++++++++-------- source/net_dgrm.c | 24 +++++++-------- source/net_main.c | 8 ++--- source/pr_cmds.c | 14 ++++----- source/pr_edict.c | 36 +++++++++++----------- source/pr_exec.c | 8 ++--- source/r_alias.c | 4 +-- source/r_brush.c | 2 +- source/r_part.c | 2 +- source/r_sprite.c | 2 +- source/sbar.c | 38 +++++++++++------------ source/snd_dma.c | 8 ++--- source/snd_flac.c | 8 ++--- source/snd_mem.c | 8 ++--- source/snd_mikmod.c | 2 +- source/snd_mp3.c | 2 +- source/snd_mpg123.c | 2 +- source/snd_opus.c | 6 ++-- source/snd_sdl.c | 6 ++-- source/snd_umx.c | 4 +-- source/snd_vorbis.c | 6 ++-- source/sv_main.c | 22 ++++++------- source/sv_phys.c | 6 ++-- source/unix/net_udp.c | 4 +-- source/unix/sys_sdl_unix.c | 2 +- source/wad.c | 2 +- source/windows/net_wins.c | 6 ++-- source/windows/sys_sdl_win.c | 2 +- source/windows/wsaerror.h | 2 +- source/zone.c | 22 ++++++------- 54 files changed, 264 insertions(+), 264 deletions(-) diff --git a/source/bgmusic.c b/source/bgmusic.c index 7cd9272..b04708f 100644 --- a/source/bgmusic.c +++ b/source/bgmusic.c @@ -326,7 +326,7 @@ void BGM_PlayCDtrack (byte track, bool looping) handler = handler->next; } 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 { q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s", @@ -437,7 +437,7 @@ static void BGM_UpdateStream (void) res = S_CodecRewindStream(bgmstream); if (res != 0) { - Con_Printf("Stream seek error (%i), stopping.\n", res); + Con_Printf("Stream seek error (%" PRIi32 "), stopping.\n", res); BGM_Stop(); return; } @@ -451,7 +451,7 @@ static void BGM_UpdateStream (void) } 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(); return; } diff --git a/source/cd_sdl.c b/source/cd_sdl.c index aa11d98..888106d 100644 --- a/source/cd_sdl.c +++ b/source/cd_sdl.c @@ -93,13 +93,13 @@ int32_t CDAudio_Play(byte track, bool looping) 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; } 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; } @@ -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) { - 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; } @@ -333,7 +333,7 @@ static void CD_f (void) FRAMES_TO_MSF(cd_handle->cur_frame, ¤t_min, ¤t_sec, ¤t_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, length_min, length_sec, length_frame * 60 / CD_FPS); } @@ -502,7 +502,7 @@ int32_t CDAudio_Init(void) } 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'); if (sdl_num_drives < 1) diff --git a/source/cl_demo.c b/source/cl_demo.c index 7ae84ad..55800d1 100644 --- a/source/cl_demo.c +++ b/source/cl_demo.c @@ -266,7 +266,7 @@ void CL_Record_f (void) if (c == 4) { 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 { @@ -295,7 +295,7 @@ void CL_Record_f (void) } cls.forcetrack = track; - fprintf (cls.demofile, "%i\n", cls.forcetrack); + fprintf (cls.demofile, "%" PRIi32 "\n", cls.forcetrack); cls.demorecording = true; @@ -414,7 +414,7 @@ void CL_PlayDemo_f (void) // ZOID, fscanf is evil // O.S.: if a space character e.g. 0x20 (' ') follows '\n', // 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; c = 0; /* silence pesky compiler warnings */ neg = false; @@ -469,7 +469,7 @@ static void CL_FinishTimeDemo (void) time = realtime - cls.td_starttime; if (!time) 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); } /* diff --git a/source/cl_main.c b/source/cl_main.c index 5b01a57..e5d45a0 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -181,7 +181,7 @@ void CL_SignonReply (void) { char str[8192]; - Con_DPrintf ("CL_SignonReply: %i\n", cls.signon); + Con_DPrintf ("CL_SignonReply: %" PRIi32 "\n", 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_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); sprintf (str, "spawn %s", cls.spawnparms); @@ -626,13 +626,13 @@ int32_t CL_ReadFromServer (void) //visedicts 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_peakstats.visedicts = q_max(cl_numvisedicts, dev_peakstats.visedicts); //temp entities 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_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) num_beams++; 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_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) num_dlights++; 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_peakstats.dlights = q_max(num_dlights, dev_peakstats.dlights); @@ -728,7 +728,7 @@ void CL_Tracepos_f (void) if (VectorLength(w) == 0) Con_Printf ("Tracepos: trace didn't hit anything\n"); 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; #if 0 //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[1], (int32_t)r_refdef.vieworg[2], @@ -753,7 +753,7 @@ void CL_Viewpos_f (void) (int32_t)r_refdef.viewangles[ROLL]); #else //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[1], (int32_t)cl_entities[cl.viewentity].origin[2], diff --git a/source/cl_parse.c b/source/cl_parse.c index 30b3eea..6bc1fd8 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -106,13 +106,13 @@ entity_t *CL_EntityNum (int32_t num) { //johnfitz -- check minimum number too if (num < 0) - Host_Error ("CL_EntityNum: %i is an invalid number",num); + Host_Error ("CL_EntityNum: %" PRIi32 " is an invalid number",num); //john if (num >= cl.num_entities) { 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) { cl_entities[cl.num_entities].colormap = vid.colormap; @@ -173,11 +173,11 @@ void CL_ParseStartSoundPacket(void) //johnfitz -- check soundnum if (sound_num >= MAX_SOUNDS) - Host_Error ("CL_ParseStartSoundPacket: %i > MAX_SOUNDS", sound_num); + Host_Error ("CL_ParseStartSoundPacket: %" PRIi32 " > MAX_SOUNDS", sound_num); //johnfitz 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++) pos[i] = MSG_ReadCoord (cl.protocolflags); @@ -278,7 +278,7 @@ void CL_ParseServerInfo (void) //johnfitz -- support multiple protocols if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ) { 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; //johnfitz @@ -292,7 +292,7 @@ void CL_ParseServerInfo (void) 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; @@ -317,7 +317,7 @@ void CL_ParseServerInfo (void) Con_Printf ("%c%s\n", 2, str); //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 // 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 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 // precache sounds @@ -360,7 +360,7 @@ void CL_ParseServerInfo (void) //johnfitz -- check for excessive sounds 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 // @@ -946,7 +946,7 @@ void CL_ParseServerMessage (void) // if recording demos, copy the message out // if (cl_shownet.value == 1) - Con_Printf ("%i ",net_message.cursize); + Con_Printf ("%" PRIi32 " ",net_message.cursize); else if (cl_shownet.value == 2) Con_Printf ("------------------\n"); @@ -1004,7 +1004,7 @@ void CL_ParseServerMessage (void) i = MSG_ReadLong (); //johnfitz -- support multiple protocols 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; //johnfitz break; @@ -1132,13 +1132,13 @@ void CL_ParseServerMessage (void) case svc_signonnum: i = MSG_ReadByte (); 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; //johnfitz -- if signonnum==2, signon packet has been fully parsed, so check for excessive static ents and efrags if (i == 2) { 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 (); } //johnfitz @@ -1156,7 +1156,7 @@ void CL_ParseServerMessage (void) case svc_updatestat: i = MSG_ReadByte (); 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 ();; break; diff --git a/source/cmd.c b/source/cmd.c index 2088ef9..744880b 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -317,7 +317,7 @@ void Cmd_Alias_f (void) for (a = cmd_alias, i = 0; a; a=a->next, i++) Con_SafePrintf (" %s: %s", a->name, a->value); if (i) - Con_SafePrintf ("%i alias command(s)\n", i); + Con_SafePrintf ("%" PRIi32 " alias command(s)\n", i); else Con_SafePrintf ("no alias commands found\n"); break; @@ -491,7 +491,7 @@ void Cmd_List_f (void) count++; } - Con_SafePrintf ("%i commands", count); + Con_SafePrintf ("%" PRIi32 " commands", count); if (partial) { Con_SafePrintf (" beginning with \"%s\"", partial); diff --git a/source/common.c b/source/common.c index b398cfe..4c6591d 100644 --- a/source/common.c +++ b/source/common.c @@ -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 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; Con_Printf ("SZ_GetSpace: overflow"); @@ -1522,7 +1522,7 @@ static void COM_Path_f (void) { 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 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) { int32_t consumed = 0; - sscanf (buffer, "%i\n%n", value, &consumed); + sscanf (buffer, "%" PRIi32 "\n%n", value, &consumed); return buffer + consumed; } @@ -1969,7 +1969,7 @@ static pack_t *COM_LoadPackFile (const char *packfile) 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); } if (!numpackfiles) @@ -1979,7 +1979,7 @@ static pack_t *COM_LoadPackFile (const char *packfile) return NULL; } 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) com_modified = true; // not the original file @@ -2010,7 +2010,7 @@ static pack_t *COM_LoadPackFile (const char *packfile) pack->numfiles = numpackfiles; 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; } @@ -2046,7 +2046,7 @@ _add_path: // add any pak files in the format pak0.pak pak1.pak, ... 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); if (i != 0 || path_id != 1 || fitzmode) qspak = NULL; diff --git a/source/console.c b/source/console.c index f66fdf7..0f26852 100644 --- a/source/console.c +++ b/source/console.c @@ -1281,7 +1281,7 @@ void LOG_Init (quakeparms_t *parms) return; 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); // unlink (logfilename); diff --git a/source/cvar.c b/source/cvar.c index 9e11d93..12d3f80 100644 --- a/source/cvar.c +++ b/source/cvar.c @@ -71,7 +71,7 @@ void Cvar_List_f (void) count++; } - Con_SafePrintf ("%i cvars", count); + Con_SafePrintf ("%" PRIi32 " cvars", count); if (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; 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 { 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; 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 { q_snprintf (val, sizeof(val), "%f", value); diff --git a/source/gl_draw.c b/source/gl_draw.c index 04a6730..9499702 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -200,7 +200,7 @@ void Scrap_Upload (void) for (i=0; iname); + Sys_Error ("Missing frame %" PRIi32 " of %s",j, tx->name); tx2->anim_total = maxanim * ANIM_CYCLE; tx2->anim_min = j * ANIM_CYCLE; tx2->anim_max = (j+1) * ANIM_CYCLE; @@ -685,7 +685,7 @@ void Mod_LoadTextures (lump_t *l) { tx2 = altanims[j]; 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_min = j * ANIM_CYCLE; tx2->anim_max = (j+1) * ANIM_CYCLE; @@ -738,7 +738,7 @@ void Mod_LoadLighting (lump_t *l) else { Hunk_FreeToLowMark(mark); - Con_Printf("Unknown .lit file version (%d)\n", i); + Con_Printf("Unknown .lit file version (%" PRIi32 ")\n", i); } } else @@ -978,7 +978,7 @@ void Mod_LoadTexinfo (lump_t *l) //johnfitz: report missing textures 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 } @@ -1169,7 +1169,7 @@ void Mod_LoadFaces (lump_t *l, bool bsp2) //johnfitz -- warn mappers about exceeding old limits 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 loadmodel->surfaces = out; @@ -1297,7 +1297,7 @@ void Mod_LoadNodes_S (lump_t *l) //johnfitz -- warn mappers about exceeding old limits 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 loadmodel->nodes = out; @@ -1330,7 +1330,7 @@ void Mod_LoadNodes_S (lump_t *l) out->children[j] = (mnode_t *)(loadmodel->leafs + p); 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 } } @@ -1382,7 +1382,7 @@ void Mod_LoadNodes_L1 (lump_t *l) out->children[j] = (mnode_t *)(loadmodel->leafs + p); 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 } } @@ -1434,7 +1434,7 @@ void Mod_LoadNodes_L2 (lump_t *l) out->children[j] = (mnode_t *)(loadmodel->leafs + p); 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 } } @@ -1467,7 +1467,7 @@ void Mod_ProcessLeafs_S (dsleaf_t *in, int32_t filelen) //johnfitz 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 loadmodel->leafs = out; @@ -1640,7 +1640,7 @@ void Mod_LoadClipnodes (lump_t *l, bool bsp2) //johnfitz -- warn about exceeding old limits 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 loadmodel->clipnodes = out; @@ -1794,7 +1794,7 @@ void Mod_LoadMarksurfaces (lump_t *l, int32_t bsp2) //johnfitz -- warn mappers about exceeding old limits 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 for (i=0 ; isubmodels; 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 } @@ -2013,7 +2013,7 @@ void Mod_LoadBrushModel (qmodel_t *mod, void *buffer) bsp2 = 2; //sanitised revision break; 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; } @@ -2095,7 +2095,7 @@ void Mod_LoadBrushModel (qmodel_t *mod, void *buffer) { // duplicate the basic information char name[10]; - sprintf (name, "*%i", i+1); + sprintf (name, "*%" PRIi32 "", i+1); loadmodel = Mod_FindName (name); *loadmodel = *mod; 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) 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; } @@ -2304,7 +2304,7 @@ void *Mod_LoadAllSkins (int32_t numskins, daliasskintype_t *pskintype) skin = (byte *)(pskintype + 1); 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; @@ -2323,13 +2323,13 @@ void *Mod_LoadAllSkins (int32_t numskins, daliasskintype_t *pskintype) memcpy (texels, (byte *)(pskintype + 1), size); //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; if (Mod_CheckFullbrights ((byte *)(pskintype+1), size)) { pheader->gltextures[i][0] = TexMgr_LoadImage (loadmodel, name, pheader->skinwidth, pheader->skinheight, 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, 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 - 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 if (Mod_CheckFullbrights ((byte *)(pskintype), size)) { pheader->gltextures[i][j&3] = TexMgr_LoadImage (loadmodel, name, pheader->skinwidth, pheader->skinheight, 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, 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); 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); // @@ -2556,7 +2556,7 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer) pheader->skinheight = LittleLong (pinmodel->skinheight); 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); pheader->numverts = LittleLong (pinmodel->numverts); @@ -2575,7 +2575,7 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer) pheader->numframes = LittleLong (pinmodel->numframes); numframes = pheader->numframes; 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; 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); //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 pspriteframe->gltexture = TexMgr_LoadImage (loadmodel, name, width, height, SRC_INDEXED, @@ -2789,7 +2789,7 @@ void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer) version = LittleLong (pin->version); if (version != SPRITE_VERSION) 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); @@ -2815,7 +2815,7 @@ void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer) // load the frames // 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; @@ -2860,6 +2860,6 @@ void Mod_Print (void) { 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 } diff --git a/source/gl_refrag.c b/source/gl_refrag.c index 76972b5..8d457e3 100644 --- a/source/gl_refrag.c +++ b/source/gl_refrag.c @@ -155,7 +155,7 @@ void R_CheckEfrags (void) return; //don't spam when still parsing signon packet full of static ents 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_peakstats.efrags = q_max(cl.num_efrags, dev_peakstats.efrags); diff --git a/source/gl_rmain.c b/source/gl_rmain.c index d2048e3..506b3d2 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -1119,7 +1119,7 @@ void R_RenderView (void) //johnfitz -- modified r_speeds output time2 = Sys_DoubleTime (); 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[1], (int32_t)cl_entities[cl.viewentity].origin[2], diff --git a/source/gl_rmisc.c b/source/gl_rmisc.c index d3d85f4..0b693b6 100644 --- a/source/gl_rmisc.c +++ b/source/gl_rmisc.c @@ -298,14 +298,14 @@ void R_TranslateNewPlayerSkin (int32_t playernum) //TODO: move these tests to the place where skinnum gets received from the server 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; } pixels = (byte *)paliashdr + paliashdr->texels[skinnum]; // This is not a persistent place! //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, 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 = ¤t_element_array_buffer; break; default: - Host_Error("GL_BindBuffer: unsupported target %d", (int32_t)target); + Host_Error("GL_BindBuffer: unsupported target %" PRIi32 "", (int32_t)target); return; } diff --git a/source/gl_screen.c b/source/gl_screen.c index 9a77d61..bb39f33 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -495,7 +495,7 @@ void SCR_DrawClock (void) minutes = 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 return; diff --git a/source/gl_texmgr.c b/source/gl_texmgr.c index 04a625a..e70bf2a 100644 --- a/source/gl_texmgr.c +++ b/source/gl_texmgr.c @@ -84,7 +84,7 @@ static void TexMgr_DescribeTextureModes_f (void) for (i = 0; i < NUM_GLMODES; i++) 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; - 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); } - Con_Printf ("dumped %i textures to %s\n", numgltextures, dirname); + Con_Printf ("dumped %" PRIi32 " textures to %s\n", numgltextures, dirname); } /* diff --git a/source/gl_vidsdl.c b/source/gl_vidsdl.c index 28967ac..4548980 100644 --- a/source/gl_vidsdl.c +++ b/source/gl_vidsdl.c @@ -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 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_GetCurrentHeight(), VID_GetCurrentBPP(), @@ -656,7 +656,7 @@ static void VID_Restart (void) // 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"); return; } @@ -897,7 +897,7 @@ static void GL_CheckExtensions (void) gl_mtexable = true; 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 { @@ -1162,7 +1162,7 @@ static void GL_Init (void) Con_SafePrintf ("GL_RENDERER: %s\n", gl_renderer); 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_minor = 0; @@ -1270,7 +1270,7 @@ VID_DescribeCurrentMode_f static void VID_DescribeCurrentMode_f (void) { 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_GetCurrentHeight(), VID_GetCurrentBPP(), @@ -1296,14 +1296,14 @@ static void VID_DescribeModes_f (void) { if (count > 0) 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; lastheight = modelist[i].height; lastbpp = modelist[i].bpp; 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 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: 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; case VID_OPT_BPP: 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; case VID_OPT_REFRESHRATE: 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; case VID_OPT_FULLSCREEN: M_Print (16, y, " Fullscreen"); diff --git a/source/gl_warp.c b/source/gl_warp.c index 06a99cb..3c8bde6 100644 --- a/source/gl_warp.c +++ b/source/gl_warp.c @@ -83,7 +83,7 @@ void SubdividePolygon (int32_t numverts, float *verts) float s, t; if (numverts > 60) - Sys_Error ("numverts = %i", numverts); + Sys_Error ("numverts = %" PRIi32 "", numverts); BoundPoly (numverts, verts, mins, maxs); diff --git a/source/host.c b/source/host.c index 4d20a54..c8827b2 100644 --- a/source/host.c +++ b/source/host.c @@ -649,7 +649,7 @@ void Host_ServerFrame (void) active++; } 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_peakstats.edicts = q_max(active, dev_peakstats.edicts); } diff --git a/source/host_cmd.c b/source/host_cmd.c index 518aba9..8f33f1e 100644 --- a/source/host_cmd.c +++ b/source/host_cmd.c @@ -209,7 +209,7 @@ void Host_Maps_f (void) Con_SafePrintf (" %s\n", level->name); if (i) - Con_SafePrintf ("%i map(s)\n", i); + Con_SafePrintf ("%" PRIi32 " map(s)\n", i); else Con_SafePrintf ("no maps found\n"); } @@ -385,7 +385,7 @@ void Host_Mods_f (void) Con_SafePrintf (" %s\n", mod->name); if (i) - Con_SafePrintf ("%i mod(s)\n", i); + Con_SafePrintf ("%" PRIi32 " mod(s)\n", i); else Con_SafePrintf ("no mods found\n"); } @@ -448,7 +448,7 @@ void Host_Status_f (void) if (ipxAvailable) print_fn ("ipx: %s\n", my_ipx_address); 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++) { if (!client->active) @@ -641,7 +641,7 @@ void Host_SetPos_f(void) SV_ClientPrintf(" setpos \n"); SV_ClientPrintf(" setpos \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[1], (int32_t)sv_player->v.origin[2], @@ -1081,12 +1081,12 @@ void Host_Savegame_f (void) return; } - fprintf (f, "%i\n", SAVEGAME_VERSION); + fprintf (f, "%" PRIi32 "\n", SAVEGAME_VERSION); Host_SavegameComment (comment); fprintf (f, "%s\n", comment); for (i = 0; i < NUM_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, "%f\n",sv.time); @@ -1174,7 +1174,7 @@ void Host_Loadgame_f (void) { free (start); 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; } data = COM_ParseStringNewline (data); @@ -1477,7 +1477,7 @@ void Host_Color_f(void) 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"); return; } @@ -2147,7 +2147,7 @@ void PrintFrameName (qmodel_t *m, int32_t frame) return; 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; 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; } - 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++) q_strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof(cls.demos[0])); diff --git a/source/image.c b/source/image.c index ddb75d5..fe393a6 100644 --- a/source/image.c +++ b/source/image.c @@ -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); 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) Sys_Error ("'%s' has wrong encoding or bit depth", loadfilename); diff --git a/source/in_sdl.c b/source/in_sdl.c index e4d663c..3de2a5a 100644 --- a/source/in_sdl.c +++ b/source/in_sdl.c @@ -236,7 +236,7 @@ void IN_StartupJoystick (void) q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir); nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb); 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 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); nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb); 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++) @@ -881,7 +881,7 @@ void IN_SendKeyEvents (void) if (event.button.button < 1 || 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); break; } diff --git a/source/keys.c b/source/keys.c index 0f519e8..809d1d8 100644 --- a/source/keys.c +++ b/source/keys.c @@ -670,7 +670,7 @@ void Key_Bindlist_f (void) 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]; if (kb && kb[0] == '+') { - sprintf (cmd, "-%s %i\n", kb+1, key); + sprintf (cmd, "-%s %" PRIi32 "\n", kb+1, key); Cbuf_AddText (cmd); } return; @@ -1041,7 +1041,7 @@ void Key_Event (int32_t key, bool down) { if (kb[0] == '+') { // button commands add keynum as a parm - sprintf (cmd, "%s %i\n", kb, key); + sprintf (cmd, "%s %" PRIi32 "\n", kb, key); Cbuf_AddText (cmd); } else diff --git a/source/main_sdl.c b/source/main_sdl.c index eac203e..f96b521 100644 --- a/source/main_sdl.c +++ b/source/main_sdl.c @@ -43,15 +43,15 @@ static void Sys_InitSDL (void) SDL_version *sdl_version = &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) { /*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) { /*reject running under newer (1.3.x) SDL */ 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) diff --git a/source/menu.c b/source/menu.c index 48d26d0..5db1530 100644 --- a/source/menu.c +++ b/source/menu.c @@ -267,7 +267,7 @@ void M_Main_Draw (void) 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; - 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 ---"); 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"); if (!f) continue; - fscanf (f, "%i\n", &version); + fscanf (f, "%" PRIi32 "\n", &version); fscanf (f, "%79s\n", name); strncpy (m_filenames[i], name, sizeof(m_filenames[i])-1); @@ -537,7 +537,7 @@ void M_Load_Key (int32_t k) SCR_BeginLoadingPlaque (); // issue the load command - Cbuf_AddText (va ("load s%i\n", load_cursor) ); + Cbuf_AddText (va ("load s%" PRIi32 "\n", load_cursor) ); return; case K_UPARROW: @@ -574,7 +574,7 @@ void M_Save_Key (int32_t k) m_state = m_none; IN_Activate(); key_dest = key_game; - Cbuf_AddText (va("save s%i\n", load_cursor)); + Cbuf_AddText (va("save s%" PRIi32 "\n", load_cursor)); return; case K_UPARROW: @@ -623,7 +623,7 @@ void M_MultiPlayer_Draw (void) 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) return; @@ -798,7 +798,7 @@ forward: if (Q_strcmp(hostname.string, setup_hostname) != 0) Cvar_Set("hostname", setup_hostname); 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_Menu_MultiPlayer_f (); break; @@ -928,7 +928,7 @@ void M_Net_Draw (void) M_Print (f, 128, net_helpMessage[m_net_cursor*4+3]); 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) { - 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 (0, 56, " Max players"); - M_Print (160, 56, va("%i", maxplayers) ); + M_Print (160, 56, va("%" PRIi32 "", maxplayers) ); M_Print (0, 64, " Game Type"); if (coop.value) @@ -2163,13 +2163,13 @@ void M_GameOptions_Draw (void) if (fraglimit.value == 0) M_Print (160, 88, "none"); 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"); if (timelimit.value == 0) M_Print (160, 96, "none"); 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"); // MED 01/06/97 added hipnotic episodes diff --git a/source/net_dgrm.c b/source/net_dgrm.c index 42fb41e..4e9f242 100644 --- a/source/net_dgrm.c +++ b/source/net_dgrm.c @@ -448,16 +448,16 @@ static void NET_Stats_f (void) if (Cmd_Argc () == 1) { - Con_Printf("unreliable messages sent = %i\n", unreliableMessagesSent); - Con_Printf("unreliable messages recv = %i\n", unreliableMessagesReceived); - Con_Printf("reliable messages sent = %i\n", messagesSent); - Con_Printf("reliable messages received = %i\n", messagesReceived); - Con_Printf("packetsSent = %i\n", packetsSent); - Con_Printf("packetsReSent = %i\n", packetsReSent); - Con_Printf("packetsReceived = %i\n", packetsReceived); - Con_Printf("receivedDuplicateCount = %i\n", receivedDuplicateCount); - Con_Printf("shortPacketCount = %i\n", shortPacketCount); - Con_Printf("droppedDatagrams = %i\n", droppedDatagrams); + Con_Printf("unreliable messages sent = %" PRIi32 "\n", unreliableMessagesSent); + Con_Printf("unreliable messages recv = %" PRIi32 "\n", unreliableMessagesReceived); + Con_Printf("reliable messages sent = %" PRIi32 "\n", messagesSent); + Con_Printf("reliable messages received = %" PRIi32 "\n", messagesReceived); + Con_Printf("packetsSent = %" PRIi32 "\n", packetsSent); + Con_Printf("packetsReSent = %" PRIi32 "\n", packetsReSent); + Con_Printf("packetsReceived = %" PRIi32 "\n", packetsReceived); + Con_Printf("receivedDuplicateCount = %" PRIi32 "\n", receivedDuplicateCount); + Con_Printf("shortPacketCount = %" PRIi32 "\n", shortPacketCount); + Con_Printf("droppedDatagrams = %" PRIi32 "\n", droppedDatagrams); } 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) { net_hostport = port; - Con_Printf("Port set to %d\n", net_hostport); + Con_Printf("Port set to %" PRIi32 "\n", net_hostport); } return noport; } @@ -566,7 +566,7 @@ static void Test_Poll (void *unused) connectTime = MSG_ReadLong(); 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--; diff --git a/source/net_main.c b/source/net_main.c index fd6e78c..73eab43 100644 --- a/source/net_main.c +++ b/source/net_main.c @@ -170,7 +170,7 @@ static void NET_Listen_f (void) { if (Cmd_Argc () != 2) { - Con_Printf ("\"listen\" is \"%d\"\n", listening ? 1 : 0); + Con_Printf ("\"listen\" is \"%" PRIi32 "\"\n", listening ? 1 : 0); return; } @@ -191,7 +191,7 @@ static void MaxPlayers_f (void) if (Cmd_Argc () != 2) { - Con_Printf ("\"maxplayers\" is \"%d\"\n", svs.maxclients); + Con_Printf ("\"maxplayers\" is \"%" PRIi32 "\"\n", svs.maxclients); return; } @@ -207,7 +207,7 @@ static void MaxPlayers_f (void) if (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) @@ -230,7 +230,7 @@ static void NET_Port_f (void) if (Cmd_Argc () != 2) { - Con_Printf ("\"port\" is \"%d\"\n", net_hostport); + Con_Printf ("\"port\" is \"%" PRIi32 "\"\n", net_hostport); return; } diff --git a/source/pr_cmds.c b/source/pr_cmds.c index 4a9cd00..49a813d 100644 --- a/source/pr_cmds.c +++ b/source/pr_cmds.c @@ -68,7 +68,7 @@ static char *PF_VarString (int32_t first) { 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; } } @@ -639,13 +639,13 @@ static void PF_sound (void) attenuation = G_FLOAT(OFS_PARM4); if (volume < 0 || volume > 255) - Host_Error ("SV_StartSound: volume = %i", volume); + Host_Error ("SV_StartSound: volume = %" PRIi32 "", volume); if (attenuation < 0 || attenuation > 4) Host_Error ("SV_StartSound: attenuation = %f", attenuation); 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); } @@ -691,7 +691,7 @@ static void PF_traceline (void) if (developer.value) { 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])) { - 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)); } } @@ -791,7 +791,7 @@ static int32_t PF_newcheckclient (int32_t check) checkpvs_capacity = pvsbytes; checkpvs = (byte *) realloc (checkpvs, checkpvs_capacity); 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); @@ -992,7 +992,7 @@ static void PF_ftos (void) v = G_FLOAT(OFS_PARM0); s = PR_GetTempString(); if (v == (int32_t)v) - sprintf (s, "%d",(int32_t)v); + sprintf (s, "%" PRIi32 "",(int32_t)v); else sprintf (s, "%5.1f",v); G_INT(OFS_RETURN) = PR_SetEngineString(s); @@ -1242,7 +1242,7 @@ static void PF_lightstyle (void) // bounds check to avoid clobbering sv struct 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; } diff --git a/source/pr_edict.c b/source/pr_edict.c index 33b2a6b..c0c14f5 100644 --- a/source/pr_edict.c +++ b/source/pr_edict.c @@ -125,7 +125,7 @@ edict_t *ED_Alloc (void) } 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++; 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)); break; 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; case ev_function: f = pr_functions + val->function; @@ -343,7 +343,7 @@ static const char *PR_ValueString (int32_t type, eval_t *val) sprintf (line, "pointer"); break; default: - sprintf (line, "bad type %i", type); + sprintf (line, "bad type %" PRIi32 "", type); break; } @@ -373,7 +373,7 @@ static const char *PR_UglyValueString (int32_t type, eval_t *val) sprintf (line, "%s", PR_GetString(val->string)); break; 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; case ev_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]); break; default: - sprintf (line, "bad type %i", type); + sprintf (line, "bad type %" PRIi32 "", type); break; } @@ -419,11 +419,11 @@ const char *PR_GlobalString (int32_t ofs) val = (void *)&pr_globals[ofs]; def = ED_GlobalAtOfs(ofs); if (!def) - sprintf (line,"%i(?)", ofs); + sprintf (line,"%" PRIi32 "(?)", ofs); else { 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); @@ -442,9 +442,9 @@ const char *PR_GlobalStringNoContents (int32_t ofs) def = ED_GlobalAtOfs(ofs); if (!def) - sprintf (line,"%i(?)", ofs); + sprintf (line,"%" PRIi32 "(?)", ofs); else - sprintf (line,"%i(%s)", ofs, PR_GetString(def->s_name)); + sprintf (line,"%" PRIi32 "(%s)", ofs, PR_GetString(def->s_name)); i = strlen(line); for ( ; i < 20; i++) @@ -476,7 +476,7 @@ void ED_Print (edict_t *ed) 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++) { d = &pr_fielddefs[i]; @@ -580,7 +580,7 @@ void ED_PrintEdicts (void) if (!sv.active) 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++) ED_PrintNum (i); } @@ -1037,7 +1037,7 @@ void ED_LoadFromFile (const char *data) 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); if (!progs) 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++) CRC_ProcessByte (&pr_crc, ((byte *)progs)[i]); @@ -1069,7 +1069,7 @@ void PR_LoadProgs (void) ((int32_t *)progs)[i] = LittleLong ( ((int32_t *)progs)[i] ); 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) 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) { 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); } @@ -1200,7 +1200,7 @@ int32_t NUM_FOR_EDICT(edict_t *e) static void PR_AllocStringSlots (void) { 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 *)); } @@ -1212,14 +1212,14 @@ const char *PR_GetString (int32_t 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 pr_knownstrings[-1 - num]; } else { - Host_Error("PR_GetString: invalid string offset %d\n", num); + Host_Error("PR_GetString: invalid string offset %" PRIi32 "\n", num); return ""; } } diff --git a/source/pr_exec.c b/source/pr_exec.c index c8275a1..f87e603 100644 --- a/source/pr_exec.c +++ b/source/pr_exec.c @@ -153,10 +153,10 @@ static void PR_PrintStatement (dstatement_t *s) } 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) { - Con_Printf("branch %i", s->a); + Con_Printf("branch %" PRIi32 "", s->a); } else if ((uint32_t)(s->op-OP_STORE_F) < 6) { @@ -612,7 +612,7 @@ void PR_ExecuteProgram (func_t fnum) { // Built-in function int32_t i = -newf->first_statement; if (i >= pr_numbuiltins) - PR_RunError("Bad builtin call number %d", i); + PR_RunError("Bad builtin call number %" PRIi32 "", i); pr_builtins[i](); break; } @@ -644,7 +644,7 @@ void PR_ExecuteProgram (func_t fnum) default: pr_xstatement = st - pr_statements; - PR_RunError("Bad opcode %i", st->op); + PR_RunError("Bad opcode %" PRIi32 "", st->op); } } /* end of while(1) loop */ } diff --git a/source/r_alias.c b/source/r_alias.c index d6c28b5..7cc45c5 100644 --- a/source/r_alias.c +++ b/source/r_alias.c @@ -415,7 +415,7 @@ void R_SetupAliasFrame (aliashdr_t *paliashdr, int32_t frame, lerpdata_t *lerpda 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; } @@ -693,7 +693,7 @@ void R_DrawAliasModel (entity_t *e) skinnum = e->skinnum; 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 skinnum = 0; } diff --git a/source/r_brush.c b/source/r_brush.c index 9038daf..e33b4c3 100644 --- a/source/r_brush.c +++ b/source/r_brush.c @@ -947,7 +947,7 @@ void GL_BuildLightmaps (void) //johnfitz -- warn about exceeding old limits 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 } diff --git a/source/r_part.c b/source/r_part.c index 6c10768..0bef503 100644 --- a/source/r_part.c +++ b/source/r_part.c @@ -315,7 +315,7 @@ void R_ReadPointFile_f (void) } fclose (f); - Con_Printf ("%i points read\n", c); + Con_Printf ("%" PRIi32 " points read\n", c); } /* diff --git a/source/r_sprite.c b/source/r_sprite.c index 31e6f0b..edb2952 100644 --- a/source/r_sprite.c +++ b/source/r_sprite.c @@ -41,7 +41,7 @@ mspriteframe_t *R_GetSpriteFrame (entity_t *currentent) 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; } diff --git a/source/sbar.c b/source/sbar.c index cbef0e8..e37a2a9 100644 --- a/source/sbar.c +++ b/source/sbar.c @@ -116,8 +116,8 @@ void Sbar_LoadPics (void) for (i = 0; i < 10; i++) { - sb_nums[0][i] = Draw_PicFromWad (va("num_%i",i)); - sb_nums[1][i] = Draw_PicFromWad (va("anum_%i",i)); + sb_nums[0][i] = Draw_PicFromWad (va("num_%" PRIi32 "",i)); + sb_nums[1][i] = Draw_PicFromWad (va("anum_%" PRIi32 "",i)); } sb_nums[0][10] = Draw_PicFromWad ("num_minus"); @@ -144,13 +144,13 @@ void Sbar_LoadPics (void) for (i = 0; i < 5; i++) { - sb_weapons[2+i][0] = Draw_PicFromWad (va("inva%i_shotgun",i+1)); - sb_weapons[2+i][1] = Draw_PicFromWad (va("inva%i_sshotgun",i+1)); - sb_weapons[2+i][2] = Draw_PicFromWad (va("inva%i_nailgun",i+1)); - sb_weapons[2+i][3] = Draw_PicFromWad (va("inva%i_snailgun",i+1)); - sb_weapons[2+i][4] = Draw_PicFromWad (va("inva%i_rlaunch",i+1)); - sb_weapons[2+i][5] = Draw_PicFromWad (va("inva%i_srlaunch",i+1)); - sb_weapons[2+i][6] = Draw_PicFromWad (va("inva%i_lightng",i+1)); + sb_weapons[2+i][0] = Draw_PicFromWad (va("inva%" PRIi32 "_shotgun",i+1)); + sb_weapons[2+i][1] = Draw_PicFromWad (va("inva%" PRIi32 "_sshotgun",i+1)); + sb_weapons[2+i][2] = Draw_PicFromWad (va("inva%" PRIi32 "_nailgun",i+1)); + sb_weapons[2+i][3] = Draw_PicFromWad (va("inva%" PRIi32 "_snailgun",i+1)); + sb_weapons[2+i][4] = Draw_PicFromWad (va("inva%" PRIi32 "_rlaunch",i+1)); + sb_weapons[2+i][5] = Draw_PicFromWad (va("inva%" PRIi32 "_srlaunch",i+1)); + sb_weapons[2+i][6] = Draw_PicFromWad (va("inva%" PRIi32 "_lightng",i+1)); } sb_ammo[0] = Draw_PicFromWad ("sb_shells"); @@ -211,11 +211,11 @@ void Sbar_LoadPics (void) for (i = 0; i < 5; i++) { - hsb_weapons[2+i][0] = Draw_PicFromWad (va("inva%i_laser",i+1)); - hsb_weapons[2+i][1] = Draw_PicFromWad (va("inva%i_mjolnir",i+1)); - hsb_weapons[2+i][2] = Draw_PicFromWad (va("inva%i_gren_prox",i+1)); - hsb_weapons[2+i][3] = Draw_PicFromWad (va("inva%i_prox_gren",i+1)); - hsb_weapons[2+i][4] = Draw_PicFromWad (va("inva%i_prox",i+1)); + hsb_weapons[2+i][0] = Draw_PicFromWad (va("inva%" PRIi32 "_laser",i+1)); + hsb_weapons[2+i][1] = Draw_PicFromWad (va("inva%" PRIi32 "_mjolnir",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%" PRIi32 "_prox_gren",i+1)); + hsb_weapons[2+i][4] = Draw_PicFromWad (va("inva%" PRIi32 "_prox",i+1)); } hsb_items[0] = Draw_PicFromWad ("sb_wsuit"); @@ -499,15 +499,15 @@ void Sbar_SoloScoreboard (void) int32_t minutes, seconds, tens, units; 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); - 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); if (!fitzmode) { /* 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); q_snprintf (str, sizeof(str), "%s (%s)", cl.levelname, cl.mapname); @@ -522,7 +522,7 @@ void Sbar_SoloScoreboard (void) seconds = cl.time - 60*minutes; tens = seconds / 10; 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); len = strlen (cl.levelname); @@ -1164,7 +1164,7 @@ void Sbar_DeathmatchOverlay (void) tens = 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 } diff --git a/source/snd_dma.c b/source/snd_dma.c index 57a47d0..49042a7 100644 --- a/source/snd_dma.c +++ b/source/snd_dma.c @@ -104,7 +104,7 @@ static void S_SoundInfo_f (void) 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); Con_Printf("%5d samples\n", shm->samples); Con_Printf("%5d samplepos\n", shm->samplepos); @@ -148,7 +148,7 @@ void S_Startup (void) } else { - Con_Printf("Audio: %d bit, %s, %d Hz\n", + Con_Printf("Audio: %" PRIi32 " bit, %s, %" PRIi32 " Hz\n", shm->samplebits, (shm->channels == 2) ? "stereo" : "mono", 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 @@ -1033,7 +1033,7 @@ static void S_SoundList (void) Con_SafePrintf (" "); //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 } diff --git a/source/snd_flac.c b/source/snd_flac.c index 4ecdbe4..ca8b630 100644 --- a/source/snd_flac.c +++ b/source/snd_flac.c @@ -83,7 +83,7 @@ flac_error_func (const FLAC__StreamDecoder *decoder, (void)decoder; flacfile_t *ff = (flacfile_t *) client_data; ff->error = -1; - Con_Printf ("FLAC: decoder error %i\n", status); + Con_Printf ("FLAC: decoder error %" PRIi32 "\n", status); } static FLAC__StreamDecoderReadStatus @@ -285,7 +285,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream) #endif 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; } @@ -293,7 +293,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream) if (rc == false || ff->error) { 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); goto _fail; } @@ -310,7 +310,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream) } 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); goto _fail; } diff --git a/source/snd_mem.c b/source/snd_mem.c index 511a107..48b4d92 100644 --- a/source/snd_mem.c +++ b/source/snd_mem.c @@ -212,7 +212,7 @@ static void FindNextChunk (const char *name) if (iff_chunk_len < 0 || iff_chunk_len > iff_end - data_p) { 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; } last_chunk = data_p + ((iff_chunk_len + 1) & ~1); @@ -240,7 +240,7 @@ static void DumpChunks (void) memcpy (str, data_p, 4); data_p += 4; 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; } while (data_p < iff_end); } @@ -308,7 +308,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int32_t wavlength) { data_p += 32; 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 FindNextChunk ("LIST"); @@ -319,7 +319,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int32_t wavlength) data_p += 24; i = GetLittleLong(); // samples in loop info.samples = info.loopstart + i; - // Con_Printf("looped length: %i\n", i); + // Con_Printf("looped length: %" PRIi32 "\n", i); } } } diff --git a/source/snd_mikmod.c b/source/snd_mikmod.c index ad78375..b00d357 100644 --- a/source/snd_mikmod.c +++ b/source/snd_mikmod.c @@ -160,7 +160,7 @@ static bool S_MIKMOD_CodecOpenStream (snd_stream_t *stream) stream->info.bits = (md_mode & DMODE_16BITS)? 16: 8; stream->info.width = stream->info.bits / 8; 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; } diff --git a/source/snd_mp3.c b/source/snd_mp3.c index 8333221..da72340 100644 --- a/source/snd_mp3.c +++ b/source/snd_mp3.c @@ -414,7 +414,7 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream) } 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); } else diff --git a/source/snd_mpg123.c b/source/snd_mpg123.c index 83d49b1..0575b55 100644 --- a/source/snd_mpg123.c +++ b/source/snd_mpg123.c @@ -125,7 +125,7 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream) stream->info.channels = 2; break; 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; } diff --git a/source/snd_opus.c b/source/snd_opus.c index 0ba9cdb..e30b637 100644 --- a/source/snd_opus.c +++ b/source/snd_opus.c @@ -94,7 +94,7 @@ static bool S_OPUS_CodecOpenStream (snd_stream_t *stream) opFile = op_open_callbacks(&stream->fh, &opc_qfs, NULL, 0, &res); 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); goto _fail; } @@ -118,14 +118,14 @@ static bool S_OPUS_CodecOpenStream (snd_stream_t *stream) numstreams = op_info->stream_count; 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); goto _fail; } 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); goto _fail; } diff --git a/source/snd_sdl.c b/source/snd_sdl.c index 49ab4df..34f74a8 100644 --- a/source/snd_sdl.c +++ b/source/snd_sdl.c @@ -131,7 +131,7 @@ bool SNDDMA_Init (dma_t *dma) shm->samplebits = (obtained.format & 0xFF); /* first byte of format is bits */ shm->signed8 = (obtained.format == AUDIO_S8); 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->channels = obtained.channels; tmp = (obtained.samples * obtained.channels) * 10; @@ -147,7 +147,7 @@ bool SNDDMA_Init (dma_t *dma) shm->samplepos = 0; 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); { const char *driver = SDL_GetCurrentAudioDriver(); @@ -157,7 +157,7 @@ bool SNDDMA_Init (dma_t *dma) device != NULL ? device : "(UNKNOWN)"); } 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); if (!shm->buffer) diff --git a/source/snd_umx.c b/source/snd_umx.c index 17afc29..838354f 100644 --- a/source/snd_umx.c +++ b/source/snd_umx.c @@ -318,7 +318,7 @@ static int32_t probe_header (void *header) return 0; } - Con_DPrintf("Unknown upkg version %d\n", hdr->file_version); + Con_DPrintf("Unknown upkg version %" PRIi32 "\n", hdr->file_version); return -1; } @@ -354,7 +354,7 @@ static bool S_UMX_CodecOpenStream (snd_stream_t *stream) 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 * that only the relevant data is accessed from now on */ stream->fh.start += ofs; diff --git a/source/snd_vorbis.c b/source/snd_vorbis.c index d819b3f..bbf5da1 100644 --- a/source/snd_vorbis.c +++ b/source/snd_vorbis.c @@ -86,7 +86,7 @@ static bool S_VORBIS_CodecOpenStream (snd_stream_t *stream) res = ov_open_callbacks(&stream->fh, ovFile, NULL, 0, ovc_qfs); 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); goto _fail; } @@ -108,14 +108,14 @@ static bool S_VORBIS_CodecOpenStream (snd_stream_t *stream) numstreams = ov_streams(ovFile); 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); goto _fail; } 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); goto _fail; } diff --git a/source/sv_main.c b/source/sv_main.c index 75b1ff5..6318c5f 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -46,12 +46,12 @@ void SV_Protocol_f (void) switch (Cmd_Argc()) { case 1: - Con_Printf ("\"sv_protocol\" is \"%i\"\n", sv_protocol); + Con_Printf ("\"sv_protocol\" is \"%" PRIi32 "\"\n", sv_protocol); break; case 2: i = atoi(Cmd_Argv(1)); 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 { sv_protocol = i; @@ -108,7 +108,7 @@ void SV_Init (void) Cmd_AddCommand ("sv_protocol", &SV_Protocol_f); //johnfitz for (i=0 ; i 255) - Host_Error ("SV_StartSound: volume = %i", volume); + Host_Error ("SV_StartSound: volume = %" PRIi32 "", volume); if (attenuation < 0 || attenuation > 4) Host_Error ("SV_StartSound: attenuation = %f", attenuation); 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) return; @@ -289,7 +289,7 @@ void SV_SendServerinfo (client_t *client) int32_t i; //johnfitz 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_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 = (byte *) realloc (fatpvs, fatpvs_capacity); 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); @@ -740,7 +740,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg) //johnfitz -- devstats stats: 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_peakstats.packetsize = q_max(msg->cursize, dev_peakstats.packetsize); //johnfitz @@ -1471,7 +1471,7 @@ void SV_SpawnServer (const char *server) //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 - 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 // send serverinfo to all connected clients diff --git a/source/sv_phys.c b/source/sv_phys.c index 15f8a76..b91bb87 100644 --- a/source/sv_phys.c +++ b/source/sv_phys.c @@ -353,7 +353,7 @@ int32_t SV_FlyMove (edict_t *ent, float time, trace_t *steptrace) { // go along the crease 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); return 7; } @@ -956,7 +956,7 @@ void SV_Physics_Client (edict_t *ent, int32_t num) break; 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) SV_Physics_Toss (ent); 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) diff --git a/source/unix/net_udp.c b/source/unix/net_udp.c index b2ca387..9fdf70d 100644 --- a/source/unix/net_udp.c +++ b/source/unix/net_udp.c @@ -349,7 +349,7 @@ const char *UDP_AddrToString (struct qsockaddr *addr) int32_t haddr; 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, ntohs(((struct sockaddr_in *)addr)->sin_port)); return buffer; @@ -361,7 +361,7 @@ int32_t UDP_StringToAddr (const char *string, struct qsockaddr *addr) { 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; addr->qsa_family = AF_INET; diff --git a/source/unix/sys_sdl_unix.c b/source/unix/sys_sdl_unix.c index ff45908..29022e1 100644 --- a/source/unix/sys_sdl_unix.c +++ b/source/unix/sys_sdl_unix.c @@ -352,7 +352,7 @@ void Sys_Init (void) host_parms->userdir = host_parms->basedir; 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) diff --git a/source/wad.c b/source/wad.c index 666900d..f75b14c 100644 --- a/source/wad.c +++ b/source/wad.c @@ -145,7 +145,7 @@ void *W_GetLumpNum (int32_t num) lumpinfo_t *lump; 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; diff --git a/source/windows/net_wins.c b/source/windows/net_wins.c index 6693a7c..b5742c3 100644 --- a/source/windows/net_wins.c +++ b/source/windows/net_wins.c @@ -108,7 +108,7 @@ static void WINS_GetLocalAddress (void) myAddr = *(in_addr_t *)local->h_addr_list[0]; 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; 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, ntohs(((struct sockaddr_in *)addr)->sin_port)); return buffer; @@ -443,7 +443,7 @@ int32_t WINS_StringToAddr (const char *string, struct qsockaddr *addr) { 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; addr->qsa_family = AF_INET; diff --git a/source/windows/sys_sdl_win.c b/source/windows/sys_sdl_win.c index c0bbb12..6d4024d 100644 --- a/source/windows/sys_sdl_win.c +++ b/source/windows/sys_sdl_win.c @@ -257,7 +257,7 @@ void Sys_Init (void) Win95old = true; } } - Sys_Printf("Detected %d CPUs.\n", host_parms->numcpus); + Sys_Printf("Detected %" PRIi32 " CPUs.\n", host_parms->numcpus); if (isDedicated) { diff --git a/source/windows/wsaerror.h b/source/windows/wsaerror.h index 5c72a37..b52e1c2 100644 --- a/source/windows/wsaerror.h +++ b/source/windows/wsaerror.h @@ -83,7 +83,7 @@ __wsaerr_static const char *__WSAE_StrError (int32_t err) default: { static char _err_unknown[64]; - sprintf(_err_unknown, "Unknown WSAE error (%d)", err); + sprintf(_err_unknown, "Unknown WSAE error (%" PRIi32 ")", err); return _err_unknown; } } diff --git a/source/zone.c b/source/zone.c index 4ef8497..7146b5b 100644 --- a/source/zone.c +++ b/source/zone.c @@ -202,7 +202,7 @@ void *Z_Malloc (int32_t size) Z_CheckHeap (); // DEBUG buf = Z_TagMalloc (size, 1); 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); return buf; @@ -235,7 +235,7 @@ void *Z_Realloc(void *ptr, int32_t size) Z_Free (ptr); ptr = Z_TagMalloc (size, 1); 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) memmove (ptr, old_ptr, q_min(old_size, size)); @@ -263,7 +263,7 @@ void Z_Print (memzone_t *zone) { 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) { @@ -434,12 +434,12 @@ void *Hunk_AllocName (int32_t size, const char *name) #endif 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); 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); hunk_low_used += size; @@ -473,7 +473,7 @@ int32_t Hunk_LowMark (void) void Hunk_FreeToLowMark (int32_t mark) { 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); hunk_low_used = mark; } @@ -497,7 +497,7 @@ void Hunk_FreeToHighMark (int32_t mark) Hunk_FreeToHighMark (hunk_tempmark); } 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); hunk_high_used = mark; } @@ -513,7 +513,7 @@ void *Hunk_HighAllocName (int32_t size, const char *name) hunk_t *h; if (size < 0) - Sys_Error ("Hunk_HighAllocName: bad size: %i", size); + Sys_Error ("Hunk_HighAllocName: bad size: %" PRIi32 "", size); 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) { - Con_Printf ("Hunk_HighAlloc: failed on %i bytes\n",size); + Con_Printf ("Hunk_HighAlloc: failed on %" PRIi32 " bytes\n",size); return NULL; } @@ -724,7 +724,7 @@ cache_system_t *Cache_TryAlloc (int32_t size, bool nobottom) if (!nobottom && cache_head.prev == &cache_head) { 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); 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"); 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;