diff --git a/xcode/OLMKit/OLMAccount.mm b/xcode/OLMKit/OLMAccount.mm index 9e48c2d..84bf1cb 100644 --- a/xcode/OLMKit/OLMAccount.mm +++ b/xcode/OLMKit/OLMAccount.mm @@ -83,7 +83,7 @@ /** public identity keys */ - (NSDictionary*) identityKeys { size_t identityKeysLength = olm_account_identity_keys_length(_account); - uint8_t *identityKeysBytes = malloc(identityKeysLength); + uint8_t *identityKeysBytes = (uint8_t *)malloc(identityKeysLength); if (!identityKeysBytes) { return nil; } @@ -124,7 +124,7 @@ - (NSDictionary*) oneTimeKeys { size_t otkLength = olm_account_one_time_keys_length(_account); - uint8_t *otkBytes = malloc(otkLength); + uint8_t *otkBytes = (uint8_t *)malloc(otkLength); if (!otkBytes) { return nil; } diff --git a/xcode/OLMKit/OLMInboundGroupSession.mm b/xcode/OLMKit/OLMInboundGroupSession.mm index 9e57741..b2be87d 100644 --- a/xcode/OLMKit/OLMInboundGroupSession.mm +++ b/xcode/OLMKit/OLMInboundGroupSession.mm @@ -38,7 +38,8 @@ self = [super init]; if (self) { - session = malloc(olm_inbound_group_session_size()); + session = (OlmInboundGroupSession *) + malloc(olm_inbound_group_session_size()); if (session) { session = olm_inbound_group_session(session); } diff --git a/xcode/OLMKit/OLMSession.mm b/xcode/OLMKit/OLMSession.mm index fc58a08..b819461 100644 --- a/xcode/OLMKit/OLMSession.mm +++ b/xcode/OLMKit/OLMSession.mm @@ -31,7 +31,7 @@ - (BOOL) initializeSessionMemory { size_t size = olm_session_size(); - _session = malloc(size); + _session = (OlmSession *)malloc(size); NSParameterAssert(_session != nil); if (!_session) { return NO; @@ -235,7 +235,7 @@ return nil; } NSString *ciphertextString = [[NSString alloc] initWithData:ciphertext encoding:NSUTF8StringEncoding]; - OLMMessage *encryptedMessage = [[OLMMessage alloc] initWithCiphertext:ciphertextString type:messageType]; + OLMMessage *encryptedMessage = [[OLMMessage alloc] initWithCiphertext:ciphertextString type:OLMMessageType(messageType)]; return encryptedMessage; } diff --git a/xcode/OLMKit/OLMUtility.mm b/xcode/OLMKit/OLMUtility.mm index 936785a..f5ed36f 100644 --- a/xcode/OLMKit/OLMUtility.mm +++ b/xcode/OLMKit/OLMUtility.mm @@ -37,7 +37,7 @@ NSString *const OLMErrorDomain = @"org.matrix.olm"; - (BOOL) initializeUtilityMemory { size_t utilitySize = olm_utility_size(); - _utility = malloc(utilitySize); + _utility = (OlmUtility *)malloc(utilitySize); NSParameterAssert(_utility != nil); if (!_utility) { return NO;