Style nits

This commit is contained in:
twinaphex 2020-05-07 20:13:02 +02:00
parent b78c48c2c3
commit 33cf0e160c
2 changed files with 40 additions and 49 deletions

View File

@ -80,7 +80,8 @@ static bool exists(char *path)
return (stat(path, &stat_buf) == 0);
}
static void fix_asset_directory(void) {
static void fix_asset_directory(void)
{
char src_path_buf[PATH_MAX_LENGTH] = {0};
char dst_path_buf[PATH_MAX_LENGTH] = {0};
@ -199,7 +200,6 @@ static int frontend_wiiu_parse_drive_list(void *data, bool load_content)
static void frontend_wiiu_exec(const char *path, bool should_load_content)
{
struct
{
u32 magic;

View File

@ -91,10 +91,7 @@ void _start(int argc, char **argv)
exit(0);
}
void __eabi(void)
{
}
void __eabi(void) { }
__attribute__((weak))
void __init(void)
@ -103,10 +100,9 @@ void __init(void)
extern void (*const __CTOR_END__)(void);
void (*const *ctor)(void) = &__CTOR_LIST__;
while (ctor < &__CTOR_END__) {
while (ctor < &__CTOR_END__)
(*ctor++)();
}
}
__attribute__((weak))
void __fini(void)
@ -115,30 +111,27 @@ void __fini(void)
extern void (*const __DTOR_END__)(void);
void (*const *dtor)(void) = &__DTOR_LIST__;
while (dtor < &__DTOR_END__) {
while (dtor < &__DTOR_END__)
(*dtor++)();
}
}
/* libiosuhax related */
//just to be able to call async
void someFunc(void *arg)
{
(void)arg;
}
/* just to be able to call async */
static void some_func(void *arg) { (void)arg; }
#ifdef HAVE_IOSUHAX
int MCPHookOpen(void)
{
//take over mcp thread
/* take over mcp thread */
mcp_hook_fd = IOS_Open("/dev/mcp", 0);
if (mcp_hook_fd < 0)
return -1;
IOS_IoctlAsync(mcp_hook_fd, 0x62, (void *)0, 0, (void *)0, 0, someFunc, (void *)0);
//let wupserver start up
IOS_IoctlAsync(mcp_hook_fd, 0x62, (void *)0, 0,
(void *)0, 0, some_func, (void *)0);
/* let wupserver start up */
usleep(1000);
if (IOSUHAX_Open("/dev/mcp") < 0)
@ -156,14 +149,14 @@ void MCPHookClose(void)
if (mcp_hook_fd < 0)
return;
//close down wupserver, return control to mcp
/* close down wupserver, return control to mcp */
IOSUHAX_Close();
//wait for mcp to return
/* wait for mcp to return */
usleep(1000);
IOS_Close(mcp_hook_fd);
mcp_hook_fd = -1;
}
#endif //HAVE_IOSUHAX
#endif /* HAVE_IOSUHAX */
static bool try_init_iosuhax(void)
{
@ -172,8 +165,10 @@ static bool try_init_iosuhax(void)
if (result < 0)
result = MCPHookOpen();
return (result < 0) ? false : true;
#else //don't HAVE_IOSUHAX
if (result < 0)
return false;
return true;
#else /* don't HAVE_IOSUHAX */
return false;
#endif
}
@ -209,12 +204,10 @@ void __mount_filesystems(void)
fatInitDefault();
fsaFd = IOSUHAX_FSA_Open();
mount_fs("storage_usb", fsaFd, NULL, "/vol/storage_usb01");
return;
}
else
mount_sd_fat("sd");
#else
mount_sd_fat("sd");
#endif
mount_sd_fat("sd");
}
/**
@ -240,12 +233,10 @@ void __unmount_filesystems(void)
MCPHookClose();
else
IOSUHAX_Close();
return;
}
else
unmount_sd_fat("sd");
#else
unmount_sd_fat("sd");
#endif
unmount_sd_fat("sd");
}
static void fsdev_init(void)