From 25013bdf9e63113ebc200989f6952ef42c12bf0a Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 8 Jun 2015 15:19:50 +0200 Subject: [PATCH] ARC: rename __bridge_retained to CFBridgingRetain and __bridge_transfer to CFBridgingRelease for the sake of consistency --- Classes/ContactDetailsTableViewController.m | 12 ++++++------ Classes/LinphoneManager.m | 2 +- Classes/Utils/FastAddressBook.m | 13 ++++++------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 35de003e3..835b8d8e9 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -407,7 +407,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe toRelease = valueRef; value = CFDictionaryGetValue(valueRef, kABPersonInstantMessageUsernameKey); } else { - value = (__bridge_transfer NSString*)valueRef; + value = CFBridgingRelease(valueRef); } if(value.length == 0) { @@ -516,11 +516,11 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe if(contactSections[[indexPath section]] == ContactSections_Number) { ABMultiValueRef lMap = ABRecordCopyValue(contact, kABPersonPhoneProperty); NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); - NSString* labelRef = (__bridge_transfer NSString*)(ABMultiValueCopyLabelAtIndex(lMap, index)); + NSString* labelRef = CFBridgingRelease(ABMultiValueCopyLabelAtIndex(lMap, index)); if(labelRef != NULL) { label = [FastAddressBook localizedLabel:labelRef]; } - NSString* valueRef = (__bridge_transfer NSString*)(ABMultiValueCopyValueAtIndex(lMap, index)); + NSString* valueRef = CFBridgingRelease(ABMultiValueCopyValueAtIndex(lMap, index)); if(valueRef != NULL) { value = [FastAddressBook localizedLabel:valueRef]; } @@ -529,7 +529,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe ABMultiValueRef lMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); - NSString* labelRef = (__bridge_transfer NSString*)(ABMultiValueCopyLabelAtIndex(lMap, index)); + NSString* labelRef = CFBridgingRelease(ABMultiValueCopyLabelAtIndex(lMap, index)); if(labelRef != NULL) { label = [FastAddressBook localizedLabel:labelRef]; } @@ -550,11 +550,11 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe } else if(contactSections[[indexPath section]] == ContactSections_Email) { ABMultiValueRef lMap = ABRecordCopyValue(contact, kABPersonEmailProperty); NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); - NSString* labelRef = (__bridge_transfer NSString*)ABMultiValueCopyLabelAtIndex(lMap, index); + NSString* labelRef = CFBridgingRelease(ABMultiValueCopyLabelAtIndex(lMap, index)); if(labelRef != NULL) { label = [FastAddressBook localizedLabel:labelRef]; } - NSString* valueRef = (__bridge_transfer NSString*)(ABMultiValueCopyValueAtIndex(lMap, index)); + NSString* valueRef = CFBridgingRelease(ABMultiValueCopyValueAtIndex(lMap, index)); if(valueRef != NULL) { value = [FastAddressBook localizedLabel:valueRef]; } diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 2f3fa43fc..fb440ffb9 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -572,7 +572,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char LinphoneCallAppData* data=(__bridge LinphoneCallAppData*)linphone_call_get_user_data(call); if (!data) { data = [[LinphoneCallAppData alloc] init]; - linphone_call_set_user_data(call, (__bridge_retained void*)data); + linphone_call_set_user_data(call, (void*)CFBridgingRetain(data)); } if (silentPushCompletion) { diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index f30442ba4..2144e770e 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -64,10 +64,10 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf + (UIImage*)getContactImage:(ABRecordRef)contact thumbnail:(BOOL)thumbnail { UIImage* retImage = nil; if (contact && ABPersonHasImageData(contact)) { - CFDataRef imgData = ABPersonCopyImageDataWithFormat(contact, thumbnail? - kABPersonImageFormatThumbnail: kABPersonImageFormatOriginalSize); + NSData* imgData = CFBridgingRelease(ABPersonCopyImageDataWithFormat(contact, thumbnail? + kABPersonImageFormatThumbnail: kABPersonImageFormatOriginalSize)); - retImage = [UIImage imageWithData:(NSData *)CFBridgingRelease(imgData)]; + retImage = [UIImage imageWithData:imgData]; if (retImage != nil && retImage.size.width != retImage.size.height) { LOGI(@"Image is not square : cropping it."); @@ -230,13 +230,12 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf add = true; } if(add) { - CFStringRef lValue = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); - NSString* lNormalizedKey = [FastAddressBook normalizeSipURI:(__bridge NSString *)(lValue)]; + NSString* lValue = (__bridge NSString*)CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); + NSString* lNormalizedKey = [FastAddressBook normalizeSipURI:lValue]; if(lNormalizedKey != NULL) { [addressBookMap setObject:(__bridge id)(lPerson) forKey:lNormalizedKey]; } else { - NSString* value = CFBridgingRelease(lValue); - [addressBookMap setObject:(__bridge id)(lPerson) forKey:value]; + [addressBookMap setObject:(__bridge id)(lPerson) forKey:lValue]; } } CFRelease(lDict);