Fix a couple of warnings
This commit is contained in:
parent
d047176da7
commit
6fea0079ba
|
@ -391,7 +391,6 @@ BAD_RETURN(s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex) {
|
||||||
|
|
||||||
void save_file_load_all(void) {
|
void save_file_load_all(void) {
|
||||||
s32 file;
|
s32 file;
|
||||||
s32 validSlots;
|
|
||||||
|
|
||||||
gMainMenuDataModified = FALSE;
|
gMainMenuDataModified = FALSE;
|
||||||
gSaveFileModified = FALSE;
|
gSaveFileModified = FALSE;
|
||||||
|
@ -405,6 +404,7 @@ void save_file_load_all(void) {
|
||||||
gSaveFileModified = TRUE;
|
gSaveFileModified = TRUE;
|
||||||
gMainMenuDataModified = TRUE;
|
gMainMenuDataModified = TRUE;
|
||||||
#else
|
#else
|
||||||
|
s32 validSlots;
|
||||||
read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer));
|
read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer));
|
||||||
|
|
||||||
if (save_file_need_bswap(&gSaveBuffer))
|
if (save_file_need_bswap(&gSaveBuffer))
|
||||||
|
|
|
@ -79,7 +79,7 @@ static s32 write_text_save(s32 fileIndex) {
|
||||||
struct SaveFile *savedata;
|
struct SaveFile *savedata;
|
||||||
struct MainMenuSaveData *menudata;
|
struct MainMenuSaveData *menudata;
|
||||||
char filename[SYS_MAX_PATH] = { 0 };
|
char filename[SYS_MAX_PATH] = { 0 };
|
||||||
char value[SYS_MAX_PATH] = { 0 };
|
char *value;
|
||||||
u32 i, bit, flags, coins, stars, starFlags;
|
u32 i, bit, flags, coins, stars, starFlags;
|
||||||
|
|
||||||
if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, sys_save_path(), fileIndex) < 0)
|
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");
|
file = fopen(filename, "wt");
|
||||||
if (file == NULL) {
|
if (file == NULL) {
|
||||||
printf("Savefile '%s' not found!\n", path);
|
printf("Savefile '%s' not found!\n", filename);
|
||||||
return -1;
|
return -1;
|
||||||
} else
|
} else
|
||||||
printf("Saving updated progress to '%s'\n", filename);
|
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) {
|
static s32 read_text_save(s32 fileIndex) {
|
||||||
char filename[SYS_MAX_PATH] = { 0 };
|
char filename[SYS_MAX_PATH] = { 0 };
|
||||||
char temp[SYS_MAX_PATH] = { 0 };
|
|
||||||
const char *value;
|
const char *value;
|
||||||
ini_t *savedata;
|
ini_t *savedata;
|
||||||
|
|
||||||
|
@ -243,9 +242,8 @@ static s32 read_text_save(s32 fileIndex) {
|
||||||
|
|
||||||
for (i = 1; i < NUM_FLAGS; i++) {
|
for (i = 1; i < NUM_FLAGS; i++) {
|
||||||
value = ini_get(savedata, "flags", sav_flags[i]);
|
value = ini_get(savedata, "flags", sav_flags[i]);
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
flag = strtol(value, &temp, 10);
|
flag = value[0] - '0'; // Flag should be 0 or 1
|
||||||
if (flag) {
|
if (flag) {
|
||||||
flag = 1 << i; // Flags defined in 'save_file' header
|
flag = 1 << i; // Flags defined in 'save_file' header
|
||||||
gSaveBuffer.files[fileIndex][0].flags |= flag;
|
gSaveBuffer.files[fileIndex][0].flags |= flag;
|
||||||
|
|
Loading…
Reference in New Issue