From 6cb17bc4cb9985b3eb02ec9b6cf4d433b67f91dc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 8 Jul 2014 18:29:28 +0200 Subject: [PATCH] (iOS) menu.m - more cleanups/build fixes --- apple/iOS/menu.m | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/apple/iOS/menu.m b/apple/iOS/menu.m index 3a11502f6b..951308e9b2 100644 --- a/apple/iOS/menu.m +++ b/apple/iOS/menu.m @@ -875,10 +875,8 @@ static void RunActionSheet(const char* title, const struct string_list* items, U [cores addObject:[RAMenuItemBasic itemWithDescription:BOXSTRING("New Config for Core") action: ^{ [weakSelf createNewConfig]; }]]; - - core_list = (const core_info_list_t*)core_info_list_get(); - if !(core_list) + if (!(core_list = (const core_info_list_t*)core_info_list_get())) return; for (i = 0; i < core_list->count; i ++) @@ -1003,16 +1001,11 @@ static void RunActionSheet(const char* title, const struct string_list* items, U - (UITableViewCell*)cellForTableView:(UITableView*)tableView { + UITableViewCell *result; static NSString* const cell_id = @"RAMenuItemCoreList"; - UITableViewCell* result = [tableView dequeueReusableCellWithIdentifier:cell_id]; - if (!result) - { + if (!(result = [tableView dequeueReusableCellWithIdentifier:cell_id])) result = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cell_id]; -// UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoDark]; -// [infoButton addTarget:self action:@selector(infoButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; -// result.accessoryView = infoButton; - } result.textLabel.text = apple_get_core_display_name(self.core); return result; @@ -1060,7 +1053,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U [self.sections addObject:core_section]; - if (core_list = (core_info_list_t*)core_info_list_get()) + if ((core_list = (core_info_list_t*)core_info_list_get())) { if (_path) { @@ -1094,6 +1087,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U - (void)load:(uint32_t)count coresFromList:(const core_info_t*)list toSection:(NSMutableArray*)array { int i; + for (i = 0; i < count; i++) [array addObject:[[RAMenuItemCoreList alloc] initWithCore:apple_get_core_id(&list[i]) parent:self]]; } @@ -1111,7 +1105,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U if ((self = [super initWithStyle:UITableViewStylePlain])) { FILE *file; - NSMutableArray* data = [NSMutableArray arrayWithObject:@""]; + NSMutableArray* data = [NSMutableArray arrayWithObject:BOXSTRING("")]; fflush(stdout); fflush(stderr); @@ -1154,7 +1148,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U result = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cell_id]; result.selectionStyle = UITableViewCellSelectionStyleNone; - result.textLabel.text = @"Slot"; + result.textLabel.text = BOXSTRING("Slot"); UISegmentedControl* accessory = [[UISegmentedControl alloc] initWithItems:@[@"0", @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9"]]; [accessory addTarget:[self class] action:@selector(changed:) forControlEvents:UIControlEventValueChanged];