diff --git a/apple/OSX/platform.m b/apple/OSX/platform.m index f828ed4c77..e89ff731b3 100644 --- a/apple/OSX/platform.m +++ b/apple/OSX/platform.m @@ -156,12 +156,10 @@ static char** waiting_argv; for (i = 0; core_list && i < core_list->count; i ++) { - char buf[PATH_MAX]; NSString* desc = (NSString*)BOXSTRING(core_list->list[i].display_name); - NSString *__core = BOXSTRING(core_info_get_id(&core_list->list[i], buf, sizeof(buf))); #if defined(MAC_OS_X_VERSION_10_6) /* FIXME - Rewrite this so that this is no longer an associated object - requires ObjC 2.0 runtime */ - objc_setAssociatedObject(desc, associated_core_key, __core, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + objc_setAssociatedObject(desc, associated_core_key, BOXSTRING(core_list->list[i].path), OBJC_ASSOCIATION_RETAIN_NONATOMIC); #endif [cb addItemWithObjectValue:desc]; } diff --git a/apple/iOS/menu.m b/apple/iOS/menu.m index 677df6fdf0..86465dc8a9 100644 --- a/apple/iOS/menu.m +++ b/apple/iOS/menu.m @@ -883,8 +883,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U for (i = 0; i < core_list->count; i ++) { - char buf[PATH_MAX]; - NSString* core_id = BOXSTRING(core_info_get_id(&core_list->list[i], buf, sizeof(buf))); + NSString* core_id = BOXSTRING(core_list->list[i].path); if (core_info_has_custom_config(core_id.UTF8String)) { @@ -1092,16 +1091,13 @@ static bool copy_config(const char *src_path, const char *dst_path) { if (_path) { - char buf[PATH_MAX]; const core_info_t* core_support = NULL; size_t core_count = 0; - NSString *__core; core_info_list_get_supported_cores(core_list, _path.UTF8String, &core_support, &core_count); - __core = BOXSTRING(core_info_get_id(&core_support[0], buf, sizeof(buf))); if (core_count == 1 && _action) - [self runAction:__core]; + [self runAction:BOXSTRING(core_support[0].path)]; else if (core_count > 1) [self load:(uint32_t)core_count coresFromList:core_support toSection:core_section]; } @@ -1125,10 +1121,9 @@ static bool copy_config(const char *src_path, const char *dst_path) - (void)load:(uint32_t)count coresFromList:(const core_info_t*)list toSection:(NSMutableArray*)array { int i; - char buf[PATH_MAX]; for (i = 0; i < count; i++) - [array addObject:[[RAMenuItemCoreList alloc] initWithCore:BOXSTRING(core_info_get_id(&list[i], buf, sizeof(buf))) parent:self]]; + [array addObject:[[RAMenuItemCoreList alloc] initWithCore:BOXSTRING(list[i].path) parent:self]]; } @end diff --git a/frontend/info/core_info.c b/frontend/info/core_info.c index dfba8b4f7d..050f664bc1 100644 --- a/frontend/info/core_info.c +++ b/frontend/info/core_info.c @@ -472,18 +472,6 @@ const core_info_t *core_info_list_get_by_id(const char *core_id) return 0; } -const char *core_info_get_id(const core_info_t *info, char *buffer, size_t buffer_length) -{ - if (!buffer || !buffer_length) - return ""; - - if (info && info->path && strlcpy(buffer, info->path, buffer_length) < buffer_length) - return buffer; - - *buffer = 0; - return buffer; -} - const char *core_info_get_custom_config(const char *core_id, char *buffer, size_t buffer_length) { if (!core_id || !buffer || !buffer_length) diff --git a/frontend/info/core_info.h b/frontend/info/core_info.h index fef2123e89..93aeaf7e30 100644 --- a/frontend/info/core_info.h +++ b/frontend/info/core_info.h @@ -91,7 +91,6 @@ void core_info_set_config_path(const char *config_path); core_info_list_t *core_info_list_get(void); const core_info_t *core_info_list_get_by_id(const char *core_id); -const char *core_info_get_id(const core_info_t *info, char *buffer, size_t buffer_length); const char *core_info_get_custom_config(const char *core_id, char *buffer, size_t buffer_length); bool core_info_has_custom_config(const char *core_id);