From 05ac7919b159da046bed89d436d450474e517d54 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 28 Apr 2013 05:18:56 +0200 Subject: [PATCH] system_process_args now has return type --- frontend/frontend_console.c | 9 +++++---- frontend/platform/platform_gx.c | 7 ++++++- frontend/platform/platform_ps3.c | 6 +++++- frontend/platform/platform_psp.c | 3 ++- frontend/platform/platform_xdk.c | 3 ++- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/frontend_console.c b/frontend/frontend_console.c index 28bab41778..9205063d0f 100644 --- a/frontend/frontend_console.c +++ b/frontend/frontend_console.c @@ -132,10 +132,11 @@ int rarch_main(int argc, char *argv[]) menu_init(); - system_process_args(argc, argv); - - g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU); - g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT); + if (system_process_args(argc, argv) == 0) + { + g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU); + g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT); + } for (;;) { diff --git a/frontend/platform/platform_gx.c b/frontend/platform/platform_gx.c index 1037830e8c..b46299a94b 100644 --- a/frontend/platform/platform_gx.c +++ b/frontend/platform/platform_gx.c @@ -335,8 +335,10 @@ static void system_exitspawn(void) static void system_deinit(void) {} #ifndef IS_SALAMANDER -static void system_process_args(int argc, char *argv[]) +static int system_process_args(int argc, char *argv[]) { + int ret = 0; + if (argc > 2 && argv[1] != NULL && argv[2] != NULL) { char rom[PATH_MAX]; @@ -347,9 +349,12 @@ static void system_process_args(int argc, char *argv[]) g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU); g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT); + ret = 1; } else g_extern.lifecycle_mode_state |= (1ULL << MODE_EXTLAUNCH_SALAMANDER); + + return ret; } #endif diff --git a/frontend/platform/platform_ps3.c b/frontend/platform/platform_ps3.c index 96fac03c1c..1532f1c9cf 100644 --- a/frontend/platform/platform_ps3.c +++ b/frontend/platform/platform_ps3.c @@ -342,8 +342,9 @@ static void system_init(void) #endif } -static void system_process_args(int argc, char *argv[]) +static int system_process_args(int argc, char *argv[]) { + int ret = 0; #ifdef HAVE_MULTIMAN if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXTLAUNCH_MULTIMAN)) { @@ -351,8 +352,11 @@ static void system_process_args(int argc, char *argv[]) strlcpy(g_extern.fullpath, argv[1], sizeof(g_extern.fullpath)); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU); g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT); + ret = 1; } #endif + + return ret; } static void system_deinit(void) diff --git a/frontend/platform/platform_psp.c b/frontend/platform/platform_psp.c index 9d660edfaf..685de35c23 100644 --- a/frontend/platform/platform_psp.c +++ b/frontend/platform/platform_psp.c @@ -97,10 +97,11 @@ static void system_init(void) setup_callback(); } -static void system_process_args(int argc, char *argv[]) +static int system_process_args(int argc, char *argv[]) { (void)argc; (void)argv; + return 0; } static void system_deinit(void) diff --git a/frontend/platform/platform_xdk.c b/frontend/platform/platform_xdk.c index 5c43316e90..ef6d7f007f 100644 --- a/frontend/platform/platform_xdk.c +++ b/frontend/platform/platform_xdk.c @@ -262,10 +262,11 @@ static void system_init(void) #endif } -static void system_process_args(int argc, char *argv[]) +static int system_process_args(int argc, char *argv[]) { (void)argc; (void)argv; + return 0; } static void system_deinit(void) {}