From e72b42f6d10eb7fa60895279157d5525fc6eb03c Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 28 Oct 2023 01:47:55 +1000 Subject: [PATCH] =?utf8?q?Fix=20GCC=2013=20warns:=20=E2=80=98new=5Fvelocit?= =?utf8?q?y[0]=E2=80=99=20may=20be=20used=20uninitialized?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- sv_phys.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; -- 2.39.2