Skip to content

Commit 2598a3f

Browse files
sezeroandrei-drexler
authored andcommitted
Avoid -Wdeclaration-after-statement (issue #3)
1 parent a75cc5a commit 2598a3f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Quake/gl_model.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ Mod_FindUsedTextures
17151715
void Mod_FindUsedTextures (qmodel_t *mod)
17161716
{
17171717
msurface_t *s;
1718-
int i, count;
1718+
int i, count, bit;
17191719
int ofs[TEXTYPE_COUNT];
17201720
int mark = Hunk_HighMark ();
17211721
byte *inuse = (byte *) Hunk_HighAllocName ((mod->numtextures + 7) >> 3, "used textures");
@@ -1727,7 +1727,7 @@ void Mod_FindUsedTextures (qmodel_t *mod)
17271727
byte *val = &inuse[s->texinfo->texnum >> 3];
17281728
if (!t)
17291729
continue;
1730-
int bit = 1 << (s->texinfo->texnum & 7);
1730+
bit = 1 << (s->texinfo->texnum & 7);
17311731
if (!(*val & bit))
17321732
{
17331733
*val |= bit;

Quake/gl_rmain.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,15 @@ void R_EntityMatrix (float matrix[16], vec3_t origin, vec3_t angles)
370370
}
371371
else
372372
{
373+
float sy, sp, sr, cy, cp, cr;
373374
pitch = DEG2RAD(pitch);
374375
roll = DEG2RAD(roll);
375-
float sy = sin(yaw);
376-
float sp = sin(pitch);
377-
float sr = sin(roll);
378-
float cy = cos(yaw);
379-
float cp = cos(pitch);
380-
float cr = cos(roll);
376+
sy = sin(yaw);
377+
sp = sin(pitch);
378+
sr = sin(roll);
379+
cy = cos(yaw);
380+
cp = cos(pitch);
381+
cr = cos(roll);
381382

382383
// https://www.symbolab.com/solver/matrix-multiply-calculator FTW!
383384

0 commit comments

Comments
 (0)