Fixed Compilation warnings related to Intialization 73/32473/1
authorAnkur <ankur29.garg@samsung.com>
Thu, 18 Dec 2014 10:43:02 +0000 (16:13 +0530)
committerAnkur <ankur29.garg@samsung.com>
Thu, 18 Dec 2014 10:43:08 +0000 (16:13 +0530)
-Error fixed: Variable was being used before intialization
-Testing will be done once the test cases are completed.

Change-Id: I5316bce003717d97f6e3cd65a909d94e1c84ad0c

src/gravity/gravity_sensor.cpp

index acb73a6..64e39e7 100755 (executable)
@@ -218,6 +218,8 @@ int gravity_sensor::get_sensor_data(const unsigned int event_type, sensor_data_t
        sensor_data_t orientation_data;
        float pitch, roll, azimuth;
 
+       m_orientation_sensor->get_sensor_data(ORIENTATION_EVENT_RAW_DATA_REPORT_ON_TIME, orientation_data);
+
        azimuth = orientation_data.values[0];
        pitch = orientation_data.values[1];
        roll = orientation_data.values[2];
@@ -231,8 +233,6 @@ int gravity_sensor::get_sensor_data(const unsigned int event_type, sensor_data_t
        if (event_type != GRAVITY_EVENT_RAW_DATA_REPORT_ON_TIME)
                return -1;
 
-       m_orientation_sensor->get_sensor_data(ORIENTATION_EVENT_RAW_DATA_REPORT_ON_TIME, orientation_data);
-
        data.accuracy = SENSOR_ACCURACY_GOOD;
        data.timestamp = get_timestamp();
        if ((roll >= (M_PI/2)-DEVIATION && roll <= (M_PI/2)+DEVIATION) ||