incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [14/29] ios commit: Accel values should be doubles. and doubles shouldnt be created via an integer constructor. duh
Date Fri, 16 Mar 2012 18:14:49 GMT
Accel values should be doubles. and doubles shouldnt be created via an integer constructor.
duh


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/0c8fa927
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/0c8fa927
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/0c8fa927

Branch: refs/heads/master
Commit: 0c8fa9276a68656be1dba62af267780bee6f903d
Parents: bbddc1c
Author: Fil Maj <maj.fil@gmail.com>
Authored: Fri Mar 2 16:02:27 2012 -0800
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Mar 16 10:56:49 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVAccelerometer.h |    8 ++++----
 CordovaLib/Classes/CDVAccelerometer.m |    9 ++++-----
 2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/0c8fa927/CordovaLib/Classes/CDVAccelerometer.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVAccelerometer.h b/CordovaLib/Classes/CDVAccelerometer.h
index 3d650f5..dfe4d69 100755
--- a/CordovaLib/Classes/CDVAccelerometer.h
+++ b/CordovaLib/Classes/CDVAccelerometer.h
@@ -25,10 +25,10 @@
 @interface CDVAccelerometer : CDVPlugin<UIAccelerometerDelegate> 
 {
 	bool _bIsRunning;
-	float x;
-    float y;
-    float z;
-    float timeout;
+	double x;
+    double y;
+    double z;
+    double timeout;
     NSTimeInterval timestamp;
     NSTimeInterval lastAccessTime;
 }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/0c8fa927/CordovaLib/Classes/CDVAccelerometer.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVAccelerometer.m b/CordovaLib/Classes/CDVAccelerometer.m
index ff12e24..9083c7f 100644
--- a/CordovaLib/Classes/CDVAccelerometer.m
+++ b/CordovaLib/Classes/CDVAccelerometer.m
@@ -51,7 +51,6 @@
 
 - (void)start
 {
-	
 	NSTimeInterval desiredFrequency_num = kAccelerometerInterval;
 	UIAccelerometer* pAccel = [UIAccelerometer sharedAccelerometer];
 	// accelerometer expects fractional seconds, but we have msecs
@@ -89,10 +88,10 @@
     
     // Create an acceleration object
     NSMutableDictionary *accelProps = [NSMutableDictionary dictionaryWithCapacity:4];
-    [accelProps setValue:[NSNumber numberWithInteger:x] forKey:@"x"];
-    [accelProps setObject:[NSNumber numberWithInteger:y] forKey:@"y"];
-    [accelProps setObject:[NSNumber numberWithInteger:z] forKey:@"z"];
-    [accelProps setObject:[NSNumber numberWithDouble:timestamp] forKey:@"timestamp"];
+    [accelProps setValue:[NSNumber numberWithDouble:x] forKey:@"x"];
+    [accelProps setValue:[NSNumber numberWithDouble:y] forKey:@"y"];
+    [accelProps setValue:[NSNumber numberWithDouble:z] forKey:@"z"];
+    [accelProps setValue:[NSNumber numberWithDouble:timestamp] forKey:@"timestamp"];
     
     result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:accelProps];
     jsString = [result toSuccessCallbackString:callbackId];


Mime
View raw message