From 954dc2fedf06ed2bfca0dad4846d0f6acc1c8e53 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 27 Oct 2014 11:48:09 +0100 Subject: [PATCH] Prepare for ARM64 compilation and remove loss-precision warnings where possible (possibly incomplete) --- Classes/ChatTableViewController.m | 6 +++--- Classes/ContactDetailsTableViewController.m | 6 +++--- Classes/ContactsTableViewController.m | 2 +- Classes/LinphoneAppDelegate.m | 2 +- Classes/LinphoneManager.m | 6 +++--- Classes/PhoneMainView.m | 2 +- Classes/SettingsViewController.m | 2 +- Classes/Utils/UACellBackgroundView/UACellBackgroundView.m | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Classes/ChatTableViewController.m b/Classes/ChatTableViewController.m index 62f029db9..bb4f88c71 100644 --- a/Classes/ChatTableViewController.m +++ b/Classes/ChatTableViewController.m @@ -104,7 +104,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo [selectedBackgroundView setBackgroundColor:LINPHONE_TABLE_CELL_BACKGROUND_COLOR]; } - [cell setChatRoom:(LinphoneChatRoom*)ms_list_nth_data(data, [indexPath row])]; + [cell setChatRoom:(LinphoneChatRoom*)ms_list_nth_data(data, (int)[indexPath row])]; return cell; } @@ -114,7 +114,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:NO]; - LinphoneChatRoom *chatRoom = (LinphoneChatRoom*)ms_list_nth_data(data, [indexPath row]); + LinphoneChatRoom *chatRoom = (LinphoneChatRoom*)ms_list_nth_data(data, (int)[indexPath row]); // Go to ChatRoom view ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); @@ -135,7 +135,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo if(editingStyle == UITableViewCellEditingStyleDelete) { [tableView beginUpdates]; - LinphoneChatRoom *chatRoom = (LinphoneChatRoom*)ms_list_nth_data(data, [indexPath row]); + LinphoneChatRoom *chatRoom = (LinphoneChatRoom*)ms_list_nth_data(data, (int)[indexPath row]); linphone_chat_room_delete_history(chatRoom); linphone_chat_room_destroy(chatRoom); data = linphone_core_get_chat_rooms([LinphoneManager getLc]); diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index ee3ebf4f8..3b0b8ca47 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -850,7 +850,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonPhoneProperty); ABMutableMultiValueRef lMap = ABMultiValueCreateMutableCopy(lcMap); CFRelease(lcMap); - int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); + NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); ABMultiValueReplaceLabelAtIndex(lMap, (CFStringRef)(value), index); ABRecordSetValue(contact, kABPersonPhoneProperty, lMap, nil); CFRelease(lMap); @@ -858,7 +858,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); ABMutableMultiValueRef lMap = ABMultiValueCreateMutableCopy(lcMap); CFRelease(lcMap); - int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); + NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); ABMultiValueReplaceLabelAtIndex(lMap, (CFStringRef)(value), index); ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, nil); CFRelease(lMap); @@ -866,7 +866,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonEmailProperty); ABMutableMultiValueRef lMap = ABMultiValueCreateMutableCopy(lcMap); CFRelease(lcMap); - int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); + NSInteger index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); ABMultiValueReplaceLabelAtIndex(lMap, (CFStringRef)(value), index); ABRecordSetValue(contact, kABPersonEmailProperty, lMap, nil); CFRelease(lMap); diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index c591b5dbc..399bb157f 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -119,7 +119,7 @@ static int ms_strcmpfuz(const char * fuzzy_word, const char * sentence) { } // If the whole fuzzy was found, returns 0. Otherwise returns number of characters left. - return (within_sentence != NULL ? 0 : fuzzy_word + strlen(fuzzy_word) - c); + return (int)(within_sentence != NULL ? 0 : fuzzy_word + strlen(fuzzy_word) - c); } - (void)loadData { diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index ee1ec0974..b29a1ec2f 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -340,7 +340,7 @@ } - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { - Linphone_log(@"%@ - state = %d", NSStringFromSelector(_cmd), application.applicationState); + Linphone_log(@"%@ - state = %ld", NSStringFromSelector(_cmd), application.applicationState); [self fixRing]; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 994f7f220..cc5e30451 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -459,7 +459,7 @@ exit_dbmigration: @"start_at_boot_preference" :@YES}; BOOL shouldSync = FALSE; - Linphone_log(@"%d user prefs", [defaults_keys count]); + Linphone_log(@"%lu user prefs", (unsigned long)[defaults_keys count]); for( NSString* userpref in values ){ if( [defaults_keys containsObject:userpref] ){ @@ -1015,7 +1015,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach && (lLinphoneMgr.connectivity == newConnectivity || lLinphoneMgr.connectivity == none)) { linphone_proxy_config_expires(proxy, 0); } else if (proxy){ - int defaultExpire = [[LinphoneManager instance] lpConfigIntForKey:@"default_expires"]; + NSInteger defaultExpire = [[LinphoneManager instance] lpConfigIntForKey:@"default_expires"]; if (defaultExpire>=0) linphone_proxy_config_expires(proxy, defaultExpire); //else keep default value from linphonecore @@ -1997,7 +1997,7 @@ static void audioRouteChangeListenerCallback ( - (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key forSection:(NSString *)section { if (!key) return; - lp_config_set_int(configDb, [section UTF8String], [key UTF8String], value ); + lp_config_set_int(configDb, [section UTF8String], [key UTF8String], (int)value ); } - (NSInteger)lpConfigIntForKey:(NSString*)key { diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 1eb161ce3..d86df71d2 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -318,7 +318,7 @@ static RootViewManager* rootViewManagerInstance = nil; } - (void)onGlobalStateChanged:(NSNotification*)notif { - LinphoneGlobalState state = [[[notif userInfo] valueForKey:@"state"] integerValue]; + LinphoneGlobalState state = (LinphoneGlobalState)[[[notif userInfo] valueForKey:@"state"] integerValue]; static BOOL already_shown = FALSE; if( state == LinphoneGlobalOn && !already_shown && [LinphoneManager instance].wasRemoteProvisioned ){ LinphoneProxyConfig* conf = NULL; diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 436f1736d..ca0ffd9bf 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -377,7 +377,7 @@ if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [self.topViewController viewWillDisappear:animated]; UIViewController *nextView = nil; - int count = [self.viewControllers count]; + NSInteger count = [self.viewControllers count]; if(count > 1) { nextView = [self.viewControllers objectAtIndex:count - 2]; } diff --git a/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m b/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m index 8a5bceba9..82a9671ed 100644 --- a/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m +++ b/Classes/Utils/UACellBackgroundView/UACellBackgroundView.m @@ -98,7 +98,7 @@ static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWi if([tableView style] == UITableViewStyleGrouped) { NSIndexPath *path = [tableView indexPathForCell:cell]; if(path) { - int count = [tableView numberOfRowsInSection:[path section]]; + NSInteger count = [tableView numberOfRowsInSection:[path section]]; // Set Position for background view if([path row] == 0) { if([path row] == (count - 1)) {