From 3e3032cfa044268cee76735823755db274025021 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 13 Jun 2023 18:27:10 -0700 Subject: *: smattering of random small fixes to silence -Wall I thought the build was already using -Wall but that seems to not be the case, maybe got lost somewhere along the line or messed up in configure.ac After forcing a build with -Wall -Werror, these showed up. Fixed up in the obvious way, nothing too scary. --- src/modules/swarm/swarm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/modules/swarm') diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c index 8e2d853..97a04d0 100644 --- a/src/modules/swarm/swarm.c +++ b/src/modules/swarm/swarm.c @@ -197,9 +197,11 @@ static til_module_context_t * swarm_create_context(const til_module_t *module, t static void swarm_update(swarm_context_t *ctxt, unsigned ticks) { v3f_t avg_direction = {}; - float avg_velocity = 0.f; v3f_t avg_center = {}; float wleader, wcenter, wdirection; + /* commented out since it's unused currently and upsets -Wall -Werror, but retained for potential future modifications + * float avg_velocity = 0.f; + */ { /* [0] = leader */ float r = M_PI * 2 * ((cosf((float)ticks * .001f) * .5f + .5f)); @@ -239,10 +241,10 @@ static void swarm_update(swarm_context_t *ctxt, unsigned ticks) avg_center = v3f_add(avg_center, b->position); avg_direction = v3f_add(avg_direction, b->direction); - avg_velocity += b->velocity; + /* avg_velocity += b->velocity; */ } - avg_velocity *= (1.f / (float)SWARM_SIZE); + /* avg_velocity *= (1.f / (float)SWARM_SIZE); */ avg_center = v3f_mult_scalar(avg_center, (1.f / (float)SWARM_SIZE)); avg_direction = v3f_mult_scalar(avg_direction, (1.f / (float)SWARM_SIZE)); v3f_normalize(&avg_direction); -- cgit v1.2.3