mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-31 08:33:40 +00:00
better handling of errors in flseek
This commit is contained in:
commit
ef0ff647fd
@ -157,6 +157,10 @@ ifeq ($(HAVE_LIBSICKSAXIS), 1)
|
||||
CFLAGS += -DHAVE_LIBSICKSAXIS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
CFLAGS += -DHAVE_LIBRETRODB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPNG), 1)
|
||||
CFLAGS += -DWANT_RPNG
|
||||
endif
|
||||
|
@ -106,7 +106,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
||||
|
||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG
|
||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LIBRETRODB -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
PPU_OPTIMIZE_LV := -O0 -g
|
||||
|
@ -128,7 +128,7 @@ static void salamander_init(char *s, size_t len)
|
||||
if (!config_file_exists || !strcmp(s, ""))
|
||||
find_and_set_first_file(s, len, EXT_EXECUTABLES);
|
||||
else
|
||||
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", len);
|
||||
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", s);
|
||||
|
||||
if (!config_file_exists)
|
||||
{
|
||||
@ -136,7 +136,7 @@ static void salamander_init(char *s, size_t len)
|
||||
|
||||
if (conf)
|
||||
{
|
||||
config_set_string(conf, "libretro_path", len);
|
||||
config_set_string(conf, "libretro_path", s);
|
||||
config_file_write(conf, g_defaults.config_path);
|
||||
config_file_free(conf);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ static void* ps3_input_init(void)
|
||||
ps3->joypad = input_joypad_init_driver(settings->input.joypad_driver, ps3);
|
||||
|
||||
if (ps3->joypad)
|
||||
ps3->joypad->init();
|
||||
ps3->joypad->init(ps3);
|
||||
|
||||
#ifdef HAVE_MOUSE
|
||||
cellMouseInit(MAX_MICE);
|
||||
|
@ -185,7 +185,8 @@ static struct buffer parse_argument(struct buffer buff, struct argument *arg,
|
||||
static struct rmsgpack_dom_value is_true(struct rmsgpack_dom_value input,
|
||||
unsigned argc, const struct argument *argv)
|
||||
{
|
||||
struct rmsgpack_dom_value res = {0};
|
||||
struct rmsgpack_dom_value res;
|
||||
memset(&res, 0, sizeof(res));
|
||||
|
||||
res.type = RDT_BOOL;
|
||||
res.bool_ = 0;
|
||||
@ -202,7 +203,8 @@ static struct rmsgpack_dom_value equals(struct rmsgpack_dom_value input,
|
||||
unsigned argc, const struct argument * argv)
|
||||
{
|
||||
struct argument arg;
|
||||
struct rmsgpack_dom_value res = {0};
|
||||
struct rmsgpack_dom_value res;
|
||||
memset(&res, 0, sizeof(res));
|
||||
|
||||
res.type = RDT_BOOL;
|
||||
|
||||
@ -231,7 +233,8 @@ static struct rmsgpack_dom_value operator_or(struct rmsgpack_dom_value input,
|
||||
unsigned argc, const struct argument * argv)
|
||||
{
|
||||
unsigned i;
|
||||
struct rmsgpack_dom_value res = {0};
|
||||
struct rmsgpack_dom_value res;
|
||||
memset(&res, 0, sizeof(res));
|
||||
|
||||
res.type = RDT_BOOL;
|
||||
res.bool_ = 0;
|
||||
@ -258,8 +261,9 @@ static struct rmsgpack_dom_value operator_or(struct rmsgpack_dom_value input,
|
||||
static struct rmsgpack_dom_value between(struct rmsgpack_dom_value input,
|
||||
unsigned argc, const struct argument * argv)
|
||||
{
|
||||
struct rmsgpack_dom_value res = {0};
|
||||
struct rmsgpack_dom_value res;
|
||||
unsigned i = 0;
|
||||
memset(&res, 0, sizeof(res));
|
||||
|
||||
res.type = RDT_BOOL;
|
||||
res.bool_ = 0;
|
||||
@ -292,7 +296,8 @@ static struct rmsgpack_dom_value operator_and(struct rmsgpack_dom_value input,
|
||||
unsigned argc, const struct argument * argv)
|
||||
{
|
||||
unsigned i;
|
||||
struct rmsgpack_dom_value res = {0};
|
||||
struct rmsgpack_dom_value res;
|
||||
memset(&res, 0, sizeof(res));
|
||||
|
||||
res.type = RDT_BOOL;
|
||||
res.bool_ = 0;
|
||||
@ -320,8 +325,9 @@ static struct rmsgpack_dom_value operator_and(struct rmsgpack_dom_value input,
|
||||
static struct rmsgpack_dom_value q_glob(struct rmsgpack_dom_value input,
|
||||
unsigned argc, const struct argument * argv)
|
||||
{
|
||||
struct rmsgpack_dom_value res;
|
||||
unsigned i = 0;
|
||||
struct rmsgpack_dom_value res = {0};
|
||||
memset(&res, 0, sizeof(res));
|
||||
|
||||
res.type = RDT_BOOL;
|
||||
res.bool_ = 0;
|
||||
@ -347,9 +353,10 @@ static struct rmsgpack_dom_value all_map(struct rmsgpack_dom_value input,
|
||||
{
|
||||
unsigned i;
|
||||
struct argument arg;
|
||||
struct rmsgpack_dom_value res;
|
||||
struct rmsgpack_dom_value nil_value;
|
||||
struct rmsgpack_dom_value res = {0};
|
||||
struct rmsgpack_dom_value *value = NULL;
|
||||
memset(&res, 0, sizeof(res));
|
||||
|
||||
nil_value.type = RDT_NULL;
|
||||
res.type = RDT_BOOL;
|
||||
@ -700,7 +707,7 @@ static struct buffer parse_table(struct buffer buff,
|
||||
unsigned i;
|
||||
const char *ident_name;
|
||||
size_t ident_len;
|
||||
struct argument args[MAX_ARGS] = {{0}};
|
||||
struct argument args[MAX_ARGS];
|
||||
unsigned argi = 0;
|
||||
|
||||
buff = chomp(buff);
|
||||
|
@ -130,62 +130,6 @@ int cb_core_updater_download(void *data, size_t len)
|
||||
}
|
||||
#endif
|
||||
|
||||
int menu_entries_common_is_settings_entry(const char *label)
|
||||
{
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
|
||||
switch (hash)
|
||||
{
|
||||
case MENU_LABEL_DRIVER_SETTINGS:
|
||||
case MENU_LABEL_CORE_SETTINGS:
|
||||
case MENU_LABEL_CONFIGURATION_SETTINGS:
|
||||
case MENU_LABEL_LOGGING_SETTINGS:
|
||||
case MENU_LABEL_SAVING_SETTINGS:
|
||||
case MENU_LABEL_REWIND_SETTINGS:
|
||||
case MENU_LABEL_VIDEO_SETTINGS:
|
||||
case MENU_LABEL_RECORDING_SETTINGS:
|
||||
case MENU_LABEL_FRAME_THROTTLE_SETTINGS:
|
||||
case MENU_LABEL_SHADER_SETTINGS:
|
||||
case MENU_LABEL_ONSCREEN_DISPLAY_SETTINGS:
|
||||
case MENU_LABEL_AUDIO_SETTINGS:
|
||||
case MENU_LABEL_INPUT_SETTINGS:
|
||||
case MENU_LABEL_INPUT_USER_1_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_2_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_3_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_4_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_5_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_6_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_7_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_8_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_9_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_10_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_11_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_12_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_13_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_14_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_15_BINDS:
|
||||
case MENU_LABEL_INPUT_USER_16_BINDS:
|
||||
case MENU_LABEL_INPUT_HOTKEY_SETTINGS:
|
||||
case MENU_LABEL_OVERLAY_SETTINGS:
|
||||
case MENU_LABEL_ONSCREEN_KEYBOARD_OVERLAY_SETTINGS:
|
||||
case MENU_LABEL_MENU_SETTINGS:
|
||||
case MENU_LABEL_UI_SETTINGS:
|
||||
case MENU_LABEL_PATCH_SETTINGS:
|
||||
case MENU_LABEL_PLAYLIST_SETTINGS:
|
||||
case MENU_LABEL_CORE_UPDATER_SETTINGS:
|
||||
case MENU_LABEL_NETWORK_SETTINGS:
|
||||
case MENU_LABEL_ARCHIVE_SETTINGS:
|
||||
case MENU_LABEL_USER_SETTINGS:
|
||||
case MENU_LABEL_DIRECTORY_SETTINGS:
|
||||
case MENU_LABEL_PRIVACY_SETTINGS:
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#define DEBUG_LOG
|
||||
#endif
|
||||
|
@ -45,8 +45,6 @@ int action_right_cheat(unsigned type, const char *label,
|
||||
|
||||
void menu_entries_common_load_content(bool persist);
|
||||
|
||||
int menu_entries_common_is_settings_entry(const char *label);
|
||||
|
||||
int menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
|
@ -460,19 +460,6 @@ static int menu_entries_cbs_init_bind_deferred_push_compare_label(menu_file_list
|
||||
{
|
||||
if (strstr(label, "deferred_rdb_entry_detail"))
|
||||
cbs->action_deferred_push = deferred_push_rdb_entry_detail;
|
||||
else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int menu_entries_cbs_init_bind_deferred_push_compare_type(menu_file_list_cbs_t *cbs, unsigned type,
|
||||
uint32_t label_hash)
|
||||
{
|
||||
if (type == MENU_SETTING_GROUP)
|
||||
cbs->action_deferred_push = deferred_push_category;
|
||||
else if (type == MENU_FILE_PLAYLIST_COLLECTION)
|
||||
cbs->action_deferred_push = deferred_push_rdb_collection;
|
||||
else
|
||||
{
|
||||
switch (label_hash)
|
||||
@ -631,21 +618,35 @@ static int menu_entries_cbs_init_bind_deferred_push_compare_type(menu_file_list_
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int menu_entries_cbs_init_bind_deferred_push_compare_type(menu_file_list_cbs_t *cbs, unsigned type,
|
||||
uint32_t label_hash)
|
||||
{
|
||||
if (type == MENU_SETTING_GROUP)
|
||||
cbs->action_deferred_push = deferred_push_category;
|
||||
else if (type == MENU_FILE_PLAYLIST_COLLECTION)
|
||||
cbs->action_deferred_push = deferred_push_rdb_collection;
|
||||
else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_setting_t *setting = menu_setting_find(elem0);
|
||||
|
||||
if (!cbs)
|
||||
return -1;
|
||||
|
||||
cbs->action_deferred_push = deferred_push_default;
|
||||
|
||||
if ((strlen(elem1) != 0) && !!strcmp(elem0, elem1))
|
||||
if (setting)
|
||||
{
|
||||
if (menu_entries_common_is_settings_entry(elem0))
|
||||
if (!strcmp(setting->parent_group, "Main Menu") && setting->type == ST_GROUP)
|
||||
{
|
||||
if (!settings->menu.collapse_subgroups_enable)
|
||||
{
|
||||
|
@ -347,10 +347,11 @@ static int menu_entries_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *c
|
||||
const char *label, uint32_t label_hash, const char *elem0)
|
||||
{
|
||||
unsigned i;
|
||||
rarch_setting_t *setting = menu_setting_find(label);
|
||||
|
||||
if (label)
|
||||
if (setting)
|
||||
{
|
||||
if (menu_entries_common_is_settings_entry(elem0))
|
||||
if (!strcmp(setting->parent_group, "Main Menu") && setting->type == ST_GROUP)
|
||||
{
|
||||
cbs->action_left = action_left_scroll;
|
||||
return 0;
|
||||
@ -447,6 +448,7 @@ static int menu_entries_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cb
|
||||
case MENU_FILE_DOWNLOAD_CORE:
|
||||
case MENU_FILE_CHEAT:
|
||||
case MENU_FILE_REMAP:
|
||||
case MENU_FILE_PLAYLIST_COLLECTION:
|
||||
case MENU_SETTING_GROUP:
|
||||
switch (menu_label_hash)
|
||||
{
|
||||
|
@ -392,6 +392,7 @@ static int menu_entries_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *c
|
||||
case MENU_FILE_DOWNLOAD_CORE:
|
||||
case MENU_FILE_CHEAT:
|
||||
case MENU_FILE_REMAP:
|
||||
case MENU_FILE_PLAYLIST_COLLECTION:
|
||||
case MENU_SETTING_GROUP:
|
||||
switch (menu_label_hash)
|
||||
{
|
||||
@ -419,10 +420,11 @@ static int menu_entries_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *
|
||||
const char *label, uint32_t label_hash, uint32_t menu_label_hash, const char *elem0)
|
||||
{
|
||||
unsigned i;
|
||||
rarch_setting_t *setting = menu_setting_find(label);
|
||||
|
||||
if (label)
|
||||
if (setting)
|
||||
{
|
||||
if (menu_entries_common_is_settings_entry(elem0))
|
||||
if (!strcmp(setting->parent_group, "Settings") && setting->type == ST_GROUP)
|
||||
{
|
||||
cbs->action_right = action_right_scroll;
|
||||
return 0;
|
||||
|
@ -45,6 +45,8 @@ static int action_get_title_default(const char *path, const char *label,
|
||||
char elem0_path[PATH_MAX_LENGTH], elem1_path[PATH_MAX_LENGTH];
|
||||
struct string_list *list_label = string_split(label, "|");
|
||||
struct string_list *list_path = string_split(path, "|");
|
||||
driver_t *driver = driver_get_ptr();
|
||||
rarch_setting_t *setting = NULL;
|
||||
|
||||
*elem0 = *elem1 = *elem0_path = *elem1_path = 0;
|
||||
|
||||
@ -70,22 +72,27 @@ static int action_get_title_default(const char *path, const char *label,
|
||||
string_list_free(list_path);
|
||||
}
|
||||
|
||||
hash = djb2_calculate(label);
|
||||
|
||||
#if 0
|
||||
RARCH_LOG("label %s, elem0 %s, elem1 %s\n", label, elem0, elem1);
|
||||
#endif
|
||||
|
||||
if (menu_entries_common_is_settings_entry(label) == 1)
|
||||
setting = menu_setting_find(label);
|
||||
|
||||
if (setting)
|
||||
{
|
||||
strlcpy(s, string_to_upper(elem0), len);
|
||||
if (elem1[0] != '\0')
|
||||
if (!strcmp(setting->parent_group, "Main Menu") && setting->type == ST_GROUP)
|
||||
{
|
||||
strlcat(s, " - ", len);
|
||||
strlcat(s, string_to_upper(elem1), len);
|
||||
strlcpy(s, string_to_upper(elem0), len);
|
||||
if (elem1[0] != '\0')
|
||||
{
|
||||
strlcat(s, " - ", len);
|
||||
strlcat(s, string_to_upper(elem1), len);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
hash = djb2_calculate(label);
|
||||
|
||||
switch (hash)
|
||||
{
|
||||
@ -283,36 +290,36 @@ static int action_get_title_default(const char *path, const char *label,
|
||||
snprintf(s, len, "AUTOCONFIG DIR %s", path);
|
||||
break;
|
||||
default:
|
||||
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT ||
|
||||
menu_type == MENU_SETTINGS)
|
||||
snprintf(s, len, "MENU %s", path);
|
||||
else if (menu_type == MENU_SETTINGS_CUSTOM_BIND ||
|
||||
menu_type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD)
|
||||
switch (menu_type)
|
||||
{
|
||||
strlcpy(s, "INPUT SETTINGS", len);
|
||||
if (elem1[0] != '\0')
|
||||
{
|
||||
strlcat(s, " - ", len);
|
||||
strlcat(s, string_to_upper(elem1), len);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
case MENU_SETTINGS_CUSTOM_VIEWPORT:
|
||||
case MENU_SETTINGS:
|
||||
snprintf(s, len, "MENU %s", path);
|
||||
break;
|
||||
case MENU_SETTINGS_CUSTOM_BIND:
|
||||
case MENU_SETTINGS_CUSTOM_BIND_KEYBOARD:
|
||||
strlcpy(s, "INPUT SETTINGS", len);
|
||||
if (elem1[0] != '\0')
|
||||
{
|
||||
strlcat(s, " - ", len);
|
||||
strlcat(s, string_to_upper(elem1), len);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (driver->menu->defer_core)
|
||||
snprintf(s, len, "CONTENT %s", path);
|
||||
else
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
const char *core_name = global->menu.info.library_name;
|
||||
|
||||
if (driver->menu->defer_core)
|
||||
snprintf(s, len, "CONTENT %s", path);
|
||||
else
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
const char *core_name = global->menu.info.library_name;
|
||||
|
||||
if (!core_name)
|
||||
core_name = global->system.info.library_name;
|
||||
if (!core_name)
|
||||
core_name = "No Core";
|
||||
snprintf(s, len, "CONTENT (%s) %s", core_name, path);
|
||||
}
|
||||
if (!core_name)
|
||||
core_name = global->system.info.library_name;
|
||||
if (!core_name)
|
||||
core_name = "No Core";
|
||||
snprintf(s, len, "CONTENT (%s) %s", core_name, path);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -135,6 +135,7 @@ typedef struct rarch_setting
|
||||
const char *short_description;
|
||||
const char *group;
|
||||
const char *subgroup;
|
||||
const char *parent_group;
|
||||
const char *values;
|
||||
|
||||
uint32_t index;
|
||||
|
Loading…
x
Reference in New Issue
Block a user