From: kibak.yoon Date: Mon, 11 Sep 2017 12:37:20 +0000 (+0900) Subject: sensord: fix coding rule violations X-Git-Tag: accepted/tizen/4.0/unified/20170913.153418^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsystem%2Fsensord.git;a=commitdiff_plain;h=f3d5bac2ce31553cecd88eb6aff0860241484584 sensord: fix coding rule violations Change-Id: I19591605e855fdbd1b44aae8fed8fe9ded23ee16 Signed-off-by: kibak.yoon --- diff --git a/src/sensor/gesture/face_down_alg_impl.h b/src/sensor/gesture/face_down_alg_impl.h index 4afa3bb..997719d 100644 --- a/src/sensor/gesture/face_down_alg_impl.h +++ b/src/sensor/gesture/face_down_alg_impl.h @@ -38,7 +38,6 @@ private: void remove_old_up_time(void); unsigned long long is_facing_down(); unsigned long long was_facing_up(); - }; #endif /* __FACE_DOWN_ALG_IMPL_H__ */ diff --git a/src/sensor/pedometer/pedometer.h b/src/sensor/pedometer/pedometer.h index edf3638..f80c315 100644 --- a/src/sensor/pedometer/pedometer.h +++ b/src/sensor/pedometer/pedometer.h @@ -73,7 +73,6 @@ private: bool m_some_speed; sensor_frequency_compensator m_acceleration_compensator; - }; #endif /* __PEDOMETER_H__ */ diff --git a/src/sensor/rotation_vector/fusion_base.cpp b/src/sensor/rotation_vector/fusion_base.cpp index ad92d2a..fbd887d 100644 --- a/src/sensor/rotation_vector/fusion_base.cpp +++ b/src/sensor/rotation_vector/fusion_base.cpp @@ -80,7 +80,6 @@ void fusion_base::push_mag(sensor_data_t &data) m_enable_magnetic = true; if (get_orientation()) store_orientation(); - } bool fusion_base::get_rv(unsigned long long ×tamp, float &x, float &y, float &z, float &w) diff --git a/src/sensor/rotation_vector/fusion_utils/matrix.cpp b/src/sensor/rotation_vector/fusion_utils/matrix.cpp index 62f0555..2b1c177 100644 --- a/src/sensor/rotation_vector/fusion_utils/matrix.cpp +++ b/src/sensor/rotation_vector/fusion_utils/matrix.cpp @@ -156,17 +156,15 @@ T_R_C matrix operator /(const matrix m1, const T val) T_R1_C1_R2_C2 bool operator ==(const matrix m1, const matrix m2) { - if ((R1 == R2) && (C1 == C2)) - { + if ((R1 == R2) && (C1 == C2)) { for (int i = 0; i < R1; i++) for (int j = 0; j < C2; j++) if (m1.m_mat[i][j] != m2.m_mat[i][j]) return false; + return true; } - else - return false; - return true; + return false; } T_R1_C1_R2_C2 bool operator !=(const matrix m1, const matrix m2) diff --git a/src/sensor/rotation_vector/fusion_utils/vector.cpp b/src/sensor/rotation_vector/fusion_utils/vector.cpp index 432cb66..d06ad7d 100644 --- a/src/sensor/rotation_vector/fusion_utils/vector.cpp +++ b/src/sensor/rotation_vector/fusion_utils/vector.cpp @@ -155,16 +155,14 @@ T_S vect operator /(const vect v, const T val) T_S1_S2 bool operator ==(const vect v1, const vect v2) { - if (S1 == S2) - { + if (S1 == S2) { for (int i = 0; i < S1; i++) if (v1.m_vec[i] != v2.m_vec[i]) return false; + return true; } - else - return false; - return true; + return false; } T_S1_S2 bool operator !=(const vect v1, const vect v2) diff --git a/src/sensorctl/loopback.cpp b/src/sensorctl/loopback.cpp index ee177b8..b890f47 100644 --- a/src/sensorctl/loopback.cpp +++ b/src/sensorctl/loopback.cpp @@ -58,7 +58,7 @@ bool loopback_manager::run(int argc, char *argv[]) * sensorhub (bytes) command [0~1] delaytime [2~5] data[6~83] * shell (argv) command [0~2] delaytime [3] data[4~81] */ - char test_data[MAX_DATA_SIZE] = {SHUB_INST_LIB_ADD, SHUB_LOOP_BACK_LIB,}; + char test_data[MAX_DATA_SIZE] = {SHUB_INST_LIB_ADD, SHUB_LOOP_BACK_LIB, }; int_to_bytes(atoi(argv[3]), sizeof(int), &(test_data[2])); for (int i = 4; i < argc; i++) @@ -75,7 +75,7 @@ bool loopback_manager::run(int argc, char *argv[]) sensor = sensord_get_sensor(CONTEXT_SENSOR); handle = sensord_connect(sensor); - char test_data[4] = {SHUB_INST_LIB_REMOVE, SHUB_LOOP_BACK_LIB,}; + char test_data[4] = {SHUB_INST_LIB_REMOVE, SHUB_LOOP_BACK_LIB, }; sensord_set_attribute_str(handle, 0, test_data, sizeof(test_data)); sensord_disconnect(handle); diff --git a/src/sensorctl/test_bench.cpp b/src/sensorctl/test_bench.cpp index db0b974..8e5b5d8 100644 --- a/src/sensorctl/test_bench.cpp +++ b/src/sensorctl/test_bench.cpp @@ -237,7 +237,6 @@ void test_bench::show(void) for (auto it = testcases.begin(); it != testcases.end(); it = testcases.upper_bound(it->first)) { - auto range = testcases.equal_range(it->first); _I("[%s]\n", it->first.c_str()); diff --git a/src/sensorctl/testcase/unit_ipc.cpp b/src/sensorctl/testcase/unit_ipc.cpp index 799924a..c11d439 100644 --- a/src/sensorctl/testcase/unit_ipc.cpp +++ b/src/sensorctl/testcase/unit_ipc.cpp @@ -112,7 +112,7 @@ static bool run_ipc_client_sleep_1s(const char *str, int size, int count) message msg; message reply; - char buf[MAX_BUF_SIZE] = {'1', '1', '1',}; + char buf[MAX_BUF_SIZE] = {'1', '1', '1', }; msg.enclose(buf, MAX_BUF_SIZE); @@ -147,7 +147,7 @@ static bool run_ipc_client_small_buffer(const char *str, int size, int count) int ret; message msg; message reply; - char buf[MAX_BUF_SIZE] = {'1', '1', '1',}; + char buf[MAX_BUF_SIZE] = {'1', '1', '1', }; msg.enclose(buf, MAX_BUF_SIZE); @@ -190,7 +190,7 @@ static bool run_ipc_client_1M(const char *str, int size, int count) int ret; message msg; message reply; - char buf[MAX_BUF_SIZE] = {'1', '1', '1',}; + char buf[MAX_BUF_SIZE] = {'1', '1', '1', }; msg.enclose(buf, MAX_BUF_SIZE);