You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/04/23 20:56:20 UTC

[06/16] git commit: CB-6212 iOS: fix warnings compiled under arm64 64-bit

CB-6212 iOS: fix warnings compiled under arm64 64-bit


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/c9bab1f9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/c9bab1f9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/c9bab1f9

Branch: refs/heads/master
Commit: c9bab1f94c89e53c0ad8dbc77e1027eaa89527f1
Parents: 5393a28
Author: James Jong <wj...@gmail.com>
Authored: Thu Mar 13 09:51:47 2014 -0400
Committer: James Jong <wj...@gmail.com>
Committed: Thu Mar 13 09:51:47 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVCamera.m           | 12 ++++++------
 src/ios/CDVJpegHeaderWriter.m | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/c9bab1f9/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index 42c5237..8413ac5 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -84,7 +84,7 @@ static NSSet* org_apache_cordova_validArrowDirections;
 
     bool hasCamera = [UIImagePickerController isSourceTypeAvailable:sourceType];
     if (!hasCamera) {
-        NSLog(@"Camera.getPicture: source type %d not available.", sourceType);
+        NSLog(@"Camera.getPicture: source type %ld not available.", sourceType);
         CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no camera available"];
         [self.commandDelegate sendPluginResult:result callbackId:callbackId];
         return;
@@ -170,10 +170,10 @@ static NSSet* org_apache_cordova_validArrowDirections;
 
 - (void)displayPopover:(NSDictionary*)options
 {
-    int x = 0;
-    int y = 32;
-    int width = 320;
-    int height = 480;
+    NSInteger x = 0;
+    NSInteger y = 32;
+    NSInteger width = 320;
+    NSInteger height = 480;
     UIPopoverArrowDirection arrowDirection = UIPopoverArrowDirectionAny;
 
     if (options) {
@@ -182,7 +182,7 @@ static NSSet* org_apache_cordova_validArrowDirections;
         width = [options integerValueForKey:@"width" defaultValue:320];
         height = [options integerValueForKey:@"height" defaultValue:480];
         arrowDirection = [options integerValueForKey:@"arrowDir" defaultValue:UIPopoverArrowDirectionAny];
-        if (![org_apache_cordova_validArrowDirections containsObject:[NSNumber numberWithInt:arrowDirection]]) {
+        if (![org_apache_cordova_validArrowDirections containsObject:[NSNumber numberWithUnsignedInteger:arrowDirection]]) {
             arrowDirection = UIPopoverArrowDirectionAny;
         }
     }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/c9bab1f9/src/ios/CDVJpegHeaderWriter.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVJpegHeaderWriter.m b/src/ios/CDVJpegHeaderWriter.m
index 93cafb8..4d3ea24 100644
--- a/src/ios/CDVJpegHeaderWriter.m
+++ b/src/ios/CDVJpegHeaderWriter.m
@@ -190,7 +190,7 @@ const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a
     // construct the complete app1 data block
     app1 = [[NSMutableString alloc] initWithFormat: @"%@%04x%@%@%@%@%@",
             app1marker,
-            16 + ([exifIFD length]/2) + ([subExifIFD length]/2) /*16+[exifIFD length]/2*/,
+            (unsigned int)(16 + ([exifIFD length]/2) + ([subExifIFD length]/2)) /*16+[exifIFD length]/2*/,
             exifmarker,
             tiffheader,
             ifd0offset,
@@ -268,10 +268,10 @@ const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a
     }
     
     // calculate IFD0 terminal offset tags, currently ExifSubIFD
-    int entrycount = [ifdblock count];
+    unsigned int entrycount = (unsigned int)[ifdblock count];
     if (ifd0flag) {
         // 18 accounts for 8769's width + offset to next ifd, 8 accounts for start of header
-        NSNumber * offset = [NSNumber numberWithInt:[exifstr length] / 2 + [dbstr length] / 2 + 18+8];
+        NSNumber * offset = [NSNumber numberWithUnsignedInteger:[exifstr length] / 2 + [dbstr length] / 2 + 18+8];
         
         [self appendExifOffsetTagTo: exifstr
                         withOffset : offset];
@@ -293,7 +293,7 @@ const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a
         NSNumber * dataformat = [formtemplate objectAtIndex:1];
         NSNumber * components = [formtemplate objectAtIndex:2];
         if([components intValue] == 0) {
-            components = [NSNumber numberWithInt: [data length] * DataTypeToWidth[[dataformat intValue]-1]];            
+            components = [NSNumber numberWithUnsignedInteger:[data length] * DataTypeToWidth[[dataformat intValue]-1]];
         }
 
         return [[NSString alloc] initWithFormat: @"%@%@%08x",
@@ -344,7 +344,7 @@ const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a
                 [datastr appendString:[dataformat objectAtIndex:3]];
             }
             if ([datastr length] < 8) {
-                NSString * format = [NSString stringWithFormat:@"%%0%dd", 8 - [datastr length]];
+                NSString * format = [NSString stringWithFormat:@"%%0%dd", (int)(8 - [datastr length])];
                 [datastr appendFormat:format,0];
             }
             return datastr;
@@ -464,7 +464,7 @@ const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a
 -(void) expandContinuedFraction: (NSArray*) fractionlist
                   withResultNumerator: (NSNumber**) numerator
                 withResultDenominator: (NSNumber**) denominator {
-    int i = 0;
+    NSUInteger i = 0;
     int den = 0;
     int num = 0;
     if ([fractionlist count] == 1) {