enable gcc format checking to our printf style functions and clean up the repercussions (suprisingly few).

This commit is contained in:
Bill Currie 2000-05-06 06:28:17 +00:00
parent 03391673eb
commit 0599bb29a7
5 changed files with 13 additions and 3 deletions

View file

@ -177,7 +177,11 @@ void COM_StripExtension (char *in, char *out);
void COM_FileBase (char *in, char *out);
void COM_DefaultExtension (char *path, char *extension);
#ifdef __GNUC__
char *va(char *format, ...) __attribute__((format (printf, 1, 2)));
#else
char *va(char *format, ...);
#endif
// does a varargs printf into a temp buffer

View file

@ -62,9 +62,15 @@ void Con_CheckResize (void);
void Con_Init (void);
void Con_DrawConsole (int lines);
void Con_Print (char *txt);
#ifdef __GNUC__
void Con_Printf (char *fmt, ...) __attribute__((format (printf, 1, 2)));
void Con_DPrintf (char *fmt, ...) __attribute__((format (printf, 1, 2)));
void Con_SafePrintf (char *fmt, ...) __attribute__((format (printf, 1, 2)));
#else
void Con_Printf (char *fmt, ...);
void Con_DPrintf (char *fmt, ...);
void Con_SafePrintf (char *fmt, ...);
#endif
void Con_Clear_f (void);
void Con_DrawNotify (void);
void Con_ClearNotify (void);

View file

@ -595,7 +595,7 @@ R_SetupAliasBlendedFrame (int frame, aliashdr_t *paliashdr, entity_t *e)
{
e->frame_interval = paliashdr->frames[frame].interval;
pose += (int)(cl.time / e->frame_interval) % numposes;
Con_DPrintf ("0x%x\n", e);
Con_DPrintf ("%p\n", e);
Con_DPrintf ("1st: pose = %i pose2 = %i pose1 = %i\n",
pose, e->pose2, e->pose1);
} else

View file

@ -248,7 +248,7 @@ qboolean SNDDMA_Init(void)
Con_Printf("%5d samplebits\n", shm->samplebits);
Con_Printf("%5d submission_chunk\n", shm->submission_chunk);
Con_Printf("%5d speed\n", shm->speed);
Con_Printf("0x%x dma buffer\n", shm->buffer);
Con_Printf("0x%x dma buffer\n", (int)shm->buffer);
Con_Printf("%5d total_channels\n", total_channels);
snd_inited=1;

View file

@ -144,7 +144,7 @@ void S_SoundInfo_f(void)
Con_Printf("%5d samplebits\n", shm->samplebits);
Con_Printf("%5d submission_chunk\n", shm->submission_chunk);
Con_Printf("%5d speed\n", shm->speed);
Con_Printf("0x%x dma buffer\n", shm->buffer);
Con_Printf("0x%x dma buffer\n", (int)shm->buffer);
Con_Printf("%5d total_channels\n", total_channels);
}