'Convert to Modern Objective-C Syntax'...
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 26 Feb 2013 17:05:38 +0000 (18:05 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 26 Feb 2013 17:05:38 +0000 (18:05 +0100)
15 files changed:
ApplicationController.m
Config.m
ConfigsController.m
Enjoy.xcodeproj/project.pbxproj
JSActionAnalog.m
JSActionHat.m
Joystick.m
JoystickController.m
Target.m
TargetConfig.m
TargetController.m
TargetKeyboard.m
TargetMouseBtn.m
TargetMouseMove.m
TargetMouseScroll.m

index c87a6ee0ebff6f13e6a09f49ee21a5ef6032e979..4a4deeaeede3cde0d189299c9bd6f5f29aedda0c 100644 (file)
@@ -42,9 +42,9 @@ pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void
        ApplicationController* self = (ApplicationController*)userData;
        NSDictionary* currentApp = [[NSWorkspace sharedWorkspace] activeApplication];
        ProcessSerialNumber psn;
-       psn.lowLongOfPSN = [[currentApp objectForKey:@"NSApplicationProcessSerialNumberLow"] longValue];
-       psn.highLongOfPSN = [[currentApp objectForKey:@"NSApplicationProcessSerialNumberHigh"] longValue];
-       [self->configsController applicationSwitchedTo: [currentApp objectForKey:@"NSApplicationName"] withPsn: psn];
+       psn.lowLongOfPSN = [currentApp[@"NSApplicationProcessSerialNumberLow"] longValue];
+       psn.highLongOfPSN = [currentApp[@"NSApplicationProcessSerialNumberHigh"] longValue];
+       [self->configsController applicationSwitchedTo: currentApp[@"NSApplicationName"] withPsn: psn];
        return noErr;
 }
 
@@ -76,10 +76,10 @@ pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void
        Config* current = [configsController currentConfig];
        NSArray* configs = [configsController configs];
        for(int i=0; i<[configs count]; i++)
-               [[dockMenuBase itemAtIndex: (2+i)] setState: (([configs objectAtIndex:i] == current) ? YES : NO)];
+               [[dockMenuBase itemAtIndex: (2+i)] setState: ((configs[i] == current) ? YES : NO)];
 }
 
 -(void) chooseConfig: (id) sender {
-       [configsController activateConfig: [[configsController configs] objectAtIndex: ([dockMenuBase indexOfItem: sender]-2)] forApplication: NULL];
+       [configsController activateConfig: [configsController configs][([dockMenuBase indexOfItem: sender]-2)] forApplication: NULL];
 }
 @end
index de3c1cc970c278ed428591054175f3acd89815f6..27ca4f0e91912a23585ecd6fbca2c4235e91e1af 100644 (file)
--- a/Config.m
+++ b/Config.m
@@ -20,7 +20,7 @@
        [entries setValue:target forKey: [jsa stringify]];
 }
 -(Target*) getTargetForAction: (id) jsa {
-       return [entries objectForKey: [jsa stringify]];
+       return entries[[jsa stringify]];
 }
 
 @end
