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:53 UTC

[3/8] 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-dialogs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/commit/9c7d4442
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/tree/9c7d4442
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/diff/9c7d4442

Branch: refs/heads/master
Commit: 9c7d4442f4f74cba573cff8a65deeb4437f21840
Parents: 18caa06
Author: James Jong <wj...@gmail.com>
Authored: Thu Mar 13 09:56:58 2014 -0400
Committer: James Jong <wj...@gmail.com>
Committed: Thu Mar 13 09:56:58 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVNotification.m | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/9c7d4442/src/ios/CDVNotification.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVNotification.m b/src/ios/CDVNotification.m
index 58c04f0..ac95cc6 100644
--- a/src/ios/CDVNotification.m
+++ b/src/ios/CDVNotification.m
@@ -49,7 +49,7 @@ static void soundCompletionCallback(SystemSoundID ssid, void* data);
 
     alertView.callbackId = callbackId;
 
-    int count = [buttons count];
+    NSUInteger count = [buttons count];
 
     for (int n = 0; n < count; n++) {
         [alertView addButtonWithTitle:[buttons objectAtIndex:n]];
@@ -106,7 +106,7 @@ static void soundCompletionCallback(SystemSoundID ssid, void* data);
     // Determine what gets returned to JS based on the alert view type.
     if (alertView.alertViewStyle == UIAlertViewStyleDefault) {
         // For alert and confirm, return button index as int back to JS.
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:buttonIndex + 1];
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)(buttonIndex + 1)];
     } else {
         // For prompt, return button index and input text back to JS.
         NSString* value0 = [[alertView textFieldAtIndex:0] text];
@@ -121,13 +121,14 @@ static void soundCompletionCallback(SystemSoundID ssid, void* data);
 
 static void playBeep(int count) {
     SystemSoundID completeSound;
+    NSInteger cbDataCount = count;
     NSURL* audioPath = [[NSBundle mainBundle] URLForResource:@"CDVNotification.bundle/beep" withExtension:@"wav"];
     #if __has_feature(objc_arc)
         AudioServicesCreateSystemSoundID((__bridge CFURLRef)audioPath, &completeSound);
     #else
         AudioServicesCreateSystemSoundID((CFURLRef)audioPath, &completeSound);
     #endif
-    AudioServicesAddSystemSoundCompletion(completeSound, NULL, NULL, soundCompletionCallback, (void*)(count-1));
+    AudioServicesAddSystemSoundCompletion(completeSound, NULL, NULL, soundCompletionCallback, (void*)(cbDataCount-1));
     AudioServicesPlaySystemSound(completeSound);
 }