change time handling, remove DI_Close()

This commit is contained in:
dborth 2009-03-26 06:49:50 +00:00
parent c7aa8f2bd8
commit 9d3f522588
4 changed files with 5 additions and 7 deletions

View File

@ -32,7 +32,7 @@ typedef struct
{ {
u64 offset; // DVD offset u64 offset; // DVD offset
unsigned int length; // file length unsigned int length; // file length
tm mtime; // file modified time time_t mtime; // file modified time
char isdir; // 0 - file, 1 - directory char isdir; // 0 - file, 1 - directory
char filename[MAXJOLIET + 1]; // full filename char filename[MAXJOLIET + 1]; // full filename
char displayname[MAXDISPLAY + 1]; // name for browser display char displayname[MAXDISPLAY + 1]; // name for browser display

View File

@ -277,7 +277,6 @@ ParseDirectory(int method)
char filename[MAXPATHLEN]; char filename[MAXPATHLEN];
char tmpname[MAXPATHLEN]; char tmpname[MAXPATHLEN];
struct stat filestat; struct stat filestat;
struct tm * timeinfo;
char msg[128]; char msg[128];
int retry = 1; int retry = 1;
bool mounted = false; bool mounted = false;
@ -352,8 +351,7 @@ ParseDirectory(int method)
} }
browserList[entryNum].length = filestat.st_size; browserList[entryNum].length = filestat.st_size;
timeinfo = localtime (&filestat.st_mtime); browserList[entryNum].mtime = filestat.st_mtime;
memcpy(&browserList[entryNum].mtime, timeinfo, sizeof(tm));
browserList[entryNum].isdir = (filestat.st_mode & _IFDIR) == 0 ? 0 : 1; // flag this as a dir browserList[entryNum].isdir = (filestat.st_mode & _IFDIR) == 0 ? 0 : 1; // flag this as a dir
entryNum++; entryNum++;

View File

@ -1489,8 +1489,9 @@ static int MenuGameSaves(int action)
saves.previewImg[j] = new GuiImageData(savebuffer); saves.previewImg[j] = new GuiImageData(savebuffer);
FreeSaveBuffer(); FreeSaveBuffer();
} }
strftime(saves.date[j], 20, "%a %b %d", &browserList[j].mtime); struct tm * timeinfo = localtime(&browserList[j].mtime);
strftime(saves.time[j], 10, "%I:%M %p", &browserList[j].mtime); strftime(saves.date[j], 20, "%a %b %d", timeinfo);
strftime(saves.time[j], 10, "%I:%M %p", timeinfo);
} }
j++; j++;
} }

View File

@ -352,7 +352,6 @@ main(int argc, char *argv[])
#endif #endif
#ifdef HW_RVL #ifdef HW_RVL
DI_Close();
DI_Init(); // first DI_Init(); // first
#endif #endif