common: add printf attribute to Error() declaration in cmdlib.h
Fix a number of warnings now generated as a result. Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
37f87a28be
commit
c3bf54e494
|
|
@ -72,7 +72,8 @@ char *ExpandPathAndArchive(char *path);
|
|||
|
||||
double I_FloatTime(void);
|
||||
|
||||
void Error(const char *error, ...) __attribute__((noreturn));
|
||||
void Error(const char *error, ...)
|
||||
__attribute__((format(printf,1,2),noreturn));
|
||||
int CheckParm(const char *check);
|
||||
|
||||
FILE *SafeOpenWrite(const char *filename);
|
||||
|
|
|
|||
|
|
@ -289,15 +289,15 @@ LoadEntities(void)
|
|||
char key[MAX_ENT_KEY];
|
||||
epair_t *epair;
|
||||
vec3_t vec;
|
||||
int num_lights;
|
||||
int memsize, num_lights;
|
||||
|
||||
/* Count the entities and allocate memory */
|
||||
max_entities = CountEntities(dentdata);
|
||||
entities = malloc(max_entities * sizeof(*entities));
|
||||
memsize = max_entities * sizeof(*entities);
|
||||
entities = malloc(memsize);
|
||||
if (!entities)
|
||||
Error("%s: allocation of %d bytes failed\n", __func__,
|
||||
max_entities * sizeof(*entities));
|
||||
memset(entities, 0, max_entities * sizeof(*entities));
|
||||
Error("%s: allocation of %d bytes failed\n", __func__, memsize);
|
||||
memset(entities, 0, memsize);
|
||||
|
||||
/* start parsing */
|
||||
num_entities = 0;
|
||||
|
|
@ -525,7 +525,7 @@ WriteEntitiesToString(void)
|
|||
entdatasize = Get_EntityStringSize(entities, num_entities);
|
||||
dentdata = malloc(entdatasize);
|
||||
if (!dentdata)
|
||||
Error("%s: allocation of %d bytes failed\n", entdatasize);
|
||||
Error("%s: allocation of %d bytes failed\n", __func__, entdatasize);
|
||||
|
||||
space = entdatasize;
|
||||
pos = dentdata;
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ CalcFaceExtents(const dface_t *face, const vec3_t offset, lightsurf_t *surf)
|
|||
" surface %d, %s extents = %d\n"
|
||||
" texture %s at (%s)\n"
|
||||
" surface normal (%s)\n",
|
||||
face - dfaces, i ? "t" : "s", surf->texsize[i],
|
||||
(int)(face - dfaces), i ? "t" : "s", surf->texsize[i],
|
||||
miptex->name, VecStr(worldpoint), VecStrf(plane->normal));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ LoadVisState(void)
|
|||
/* Sanity check the headers */
|
||||
if (state.version != VIS_STATE_VERSION) {
|
||||
fclose(infile);
|
||||
Error("%s: state file version does not match");
|
||||
Error("%s: state file version does not match", __func__);
|
||||
}
|
||||
if (state.numportals != numportals || state.numleafs != portalleafs) {
|
||||
fclose(infile);
|
||||
|
|
|
|||
Loading…
Reference in New Issue