ARC: rename __bridge_retained to CFBridgingRetain and __bridge_transfer to CFBridgingRelease for the sake of consistency

This commit is contained in:
Gautier Pelloux-Prayer 2015-06-08 15:19:50 +02:00
parent 2d288f3a21
commit 25013bdf9e
3 changed files with 13 additions and 14 deletions

View file

@ -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];
}

View file

@ -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) {

View file

@ -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);