From 698139ed8ea915f20c1dd01e3cdb7f1bdadc4fca Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 4 Aug 2022 21:26:55 -0700 Subject: [PATCH] saves.cpp: Fix compiling issue for all non-Windows platforms. (Regression from commit 3a6c8cf9.) --- desmume/src/saves.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index 85daf0a13..df9df4c26 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -725,6 +725,7 @@ void savestate_slot(int num) void loadstate_slot(int num) { char filename[MAX_PATH]; + int max_index = -1; lastSaveState = num; //Set last savestate used @@ -734,7 +735,7 @@ void loadstate_slot(int num) #ifdef HOST_WINDOWS // Maximum backup number can be set in config: [General] BackupSavesMax= // Setting BackupSavesMax=0 would disable backups - int max_index = GetPrivateProfileInt("General", "BackupSavesMax", -1, IniName); // 0 for disabled + max_index = GetPrivateProfileInt("General", "BackupSavesMax", -1, IniName); // 0 for disabled int suppress_backups = GetPrivateProfileInt("General", "BackupSavestateSuppress", 0, IniName); if(!suppress_backups && max_index != 0 ) #endif