From ca63c0360af4a78593f3b940ce566c45d25bd8ad Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 29 Jul 2021 11:12:37 +0900 Subject: [PATCH] Do an audit of hunk mark usage I realized that after making the hunk 64-bit clean, I had forgotten to go through and convert all the saved marks to size_t. --- libs/gib/gib_init.c | 2 +- libs/image/pcx.c | 2 +- libs/image/tga.c | 3 ++- libs/models/alias/model_alias.c | 3 ++- libs/models/brush/vulkan_model_brush.c | 2 +- libs/util/cmd.c | 2 +- nq/source/host.c | 2 +- nq/source/sv_phys.c | 2 +- qw/include/server.h | 2 +- qw/source/cl_main.c | 2 +- qw/source/sv_main.c | 2 +- qw/source/sv_phys.c | 2 +- 12 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libs/gib/gib_init.c b/libs/gib/gib_init.c index f7cc09827..9b20c61f8 100644 --- a/libs/gib/gib_init.c +++ b/libs/gib/gib_init.c @@ -62,7 +62,7 @@ static void GIB_Exec_Override_f (void) { char *f; - int mark; + size_t mark; if (Cmd_Argc () != 2) { Sys_Printf ("exec : execute a script file\n"); diff --git a/libs/image/pcx.c b/libs/image/pcx.c index 2eb512c1d..250429502 100644 --- a/libs/image/pcx.c +++ b/libs/image/pcx.c @@ -50,7 +50,7 @@ VISIBLE tex_t * LoadPCX (QFile *f, qboolean convert, const byte *pal, int load) { pcx_t *pcx; - int pcx_mark; + size_t pcx_mark; byte *palette; byte *end; byte *pix; diff --git a/libs/image/tga.c b/libs/image/tga.c index 3491e37ce..20db43ddd 100644 --- a/libs/image/tga.c +++ b/libs/image/tga.c @@ -625,7 +625,8 @@ LoadTGA (QFile *fin, int load) byte *dataByte; decoder_t decode; int fsize = sizeof (TargaHeader); - int numPixels, targa_mark; + int numPixels; + size_t targa_mark; TargaHeader *targa; tex_t *tex; diff --git a/libs/models/alias/model_alias.c b/libs/models/alias/model_alias.c index 90ec0b9cd..aa1186b98 100644 --- a/libs/models/alias/model_alias.c +++ b/libs/models/alias/model_alias.c @@ -214,7 +214,8 @@ Mod_LoadAliasGroup (mod_alias_ctx_t *alias_ctx, void *pin, int *posenum, void Mod_LoadAliasModel (model_t *mod, void *buffer, cache_allocator_t allocator) { - int size, version, numframes, start, end, total, i, j; + size_t size, start, end, total; + int version, numframes, i, j; int extra = 0; // extra precision bytes void *mem; dtriangle_t *pintriangles; diff --git a/libs/models/brush/vulkan_model_brush.c b/libs/models/brush/vulkan_model_brush.c index b2bd64417..970ab1f44 100644 --- a/libs/models/brush/vulkan_model_brush.c +++ b/libs/models/brush/vulkan_model_brush.c @@ -360,7 +360,7 @@ Vulkan_Mod_ProcessTexture (model_t *mod, texture_t *tx, vulkan_ctx_t *ctx) const char *name = va (ctx->va_ctx, "fb_%s", tx->name); int size = (tx->width * tx->height * 85) / 64; - int fullbright_mark = Hunk_LowMark (0); + size_t fullbright_mark = Hunk_LowMark (0); byte *pixels = Hunk_AllocName (0, size, name); if (!Mod_CalcFullbright ((byte *) (tx + 1), pixels, size)) { diff --git a/libs/util/cmd.c b/libs/util/cmd.c index 6ee2ee10c..13038f53d 100644 --- a/libs/util/cmd.c +++ b/libs/util/cmd.c @@ -502,7 +502,7 @@ static void Cmd_Exec_f (void) { char *f; - int mark; + size_t mark; if (Cmd_Argc () != 2) { Sys_Printf ("exec : execute a script file\n"); diff --git a/nq/source/host.c b/nq/source/host.c index f468e4bd9..397911f90 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -94,7 +94,7 @@ double con_realtime; double oldcon_realtime; int host_framecount; -int host_hunklevel; +size_t host_hunklevel; int host_in_game; size_t minimum_memory; diff --git a/nq/source/sv_phys.c b/nq/source/sv_phys.c index f649c0248..ffaf35ae1 100644 --- a/nq/source/sv_phys.c +++ b/nq/source/sv_phys.c @@ -423,7 +423,7 @@ SV_Push (edict_t *pusher, const vec3_t tmove, const vec3_t amove) vec3_t forward = {1, 0, 0}; vec3_t left = {0, 1, 0}; vec3_t up = {0, 0, 1}; - int mark; + size_t mark; int c_flags, c_movetype, c_groundentity, c_solid; vec_t *c_absmin, *c_absmax, *c_origin, *c_angles, *c_mins, *c_maxs; vec_t *p_origin, *p_angles; diff --git a/qw/include/server.h b/qw/include/server.h index 3693a32fa..c75cfa659 100644 --- a/qw/include/server.h +++ b/qw/include/server.h @@ -452,7 +452,7 @@ extern char localmodels[MAX_MODELS][5]; // inline model names for precache extern struct info_s *localinfo; -extern int host_hunklevel; +extern size_t host_hunklevel; extern QFile *sv_logfile; extern QFile *sv_fraglogfile; diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index f35e1b2cd..7362327cf 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -211,7 +211,7 @@ double con_frametime; double con_realtime; double oldcon_realtime; -int host_hunklevel; +size_t host_hunklevel; cvar_t *host_speeds; cvar_t *hud_fps; diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index 9d2002317..0e1904137 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -106,7 +106,7 @@ entity_state_t cl_entities[MAX_CLIENTS][UPDATE_BACKUP+1][MAX_PACKET_ENTITIES]; / double sv_frametime; double realtime; // without any filtering or bounding -int host_hunklevel; +size_t host_hunklevel; netadr_t master_adr[MAX_MASTERS]; // address of group servers diff --git a/qw/source/sv_phys.c b/qw/source/sv_phys.c index c7e287d6d..41ae45ccd 100644 --- a/qw/source/sv_phys.c +++ b/qw/source/sv_phys.c @@ -426,7 +426,7 @@ SV_Push (edict_t *pusher, const vec3_t tmove, const vec3_t amove) vec3_t forward = {1, 0, 0}; vec3_t left = {0, 1, 0}; vec3_t up = {0, 0, 1}; - int mark; + size_t mark; int c_flags, c_movetype, c_groundentity, c_solid; vec_t *c_absmin, *c_absmax, *c_origin, *c_angles, *c_mins, *c_maxs; vec_t *p_origin, *p_angles;