diff --git a/Boxer/BXExternalMT32+BXMT32Sysexes.m b/Boxer/BXExternalMT32+BXMT32Sysexes.m index df210f1c..4073f8d0 100644 --- a/Boxer/BXExternalMT32+BXMT32Sysexes.m +++ b/Boxer/BXExternalMT32+BXMT32Sysexes.m @@ -90,7 +90,7 @@ + (NSData *) dataInSysex: (NSData *)sysex includingAddress: (BOOL)includeAddress } //Calculate the Roland checksum for the specified raw bytes. -+ (NSUInteger) _checksumForBytes: (UInt8 *)bytes length: (NSUInteger)length ++ (NSUInteger) _checksumForBytes: (const UInt8 *)bytes length: (NSUInteger)length { NSUInteger i, checksum = 0; for (i = 0; i < length; i++) checksum += bytes[i]; @@ -110,7 +110,7 @@ + (NSUInteger) checksumForSysex: (NSData *)sysex //The checksum for a Roland sysex message is calculated from //the bytes of the message address and the message data: //skip the bytes before and after that block. - UInt8 *bytes = (UInt8 *)sysex.bytes; + const UInt8 *bytes = sysex.bytes; NSUInteger length = sysex.length - BXRolandSysexHeaderLength - BXRolandSysexTailLength; @@ -152,7 +152,7 @@ + (NSData *) sysexWithData: (NSData *)data forAddress: (UInt8[3])address [sysex appendData: data]; //Calculate the checksum based on the address and data parts of the overall sysex - UInt8 *bytes = (UInt8 *)sysex.bytes; + const UInt8 *bytes = sysex.bytes; NSUInteger checksum = [self _checksumForBytes: &bytes[BXRolandSysexHeaderLength] length: (BXRolandSysexAddressLength + [data length])]; @@ -187,7 +187,7 @@ + (NSData *) sysexRequestForDataOfLength: (NSUInteger)numBytes [sysex appendBytes: requestSize length: BXRolandSysexRequestSizeLength]; //Calculate the checksum based on the address and request size parts of the overall sysex - UInt8 *bytes = (UInt8 *)sysex.bytes; + const UInt8 *bytes = sysex.bytes; NSUInteger checksum = [self _checksumForBytes: &bytes[BXRolandSysexHeaderLength] length: (BXRolandSysexAddressLength + BXRolandSysexRequestSizeLength)];