Fix a couple of warnings

This commit is contained in:
Zerocker 2020-06-07 22:19:47 +09:00
parent 6733bdb3ae
commit f6ab82d144
2 changed files with 4 additions and 6 deletions

View File

@ -391,7 +391,6 @@ BAD_RETURN(s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex) {
void save_file_load_all(void) {
s32 file;
s32 validSlots;
gMainMenuDataModified = FALSE;
gSaveFileModified = FALSE;
@ -405,6 +404,7 @@ void save_file_load_all(void) {
gSaveFileModified = TRUE;
gMainMenuDataModified = TRUE;
#else
s32 validSlots;
read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer));
if (save_file_need_bswap(&gSaveBuffer))

View File

@ -79,7 +79,7 @@ static s32 write_text_save(s32 fileIndex) {
struct SaveFile *savedata;
struct MainMenuSaveData *menudata;
char filename[SYS_MAX_PATH] = { 0 };
char value[SYS_MAX_PATH] = { 0 };
char *value;
u32 i, bit, flags, coins, stars, starFlags;
if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, sys_save_path(), fileIndex) < 0)
@ -87,7 +87,7 @@ static s32 write_text_save(s32 fileIndex) {
file = fopen(filename, "wt");
if (file == NULL) {
printf("Savefile '%s' not found!\n", path);
printf("Savefile '%s' not found!\n", filename);
return -1;
} else
printf("Saving updated progress to '%s'\n", filename);
@ -204,7 +204,6 @@ static s32 write_text_save(s32 fileIndex) {
*/
static s32 read_text_save(s32 fileIndex) {
char filename[SYS_MAX_PATH] = { 0 };
char temp[SYS_MAX_PATH] = { 0 };
const char *value;
ini_t *savedata;
@ -243,9 +242,8 @@ static s32 read_text_save(s32 fileIndex) {
for (i = 1; i < NUM_FLAGS; i++) {
value = ini_get(savedata, "flags", sav_flags[i]);
if (value) {
flag = strtol(value, &temp, 10);
flag = value[0] - '0'; // Flag should be 0 or 1
if (flag) {
flag = 1 << i; // Flags defined in 'save_file' header
gSaveBuffer.files[fileIndex][0].flags |= flag;