commit f254d2151f45e754e90ab5c95cd138bd78bd40c6
Author: NY00123 <ny00@outlook.com>
AuthorDate: Tue Feb 20 21:42:41 2024 +0200
Commit: Turo Lamminen <turol@users.noreply.github.com>
CommitDate: Wed Feb 21 16:00:03 2024 +0200
hexen/strife: Reduce scope of variable "i" in function InitGameVersion
Note that this cannot be done for Doom.
---
src/hexen/h2_main.c | 2 +-
src/strife/d_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 0246e800..e84ee332 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -369,7 +369,6 @@ static const struct
static void InitGameVersion(void)
{
int p;
- int i;
//!
// @arg <version>
@@ -383,6 +382,7 @@ static void InitGameVersion(void)
if (p)
{
+ int i;
for (i=0; gameversions[i].description != NULL; ++i)
{
if (!strcmp(myargv[p+1], gameversions[i].cmdline))
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index 277049f9..72157b7c 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -1025,7 +1025,6 @@ static const struct
static void InitGameVersion(void)
{
int p;
- int i;
// haleyjd: we support emulating either the 1.2 or the 1.31 versions of
// Strife, which are the most significant. 1.2 is the most mature version
@@ -1044,6 +1043,7 @@ static void InitGameVersion(void)
if (p)
{
+ int i;
for (i=0; gameversions[i].description != NULL; ++i)
{
if (!strcmp(myargv[p+1], gameversions[i].cmdline))