Removed compiler warnings related to unused variable 57/32657/1
authorAnkur <ankur29.garg@samsung.com>
Mon, 22 Dec 2014 08:51:48 +0000 (14:21 +0530)
committerAnkur <ankur29.garg@samsung.com>
Mon, 22 Dec 2014 08:51:56 +0000 (14:21 +0530)
-changed the variable (MS_TO_US) declaration to a macro as done in other files
this removes the warning in csensor_event_listener.cpp regarding unused variable.
-similarly, based on this, changed all occurrences of (MIN_DELIVERY_DIFF_FACTOR) from variable declaration to macro
this removes the warning in csensor_event_listener.cpp regarding unused variable.

Change-Id: I98708ed5eca0d84dd959d5a59ad865f5381c0b26

src/gravity/gravity_sensor.cpp
src/libsensord/csensor_event_listener.cpp
src/linear_accel/linear_accel_sensor.cpp
src/orientation/orientation_sensor.cpp

index 64e39e7..f10f502 100755 (executable)
@@ -42,6 +42,7 @@
 #define SENSOR_TYPE_ORIENTATION                "ORIENTATION"
 
 #define MS_TO_US 1000
+#define MIN_DELIVERY_DIFF_FACTOR 0.75f
 
 #define ELEMENT_NAME                                                                                   "NAME"
 #define ELEMENT_VENDOR                                                                                 "VENDOR"
@@ -172,7 +173,6 @@ void gravity_sensor::synthesize(const sensor_event_t &event, vector<sensor_event
        pitch = event.data.values[1];
        roll = event.data.values[2];
 
-       const float MIN_DELIVERY_DIFF_FACTOR = 0.75f;
        unsigned long long diff_time;
 
        if(m_orientation_data_unit == "DEGREES") {
index 78e705e..7dbebc3 100755 (executable)
@@ -25,6 +25,9 @@
 #include <thread>
 #include <chrono>
 
+#define MS_TO_US 1000
+#define MIN_DELIVERY_DIFF_FACTOR 0.75f
+
 using std::thread;
 using std::pair;
 
@@ -649,9 +652,6 @@ client_callback_info* csensor_event_listener::handle_calibration_cb(csensor_hand
 
 void csensor_event_listener::handle_events(void* event)
 {
-       const unsigned int MS_TO_US = 1000;
-       const float MIN_DELIVERY_DIFF_FACTOR = 0.75f;
-
        unsigned long long cur_time;
        creg_event_info *event_info = NULL;
        sensor_event_data_t event_data;
index 96e6cce..1af20bc 100755 (executable)
@@ -47,6 +47,7 @@
 #define GRAVITY 9.80665
 
 #define MS_TO_US 1000
+#define MIN_DELIVERY_DIFF_FACTOR 0.75f
 
 #define ACCELEROMETER_ENABLED 0x01
 #define GRAVITY_ENABLED 0x02
@@ -197,7 +198,6 @@ void linear_accel_sensor::synthesize(const sensor_event_t &event, vector<sensor_
 {
        sensor_event_t lin_accel_event;
 
-       const float MIN_DELIVERY_DIFF_FACTOR = 0.75f;
        unsigned long long diff_time;
 
        if (event.event_type == ACCELEROMETER_EVENT_RAW_DATA_REPORT_ON_TIME) {
index 72145b0..325c004 100755 (executable)
@@ -43,6 +43,7 @@
 #define INITIAL_VALUE -1
 
 #define MS_TO_US 1000
+#define MIN_DELIVERY_DIFF_FACTOR 0.75f
 
 #define PI 3.141593
 #define AZIMUTH_OFFSET_DEGREES 360
@@ -290,7 +291,6 @@ bool orientation_sensor::delete_interval(int client_id)
 
 void orientation_sensor::synthesize(const sensor_event_t &event, vector<sensor_event_t> &outs)
 {
-       const float MIN_DELIVERY_DIFF_FACTOR = 0.75f;
        unsigned long long diff_time;
 
        sensor_event_t orientation_event;