Fix some 64 bit precision warnings

This commit is contained in:
Guillaume BIENKOWSKI 2014-11-25 17:22:43 +01:00
parent 80aedc26dc
commit 8c03c66710
12 changed files with 21 additions and 21 deletions

View file

@ -170,7 +170,7 @@
cell = [[[UIChatRoomCell alloc] initWithIdentifier:kCellId] autorelease];
}
LinphoneChatMessage* chat = ms_list_nth_data(self->messageList, [indexPath row]);
LinphoneChatMessage* chat = ms_list_nth_data(self->messageList, (int)[indexPath row]);
[cell setChatMessage:chat];
[cell setChatRoomDelegate:chatRoomDelegate];
return cell;
@ -182,7 +182,7 @@
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if(editingStyle == UITableViewCellEditingStyleDelete) {
[tableView beginUpdates];
LinphoneChatMessage *chat = ms_list_nth_data(self->messageList, [indexPath row]);
LinphoneChatMessage *chat = ms_list_nth_data(self->messageList, (int)[indexPath row]);
if( chat ){
linphone_chat_room_delete_message(chatRoom, chat);
@ -204,7 +204,7 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
LinphoneChatMessage* message = ms_list_nth_data(self->messageList, [indexPath row]);
LinphoneChatMessage* message = ms_list_nth_data(self->messageList, (int)[indexPath row]);
return [UIChatRoomCell height:message width:[self.view frame].size.width];
}

View file

@ -748,9 +748,9 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta
[tableController.view setFrame:tableFrame];
// Scroll to bottom
int lastSection = [tableController.tableView numberOfSections] - 1;
NSInteger lastSection = [tableController.tableView numberOfSections] - 1;
if(lastSection >= 0) {
int lastRow = [tableController.tableView numberOfRowsInSection:lastSection] - 1;
NSInteger lastRow = [tableController.tableView numberOfRowsInSection:lastSection] - 1;
if(lastRow >=0) {
[tableController.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:lastRow inSection:lastSection]
atScrollPosition:UITableViewScrollPositionBottom
@ -810,9 +810,9 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta
}
// Scroll
int lastSection = [tableController.tableView numberOfSections] - 1;
NSInteger lastSection = [tableController.tableView numberOfSections] - 1;
if(lastSection >= 0) {
int lastRow = [tableController.tableView numberOfRowsInSection:lastSection] - 1;
NSInteger lastRow = [tableController.tableView numberOfRowsInSection:lastSection] - 1;
if(lastRow >=0) {
[tableController.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:lastRow inSection:lastSection]
atScrollPosition:UITableViewScrollPositionBottom

View file

@ -141,7 +141,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
[contactDetailsDelegate onModification:nil];
}
- (NSMutableArray*)getSectionData:(int)section {
- (NSMutableArray*)getSectionData:(NSInteger)section {
if(contactSections[section] == ContactSections_Number) {
return [dataCache objectAtIndex:0];
} else if(contactSections[section] == ContactSections_Sip) {

View file

@ -35,7 +35,7 @@
@private
NSInteger totalBytesExpectedToRead;
id<ImageSharingDelegate> delegate;
int statusCode;
NSInteger statusCode;
}
+ (id)newImageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id<ImageSharingDelegate>)delegate userInfo:(id)userInfo;

View file

@ -115,7 +115,7 @@
now lets create the body of the post
*/
NSMutableData *body = [NSMutableData data];
NSString *imageName = [NSString stringWithFormat:@"%i-%f.jpg", [image hash],[NSDate timeIntervalSinceReferenceDate]];
NSString *imageName = [NSString stringWithFormat:@"%lu-%f.jpg", (unsigned long)[image hash],[NSDate timeIntervalSinceReferenceDate]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@\"\r\n",imageName] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];

View file

@ -323,7 +323,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];

View file

@ -484,14 +484,14 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
bool range = [match rangeAtIndex:2].length > 0;
if(!range) {
NSRange rangeMinPort = [match rangeAtIndex:1];
*minPort = [LinphoneCoreSettingsStore validPort:[[text substringWithRange:rangeMinPort] integerValue]];
*minPort = [LinphoneCoreSettingsStore validPort:[[text substringWithRange:rangeMinPort] intValue]];
*maxPort = *minPort;
return TRUE;
} else {
NSRange rangeMinPort = [match rangeAtIndex:1];
*minPort = [LinphoneCoreSettingsStore validPort:[[text substringWithRange:rangeMinPort] integerValue]];
*minPort = [LinphoneCoreSettingsStore validPort:[[text substringWithRange:rangeMinPort] intValue]];
NSRange rangeMaxPort = [match rangeAtIndex:4];
*maxPort = [LinphoneCoreSettingsStore validPort:[[text substringWithRange:rangeMaxPort] integerValue]];
*maxPort = [LinphoneCoreSettingsStore validPort:[[text substringWithRange:rangeMaxPort] intValue]];
if(*minPort > *maxPort) {
*minPort = *maxPort;
}

View file

@ -1057,7 +1057,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
} else if (proxy){
NSInteger defaultExpire = [[LinphoneManager instance] lpConfigIntForKey:@"default_expires"];
if (defaultExpire>=0)
linphone_proxy_config_expires(proxy, defaultExpire);
linphone_proxy_config_expires(proxy, (int)defaultExpire);
//else keep default value from linphonecore
}

View file

@ -72,7 +72,7 @@
#pragma mark -
- (NSString *)accessibilityValue {
return [NSString stringWithFormat:@"%@ - %@ (%d)", addressLabel.text, chatContentLabel.text, [unreadMessageLabel.text integerValue]];
return [NSString stringWithFormat:@"%@ - %@ (%ld)", addressLabel.text, chatContentLabel.text, (long)[unreadMessageLabel.text integerValue]];
}
- (LinphoneChatMessage*)getLastIncomingMessage {

View file

@ -36,7 +36,7 @@
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't convert not RGB color"];
return self;
} else {
const float *colors = CGColorGetComponents(cgColor);
const CGFloat *colors = CGColorGetComponents(cgColor);
rgbaR = colors[0];
rgbaG = colors[1];
rgbaB = colors[2];
@ -64,7 +64,7 @@
[LinphoneLogger log:LinphoneLoggerWarning format:@"Can't convert not RGB color"];
return self;
} else {
const float *colors = CGColorGetComponents(cgColor);
const CGFloat *colors = CGColorGetComponents(cgColor);
rgbaR = colors[0];
rgbaG = colors[1];
rgbaB = colors[2];

View file

@ -53,7 +53,7 @@
}
- (int)integerForKey:(NSString*)key {
return [[NSUserDefaults standardUserDefaults] integerForKey:key];
return (int)[[NSUserDefaults standardUserDefaults] integerForKey:key];
}
- (id)objectForKey:(NSString*)key {

View file

@ -759,8 +759,8 @@ static UICompositeViewDescription *compositeDescription = nil;
NSString *email = [WizardViewController findTextField:ViewElement_Email view:contentView].text;
NSMutableString *errors = [NSMutableString string];
int username_length = [[LinphoneManager instance] lpConfigIntForKey:@"username_length" forSection:@"wizard"];
int password_length = [[LinphoneManager instance] lpConfigIntForKey:@"password_length" forSection:@"wizard"];
NSInteger username_length = [[LinphoneManager instance] lpConfigIntForKey:@"username_length" forSection:@"wizard"];
NSInteger password_length = [[LinphoneManager instance] lpConfigIntForKey:@"password_length" forSection:@"wizard"];
if ([username length] < username_length) {
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"The username is too short (minimum %d characters).\n", nil), username_length]];