fix %zu windows build warnings

This commit is contained in:
Denis Pauk 2024-03-31 16:14:44 +03:00
parent 98ebc126c2
commit 57e68967cb
8 changed files with 42 additions and 25 deletions

View File

@ -503,7 +503,7 @@ R_StoreLightMap(byte *dest, int stride, const byte *destmax, int smax, int tmax)
if ((dest + (stride * (tmax - 1)) + smax * LIGHTMAP_BYTES) > destmax)
{
Com_Error(ERR_DROP, "%s destination too small for lightmap %d > %ld",
Com_Error(ERR_DROP, "%s destination too small for lightmap %d > " YQ2_COM_PRIdS,
__func__, (stride * (tmax - 1)) + smax * LIGHTMAP_BYTES, destmax - dest);
}

View File

@ -1377,7 +1377,7 @@ Mod_LoadModel_MD3(const char *mod_name, const void *buffer, int modfilelen,
if (modfilelen < sizeof(pinmodel))
{
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be %ld)\n",
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be " YQ2_COM_PRIdS ")\n",
__func__, mod_name, modfilelen, sizeof(pinmodel));
return NULL;
}
@ -1616,7 +1616,7 @@ Mod_LoadModel_MD2Anox(const char *mod_name, const void *buffer, int modfilelen,
if (modfilelen < sizeof(pinmodel))
{
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be %ld)\n",
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be " YQ2_COM_PRIdS ")\n",
__func__, mod_name, modfilelen, sizeof(pinmodel));
return NULL;
}
@ -1790,7 +1790,7 @@ Mod_LoadModel_MD2(const char *mod_name, const void *buffer, int modfilelen,
if (modfilelen < sizeof(pinmodel))
{
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be %ld)\n",
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be " YQ2_COM_PRIdS ")\n",
__func__, mod_name, modfilelen, sizeof(pinmodel));
return NULL;
}
@ -1952,7 +1952,7 @@ Mod_LoadSkinList_MD2(const char *mod_name, const void *buffer, int modfilelen,
if (modfilelen < sizeof(pinmodel))
{
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be %ld)\n",
R_Printf(PRINT_ALL, "%s: %s has incorrect header size (%i should be " YQ2_COM_PRIdS ")\n",
__func__, mod_name, modfilelen, sizeof(pinmodel));
return;
}

View File

@ -355,8 +355,10 @@ Mod_LoadFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}
@ -481,8 +483,10 @@ Mod_LoadQFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}

View File

@ -356,8 +356,10 @@ Mod_LoadFaces(gl3model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}
@ -482,8 +484,10 @@ Mod_LoadQFaces(gl3model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}

View File

@ -356,8 +356,10 @@ Mod_LoadFaces(gl4model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}
@ -482,8 +484,10 @@ Mod_LoadQFaces(gl4model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}

View File

@ -330,8 +330,10 @@ Mod_LoadFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}
@ -456,8 +458,10 @@ Mod_LoadQFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->numsurfaces = count;
lminfos = Mod_LoadBSPXFindLump(bspx_header, "DECOUPLED_LM", &lminfosize, mod_base);
if (lminfos != NULL && lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces) {
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size %ld does not match surface count %d\n",
if ((lminfos != NULL) &&
(lminfosize / sizeof(dlminfo_t) != loadmodel->numsurfaces))
{
R_Printf(PRINT_ALL, "%s: [%s] decoupled_lm size " YQ2_COM_PRIdS " does not match surface count %d\n",
__func__, loadmodel->name, lminfosize / sizeof(dlminfo_t), loadmodel->numsurfaces);
lminfos = NULL;
}

View File

@ -215,14 +215,14 @@ Mod_LoadValidateLumps(const char *name, const dheader_t *header)
{
if (header->lumps[s].filelen % rules[s])
{
Com_Printf("%s: Map %s lump #%d: incorrect size %d / %zd\n",
Com_Printf("%s: Map %s lump #%d: incorrect size %d / " YQ2_COM_PRIdS "\n",
__func__, name, s, header->lumps[s].filelen, rules[s]);
error = true;
}
#ifdef DEBUG
else
{
Com_Printf("%s: Map %s lump #%d: correct size %d / %zd\n",
Com_Printf("%s: Map %s lump #%d: correct size %d / " YQ2_COM_PRIdS "\n",
__func__, name, s, header->lumps[s].filelen, rules[s]);
}
#endif

View File

@ -1386,7 +1386,7 @@ CMod_LoadNodes(const char *name, cnode_t **map_nodes, int *numnodes,
if (l->filelen % sizeof(*in))
{
Com_Error(ERR_DROP, "%s: Map %s has funny lump size %ld",
Com_Error(ERR_DROP, "%s: Map %s has funny lump size " YQ2_COM_PRIdS,
__func__, name, sizeof(*in));
}
@ -1425,7 +1425,8 @@ CMod_LoadQNodes(const char *name, cnode_t **map_nodes, int *numnodes,
if (l->filelen % sizeof(*in))
{
Com_Error(ERR_DROP, "%s: Map %s funny lump size %ld", __func__, name, sizeof(*in));
Com_Error(ERR_DROP, "%s: Map %s funny lump size " YQ2_COM_PRIdS,
__func__, name, sizeof(*in));
}
count = l->filelen / sizeof(*in);