diff options
| author | Vito Caputo <vcaputo@pengaru.com> | 2023-06-13 18:27:10 -0700 | 
|---|---|---|
| committer | Vito Caputo <vcaputo@pengaru.com> | 2023-06-13 23:27:20 -0700 | 
| commit | 3e3032cfa044268cee76735823755db274025021 (patch) | |
| tree | ead68726685be0e1b6fdccd5c78f132dfb093517 /src/modules/swarm | |
| parent | 2825d01bf16f8b22f8eb9b92b2c21a654c13e563 (diff) | |
*: 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.
Diffstat (limited to 'src/modules/swarm')
| -rw-r--r-- | src/modules/swarm/swarm.c | 8 | 
1 files changed, 5 insertions, 3 deletions
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);  | 
