From: Ankur Date: Mon, 23 Feb 2015 13:30:17 +0000 (+0530) Subject: Changes as per the reviews on the previous patches X-Git-Tag: submit/tizen_tv/20150226.040306~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64ca0ce9bf24497db494a45313e2b6f19346a0c1;p=platform%2Fcore%2Fsystem%2Fsensord.git Changes as per the reviews on the previous patches As per the reviews on the previous patches, submitting a patch with all the changes suggested in the reviews. Tested on RD-PQ device Change-Id: I15e79bdd0331c17908cc62fa523bab188cc28295 --- diff --git a/src/libsensord/sensor_geomagnetic_rv.h b/src/libsensord/sensor_geomagnetic_rv.h index 73106aeb..3deaaa2d 100755 --- a/src/libsensord/sensor_geomagnetic_rv.h +++ b/src/libsensord/sensor_geomagnetic_rv.h @@ -48,6 +48,4 @@ enum geomagnetic_rv_event_type { } #endif -#endif -//! End of a file - +#endif /* __SENSOR_GEOMAGNETIC_RV_H__ */ diff --git a/src/sensor_fusion/euler_angles.h b/src/sensor_fusion/euler_angles.h index 061dfb10..9e2f6079 100644 --- a/src/sensor_fusion/euler_angles.h +++ b/src/sensor_fusion/euler_angles.h @@ -29,7 +29,7 @@ template class euler_angles { public: - vect m_ang; + vect m_ang; euler_angles(); euler_angles(const TYPE roll, const TYPE pitch, const TYPE azimuth); diff --git a/src/sensor_fusion/matrix.cpp b/src/sensor_fusion/matrix.cpp index 9d483f29..62f05553 100755 --- a/src/sensor_fusion/matrix.cpp +++ b/src/sensor_fusion/matrix.cpp @@ -51,9 +51,9 @@ TYPE_ROW_COL matrix matrix::operator =(const mat return *this; } - for (int p = 0; p < ROW; p++) - for (int q = 0; q < COL; q++) - m_mat[p][q] = m.m_mat[p][q]; + for (int i = 0; i < ROW; i++) + for (int j = 0; j < COL; j++) + m_mat[i][j] = m.m_mat[i][j]; return *this; } diff --git a/src/sensor_fusion/orientation_filter.cpp b/src/sensor_fusion/orientation_filter.cpp index 2bf78656..76febbb1 100644 --- a/src/sensor_fusion/orientation_filter.cpp +++ b/src/sensor_fusion/orientation_filter.cpp @@ -84,7 +84,7 @@ inline void orientation_filter::init_accel_gyro_mag_data(const sensor_data m_magnetic.m_data = magnetic.m_data; if (m_gyro.m_time_stamp != 0 && gyro.m_time_stamp != 0) - sample_interval_gyro = gyro.m_time_stamp - m_gyro.m_time_stamp; + sample_interval_gyro = gyro.m_time_stamp - m_gyro.m_time_stamp; m_gyro_dt = sample_interval_gyro * US2S; diff --git a/src/sensor_fusion/quaternion.cpp b/src/sensor_fusion/quaternion.cpp index caf29509..9d28f582 100755 --- a/src/sensor_fusion/quaternion.cpp +++ b/src/sensor_fusion/quaternion.cpp @@ -30,7 +30,7 @@ template int sgn(T val) { template T mag(T val) { if (val < 0) - return val * (T)-1; + return val * static_cast(-1); else return val; } diff --git a/src/sensor_fusion/vector.cpp b/src/sensor_fusion/vector.cpp index 2fc932aa..5174035f 100644 --- a/src/sensor_fusion/vector.cpp +++ b/src/sensor_fusion/vector.cpp @@ -21,7 +21,7 @@ TYPE_SIZE vect::vect(void) { - for(int i=0;i::~vect() TYPE_SIZE vect vect::operator =(const vect& v) { if (this == &v) - { return *this; - } + for (int q = 0; q < SIZE; q++) m_vec[q] = v.m_vec[q]; - return *this; + + return *this; } T_S ostream& operator <<(ostream& dout, vect& v) { for (int j = 0; j < S; j++) - { dout << v.m_vec[j] << "\t"; - } dout << endl; @@ -114,12 +112,8 @@ T_S_R_C matrix operator *(const matrix m, const vect v) matrix m1; for (int i = 0; i < R; i++) - { for (int j = 0; j < S; j++) - { m1.m_mat[i][j] = m.m_mat[i][0] * v.m_vec[j]; - } - } return m1; }