1
0
mirror of https://github.com/libretro/RetroArch synced 2025-04-02 16:20:39 +00:00

(ObjC) Avoid local variables named index

This commit is contained in:
twinaphex 2014-10-20 19:33:50 +02:00
parent 7dbf9f2298
commit 16d440e6a3
3 changed files with 15 additions and 15 deletions

@ -60,13 +60,13 @@ static void* const associated_name_tag = (void*)&associated_name_tag;
- (void)checkBind:(NSTimer*)send - (void)checkBind:(NSTimer*)send
{ {
int32_t value = 0; int32_t value = 0;
int32_t index = self.setting->index ? self.setting->index - 1 : 0; int32_t idx = self.setting->index ? self.setting->index - 1 : 0;
if ((value = apple_input_find_any_key())) if ((value = apple_input_find_any_key()))
BINDFOR(*[self setting]).key = input_translate_keysym_to_rk(value); BINDFOR(*[self setting]).key = input_translate_keysym_to_rk(value);
else if ((value = apple_input_find_any_button(index)) >= 0) else if ((value = apple_input_find_any_button(idx)) >= 0)
BINDFOR(*[self setting]).joykey = value; BINDFOR(*[self setting]).joykey = value;
else if ((value = apple_input_find_any_axis(index))) else if ((value = apple_input_find_any_axis(idx)))
BINDFOR(*[self setting]).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1); BINDFOR(*[self setting]).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1);
else else
return; return;
@ -211,9 +211,9 @@ NSWindowDelegate>
return (item == nil) ? [self.currentGroup count] : [item count]; return (item == nil) ? [self.currentGroup count] : [item count];
} }
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)idx ofItem:(id)item
{ {
return (item == nil) ? [self.currentGroup objectAtIndex:index] : [item objectAtIndex:index]; return (item == nil) ? [self.currentGroup objectAtIndex:idx] : [item objectAtIndex:idx];
} }
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item

@ -306,11 +306,11 @@ static void file_action(enum file_action action, NSString* source, NSString* tar
if (gesture.state == UIGestureRecognizerStateBegan) if (gesture.state == UIGestureRecognizerStateBegan)
{ {
CGPoint point = [gesture locationInView:self.tableView]; CGPoint point = [gesture locationInView:self.tableView];
NSIndexPath* indexPath = [self.tableView indexPathForRowAtPoint:point]; NSIndexPath* idx_path = [self.tableView indexPathForRowAtPoint:point];
if (indexPath) if (idx_path)
{ {
self.selectedItem = [self itemForIndexPath:indexPath]; self.selectedItem = [self itemForIndexPath:idx_path];
bool is_zip = [[self.selectedItem.path pathExtension] isEqualToString:@"zip"]; bool is_zip = [[self.selectedItem.path pathExtension] isEqualToString:@"zip"];
NSString* button4_name = (IOS_IS_VERSION_7_OR_HIGHER()) ? @"AirDrop" : @"Delete"; NSString* button4_name = (IOS_IS_VERSION_7_OR_HIGHER()) ? @"AirDrop" : @"Delete";

@ -501,16 +501,16 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
- (void)checkBind:(NSTimer*)send - (void)checkBind:(NSTimer*)send
{ {
int32_t value = 0; int32_t value = 0;
int32_t index = 0; int32_t idx = 0;
if (self.setting->index) if (self.setting->index)
index = self.setting->index - 1; idx = self.setting->index - 1;
if ((value = apple_input_find_any_key())) if ((value = apple_input_find_any_key()))
BINDFOR(*self.setting).key = input_translate_keysym_to_rk(value); BINDFOR(*self.setting).key = input_translate_keysym_to_rk(value);
else if ((value = apple_input_find_any_button(index)) >= 0) else if ((value = apple_input_find_any_button(idx)) >= 0)
BINDFOR(*self.setting).joykey = value; BINDFOR(*self.setting).joykey = value;
else if ((value = apple_input_find_any_axis(index))) else if ((value = apple_input_find_any_axis(idx)))
BINDFOR(*self.setting).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1); BINDFOR(*self.setting).joyaxis = (value > 0) ? AXIS_POS(value - 1) : AXIS_NEG(abs(value) - 1);
else else
return; return;
@ -1062,12 +1062,12 @@ static bool copy_config(const char *src_path, const char *dst_path)
return self; return self;
} }
- (void)editValue:(uint32_t)index - (void)editValue:(uint32_t)idx
{ {
RACoreOptionsMenu __weak* weakSelf = self; RACoreOptionsMenu __weak* weakSelf = self;
self.currentIndex = index; self.currentIndex = idx;
RunActionSheet(core_option_get_desc(g_extern.system.core_options, index), core_option_get_vals(g_extern.system.core_options, index), self.tableView, RunActionSheet(core_option_get_desc(g_extern.system.core_options, idx), core_option_get_vals(g_extern.system.core_options, idx), self.tableView,
^(UIActionSheet* actionSheet, NSInteger buttonIndex) ^(UIActionSheet* actionSheet, NSInteger buttonIndex)
{ {
if (buttonIndex != actionSheet.cancelButtonIndex) if (buttonIndex != actionSheet.cancelButtonIndex)