index f6770cc78dbffbfb365188f47a67cc36ff465e55..3168f8d31bb7df7b99f4a654d245171364efc316 100644 (file)
 -(IBAction) removePressed: (id)sender {
        // save changes first
        [tableView reloadData];
-       Config* current_config = [configs objectAtIndex: [tableView selectedRow]];
+       Config* current_config = configs[[tableView selectedRow]];
        if([current_config protect])
                return;
        [configs removeObjectAtIndex: [tableView selectedRow]];
        
        // remove all "switch to configuration" actions
        for(int i=0; i<[configs count]; i++) {
-               NSMutableDictionary* entries = [(Config*)[configs objectAtIndex:i] entries];
+               NSMutableDictionary* entries = [(Config*)configs[i] entries];
                for(id key in entries) {
-                       Target* target = (Target*) [entries objectForKey: key];
+                       Target* target = (Target*) entries[key];
                        if([target isKindOfClass: [TargetConfig class]] && [(TargetConfig*)target config] == current_config)
                                [entries removeObjectForKey: key];
                }
 
 -(void)tableViewSelectionDidChange:(NSNotification*) notify {
     if (tableView.selectedRow < configs.count)
-        [self activateConfig: (Config*)[configs objectAtIndex:[tableView selectedRow]] forApplication: NULL];
+        [self activateConfig: (Config*)configs[[tableView selectedRow]] forApplication: NULL];
 }
        
 -(id) tableView: (NSTableView*)view objectValueForTableColumn: (NSTableColumn*) column row: (int) index {
     NSParameterAssert(index >= 0 && index < [configs count]);
-       return [[configs objectAtIndex: index] name];
+       return [configs[index] name];
 }
 
 -(void) tableView: (NSTableView*) view setObjectValue:obj forTableColumn:(NSTableColumn*) col row: (int)index {
     NSParameterAssert(index >= 0 && index < [configs count]);
        /* ugly hack so stringification doesn't fail */
        NSString* newName = [(NSString*)obj stringByReplacingOccurrencesOfString: @"~" withString: @""];
-       [(Config*)[configs objectAtIndex: index] setName: newName];
+       [(Config*)configs[index] setName: newName];
        [targetController refreshConfigsPreservingSelection:YES];
        [tableView reloadData];
        [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged];
 }
 
 -(BOOL)tableView: (NSTableView*)view shouldEditTableColumn: (NSTableColumn*) column row: (int) index {
-       return ![[configs objectAtIndex: index] protect];
+       return ![configs[index] protect];
 }      
 
 -(Config*) currentConfig {
        NSMutableArray* ary = [[NSMutableArray alloc] init];
        for(Config* config in configs) {
                NSMutableDictionary* cfgInfo = [[NSMutableDictionary alloc] init];
-               [cfgInfo setObject:[config name] forKey:@"name"];
+               cfgInfo[@"name"] = [config name];
                NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] init];
                for(id key in [config entries]) {
-                       [cfgEntries setObject:[[[config entries]objectForKey:key]stringify] forKey: key];
+                       cfgEntries[key] = [[config entries][key]stringify];
                }
-               [cfgInfo setObject: cfgEntries forKey: @"entries"];
+               cfgInfo[@"entries"] = cfgEntries;
                [ary addObject: cfgInfo];
        }
-       [envelope setObject: ary forKey: @"configurationList"];
-       [envelope setObject: [NSNumber numberWithInt: [configs indexOfObject: [self currentNeutralConfig] ] ] forKey: @"selectedIndex"];
+       envelope[@"configurationList"] = ary;
+       envelope[@"selectedIndex"] = [NSNumber numberWithInt: [configs indexOfObject: [self currentNeutralConfig] ] ];
        return envelope;
 }
 -(void) loadAllFrom: (NSDictionary*) envelope{
        if(envelope == NULL)
                return;
-       NSArray* ary = [envelope objectForKey: @"configurationList"];
+       NSArray* ary = envelope[@"configurationList"];
        
        NSMutableArray* newConfigs = [[NSMutableArray alloc] init];
        // have to do two passes in case config1 refers to config2 via a TargetConfig
        for(int i=0; i<[ary count]; i++) {
                Config* cfg = [[Config alloc] init];
-               [cfg setName: [[ary objectAtIndex:i] objectForKey:@"name"]];            
+               [cfg setName: ary[i][@"name"]];         
                [newConfigs addObject: cfg];
        }
-       [[configs objectAtIndex:0] setProtect: YES];
+       [configs[0] setProtect: YES];
        for(int i=0; i<[ary count]; i++) {
-               NSDictionary* dict = [[ary objectAtIndex:i] objectForKey:@"entries"];
+               NSDictionary* dict = ary[i][@"entries"];
                for(id key in dict) {
-                       [[[newConfigs objectAtIndex:i] entries]
-                        setObject: [Target unstringify: [dict objectForKey: key] withConfigList: newConfigs]
-                        forKey: key];
+                       [newConfigs[i] entries][key] = [Target unstringify: dict[key] withConfigList: newConfigs];
                }
        }
        
        currentConfig = NULL;
        [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged];
        
-       int index = [[envelope objectForKey: @"selectedIndex"] intValue];
+       int index = [envelope[@"selectedIndex"] intValue];
     if (index < configs.count)
-        [self activateConfig: [configs objectAtIndex:index] forApplication: NULL];
+        [self activateConfig: configs[index] forApplication: NULL];
 }
 
 -(void) applicationSwitchedTo: (NSString*) name withPsn: (ProcessSerialNumber) psn {
        for(int i=0; i<[configs count]; i++) {
-               Config* cfg = [configs objectAtIndex:i];
+               Config* cfg = configs[i];
                if([[cfg name] isEqualToString: name]) {
                        [self activateConfig: cfg forApplication: &psn];
                        return;
index 6ac1e0d4414a81727ccde64a2aa6ed5f607de78d..9fbdbb6f2dd70fdd757d4afee78da568a2dc2a5d 100644 (file)
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                ALWAYS_SEARCH_USER_PATHS = NO;
+                               ARCHS = "$(ARCHS_STANDARD_64_BIT)";
                                COMBINE_HIDPI_IMAGES = YES;
                                COPY_PHASE_STRIP = NO;
                                FRAMEWORK_SEARCH_PATHS = (
                                GCC_PREFIX_HEADER = Enjoy_Prefix.pch;
                                INFOPLIST_FILE = Info.plist;
                                INSTALL_PATH = "$(HOME)/Applications";
-                               MACOSX_DEPLOYMENT_TARGET = 10.6;
+                               MACOSX_DEPLOYMENT_TARGET = 10.6.8;
                                PRODUCT_NAME = Enjoy;
                        };
                        name = Debug;
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                ALWAYS_SEARCH_USER_PATHS = NO;
+                               ARCHS = "$(ARCHS_STANDARD_64_BIT)";
                                COMBINE_HIDPI_IMAGES = YES;
                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
                                FRAMEWORK_SEARCH_PATHS = (
                                GCC_PREFIX_HEADER = Enjoy_Prefix.pch;
                                INFOPLIST_FILE = Info.plist;
                                INSTALL_PATH = "$(HOME)/Applications";
-                               MACOSX_DEPLOYMENT_TARGET = 10.6;
+                               MACOSX_DEPLOYMENT_TARGET = 10.6.8;
                                PRODUCT_NAME = Enjoy;
                        };
                        name = Release;
index e35199613cabfd2fe2e8d43319ad71b41137a0e8..293146421ba1477028ba6ec4d987a9ceb84a2ed1 100644 (file)
@@ -9,12 +9,9 @@
 
 - (id) initWithIndex: (int)newIndex {
        if(self = [super init]) {
-       subActions = [NSArray arrayWithObjects:
-               [[SubAction alloc] initWithIndex: 0 name: @"Low" base: self],
+       subActions = @[[[SubAction alloc] initWithIndex: 0 name: @"Low" base: self],
                [[SubAction alloc] initWithIndex: 1 name: @"High" base: self],
-        [[SubAction alloc] initWithIndex: 2 name: @"Analog" base: self],
-               nil
-       ];
+        [[SubAction alloc] initWithIndex: 2 name: @"Analog" base: self]];
                [subActions retain];
        index = newIndex;
        name = [[NSString alloc] initWithFormat: @"Axis %d", (index+1)];
@@ -23,8 +20,8 @@
 }
 
 -(id) findSubActionForValue: (IOHIDValueRef) value {
-    if ([[subActions objectAtIndex: 2] active]) {
-        return [subActions objectAtIndex: 2]; // TODO?
+    if ([subActions[2] active]) {
+        return subActions[2]; // TODO?
     }
     
     //Target* target = [[base->configsController currentConfig] getTargetForAction: [subActions objectAtIndex: 0]];
     double parsed = [self getRealValue: raw];
        
        if(parsed < -0.3) // fixed?!
-               return [subActions objectAtIndex: 0];
+               return subActions[0];
        else if(parsed > 0.3)
-               return [subActions objectAtIndex: 1];
+               return subActions[1];
        return NULL;
 }
 
 -(void) notifyEvent: (IOHIDValueRef) value {
     // Analog action is always active
-    [[subActions objectAtIndex: 2] setActive: true];
+    [subActions[2] setActive: true];
     
        int raw = IOHIDValueGetIntegerValue(value);
     double parsed = [self getRealValue: raw];
        
-       [[subActions objectAtIndex: 0] setActive: (parsed < -0.3)];
-       [[subActions objectAtIndex: 1] setActive: (parsed > 0.3)];
+       [subActions[0] setActive: (parsed < -0.3)];
+       [subActions[1] setActive: (parsed > 0.3)];
 }
 
 -(double) getRealValue: (int)value {
index 1ea30af7284dd297e931ed684073894c8dd5839f..61241b99c17bbaa9de8a155161bb8f186cf43f32 100644 (file)
@@ -28,13 +28,10 @@ NO,  NO,  YES, NO , // W
 
 - (id) init {
        if(self = [super init]) {
-               subActions = [NSArray arrayWithObjects:
-                                         [[SubAction alloc] initWithIndex: 0 name: @"Up" base: self],
+               subActions = @[[[SubAction alloc] initWithIndex: 0 name: @"Up" base: self],
                                          [[SubAction alloc] initWithIndex: 1 name: @"Down" base: self],
                                          [[SubAction alloc] initWithIndex: 2 name: @"Left" base: self],
-                                         [[SubAction alloc] initWithIndex: 3 name: @"Right" base: self],
-                                         nil
-                                         ];
+                                         [[SubAction alloc] initWithIndex: 3 name: @"Right" base: self]];
                [subActions retain];
                name = @"Hat switch";
        }
@@ -46,34 +43,34 @@ NO,  NO,  YES, NO , // W
        if(IOHIDElementGetLogicalMax(IOHIDValueGetElement(value)) == 7) {
                // 8-way
                switch(parsed) {
-                       case 0: return [subActions objectAtIndex: 0];
-                       case 4: return [subActions objectAtIndex: 1];
-                       case 6: return [subActions objectAtIndex: 2];
-                       case 2: return [subActions objectAtIndex: 3];
+                       case 0: return subActions[0];
+                       case 4: return subActions[1];
+                       case 6: return subActions[2];
+                       case 2: return subActions[3];
                }
        } else  if(IOHIDElementGetLogicalMax(IOHIDValueGetElement(value)) == 8) {
                // 8-way
                switch(parsed) {
-                       case 1: return [subActions objectAtIndex: 0];
-                       case 5: return [subActions objectAtIndex: 1];
-                       case 7: return [subActions objectAtIndex: 2];
-                       case 3: return [subActions objectAtIndex: 3];
+                       case 1: return subActions[0];
+                       case 5: return subActions[1];
+                       case 7: return subActions[2];
+                       case 3: return subActions[3];
                }
        } else if(IOHIDElementGetLogicalMax(IOHIDValueGetElement(value)) == 3) {
                        // 4-way
                switch(parsed) {
-                       case 0: return [subActions objectAtIndex: 0];
-                       case 2: return [subActions objectAtIndex: 1];
-                       case 3: return [subActions objectAtIndex: 2];
-                       case 1: return [subActions objectAtIndex: 3];
+                       case 0: return subActions[0];
+                       case 2: return subActions[1];
+                       case 3: return subActions[2];
+                       case 1: return subActions[3];
                }
        } else if(IOHIDElementGetLogicalMax(IOHIDValueGetElement(value)) == 4) {
                // 4-way
                switch(parsed) {
-                       case 1: return [subActions objectAtIndex: 0];
-                       case 3: return [subActions objectAtIndex: 1];
-                       case 4: return [subActions objectAtIndex: 2];
-                       case 2: return [subActions objectAtIndex: 3];
+                       case 1: return subActions[0];
+                       case 3: return subActions[1];
+                       case 4: return subActions[2];
+                       case 2: return subActions[3];
                }
        }
        return NULL;
@@ -88,7 +85,7 @@ NO,  NO,  YES, NO , // W
        }
        BOOL* activeSubactions = (size == 8) ? active_eightway : active_fourway;
        for(int i=0; i<4; i++)
-               [[subActions objectAtIndex: i] setActive: activeSubactions[parsed * 4 + i]];
+               [subActions[i] setActive: activeSubactions[parsed * 4 + i]];
 }
 
 @end
index 8fa67919789fde788b7c9bd807e787d63f21146a..fd08ee6748ddcdbfb9266da3711613bd786a8130 100644 (file)
@@ -48,7 +48,7 @@
        int axes = 0;
        
        for(int i=0; i<[elements count]; i++) {
-               IOHIDElementRef element = (IOHIDElementRef)[elements objectAtIndex: i];
+               IOHIDElementRef element = (IOHIDElementRef)elements[i];
                int type = IOHIDElementGetType(element);
                int usage = IOHIDElementGetUsage(element);
                int usagePage = IOHIDElementGetUsagePage(element);
@@ -96,8 +96,8 @@
 
 - (JSAction*) findActionByCookie: (void*) cookie {
        for(int i=0; i<[children count]; i++)
-               if([[children objectAtIndex:i]cookie] == cookie)
-                       return (JSAction*)[children objectAtIndex:i];
+               if([children[i]cookie] == cookie)
+                       return (JSAction*)children[i];
        return NULL;
 }
 
index 1bf5b4384b16d4ccb560fcd3e72f13e1526ca8d8..6b748df7a33eaae1322268b63f4bbd59951e03df 100644 (file)
@@ -23,7 +23,7 @@
 
 -(void) finalize {
        for(int i=0; i<[joysticks count]; i++) {
-               [[joysticks objectAtIndex:i] invalidate];
+               [joysticks[i] invalidate];
        }
        IOHIDManagerClose(hidManager, kIOHIDOptionsTypeNone);
        CFRelease(hidManager);
@@ -33,8 +33,8 @@
 static NSMutableDictionary* create_criterion( UInt32 inUsagePage, UInt32 inUsage )
 {
        NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
-       [dict setObject: [NSNumber numberWithInt: inUsagePage] forKey: (NSString*)CFSTR(kIOHIDDeviceUsagePageKey)];
-       [dict setObject: [NSNumber numberWithInt: inUsage] forKey: (NSString*)CFSTR(kIOHIDDeviceUsageKey)];
+       dict[(NSString*)CFSTR(kIOHIDDeviceUsagePageKey)] = [NSNumber numberWithInt: inUsagePage];
+       dict[(NSString*)CFSTR(kIOHIDDeviceUsageKey)] = [NSNumber numberWithInt: inUsage];
        return dict;
 } 
 
@@ -74,7 +74,7 @@ void input_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDVal
                [mainAction notifyEvent: value];
                NSArray* subactions = [mainAction subActions];
                if(!subactions)
-                       subactions = [NSArray arrayWithObject:mainAction];
+                       subactions = @[mainAction];
                for(id subaction in subactions) {
                        Target* target = [[self->configsController currentConfig] getTargetForAction:subaction];
                        if(!target)
@@ -121,7 +121,7 @@ int findAvailableIndex(id list, Joystick* js) {
        for(int index=0;;index++) {
                available = YES;
                for(int i=0; i<[list count]; i++) {
-                       js2 = [list objectAtIndex: i];
+                       js2 = list[i];
                        if([js2 vendorId] == [js vendorId] && [js2 productId] == [js productId] && [js index] == index) {
                                available = NO;
                                break;
@@ -169,12 +169,9 @@ void remove_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDe
 
 -(void) setup {
     hidManager = IOHIDManagerCreate( kCFAllocatorDefault, kIOHIDOptionsTypeNone);
-       NSArray *criteria = [NSArray arrayWithObjects: 
-                create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick),
+       NSArray *criteria = @[create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick),
                 create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad),
-         create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_MultiAxisController),
-         //create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard),
-       nil];
+         create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_MultiAxisController)];
        
        IOHIDManagerSetDeviceMatchingMultiple(hidManager, (CFArrayRef)criteria);
     
@@ -234,13 +231,13 @@ void remove_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDe
 
 - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item {
        if(item == nil) 
-               return [joysticks objectAtIndex: index];
+               return joysticks[index];
 
        if([item isKindOfClass: [Joystick class]])
-               return [[item children] objectAtIndex: index];
+               return [item children][index];
        
        if([item isKindOfClass: [JSAction class]]) 
-               return [[item subActions] objectAtIndex:index];
+               return [item subActions][index];
 
        return NULL;
 }
index ec2d6a16462c5b5f1701f97143e45ff017d5ee9b..052f01a852e407d132cbfd59963ed27064846d4c 100644 (file)
--- a/Target.m
+++ b/Target.m
@@ -10,7 +10,7 @@
 +(Target*) unstringify: (NSString*) str withConfigList: (NSArray*) configs {
        NSArray* components = [str componentsSeparatedByString:@"~"];
        NSParameterAssert([components count]);
-       NSString* typeTag = [components objectAtIndex:0];
+       NSString* typeTag = components[0];
        if([typeTag isEqualToString:@"key"])
                return [TargetKeyboard unstringifyImpl:components];
        if([typeTag isEqualToString:@"cfg"])
index dae77866b6ba7a8777718a82cd7c70d71ea6fbcf..f62755d1da5912ea499183bb7df8f17e2653d7b9 100644 (file)
 
 +(TargetConfig*) unstringifyImpl: (NSArray*) comps withConfigList: (NSArray*) configs {
        NSParameterAssert([comps count] == 2);
-       NSString* name = [comps objectAtIndex: 1];
+       NSString* name = comps[1];
        TargetConfig* target = [[TargetConfig alloc] init];
        for(int i=0; i<[configs count]; i++)
-               if([[[configs objectAtIndex:i] name] isEqualToString:name]) {
-                       [target setConfig: [configs objectAtIndex:i]];
+               if([[configs[i] name] isEqualToString:name]) {
+                       [target setConfig: configs[i]];
                        return target;
                }
        NSLog(@"Warning: couldn't find matching config to restore from: %@",name);
index 3442a61e3912169d45437683405bcff8e7f9ad24..9f85fd989913d0ec25db1974fdbf8d4854eb5352 100644 (file)
@@ -47,7 +47,7 @@
                case 2:
                {
                        TargetConfig* c = [[TargetConfig alloc] init];
-                       [c setConfig: [[configsController configs] objectAtIndex: [configPopup indexOfSelectedItem]]];
+                       [c setConfig: [configsController configs][[configPopup indexOfSelectedItem]]];
                        return c;
                }
         case 3: {
        NSArray* configs = [configsController configs];
        [configPopup removeAllItems];
        for(int i=0; i<[configs count]; i++) {
-               [configPopup addItemWithTitle: [[configs objectAtIndex:i]name]];
+               [configPopup addItemWithTitle: [configs[i]name]];
        }
        if(preserve)
                [configPopup selectItemAtIndex:initialIndex];
index 40661b8c2a4b41e42d8f534efaef1569c763af1a..f171a50976a50624ca6cb49b54dbe66ee33270a2 100644 (file)
@@ -16,8 +16,8 @@
 +(TargetKeyboard*) unstringifyImpl: (NSArray*) comps {
        NSParameterAssert([comps count] == 3);
        TargetKeyboard* target = [[TargetKeyboard alloc] init];
-       [target setVk: [[comps objectAtIndex:1] integerValue]];
-       [target setDescr: [comps objectAtIndex:2]];
+       [target setVk: [comps[1] integerValue]];
+       [target setDescr: comps[2]];
        return target;
 }
 
index 74298746cfd67fa3d990aea981364d851b046f02..172f7406f1a1d0d3c1a56d53b2a37d2fed5b9f6c 100644 (file)
@@ -19,7 +19,7 @@
 +(TargetMouseBtn*) unstringifyImpl: (NSArray*) comps {
        NSParameterAssert([comps count] == 2);
        TargetMouseBtn* target = [[TargetMouseBtn alloc] init];
-       [target setWhich: [[comps objectAtIndex:1] integerValue]];
+       [target setWhich: [comps[1] integerValue]];
        return target;
 }
 
index 8cf09d2c508a3fb418f3705911b3eac31859dd12..86dd7367749b562936018f232bfb253b8da3caa4 100644 (file)
@@ -23,7 +23,7 @@
 +(TargetMouseMove*) unstringifyImpl: (NSArray*) comps {
        NSParameterAssert([comps count] == 2);
        TargetMouseMove* target = [[TargetMouseMove alloc] init];
-       [target setDir: [[comps objectAtIndex:1] integerValue]];
+       [target setDir: [comps[1] integerValue]];
        return target;
 }
 
index a1cca9c94d926816c95e8106f5c25cc7345f0bd7..be64f7a2986c4e9824a0534ccd4d7dea6dec744f 100644 (file)
@@ -19,7 +19,7 @@
 +(TargetMouseScroll*) unstringifyImpl: (NSArray*) comps {
        NSParameterAssert([comps count] == 2);
        TargetMouseScroll* target = [[TargetMouseScroll alloc] init];
-       [target setHowMuch: [[comps objectAtIndex:1] integerValue]];
+       [target setHowMuch: [comps[1] integerValue]];
        return target;
 }