Correcting indentation for if condition and adding error handling statement for senso... 01/35701/3
authorVibhor Gaur <vibhor.gaur@samsung.com>
Mon, 23 Feb 2015 12:53:29 +0000 (18:23 +0530)
committerKibak Yoon <kibak.yoon@samsung.com>
Mon, 23 Feb 2015 14:13:46 +0000 (06:13 -0800)
-Correcting the position of the starting brace in the if condition.
-Adding error handling condition in the common test folder for unregistering the event.
-Changes have been made as per reviews in previous patches.

Change-Id: I407bb6a22ddf0756aed2e7c3649a1c3490a7ba28

src/sensor_fusion/orientation_filter.cpp
test/src/tc-common.c

index 76febbb..0b316ee 100644 (file)
@@ -333,8 +333,7 @@ inline void orientation_filter<TYPE>::time_update_gaming_rv()
 
        m_quat_gaming_rv = euler2quat(euler_gaming_rv);
 
-       if (is_initialized(m_state_new))
-       {
+       if (is_initialized(m_state_new)) {
                m_state_error.m_vec[0] = euler_error.m_ang.m_vec[0];
                m_state_error.m_vec[1] = euler_error.m_ang.m_vec[1];
                m_state_error.m_vec[2] = euler_error.m_ang.m_vec[2];
index c94f77d..53661c3 100644 (file)
@@ -280,7 +280,13 @@ int main(int argc, char **argv)
        g_main_loop_run(mainloop);
        g_main_loop_unref(mainloop);
 
-       sensord_unregister_event(handle, event);
+       result = sensord_unregister_event(handle, event);
+
+       if (result < 0) {
+               printf("Error\n\n");
+               return -1;
+       }
+
        stop_handle = sensord_stop(handle);
 
        if (stop_handle < 0) {