TTimo / GtkRadiant

The open source, cross platform level editor for idtech games
http://icculus.org/gtkradiant/
Other
582 stars 152 forks source link

Fix warning variable add is used uninitialized #526

Closed Pan7 closed 6 years ago

Pan7 commented 6 years ago

tools/quake3/q3map2/light.c:939:12: warning: variable 'add' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] else if ( light->type == EMIT_SUN ) { ^~~~~~~ tools/quake3/q3map2/light.c:979:7: note: uninitialized use occurs here if ( add <= 0.0f || ( add <= light->falloffTolerance && ( light->flags & LIGHT_FAST_ACTUAL ) ) ) { ^~~ tools/quake3/q3map2/light.c:939:7: note: remove the 'if' if its condition is always true else if ( light->type == EMIT_SUN ) { ^~~~~~~ tools/quake3/q3map2/light.c:754:11: note: initialize the variable 'add' to silence this warning float add;

See https://github.com/TTimo/GtkRadiant/issues/467