mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 22:40:50 +00:00
fix -O3 warning. Fix indexes in vtx.
Loop 'for ( i = 0; i < 3; i++ )' sets values to vtx[0..2]. So next index must be 3(instead 4) and loop 'for ( i = 16; i >= 0; i-- )' will set vtx[3..(18*3-1)]. ===== src/client/refresh/gl/r_light.c: In function ‘R_RenderDlight’: src/client/refresh/gl/r_light.c:76:21: warning: iteration 16 invokes undefined behavior [-Waggressive-loop-optimizations] vtx[index_vtx++] = light->origin [ j ] + vright [ j ] * cos( a ) * rad ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + vup [ j ] * sin( a ) * rad; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/client/refresh/gl/r_light.c:65:2: note: within this loop for ( i = 16; i >= 0; i-- ) ^~~ =====
This commit is contained in:
parent
de30b75f94
commit
bf19c8b50c
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ R_RenderDlight(dlight_t *light)
|
|||
GLfloat vtx[3*18];
|
||||
GLfloat clr[4*18];
|
||||
|
||||
unsigned int index_vtx = 4;
|
||||
unsigned int index_vtx = 3;
|
||||
unsigned int index_clr = 0;
|
||||
|
||||
glEnableClientState( GL_VERTEX_ARRAY );
|
||||
|
|
Loading…
Reference in a new issue