From: bones_was_here Date: Fri, 27 Oct 2023 15:47:55 +0000 (+1000) Subject: Fix GCC 13 warns: ‘new_velocity[0]’ may be used uninitialized X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e72b42f6d10eb7fa60895279157d5525fc6eb03c;p=xonotic%2Fdarkplaces.git Fix GCC 13 warns: ‘new_velocity[0]’ may be used uninitialized Pretty sure this was a false positive, for it to happen `numplanes` would have to be <= 0 in the loop which sets `new_velocity` which should be impossible. Declaring `numplanes` as unsigned placates the compiler, and these ints should be unsigned anyway because they index an array. Signed-off-by: bones_was_here --- diff --git a/sv_phys.c b/sv_phys.c index 77c3bacf..f468a7e9 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1199,8 +1199,7 @@ static qbool SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, qboo static int SV_FlyMove (prvm_edict_t *ent, float time, qbool applygravity, float *stepnormal, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float stepheight) { prvm_prog_t *prog = SVVM_prog; - int blocked, bumpcount; - int i, j, numplanes; + unsigned int i, j, numplanes, blocked, bumpcount; float d, time_left, gravity; vec3_t dir, push, planes[MAX_CLIP_PLANES]; prvm_vec3_t primal_velocity, original_velocity, new_velocity, restore_velocity;