Apply some improvement preparing for new toolchain (#9330)

This commit is contained in:
Francisco Javier Trujillo Mata 2019-08-19 20:36:15 +02:00 committed by Twinaphex
parent 0420d7f06c
commit c987945b5e
10 changed files with 48 additions and 17 deletions

View File

@ -225,7 +225,7 @@ static void frontend_ps2_init(void *data)
waitUntilDeviceIsReady(bootDeviceID);
#if defined(HAVE_FILE_LOGGER)
retro_main_log_file_init("retroarch.log");
retro_main_log_file_init("retroarch.log", false);
verbosity_enable();
#endif
}

View File

@ -938,7 +938,9 @@ int retro_vfs_stat_impl(const char *path, int32_t *size)
/* if fileXioGetStat fails */
int dir_ret = fileXioDopen(path);
is_dir = dir_ret > 0;
fileXioDclose(dir_ret);
if (is_dir) {
fileXioDclose(dir_ret);
}
}
else
is_dir = FIO_S_ISDIR(buf.mode);

View File

@ -442,7 +442,6 @@ float strtof(const char* str, char** endptr)
{
return (float) strtod(str, endptr);
}
//unsigned long strtoul(const char *s, char **endptr, int base); FJTRUJY MISSING
int link(const char *oldpath, const char *newpath)
{
@ -453,3 +452,8 @@ int unlink(const char *path)
{
return fileXioRemove(path);
}
int rename(const char *source, const char *dest)
{
return fileXioRename(source, dest);
}

View File

@ -191,9 +191,12 @@ int ps2fileXioDread(int fd, iox_dirent_t *dirent)
int ps2fileXioDclose(int fd)
{
int ret = -19;
if (is_fd_valid(fd)) {
return __ps2_release_descriptor(fd);
} else {
return fileXioDclose(fd);
ret = __ps2_release_descriptor(fd);
} else if (fd > 0) {
ret = fileXioDclose(fd);
}
return ret;
}

View File

@ -62,7 +62,6 @@ int is_fd_valid(int fd)
}
void _init_ps2_io(void) {
int ret;
ee_sema_t sp;
memset(__ps2_fdmap, 0, sizeof(__ps2_fdmap));
@ -72,7 +71,6 @@ void _init_ps2_io(void) {
sp.max_count = 1;
sp.option = 0;
_lock_sema_id = CreateSema(&sp);
}
void _free_ps2_io(void) {

View File

@ -179,8 +179,9 @@ bool waitUntilDeviceIsReady(enum BootDeviceIDs device_id)
retries--;
};
fileXioDclose(openFile);
if (openFile > 0) {
fileXioDclose(openFile);
}
return openFile >= 0;
}

View File

@ -107,8 +107,31 @@ clock_t clock(void)
return SDL_GetTicks();
}
time_t time(time_t *t) {
time_t time(time_t *t)
{
time_t tim = -1;
/* TODO: This function need to be implemented again because the SDK one is not working fine */
return time;
return tim;
}
time_t mktime(struct tm *timeptr)
{
time_t tim = -1;
/* TODO: This function need to be implemented again because the SDK one is not working fine */
return tim;
}
struct tm *localtime(const time_t *timep)
{
return NULL;
}
size_t strftime(char *s, size_t max, const char *format, const struct tm *tm)
{
return -1;
}
char *setlocale(int category, const char *locale)
{
return NULL;
}

View File

@ -15,8 +15,8 @@
#ifndef INTTYPES_H
#define INTTYPES_H
#define PRId64 "ld"
#define PRIu64 "lu"
#define PRIuPTR "lu"
#define PRId64 "lld"
#define PRIu64 "llu"
#define PRIuPTR "llu"
#endif /* INTTYPES_H */

View File

@ -33,4 +33,6 @@
#define exp(a) ((double)expf((float)a))
#define log(a) ((double)logf((float)a))
#define fmod(a, b) (a - b * floor(a / b));
#endif //MATH_H

View File

@ -34,8 +34,6 @@ typedef struct
entries *FileEntry;
} DescriptorTranslation;
extern DescriptorTranslation *__ps2_fdmap[];
void _init_ps2_io(void);
void _free_ps2_io(void);
int is_fd_valid(int fd);