DWORD dwReturn;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD_PTR)NULL)))
- Con_Printf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn);
+ Con_Printf("MCI_SET_DOOR_OPEN failed (%x)\n", (unsigned)dwReturn);
}
DWORD dwReturn;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD_PTR)NULL)))
- Con_Printf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn);
+ Con_Printf("MCI_SET_DOOR_CLOSED failed (%x)\n", (unsigned)dwReturn);
}
int CDAudio_SysGetAudioDiskInfo(void)
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%x)\n", (unsigned)dwReturn);
return -1;
}
if (mciStatusParms.dwReturn != MCI_CDA_TRACK_AUDIO)
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%x)\n", (unsigned)dwReturn);
return -1;
}
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD_PTR)(LPVOID) &mciPlayParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysPlay: MCI_PLAY failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysPlay: MCI_PLAY failed (%x)\n", (unsigned)dwReturn);
return -1;
}
if ((dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD_PTR)NULL)))
{
- Con_Printf("MCI_STOP failed (%i)\n", dwReturn);
+ Con_Printf("MCI_STOP failed (%x)\n", (unsigned)dwReturn);
return -1;
}
return 0;
mciGenericParms.dwCallback = (DWORD_PTR)mainwindow;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD_PTR)(LPVOID) &mciGenericParms)))
{
- Con_Printf("MCI_PAUSE failed (%i)\n", dwReturn);
+ Con_Printf("MCI_PAUSE failed (%x)\n", (unsigned)dwReturn);
return -1;
}
return 0;
dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD_PTR)(LPVOID) &mciPlayParms);
if (dwReturn)
{
- Con_Printf("CDAudio_SysResume: MCI_PLAY failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysResume: MCI_PLAY failed (%x)\n", (unsigned)dwReturn);
return -1;
}
return 0;
mciOpenParms.lpstrDeviceType = "cdaudio";
if ((dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD_PTR) (LPVOID) &mciOpenParms)))
{
- Con_Printf("CDAudio_SysStartup: MCI_OPEN failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysStartup: MCI_OPEN failed (%x)\n", (unsigned)dwReturn);
return -1;
}
wDeviceID = mciOpenParms.wDeviceID;
mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD_PTR)(LPVOID) &mciSetParms)))
{
- Con_Printf("CDAudio_SysStartup: MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn);
+ Con_Printf("CDAudio_SysStartup: MCI_SET_TIME_FORMAT failed (%x)\n", (unsigned)dwReturn);
mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD_PTR)NULL);
return -1;
}
if (strchr(key, '\"') || strchr(value, '\"') || (!allowstarkey && key[0] == '*') || (!allowmodel && (!strcasecmp(key, "pmodel") || !strcasecmp(key, "emodel"))))
{
if (!quiet)
- Con_Printf("Can't setinfo \"%s\" \"%s\"\n");
+ Con_Printf("Can't setinfo \"%s\" \"%s\"\n", key, value);
return;
}
InfoString_SetValue(cls.userinfo, sizeof(cls.userinfo), key, value);
if (nummodels==MAX_MODELS)
Host_Error("Server sent too many model precaches");
if (strlen(str) >= MAX_QPATH)
- Host_Error("Server sent a precache name of %i characters (max %i)", strlen(str), MAX_QPATH - 1);
+ Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
strlcpy(cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
}
if (numsounds==MAX_SOUNDS)
Host_Error("Server sent too many sound precaches");
if (strlen(str) >= MAX_QPATH)
- Host_Error("Server sent a precache name of %i characters (max %i)", strlen(str), MAX_QPATH - 1);
+ Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
strlcpy(cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
}
if (nummodels==MAX_MODELS)
Host_Error ("Server sent too many model precaches");
if (strlen(str) >= MAX_QPATH)
- Host_Error ("Server sent a precache name of %i characters (max %i)", strlen(str), MAX_QPATH - 1);
+ Host_Error ("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
strlcpy (cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
}
// parse sound precache list
if (numsounds==MAX_SOUNDS)
Host_Error("Server sent too many sound precaches");
if (strlen(str) >= MAX_QPATH)
- Host_Error("Server sent a precache name of %i characters (max %i)", strlen(str), MAX_QPATH - 1);
+ Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
strlcpy (cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
}
void COM_Shutdown (void);
void COM_InitGameType (void);
-char *va(const char *format, ...);
+char *va(const char *format, ...) DP_FUNC_PRINTF(1);
// does a varargs printf into a temp buffer
// return the number of printed characters, excluding the final '\0'
// or return -1 if the buffer isn't big enough to contain the entire string.
// buffer is ALWAYS null-terminated
-extern int dpsnprintf (char *buffer, size_t buffersize, const char *format, ...);
+extern int dpsnprintf (char *buffer, size_t buffersize, const char *format, ...) DP_FUNC_PRINTF(3);
extern int dpvsnprintf (char *buffer, size_t buffersize, const char *format, va_list args);
// A bunch of functions are forbidden for security reasons (and also to please MSVS 2005, for some of them)
file = FS_Open(Cmd_Argv(1), "wb", false, false);
if (!file)
{
- Con_Printf("condump: unable to write file \"%s\"\n", file);
+ Con_Printf("condump: unable to write file \"%s\"\n", Cmd_Argv(1));
return;
}
// iterate over the entire console history buffer line by line
void Con_Init_Commands (void);
void Con_DrawConsole (int lines);
void Con_Print(const char *txt);
-void Con_Printf(const char *fmt, ...);
+void Con_Printf(const char *fmt, ...) DP_FUNC_PRINTF(1);
void Con_DPrint(const char *msg);
-void Con_DPrintf(const char *fmt, ...);
+void Con_DPrintf(const char *fmt, ...) DP_FUNC_PRINTF(1);
void Con_Clear_f (void);
void Con_DrawNotify (void);
void Con_ClearNotify (void);
void Log_Close (void);
void Log_Start (void);
-void Log_Printf(const char *logfilename, const char *fmt, ...);
+void Log_Printf(const char *logfilename, const char *fmt, ...) DP_FUNC_PRINTF(2);
#endif
}
}
+void CL_VM_Error (const char *format, ...) DP_FUNC_PRINTF(1);
void CL_VM_Error (const char *format, ...) //[515]: hope it will be never executed =)
{
char errorstring[4096];
if (lseek (pack->handle, pfile->offset, SEEK_SET) == -1)
{
Con_Printf ("FS_OpenPackedFile: can't lseek to %s in %s (offset: %d)\n",
- pfile->name, pack->filename, pfile->offset);
+ pfile->name, pack->filename, (int) pfile->offset);
return NULL;
}
fs_offset_t FS_Write (qfile_t* file, const void* data, size_t datasize);
fs_offset_t FS_Read (qfile_t* file, void* buffer, size_t buffersize);
int FS_Print(qfile_t* file, const char *msg);
-int FS_Printf(qfile_t* file, const char* format, ...);
+int FS_Printf(qfile_t* file, const char* format, ...) DP_FUNC_PRINTF(2);
int FS_VPrintf(qfile_t* file, const char* format, va_list ap);
int FS_Getc (qfile_t* file);
int FS_UnGetc (qfile_t* file, unsigned char c);
unsigned int numelements = numtriangles * 3;
if (numvertices < 3 || numtriangles < 1)
{
- Con_Printf("R_Mesh_Draw(%d, %d, %d, %08p);\n", firstvertex, numvertices, numtriangles, elements);
+ Con_Printf("R_Mesh_Draw(%d, %d, %d, %8p);\n", firstvertex, numvertices, numtriangles, elements);
return;
}
CHECKGLERROR
size = width * height * depth * sides * texinfo->inputbytesperpixel;
if (size < 1)
{
- Con_Printf ("R_LoadTexture: bogus texture size (%dx%dx%dx%dbppx%dsides = %d bytes)\n", width, height, depth, texinfo->inputbytesperpixel * 8, sides);
+ Con_Printf ("R_LoadTexture: bogus texture size (%dx%dx%dx%dbppx%dsides = %d bytes)\n", width, height, depth, texinfo->inputbytesperpixel * 8, sides, size);
return NULL;
}
l = my_png.tmpBuflength - my_png.tmpi;
if (l < length)
{
- Con_Printf("PNG_fReadData: overrun by %i bytes\n", length - l);
+ Con_Printf("PNG_fReadData: overrun by %i bytes\n", (int)(length - l));
// a read going past the end of the file, fill in the remaining bytes
// with 0 just to be consistent
memset(data + l, 0, length - l);
void MR_SetRouting (qboolean forceold);
+void MP_Error(const char *format, ...) DP_FUNC_PRINTF(1);
void MP_Error(const char *format, ...)
{
static qboolean processingError = false;
pinmodel = (zymtype1header_t *)buffer;
pbase = (unsigned char *)buffer;
if (memcmp(pinmodel->id, "ZYMOTICMODEL", 12))
- Host_Error ("Mod_ZYMOTICMODEL_Load: %s is not a zymotic model");
+ Host_Error ("Mod_ZYMOTICMODEL_Load: %s is not a zymotic model", loadmodel->name);
if (BigLong(pinmodel->type) != 1)
Host_Error ("Mod_ZYMOTICMODEL_Load: only type 1 (skeletal pose) models are currently supported (name = %s)", loadmodel->name);
if (pheader->numtris < 1 || pheader->numverts < 3 || pheader->numshaders < 1)
{
- Con_Printf("%s has no geometry\n");
+ Con_Printf("%s has no geometry\n", loadmodel->name);
return;
}
if (pheader->numscenes < 1 || pheader->lump_poses.length < (int)sizeof(float[3][4]))
{
- Con_Printf("%s has no animations\n");
+ Con_Printf("%s has no animations\n", loadmodel->name);
return;
}
pheader = (dpmheader_t *)buffer;
pbase = (unsigned char *)buffer;
if (memcmp(pheader->id, "DARKPLACESMODEL\0", 16))
- Host_Error ("Mod_DARKPLACESMODEL_Load: %s is not a darkplaces model");
+ Host_Error ("Mod_DARKPLACESMODEL_Load: %s is not a darkplaces model", loadmodel->name);
if (BigLong(pheader->type) != 2)
Host_Error ("Mod_DARKPLACESMODEL_Load: only type 2 (hierarchical skeletal pose) models are currently supported (name = %s)", loadmodel->name);
if (pheader->num_bones < 1 || pheader->num_meshs < 1)
{
- Con_Printf("%s has no geometry\n");
+ Con_Printf("%s has no geometry\n", loadmodel->name);
return;
}
if (pheader->num_frames < 1)
{
- Con_Printf("%s has no frames\n");
+ Con_Printf("%s has no frames\n", loadmodel->name);
return;
}
pchunk = (pskchunk_t *)buffer;
if (strcmp(pchunk->id, "ACTRHEAD"))
- Host_Error ("Mod_PSKMODEL_Load: %s is not an Unreal Engine ActorX (.psk + .psa) model");
+ Host_Error ("Mod_PSKMODEL_Load: %s is not an Unreal Engine ActorX (.psk + .psa) model", loadmodel->name);
loadmodel->type = mod_alias;
loadmodel->DrawSky = NULL;
// positions from the psk, but this is hard for me to implement
// and people can easily make animations that match.
if (numanimbones != numbones)
- Host_Error("%s: this loader only supports animations with the same bones as the mesh");
+ Host_Error("%s: this loader only supports animations with the same bones as the mesh", loadmodel->name);
for (index = 0, p = (pskboneinfo_t *)animbuffer;index < numrecords;index++, p++)
{
p->numchildren = LittleLong(p->numchildren);
{
if (in == inend)
{
- Con_Printf("Mod_Q1BSP_DecompressVis: input underrun on model \"%s\" (decompressed %i of %i output bytes)\n", loadmodel->name, out - outstart, outend - outstart);
+ Con_Printf("Mod_Q1BSP_DecompressVis: input underrun on model \"%s\" (decompressed %i of %i output bytes)\n", loadmodel->name, (int)(out - outstart), (int)(outend - outstart));
return;
}
c = *in++;
{
if (in == inend)
{
- Con_Printf("Mod_Q1BSP_DecompressVis: input underrun (during zero-run) on model \"%s\" (decompressed %i of %i output bytes)\n", loadmodel->name, out - outstart, outend - outstart);
+ Con_Printf("Mod_Q1BSP_DecompressVis: input underrun (during zero-run) on model \"%s\" (decompressed %i of %i output bytes)\n", loadmodel->name, (int)(out - outstart), (int)(outend - outstart));
return;
}
for (c = *in++;c > 0;c--)
{
if (out == outend)
{
- Con_Printf("Mod_Q1BSP_DecompressVis: output overrun on model \"%s\" (decompressed %i of %i output bytes)\n", loadmodel->name, out - outstart, outend - outstart);
+ Con_Printf("Mod_Q1BSP_DecompressVis: output overrun on model \"%s\" (decompressed %i of %i output bytes)\n", loadmodel->name, (int)(out - outstart), (int)(outend - outstart));
return;
}
*out++ = 0;
else if (filesize == 8)
Con_Print("Empty .lit file, ignoring\n");
else
- Con_Printf("Corrupt .lit file (file size %i bytes, should be %i bytes), ignoring\n", filesize, 8 + l->filelen * 3);
+ Con_Printf("Corrupt .lit file (file size %i bytes, should be %i bytes), ignoring\n", (int) filesize, (int) (8 + l->filelen * 3));
if (data)
{
Mem_Free(data);
out->numleafsurfaces = LittleShort(in->nummarksurfaces);
if (out->firstleafsurface < 0 || LittleShort(in->firstmarksurface) + out->numleafsurfaces > loadmodel->brush.num_leafsurfaces)
{
- Con_Printf("Mod_Q1BSP_LoadLeafs: invalid leafsurface range %i:%i outside range %i:%i\n", out->firstleafsurface, out->firstleafsurface + out->numleafsurfaces, 0, loadmodel->brush.num_leafsurfaces);
+ Con_Printf("Mod_Q1BSP_LoadLeafs: invalid leafsurface range %i:%i outside range %i:%i\n", (int)(out->firstleafsurface - loadmodel->brush.data_leafsurfaces), (int)(out->firstleafsurface + out->numleafsurfaces - loadmodel->brush.data_leafsurfaces), 0, loadmodel->brush.num_leafsurfaces);
out->firstleafsurface = NULL;
out->numleafsurfaces = 0;
}
if (l->filelen)
{
if (l->filelen < count * (int)sizeof(*in))
- Host_Error("Mod_Q3BSP_LoadLightGrid: invalid lightgrid lump size %i bytes, should be %i bytes (%ix%ix%i)", l->filelen, count * sizeof(*in), loadmodel->brushq3.num_lightgrid_dimensions[0], loadmodel->brushq3.num_lightgrid_dimensions[1], loadmodel->brushq3.num_lightgrid_dimensions[2]);
+ Host_Error("Mod_Q3BSP_LoadLightGrid: invalid lightgrid lump size %i bytes, should be %i bytes (%ix%ix%i)", l->filelen, (int)(count * sizeof(*in)), loadmodel->brushq3.num_lightgrid_dimensions[0], loadmodel->brushq3.num_lightgrid_dimensions[1], loadmodel->brushq3.num_lightgrid_dimensions[2]);
if (l->filelen != count * (int)sizeof(*in))
- Con_Printf("Mod_Q3BSP_LoadLightGrid: Warning: calculated lightgrid size %i bytes does not match lump size %i", count * sizeof(*in), l->filelen);
+ Con_Printf("Mod_Q3BSP_LoadLightGrid: Warning: calculated lightgrid size %i bytes does not match lump size %i\n", (int)(count * sizeof(*in)), l->filelen);
out = (q3dlightgrid_t *)Mem_Alloc(loadmodel->mempool, count * sizeof(*out));
loadmodel->brushq3.data_lightgrid = out;
loadmodel->brushq3.num_lightgrid = count;
Host_Error("Mod_Q3BSP_LoadPVS: (chainlength = %i) < ((numclusters = %i) + 7) / 8", loadmodel->brush.num_pvsclusterbytes, loadmodel->brush.num_pvsclusters);
totalchains = loadmodel->brush.num_pvsclusterbytes * loadmodel->brush.num_pvsclusters;
if (l->filelen < totalchains + (int)sizeof(*in))
- Host_Error("Mod_Q3BSP_LoadPVS: lump too small ((numclusters = %i) * (chainlength = %i) + sizeof(q3dpvs_t) == %i bytes, lump is %i bytes)", loadmodel->brush.num_pvsclusters, loadmodel->brush.num_pvsclusterbytes, totalchains + sizeof(*in), l->filelen);
+ Host_Error("Mod_Q3BSP_LoadPVS: lump too small ((numclusters = %i) * (chainlength = %i) + sizeof(q3dpvs_t) == %i bytes, lump is %i bytes)", loadmodel->brush.num_pvsclusters, loadmodel->brush.num_pvsclusterbytes, (int)(totalchains + sizeof(*in)), l->filelen);
loadmodel->brush.data_pvsclusters = (unsigned char *)Mem_Alloc(loadmodel->mempool, totalchains);
memcpy(loadmodel->brush.data_pvsclusters, (unsigned char *)(in + 1), totalchains);
Con_Print("Loaded models:\n");
for (i = 0, mod = mod_known;i < mod_numknown;i++, mod++)
if (mod->name[0])
- Con_Printf("%4iK %s\n", mod->mempool ? (mod->mempool->totalsize + 1023) / 1024 : 0, mod->name);
+ Con_Printf("%4iK %s\n", mod->mempool ? (int)((mod->mempool->totalsize + 1023) / 1024) : 0, mod->name);
}
/*
ent = PRVM_G_EDICT(OFS_PARM1);
if(ent->priv.required->free)
{
- VM_Warning("VM_M_writetofile: %s: entity %i is free !\n", PRVM_NAME, PRVM_EDICT_NUM(OFS_PARM1));
+ VM_Warning("VM_M_writetofile: %s: entity %i is free !\n", PRVM_NAME, PRVM_NUM_FOR_EDICT(ent));
return;
}
{
if (conn->message.cursize > (int)sizeof(conn->sendMessage))
{
- Con_Printf("NetConn_SendUnreliableMessage: reliable message too big (%u > %u)\n", conn->message.cursize, sizeof(conn->sendMessage));
+ Con_Printf("NetConn_SendUnreliableMessage: reliable message too big (%u > %u)\n", conn->message.cursize, (int)sizeof(conn->sendMessage));
conn->message.overflowed = true;
return -1;
}
{
if (LHNETADDRESS_FromString(&tempaddress, com_argv[i + 1], 0) == 1)
{
- Con_Printf("-ip option used, setting net_address to \"%s\"\n");
+ Con_Printf("-ip option used, setting net_address to \"%s\"\n", com_argv[i + 1]);
Cvar_SetQuick(&net_address, com_argv[i + 1]);
}
else
void (*init_cmd)(void); // [INIT] used by PRVM_InitProg
void (*reset_cmd)(void); // [INIT] used by PRVM_ResetProg
- void (*error_cmd)(const char *format, ...); // [INIT]
+ void (*error_cmd)(const char *format, ...) DP_FUNC_PRINTF(1); // [INIT]
} prvm_prog_t;
int PRVM_GetProgNr(void);
-void VM_Warning(const char *fmt, ...);
+void VM_Warning(const char *fmt, ...) DP_FUNC_PRINTF(1);
// TODO: fill in the params
//void PRVM_Create();
char string[VM_STRINGTEMP_LENGTH];
VM_VarString(0, string, sizeof(string));
- Con_Printf("======OBJECT ERROR======\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+ Con_Printf("======OBJECT ERROR======\n"); // , PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string); // or include them? FIXME
if(prog->self)
{
ed = PRVM_G_EDICT (prog->self->ofs);
s = PRVM_G_STRING(OFS_PARM0);
if(!s)
- PRVM_ERROR ("VM_freepic: %s: NULL");
+ PRVM_ERROR ("VM_freepic: NULL");
VM_CheckEmptyString (s);
if (prog->progs == NULL || filesize < (fs_offset_t)sizeof(dprograms_t))
PRVM_ERROR ("PRVM_LoadProgs: couldn't load %s for %s", filename, PRVM_NAME);
- Con_DPrintf("%s programs occupy %iK.\n", PRVM_NAME, filesize/1024);
+ Con_DPrintf("%s programs occupy %iK.\n", PRVM_NAME, (int)(filesize/1024));
prog->filecrc = CRC_Block((unsigned char *)prog->progs, filesize);
{
prog->xstatement = st - prog->statements;
PRVM_Profile(1<<30, 1000000);
- PRVM_ERROR("runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", jumpcount, PRVM_NAME);
+ PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
}
}
break;
{
prog->xstatement = st - prog->statements;
PRVM_Profile(1<<30, 1000000);
- PRVM_ERROR("runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", jumpcount, PRVM_NAME);
+ PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
}
}
break;
{
prog->xstatement = st - prog->statements;
PRVM_Profile(1<<30, 1000000);
- PRVM_ERROR("runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", jumpcount, PRVM_NAME);
+ PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
}
break;
#ifndef QUAKEDEF_H
#define QUAKEDEF_H
+#ifdef __GNUC__
+#define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
+#else
+#define DP_FUNC_PRINTF(n)
+#endif
#include <sys/types.h>
#include <ctype.h>
void Host_Main(void);
void Host_Shutdown(void);
void Host_StartVideo(void);
-void Host_Error(const char *error, ...);
+void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1);
void Host_Quit_f(void);
-void Host_ClientCommands(const char *fmt, ...);
+void Host_ClientCommands(const char *fmt, ...) DP_FUNC_PRINTF(1);
void Host_ShutdownServer(void);
void Host_Reconnect_f(void);
int tris, outverts;
if (projectdistance < 0.1)
{
- Con_Printf("R_Shadow_Volume: projectdistance %f\n");
+ Con_Printf("R_Shadow_Volume: projectdistance %f\n", projectdistance);
return;
}
if (!numverts || !nummarktris)
if (strlen(sky) > 1000)
{
- Con_Printf("sky name too long (%i, max is 1000)\n", strlen(sky));
+ Con_Printf("sky name too long (%i, max is 1000)\n", (int)strlen(sky));
return false;
}
void SV_ClientThink (void);
void SV_ClientPrint(const char *msg);
-void SV_ClientPrintf(const char *fmt, ...);
+void SV_ClientPrintf(const char *fmt, ...) DP_FUNC_PRINTF(1);
void SV_BroadcastPrint(const char *msg);
-void SV_BroadcastPrintf(const char *fmt, ...);
+void SV_BroadcastPrintf(const char *fmt, ...) DP_FUNC_PRINTF(1);
void SV_Physics (void);
void SV_Physics_ClientEntity (prvm_edict_t *ent);
if (sb == NULL)
{
Con_DPrintf("SND_PaintChannel: ERROR: can't get sound buffer from sfx \"%s\"\n",
- ch->sfx->name, count);
+ ch->sfx->name); // , count); // or add this? FIXME
}
else
{
requested->speed != format.Format.nSamplesPerSec)
{
Con_Printf("DS:CreateSoundBuffer Failed (%d): channels=%u, width=%u, speed=%u\n",
- result, format.Format.nChannels, format.Format.wBitsPerSample / 8, format.Format.nSamplesPerSec);
+ (int)result, (unsigned)format.Format.nChannels, (unsigned)format.Format.wBitsPerSample / 8, (unsigned)format.Format.nSamplesPerSec);
SndSys_Shutdown ();
return SIS_FAILURE;
}
//
// system IO interface (these are the sys functions that need to be implemented in a new driver atm)
//
-void Sys_Error (const char *error, ...);
+void Sys_Error (const char *error, ...) DP_FUNC_PRINTF(1);
// an error will cause the entire program to exit
void Sys_PrintToTerminal(const char *text);
carbonError = CreateNewWindow(kDocumentWindowClass, kWindowStandardFloatingAttributes | kWindowStandardHandlerAttribute, &windowBounds, &window);
if (carbonError != noErr || window == NULL)
{
- Con_Printf("Unable to create window (error %d)\n", carbonError);
+ Con_Printf("Unable to create window (error %u)\n", (unsigned)carbonError);
return false;
}
}
default:
- Con_Printf (">> kEventClassMouse (UNKNOWN eventKind: %d) <<\n", eventKind);
+ Con_Printf (">> kEventClassMouse (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
break;
}
}
break;
default:
- Con_Printf (">> kEventClassKeyboard (UNKNOWN eventKind: %d) <<\n", eventKind);
+ Con_Printf (">> kEventClassKeyboard (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
break;
}
break;
}
case kEventClassTextInput:
- Con_Printf(">> kEventClassTextInput (%d) <<\n", eventKind);
+ Con_Printf(">> kEventClassTextInput (%d) <<\n", (int)eventKind);
break;
case kEventClassApplication:
case kEventAppActiveWindowChanged:
break;
default:
- Con_Printf(">> kEventClassApplication (UNKNOWN eventKind: %d) <<\n", eventKind);
+ Con_Printf(">> kEventClassApplication (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
break;
}
break;
case kEventAppleEvent :
break;
default:
- Con_Printf(">> kEventClassAppleEvent (UNKNOWN eventKind: %d) <<\n", eventKind);
+ Con_Printf(">> kEventClassAppleEvent (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
break;
}
break;
case kEventWindowUpdate :
break;
default:
- Con_Printf(">> kEventClassWindow (UNKNOWN eventKind: %d) <<\n", eventKind);
+ Con_Printf(">> kEventClassWindow (UNKNOWN eventKind: %u) <<\n", (unsigned)eventKind);
break;
}
break;
mainwindow = CreateWindowEx (ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL);
if (!mainwindow)
{
- Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %d, %p) failed\n", ExWindowStyle, "DarkPlacesWindowClass", gamename, WindowStyle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, global_hInstance, NULL);
+ Con_Printf("CreateWindowEx(%d, %s, %s, %d, %d, %d, %d, %d, %p, %p, %d, %p) failed\n", (int)ExWindowStyle, "DarkPlacesWindowClass", gamename, (int)WindowStyle, (int)(rect.left), (int)(rect.top), (int)(rect.right - rect.left), (int)(rect.bottom - rect.top), NULL, NULL, (int)global_hInstance, NULL);
VID_Shutdown();
return false;
}
if ((pixelformat = ChoosePixelFormat(baseDC, &pfd)) == 0)
{
VID_Shutdown();
- Con_Printf("ChoosePixelFormat(%d, %p) failed\n", baseDC, &pfd);
+ Con_Printf("ChoosePixelFormat(%d, %p) failed\n", (int)baseDC, &pfd);
return false;
}
if (SetPixelFormat(baseDC, pixelformat, &pfd) == false)
{
VID_Shutdown();
- Con_Printf("SetPixelFormat(%d, %d, %p) failed\n", baseDC, pixelformat, &pfd);
+ Con_Printf("SetPixelFormat(%d, %d, %p) failed\n", (int)baseDC, pixelformat, &pfd);
return false;
}
if (!qwglMakeCurrent(baseDC, baseRC))
{
VID_Shutdown();
- Con_Printf("wglMakeCurrent(%d, %d) failed\n", baseDC, baseRC);
+ Con_Printf("wglMakeCurrent(%d, %d) failed\n", (int)baseDC, (int)baseRC);
return false;
}
if (pool == NULL)
Sys_Error("Mem_Alloc: pool == NULL (alloc at %s:%i)", filename, fileline);
if (developer.integer && developer_memory.integer)
- Con_Printf("Mem_Alloc: pool %s, file %s:%i, size %i bytes\n", pool->name, filename, fileline, size);
+ Con_Printf("Mem_Alloc: pool %s, file %s:%i, size %i bytes\n", pool->name, filename, fileline, (int)size);
if (developer.integer && developer_memorydebug.integer)
_Mem_CheckSentinelsGlobal(filename, fileline);
pool->totalsize += size;
Sys_Error("Mem_Free: trashed header sentinel 2 (alloc at %s:%i, free at %s:%i)", mem->filename, mem->fileline, filename, fileline);
pool = mem->pool;
if (developer.integer && developer_memory.integer)
- Con_Printf("Mem_Free: pool %s, alloc %s:%i, free %s:%i, size %i bytes\n", pool->name, mem->filename, mem->fileline, filename, fileline, mem->size);
+ Con_Printf("Mem_Free: pool %s, alloc %s:%i, free %s:%i, size %i bytes\n", pool->name, mem->filename, mem->fileline, filename, fileline, (int)(mem->size));
// unlink memheader from doubly linked list
if ((mem->prev ? mem->prev->next != mem : pool->chain != mem) || (mem->next && mem->next->prev != mem))
Sys_Error("Mem_Free: not allocated or double freed (free at %s:%i)", filename, fileline);