From 00a944ce24b4bbfc6c7fad3538b94931f46aab07 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Mon, 25 Nov 2019 20:29:41 -0500 Subject: [PATCH] use more PRIxXX --- source/bgmusic.c | 4 ++-- source/cd_sdl.c | 10 +++++----- source/cl_main.c | 4 ++-- source/cl_parse.c | 4 ++-- source/gl_mesh.c | 28 ++++++++++++++-------------- source/gl_rmain.c | 14 +++++++------- source/gl_screen.c | 16 ++++++++-------- source/gl_texmgr.c | 4 ++-- source/gl_vidsdl.c | 2 +- source/host.c | 6 +++--- source/host_cmd.c | 6 +++--- source/lodepng.h | 2 +- source/menu.c | 6 +++--- source/net_dgrm.c | 14 +++++++------- source/net_main.c | 4 ++-- source/pr_edict.c | 10 +++++----- source/pr_exec.c | 2 +- source/r_brush.c | 26 +++++++++++++------------- source/sbar.c | 30 ++++++------------------------ source/snd_dma.c | 13 ++++++------- source/snd_mp3.c | 2 +- source/snd_sdl.c | 2 +- source/windows/net_wipx.c | 8 ++++---- source/zone.c | 14 +++++++------- 24 files changed, 106 insertions(+), 125 deletions(-) diff --git a/source/bgmusic.c b/source/bgmusic.c index b04708f..dec305c 100644 --- a/source/bgmusic.c +++ b/source/bgmusic.c @@ -312,7 +312,7 @@ void BGM_PlayCDtrack (byte track, bool looping) goto _next; if (! CDRIPTYPE(handler->type)) goto _next; - q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s", + q_snprintf(tmp, sizeof(tmp), "%s/track%02" PRIi32 ".%s", MUSIC_DIRNAME, (int32_t)track, handler->ext); if (! COM_FileExists(tmp, &path_id)) goto _next; @@ -329,7 +329,7 @@ void BGM_PlayCDtrack (byte track, bool looping) Con_Printf("Couldn't find a cdrip for track %" PRIi32 "\n", (int32_t)track); else { - q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s", + q_snprintf(tmp, sizeof(tmp), "%s/track%02" PRIi32 ".%s", MUSIC_DIRNAME, (int32_t)track, ext); bgmstream = S_CodecOpenStreamType(tmp, type); if (! bgmstream) diff --git a/source/cd_sdl.c b/source/cd_sdl.c index 888106d..5ae33c4 100644 --- a/source/cd_sdl.c +++ b/source/cd_sdl.c @@ -255,7 +255,7 @@ static void CD_f (void) { for (n = 1; n < 100; n++) if (remap[n] != n) - Con_Printf(" %u -> %u\n", n, remap[n]); + Con_Printf(" %" PRIu32 " -> %" PRIu32 "\n", n, remap[n]); return; } for (n = 1; n <= ret; n++) @@ -320,12 +320,12 @@ static void CD_f (void) int32_t current_min, current_sec, current_frame; int32_t length_min, length_sec, length_frame; - Con_Printf ("%u tracks\n", cd_handle->numtracks); + Con_Printf ("%" PRIu32 " tracks\n", cd_handle->numtracks); if (playing) - Con_Printf("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack); + Con_Printf("Currently %s track %" PRIu32 "\n", playLooping ? "looping" : "playing", playTrack); else if (wasPlaying) - Con_Printf("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack); + Con_Printf("Paused %s track %" PRIu32 "\n", playLooping ? "looping" : "playing", playTrack); if (playing || wasPlaying) { @@ -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: %" PRIi32 ":%02d.%02d (of %" PRIi32 ":%02d.%02d)\n", + Con_Printf ("Current position: %" PRIi32 ":%02" PRIi32 ".%02" PRIi32 " (of %" PRIi32 ":%02" PRIi32 ".%02" PRIi32 ")\n", current_min, current_sec, current_frame * 60 / CD_FPS, length_min, length_sec, length_frame * 60 / CD_FPS); } diff --git a/source/cl_main.c b/source/cl_main.c index e5d45a0..ac3f8ec 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -262,13 +262,13 @@ void CL_PrintEntities_f (void) for (i=0,ent=cl_entities ; imodel) { Con_Printf ("EMPTY\n"); continue; } - Con_Printf ("%s:%2i (%5.1f,%5.1f,%5.1f) [%5.1f %5.1f %5.1f]\n" + Con_Printf ("%s:%2" PRIi32 " (%5.1f,%5.1f,%5.1f) [%5.1f %5.1f %5.1f]\n" ,ent->model->name,ent->frame, ent->origin[0], ent->origin[1], ent->origin[2], ent->angles[0], ent->angles[1], ent->angles[2]); } } diff --git a/source/cl_parse.c b/source/cl_parse.c index 6bc1fd8..0dc26f1 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -301,7 +301,7 @@ void CL_ParseServerInfo (void) cl.maxclients = MSG_ReadByte (); if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD) { - Host_Error ("Bad maxclients (%u) from server", cl.maxclients); + Host_Error ("Bad maxclients (%" PRIu32 ") from server", cl.maxclients); } cl.scores = (scoreboard_t *) Hunk_AllocName (cl.maxclients*sizeof(*cl.scores), "scores"); @@ -928,7 +928,7 @@ void CL_ParseStaticSound (int32_t version) //johnfitz -- added argument } -#define SHOWNET(x) if(cl_shownet.value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x); +#define SHOWNET(x) if(cl_shownet.value==2)Con_Printf ("%3" PRIi32 ":%s\n", msg_readcount-1, x); /* ===================== diff --git a/source/gl_mesh.c b/source/gl_mesh.c index cfef661..e0e934d 100644 --- a/source/gl_mesh.c +++ b/source/gl_mesh.c @@ -281,7 +281,7 @@ void BuildTris (void) commands[numcommands++] = 0; // end of list marker - Con_DPrintf2 ("%3i tri %3i vert %3i cmd\n", pheader->numtris, numorder, numcommands); + Con_DPrintf2 ("%3" PRIi32 " tri %3" PRIi32 " vert %3" PRIi32 " cmd\n", pheader->numtris, numorder, numcommands); allverts += numorder; alltris += pheader->numtris; @@ -437,7 +437,7 @@ void GL_MakeAliasModelDisplayLists_VBO (void) } } } - + // upload immediately GLMesh_LoadVertexBuffer (aliasmodel, pheader); } @@ -465,23 +465,23 @@ static void GLMesh_LoadVertexBuffer (qmodel_t *m, const aliashdr_t *hdr) if (!gl_glsl_alias_able) return; - + // count the sizes we need - + // ericw -- RMQEngine stored these vbo*ofs values in aliashdr_t, but we must not // mutate Mod_Extradata since it might be reloaded from disk, so I moved them to qmodel_t // (test case: roman1.bsp from arwop, 64mb heap) m->vboindexofs = 0; - + m->vboxyzofs = 0; totalvbosize += (hdr->numposes * hdr->numverts_vbo * sizeof (meshxyz_t)); // ericw -- what RMQEngine called nummeshframes is called numposes in QuakeSpasm - + m->vbostofs = totalvbosize; totalvbosize += (hdr->numverts_vbo * sizeof (meshst_t)); - + if (!hdr->numindexes) return; if (!totalvbosize) return; - + // grab the pointers to data in the extradata desc = (aliasmesh_t *) ((byte *) hdr + hdr->meshdesc); @@ -571,14 +571,14 @@ void GLMesh_LoadVertexBuffers (void) if (!gl_glsl_alias_able) return; - + for (j = 1; j < MAX_MODELS; j++) { if (!(m = cl.model_precache[j])) break; if (m->type != mod_alias) continue; hdr = (const aliashdr_t *) Mod_Extradata (m); - + GLMesh_LoadVertexBuffer (m, hdr); } } @@ -594,21 +594,21 @@ void GLMesh_DeleteVertexBuffers (void) { int32_t j; qmodel_t *m; - + if (!gl_glsl_alias_able) return; - + for (j = 1; j < MAX_MODELS; j++) { if (!(m = cl.model_precache[j])) break; if (m->type != mod_alias) continue; - + GL_DeleteBuffersFunc (1, &m->meshvbo); m->meshvbo = 0; GL_DeleteBuffersFunc (1, &m->meshindexesvbo); m->meshindexesvbo = 0; } - + GL_ClearBufferBindings (); } diff --git a/source/gl_rmain.c b/source/gl_rmain.c index 506b3d2..917dcf8 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -209,7 +209,7 @@ void GLSLGamma_GammaCorrect (void) r_gamma_texture_width = TexMgr_Pad(r_gamma_texture_width); r_gamma_texture_height = TexMgr_Pad(r_gamma_texture_height); } - + glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, r_gamma_texture_width, r_gamma_texture_height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -224,7 +224,7 @@ void GLSLGamma_GammaCorrect (void) Sys_Error("GLSLGamma_CreateShaders failed"); } } - + // copy the framebuffer to the texture GL_DisableMultitexture(); glBindTexture (GL_TEXTURE_2D, r_gamma_texture); @@ -254,9 +254,9 @@ void GLSLGamma_GammaCorrect (void) glTexCoord2f (0, tmax); glVertex2f (-1, 1); glEnd (); - + GL_UseProgramFunc (0); - + // clear cached binding GL_ClearBindings (); } @@ -960,7 +960,7 @@ void R_ScaleView_DeleteTexture (void) R_ScaleView The r_scale cvar allows rendering the 3D view at 1/2, 1/3, or 1/4 resolution. -This function scales the reduced resolution 3D view back up to fill +This function scales the reduced resolution 3D view back up to fill r_refdef.vrect. This is for emulating a low-resolution pixellated look, or possibly as a perforance boost on slow graphics cards. ================ @@ -1127,7 +1127,7 @@ void R_RenderView (void) (int32_t)cl.viewangles[YAW], (int32_t)cl.viewangles[ROLL]); else if (r_speeds.value == 2) - Con_Printf ("%3i ms %4i/%4i wpoly %4i/%4i epoly %3i lmap %4i/%4i sky %1.1f mtex\n", + Con_Printf ("%3" PRIi32 " ms %4" PRIi32 "/%4" PRIi32 " wpoly %4" PRIi32 "/%4" PRIi32 " epoly %3" PRIi32 " lmap %4" PRIi32 "%4" PRIi32 "sky %1.1f mtex\n", (int32_t)((time2-time1)*1000), rs_brushpolys, rs_brushpasses, @@ -1138,7 +1138,7 @@ void R_RenderView (void) rs_skypasses, TexMgr_FrameUsage ()); else if (r_speeds.value) - Con_Printf ("%3i ms %4i wpoly %4i epoly %3i lmap\n", + Con_Printf ("%3" PRIi32 " ms %4" PRIi32 " wpoly %4" PRIi32 " epoly %3" PRIi32 " lmap\n", (int32_t)((time2-time1)*1000), rs_brushpolys, rs_aliaspolys, diff --git a/source/gl_screen.c b/source/gl_screen.c index bb39f33..b1bb3cf 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -531,25 +531,25 @@ void SCR_DrawDevStats (void) sprintf (str, "---------+---------"); Draw_String (x, (y++)*8-x, str); - sprintf (str, "Edicts |%4i %4i", dev_stats.edicts, dev_peakstats.edicts); + sprintf (str, "Edicts |%4" PRIi32 " %4" PRIi32 "", dev_stats.edicts, dev_peakstats.edicts); Draw_String (x, (y++)*8-x, str); - sprintf (str, "Packet |%4i %4i", dev_stats.packetsize, dev_peakstats.packetsize); + sprintf (str, "Packet |%4" PRIi32 " %4" PRIi32 "", dev_stats.packetsize, dev_peakstats.packetsize); Draw_String (x, (y++)*8-x, str); - sprintf (str, "Visedicts|%4i %4i", dev_stats.visedicts, dev_peakstats.visedicts); + sprintf (str, "Visedicts|%4" PRIi32 " %4" PRIi32 "", dev_stats.visedicts, dev_peakstats.visedicts); Draw_String (x, (y++)*8-x, str); - sprintf (str, "Efrags |%4i %4i", dev_stats.efrags, dev_peakstats.efrags); + sprintf (str, "Efrags |%4" PRIi32 " %4" PRIi32 "", dev_stats.efrags, dev_peakstats.efrags); Draw_String (x, (y++)*8-x, str); - sprintf (str, "Dlights |%4i %4i", dev_stats.dlights, dev_peakstats.dlights); + sprintf (str, "Dlights |%4" PRIi32 " %4" PRIi32 "", dev_stats.dlights, dev_peakstats.dlights); Draw_String (x, (y++)*8-x, str); - sprintf (str, "Beams |%4i %4i", dev_stats.beams, dev_peakstats.beams); + sprintf (str, "Beams |%4" PRIi32 " %4" PRIi32 "", dev_stats.beams, dev_peakstats.beams); Draw_String (x, (y++)*8-x, str); - sprintf (str, "Tempents |%4i %4i", dev_stats.tempents, dev_peakstats.tempents); + sprintf (str, "Tempents |%4" PRIi32 " %4" PRIi32 "", dev_stats.tempents, dev_peakstats.tempents); Draw_String (x, (y++)*8-x, str); } @@ -811,7 +811,7 @@ void SCR_ScreenShot_f (void) // find a file name to save it to for (i=0; i<10000; i++) { - q_snprintf (imagename, sizeof(imagename), "spasm%04i.%s", i, ext); // "fitz%04i.tga" + q_snprintf (imagename, sizeof(imagename), "quake%04" PRIi32 ".%s", i, ext); q_snprintf (checkname, sizeof(checkname), "%s/%s", com_gamedir, imagename); if (Sys_FileTime(checkname) == -1) break; // file doesn't exist diff --git a/source/gl_texmgr.c b/source/gl_texmgr.c index e70bf2a..d17b232 100644 --- a/source/gl_texmgr.c +++ b/source/gl_texmgr.c @@ -82,7 +82,7 @@ static void TexMgr_DescribeTextureModes_f (void) int32_t i; for (i = 0; i < NUM_GLMODES; i++) - Con_SafePrintf (" %2i: %s\n", i + 1, glmodes[i].name); + Con_SafePrintf (" %2" PRIi32 ": %s\n", i + 1, glmodes[i].name); Con_Printf ("%" PRIi32 " modes\n", i); } @@ -212,7 +212,7 @@ static void TexMgr_Imagelist_f (void) for (glt = active_gltextures; glt; glt = glt->next) { - Con_SafePrintf (" %4i x%4i %s\n", glt->width, glt->height, glt->name); + Con_SafePrintf (" %4" PRIi32 " x%4" PRIi32 " %s\n", glt->width, glt->height, glt->name); if (glt->flags & TEXPREF_MIPMAP) texels += glt->width * glt->height * 4.0f / 3.0f; else diff --git a/source/gl_vidsdl.c b/source/gl_vidsdl.c index 4548980..b27c899 100644 --- a/source/gl_vidsdl.c +++ b/source/gl_vidsdl.c @@ -1296,7 +1296,7 @@ static void VID_DescribeModes_f (void) { if (count > 0) Con_SafePrintf ("\n"); - Con_SafePrintf (" %4i x %4i x %" PRIi32 " : %" PRIi32 "", modelist[i].width, modelist[i].height, modelist[i].bpp, modelist[i].refreshrate); + Con_SafePrintf (" %4" PRIi32 " x %4" PRIi32 " 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; diff --git a/source/host.c b/source/host.c index c8827b2..25e2867 100644 --- a/source/host.c +++ b/source/host.c @@ -513,7 +513,7 @@ void Host_ShutdownServer(bool crash) MSG_WriteByte(&buf, svc_disconnect); count = NET_SendToAll(&buf, 5.0); if (count) - Con_Printf("Host_ShutdownServer: NET_SendToAll failed for %u clients\n", count); + Con_Printf("Host_ShutdownServer: NET_SendToAll failed for %" PRIu32 " clients\n", count); for (i = 0, host_client = svs.clients; i < svs.maxclients; i++, host_client++) if (host_client->active) @@ -754,7 +754,7 @@ void _Host_Frame (float time) time3 = Sys_DoubleTime (); pass2 = (time2 - time1)*1000; pass3 = (time3 - time2)*1000; - Con_Printf ("%3i tot %3i server %3i gfx %3i snd\n", + Con_Printf ("%3" PRIi32 " tot %3" PRIi32 " server %3" PRIi32 " gfx %3" PRIi32 " snd\n", pass1+pass2+pass3, pass1, pass2, pass3); } @@ -795,7 +795,7 @@ void Host_Frame (float time) c++; } - Con_Printf ("serverprofile: %2i clients %2i msec\n", c, m); + Con_Printf ("serverprofile: %2" PRIi32 " clients %2" PRIi32 " msec\n", c, m); } /* diff --git a/source/host_cmd.c b/source/host_cmd.c index 8f33f1e..e3503ef 100644 --- a/source/host_cmd.c +++ b/source/host_cmd.c @@ -464,7 +464,7 @@ void Host_Status_f (void) } else hours = 0; - print_fn ("#%-2u %-16.16s %3i %2i:%02i:%02i\n", j+1, client->name, (int32_t)client->edict->v.frags, hours, minutes, seconds); + print_fn ("#%-2" PRIu32 " %-16.16s %3" PRIi32 " %2" PRIi32 ":%02" PRIi32 ":%02" PRIi32 "n", j+1, client->name, (int32_t)client->edict->v.frags, hours, minutes, seconds); print_fn (" %s\n", NET_QSocketGetAddressString(client->netconnection)); } } @@ -758,7 +758,7 @@ void Host_Ping_f (void) for (j = 0; j < NUM_PING_TIMES; j++) total+=client->ping_times[j]; total /= NUM_PING_TIMES; - SV_ClientPrintf ("%4i %s\n", (int32_t)(total*1000), client->name); + SV_ClientPrintf ("%4" PRIi32 " %s\n", (int32_t)(total*1000), client->name); } } @@ -1004,7 +1004,7 @@ void Host_SavegameComment (char *text) for (i = 0; i < SAVEGAME_COMMENT_LENGTH; i++) text[i] = ' '; memcpy (text, cl.levelname, q_min(strlen(cl.levelname),22)); //johnfitz -- only copy 22 chars. - sprintf (kills,"kills:%3i/%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]); + sprintf (kills,"kills:%3" PRIi32 "/%3" PRIi32 "", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]); memcpy (text+22, kills, strlen(kills)); // convert space to _ to make stdio happy for (i = 0; i < SAVEGAME_COMMENT_LENGTH; i++) diff --git a/source/lodepng.h b/source/lodepng.h index 13230a4..dbbe8bf 100644 --- a/source/lodepng.h +++ b/source/lodepng.h @@ -1553,7 +1553,7 @@ int32_t main(int32_t argc, char *argv[]) error = lodepng_decode32_file(&image, &width, &height, filename); - if(error) printf("decoder error %u: %s\n", error, lodepng_error_text(error)); + if(error) printf("decoder error %" PRIu32 ": %s\n", error, lodepng_error_text(error)); / * use image here * / diff --git a/source/menu.c b/source/menu.c index 5db1530..55e36c9 100644 --- a/source/menu.c +++ b/source/menu.c @@ -1738,7 +1738,7 @@ void M_Menu_LanConfig_f (void) if (StartingGame && lanConfig_cursor == 2) lanConfig_cursor = 1; lanConfig_port = DEFAULTnet_hostport; - sprintf(lanConfig_portname, "%u", lanConfig_port); + sprintf(lanConfig_portname, "%" PRIu32 "", lanConfig_port); m_return_onerror = false; m_return_reason[0] = 0; @@ -1891,7 +1891,7 @@ void M_LanConfig_Key (int32_t key) l = lanConfig_port; else lanConfig_port = l; - sprintf(lanConfig_portname, "%u", lanConfig_port); + sprintf(lanConfig_portname, "%" PRIu32 "", lanConfig_port); } @@ -2364,7 +2364,7 @@ void M_GameOptions_Key (int32_t key) if (sv.active) Cbuf_AddText ("disconnect\n"); Cbuf_AddText ("listen 0\n"); // so host_netport will be re-examined - Cbuf_AddText ( va ("maxplayers %u\n", maxplayers) ); + Cbuf_AddText ( va ("maxplayers %" PRIu32 "\n", maxplayers) ); SCR_BeginLoadingPlaque (); if (hipnotic) diff --git a/source/net_dgrm.c b/source/net_dgrm.c index 4e9f242..fff85d4 100644 --- a/source/net_dgrm.c +++ b/source/net_dgrm.c @@ -140,7 +140,7 @@ int32_t Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data) Sys_Error("Datagram_SendMessage: zero length message\n"); if (data->cursize > NET_MAXMESSAGE) - Sys_Error("Datagram_SendMessage: message too big %u\n", data->cursize); + Sys_Error("Datagram_SendMessage: message too big %" PRIu32 "\n", data->cursize); if (sock->canSend == false) Sys_Error("SendMessage: called with canSend == false\n"); @@ -267,7 +267,7 @@ int32_t Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data) Sys_Error("Datagram_SendUnreliableMessage: zero length message\n"); if (data->cursize > MAX_DATAGRAM) - Sys_Error("Datagram_SendUnreliableMessage: message too big %u\n", data->cursize); + Sys_Error("Datagram_SendUnreliableMessage: message too big %" PRIu32 "\n", data->cursize); #endif packetLen = NET_HEADERSIZE + data->cursize; @@ -350,7 +350,7 @@ int32_t Datagram_GetMessage (qsocket_t *sock) { count = sequence - sock->unreliableReceiveSequence; droppedDatagrams += count; - Con_DPrintf("Dropped %u datagram(s)\n", count); + Con_DPrintf("Dropped %" PRIu32 " datagram(s)\n", count); } sock->unreliableReceiveSequence = sequence + 1; @@ -436,9 +436,9 @@ int32_t Datagram_GetMessage (qsocket_t *sock) static void PrintStats(qsocket_t *s) { - Con_Printf("canSend = %4u \n", s->canSend); - Con_Printf("sendSeq = %4u ", s->sendSequence); - Con_Printf("recvSeq = %4u \n", s->receiveSequence); + Con_Printf("canSend = %4" PRIu32 " \n", s->canSend); + Con_Printf("sendSeq = %4" PRIu32 " ", s->sendSequence); + Con_Printf("recvSeq = %4" PRIu32 " \n", s->receiveSequence); Con_Printf("\n"); } @@ -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:%" PRIi32 " %" PRIi32 " time:%" PRIi32 "\n %s\n", name, frags, colors >> 4, colors & 0x0f, connectTime / 60, address); + Con_Printf("%s\n frags:%3" PRIi32 " 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 73eab43..2ff1579 100644 --- a/source/net_main.c +++ b/source/net_main.c @@ -268,7 +268,7 @@ static void PrintSlist(void) for (n = slistLastShown; n < hostCacheCount; n++) { if (hostcache[n].maxusers) - Con_Printf("%-15.15s %-15.15s %2u/%2u\n", hostcache[n].name, hostcache[n].map, hostcache[n].users, hostcache[n].maxusers); + Con_Printf("%-15.15s %-15.15s %2" PRIu32 "/%2" PRIu32 "\n", hostcache[n].name, hostcache[n].map, hostcache[n].users, hostcache[n].maxusers); else Con_Printf("%-15.15s %-15.15s\n", hostcache[n].name, hostcache[n].map); } @@ -337,7 +337,7 @@ const char *NET_SlistPrintServer (int32_t idx) if (hostcache[idx].maxusers) { - q_snprintf(string, sizeof(string), "%-15.15s %-15.15s %2u/%2u\n", + q_snprintf(string, sizeof(string), "%-15.15s %-15.15s %2" PRIu32 "/%2" PRIu32 "\n", hostcache[idx].name, hostcache[idx].map, hostcache[idx].users, hostcache[idx].maxusers); } diff --git a/source/pr_edict.c b/source/pr_edict.c index c0c14f5..1219ba2 100644 --- a/source/pr_edict.c +++ b/source/pr_edict.c @@ -638,11 +638,11 @@ static void ED_Count (void) step++; } - Con_Printf ("num_edicts:%3i\n", sv.num_edicts); - Con_Printf ("active :%3i\n", active); - Con_Printf ("view :%3i\n", models); - Con_Printf ("touch :%3i\n", solid); - Con_Printf ("step :%3i\n", step); + Con_Printf ("num_edicts:%3" PRIi32 "\n", sv.num_edicts); + Con_Printf ("active :%3" PRIi32 "\n", active); + Con_Printf ("view :%3" PRIi32 "\n", models); + Con_Printf ("touch :%3" PRIi32 "\n", solid); + Con_Printf ("step :%3" PRIi32 "\n", step); } diff --git a/source/pr_exec.c b/source/pr_exec.c index f87e603..605f017 100644 --- a/source/pr_exec.c +++ b/source/pr_exec.c @@ -239,7 +239,7 @@ void PR_Profile_f (void) if (best) { if (num < 10) - Con_Printf("%7i %s\n", best->profile, PR_GetString(best->s_name)); + Con_Printf("%7" PRIi32 " %s\n", best->profile, PR_GetString(best->s_name)); num++; best->profile = 0; } diff --git a/source/r_brush.c b/source/r_brush.c index e33b4c3..dde0e6f 100644 --- a/source/r_brush.c +++ b/source/r_brush.c @@ -183,17 +183,17 @@ void R_DrawSequentialPoly (msurface_t *s) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glColor4f(1, 1, 1, entalpha); } - + if (s->flags & SURF_DRAWFENCE) glEnable (GL_ALPHA_TEST); // Flip on alpha test - + GL_Bind (t->gltexture); DrawGLPoly (s->polys); rs_brushpasses++; - + if (s->flags & SURF_DRAWFENCE) glDisable (GL_ALPHA_TEST); // Flip alpha test back off - + if (entalpha < 1) { glDepthMask(GL_TRUE); @@ -317,10 +317,10 @@ void R_DrawSequentialPoly (msurface_t *s) } else glColor3f(1, 1, 1); - + if (s->flags & SURF_DRAWFENCE) glEnable (GL_ALPHA_TEST); // Flip on alpha test - + if (gl_overbright.value) { if (gl_texture_env_combine && gl_mtexable) //case 1: texture and lightmap in one pass, overbright using texture combiners @@ -481,10 +481,10 @@ void R_DrawSequentialPoly (msurface_t *s) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glColor3f(1, 1, 1); } - + if (s->flags & SURF_DRAWFENCE) glDisable (GL_ALPHA_TEST); // Flip alpha test back off - + fullbrights: if (gl_fullbrights.value && t->fullbright) { @@ -938,7 +938,7 @@ void GL_BuildLightmaps (void) lightmap_rectchange[i].h = 0; //johnfitz -- use texture manager - sprintf(name, "lightmap%03i",i); + sprintf(name, "lightmap%03" PRIi32 "",i); data = lightmaps+i*BLOCK_WIDTH*BLOCK_HEIGHT*lightmap_bytes; lightmap_textures[i] = TexMgr_LoadImage (cl.worldmodel, name, BLOCK_WIDTH, BLOCK_HEIGHT, SRC_LIGHTMAP, data, "", (src_offset_t)data, TEXPREF_LINEAR | TEXPREF_NOPICMIP); @@ -993,7 +993,7 @@ void GL_BuildBModelVertexBuffer (void) // ask GL for a name for our VBO GL_DeleteBuffersFunc (1, &gl_bmodel_vbo); GL_GenBuffersFunc (1, &gl_bmodel_vbo); - + // count all verts in all models numverts = 0; for (j=1 ; jsurfaces[i].numedges; } } - + // build vertex array varray_bytes = VERTEXSIZE * sizeof(float) * numverts; varray = (float *) malloc (varray_bytes); varray_index = 0; - + for (j=1 ; jfrags, s->name); + sprintf (&scoreboardtext[i][1], "%3" PRIi32 " %s", s->frags, s->name); top = s->colors & 0xf0; bottom = (s->colors & 15) <<4; @@ -672,7 +672,7 @@ void Sbar_DrawInventory (void) { val = cl.stats[STAT_SHELLS+i]; val = (val < 0)? 0 : q_min(999,val);//johnfitz -- cap displayed value to 999 - sprintf (num, "%3i", val); + sprintf (num, "%3" PRIi32 "", val); if (num[0] != ' ') Sbar_DrawCharacter ( (6*i+1)*8 + 2, -24, 18 + num[0] - '0'); if (num[1] != ' ') @@ -804,7 +804,7 @@ void Sbar_DrawFrags (void) Draw_Fill (x + 10, 5, 28, 3, color, 1); // number - sprintf (num, "%3i", s->frags); + sprintf (num, "%3" PRIi32 "", s->frags); Sbar_DrawCharacter (x + 12, -24, num[0]); Sbar_DrawCharacter (x + 20, -24, num[1]); Sbar_DrawCharacter (x + 28, -24, num[2]); @@ -857,7 +857,7 @@ void Sbar_DrawFace (void) // draw number f = s->frags; - sprintf (num, "%3i",f); + sprintf (num, "%3" PRIi32 "",f); if (top == 8) { @@ -1143,7 +1143,7 @@ void Sbar_DeathmatchOverlay (void) // draw number f = s->frags; - sprintf (num, "%3i",f); + sprintf (num, "%3" PRIi32 "",f); Draw_Character ( x+8 , y, num[0]); //johnfitz -- stretched overlays Draw_Character ( x+16 , y, num[1]); //johnfitz -- stretched overlays @@ -1152,24 +1152,6 @@ void Sbar_DeathmatchOverlay (void) if (k == cl.viewentity - 1) Draw_Character ( x - 8, y, 12); //johnfitz -- stretched overlays -#if 0 -{ - int32_t total; - int32_t n, minutes, tens, units; - - // draw time - total = cl.completed_time - s->entertime; - minutes = (int32_t)total/60; - n = total - minutes*60; - tens = n/10; - units = n%10; - - sprintf (num, "%3i:%" PRIi32 "%" PRIi32 "", minutes, tens, units); - - M_Print ( x+48 , y, num); //johnfitz -- was Draw_String, changed for stretched overlays -} -#endif - // draw name M_Print (x+64, y, s->name); //johnfitz -- was Draw_String, changed for stretched overlays @@ -1236,7 +1218,7 @@ void Sbar_MiniDeathmatchOverlay (void) // number f = s->frags; - sprintf (num, "%3i",f); + sprintf (num, "%3" PRIi32 "",f); Draw_Character (x+ 8, y, num[0]); Draw_Character (x+16, y, num[1]); Draw_Character (x+24, y, num[2]); diff --git a/source/snd_dma.c b/source/snd_dma.c index 49042a7..26a19c0 100644 --- a/source/snd_dma.c +++ b/source/snd_dma.c @@ -106,10 +106,10 @@ static void S_SoundInfo_f (void) 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); - Con_Printf("%5d submission_chunk\n", shm->submission_chunk); - Con_Printf("%5d total_channels\n", total_channels); + Con_Printf("%5" PRIi32 " samples\n", shm->samples); + Con_Printf("%5" PRIi32 " samplepos\n", shm->samplepos); + Con_Printf("%5" PRIi32 " submission_chunk\n", shm->submission_chunk); + Con_Printf("%5" PRIi32 " total_channels\n", total_channels); Con_Printf("%p dma buffer\n", shm->buffer); } @@ -851,7 +851,6 @@ void S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) { if (ch->sfx && (ch->leftvol || ch->rightvol) ) { - // Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name); total++; } } @@ -1031,9 +1030,9 @@ static void S_SoundList (void) Con_SafePrintf ("L"); //johnfitz -- was Con_Printf else Con_SafePrintf (" "); //johnfitz -- was Con_Printf - Con_SafePrintf("(%2db) %6i : %s\n", sc->width*8, size, sfx->name); //johnfitz -- was Con_Printf + Con_SafePrintf("(%2" PRIi32 "b) %6" PRIi32 " : %s\n", sc->width*8, size, sfx->name); //johnfitz -- was Con_Printf } - Con_Printf ("%" PRIi32 " sounds, %" PRIi32 " bytes\n", num_sfx, total); //johnfitz -- added count + Con_Printf ("%" PRIi32" PRIi32 "" sou" PRIi32 "ds, %" PRIi32 " bytes\n", num_sfx, total); //johnfitz -- added count } diff --git a/source/snd_mp3.c b/source/snd_mp3.c index da72340..f41bec9 100644 --- a/source/snd_mp3.c +++ b/source/snd_mp3.c @@ -470,7 +470,7 @@ static int32_t S_MP3_CodecRewindStream (snd_stream_t *stream) MP3_BUFFER_SIZE - leftover, &stream->fh); if (bytes_read <= 0) { - Con_DPrintf("seek failure. unexpected EOF (frames=%u leftover=%u)\n", + Con_DPrintf("seek failure. unexpected EOF (frames=%" PRIu32 " leftover=%" PRIu32 ")\n", p->frame_count, leftover); break; } diff --git a/source/snd_sdl.c b/source/snd_sdl.c index 34f74a8..872d4cb 100644 --- a/source/snd_sdl.c +++ b/source/snd_sdl.c @@ -118,7 +118,7 @@ bool SNDDMA_Init (dma_t *dma) /* Supported */ break; default: - Con_Printf ("Unsupported audio format received (%u)\n", obtained.format); + Con_Printf ("Unsupported audio format received (%" PRIu32 ")\n", obtained.format); SDL_CloseAudio(); SDL_QuitSubSystem(SDL_INIT_AUDIO); return false; diff --git a/source/windows/net_wipx.c b/source/windows/net_wipx.c index 66fcca2..14e0211 100644 --- a/source/windows/net_wipx.c +++ b/source/windows/net_wipx.c @@ -304,7 +304,7 @@ const char *WIPX_AddrToString (struct qsockaddr *addr) { static char buf[28]; - sprintf(buf, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%u", + sprintf(buf, "%02x%02x%02x%02x:%02x%02x%02x%02x%02x%02x:%" PRIu32 "", ((struct sockaddr_ipx *)addr)->sa_netnum[0] & 0xff, ((struct sockaddr_ipx *)addr)->sa_netnum[1] & 0xff, ((struct sockaddr_ipx *)addr)->sa_netnum[2] & 0xff, @@ -351,7 +351,7 @@ int32_t WIPX_StringToAddr (const char *string, struct qsockaddr *addr) DO(19, sa_nodenum[5]); #undef DO - sscanf (&string[22], "%u", &val); + sscanf (&string[22], "%" PRIu32 "", &val); ((struct sockaddr_ipx *)addr)->sa_socket = htons((uint16_t)val); return 0; @@ -394,12 +394,12 @@ int32_t WIPX_GetAddrFromName (const char *name, struct qsockaddr *addr) if (n == 12) { - sprintf(buf, "00000000:%s:%u", name, net_hostport); + sprintf(buf, "00000000:%s:%" PRIu32 "", name, net_hostport); return WIPX_StringToAddr (buf, addr); } if (n == 21) { - sprintf(buf, "%s:%u", name, net_hostport); + sprintf(buf, "%s:%" PRIu32 "", name, net_hostport); return WIPX_StringToAddr (buf, addr); } if (n > 21 && n <= 27) diff --git a/source/zone.c b/source/zone.c index 7146b5b..e5ee78a 100644 --- a/source/zone.c +++ b/source/zone.c @@ -267,7 +267,7 @@ void Z_Print (memzone_t *zone) for (block = zone->blocklist.next ; ; block = block->next) { - Con_Printf ("block:%p size:%7i tag:%3i\n", + Con_Printf ("block:%p size:%7" PRIi32 " tag:%3" PRIi32 "\n", block, block->size, block->tag); if (block->next == &zone->blocklist) @@ -348,7 +348,7 @@ void Hunk_Print (bool all) starthigh = (hunk_t *)(hunk_base + hunk_size - hunk_high_used); endhigh = (hunk_t *)(hunk_base + hunk_size); - Con_Printf (" :%8i total hunk size\n", hunk_size); + Con_Printf (" :%8" PRIi32 " total hunk size\n", hunk_size); Con_Printf ("-------------------------\n"); while (1) @@ -359,7 +359,7 @@ void Hunk_Print (bool all) if ( h == endlow ) { Con_Printf ("-------------------------\n"); - Con_Printf (" :%8i REMAINING\n", hunk_size - hunk_low_used - hunk_high_used); + Con_Printf (" :%8" PRIi32 " REMAINING\n", hunk_size - hunk_low_used - hunk_high_used); Con_Printf ("-------------------------\n"); h = starthigh; } @@ -388,7 +388,7 @@ void Hunk_Print (bool all) // memcpy (name, h->name, HUNKNAME_LEN); if (all) - Con_Printf ("%8p :%8i %8s\n",h, h->size, name); + Con_Printf ("%8p :%8" PRIi32 " %8s\n",h, h->size, name); // // print the total @@ -397,7 +397,7 @@ void Hunk_Print (bool all) strncmp (h->name, next->name, HUNKNAME_LEN - 1)) { if (!all) - Con_Printf (" :%8i %8s (TOTAL)\n",sum, name); + Con_Printf (" :%8" PRIi32 " %8s (TOTAL)\n",sum, name); count = 0; sum = 0; } @@ -406,7 +406,7 @@ void Hunk_Print (bool all) } Con_Printf ("-------------------------\n"); - Con_Printf ("%8i total blocks\n", totalblocks); + Con_Printf ("%8" PRIi32 " total blocks\n", totalblocks); } @@ -812,7 +812,7 @@ void Cache_Print (void) for (cd = cache_head.next ; cd != &cache_head ; cd = cd->next) { - Con_Printf ("%8i : %s\n", cd->size, cd->name); + Con_Printf ("%8" PRIi32 " : %s\n", cd->size, cd->name); } }