Skip to content

Commit

Permalink
Fixes for building on iOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
armadsen committed Apr 16, 2014
1 parent b03072d commit 492136e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Source/MIKMIDIControlChangeCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (NSData *)fourteenBitDataFromPioneer5ByteData:(NSData *)data

if ([data length] != 6) return nil;

uint8_t statusByte = *(uint8 *)([data bytes] + 3);
uint8_t statusByte = *(uint8_t *)([data bytes] + 3);
if ((statusByte & 0xF0) != (MIKMIDICommandTypeControlChange & 0xF0)) return nil; // Status byte's first nibble should be B for control change

NSData *standardData = [data subdataWithRange:NSMakeRange(1, 2)];
Expand Down
2 changes: 1 addition & 1 deletion Source/MIKMIDIMappingGenerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "MIKMIDIMappingGenerator.h"

#import <MIKMIDI/MIKMIDI.h>
#import "MIKMIDI.h"
#import "MIKMIDIMapping.h"
#import "MIKMIDIPrivateUtilities.h"

Expand Down
7 changes: 3 additions & 4 deletions Source/MIKMIDIMappingManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ - (MIKMIDIMapping *)mappingWithName:(NSString *)mappingName;

- (MIKMIDIMapping *)importMappingFromFileAtURL:(NSURL *)URL overwritingExistingMapping:(BOOL)shouldOverwrite error:(NSError **)error;
{
#if TARGET_OS_IPHONE
return nil;
#endif

#if !TARGET_OS_IPHONE
error = error ? error : &(NSError *__autoreleasing){ nil };
if (![[URL pathExtension] isEqualToString:kMIKMIDIMappingFileExtension]) {
NSString *recoverySuggestion = [NSString stringWithFormat:NSLocalizedString(@"%1$@ can't be imported, because it does not have the file extension %2$@.", @"MIDI mapping import failed because of incorrect file extension message. Placeholder 1 is the filename, 2 is the required extension (e.g. 'midimap')")];
Expand All @@ -111,6 +108,8 @@ - (MIKMIDIMapping *)importMappingFromFileAtURL:(NSURL *)URL overwritingExistingM

[self addUserMappingsObject:mapping];
return mapping;
#endif // TARGET_OS_IPHONE
return nil;
}

- (void)saveMappingsToDisk
Expand Down

0 comments on commit 492136e

Please sign in to comment.