sensor: hal: tw1: fix coding rule violations 32/149232/2 accepted/tizen/unified/20170913.071916 submit/tizen/20170912.122717
authorkibak.yoon <kibak.yoon@samsung.com>
Tue, 12 Sep 2017 02:23:18 +0000 (11:23 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Tue, 12 Sep 2017 02:27:48 +0000 (11:27 +0900)
Change-Id: I424f765ca19aa6f16ca24dd594ea93bd4c7b7904
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
14 files changed:
src/accel/accel_device.cpp
src/accel/accel_device.h
src/gyro/gyro_device.cpp
src/gyro/gyro_device.h
src/gyro_uncal/gyro_uncal_device.cpp
src/gyro_uncal/gyro_uncal_device.h
src/hrm/hrm_device.cpp
src/hrm/hrm_device.h
src/hrm_raw/hrm_raw_device.h
src/light/light_device.h
src/pressure/pressure_device.cpp
src/pressure/pressure_device.h
src/sensor_log.h
src/util.cpp

index 3be9ed3e7165034556c4d901bcd122cceb3f353e..84bc5d08570d8422eec42c3894b97ed3f081d022 100644 (file)
@@ -183,8 +183,8 @@ bool accel_device::set_interval(uint32_t id, unsigned long val)
 
 bool accel_device::update_value_input_event(void)
 {
-       int accel_raw[3] = {0,};
-       bool x,y,z;
+       int accel_raw[3] = {0, };
+       bool x, y, z;
        int read_input_cnt = 0;
        const int INPUT_MAX_BEFORE_SYN = 10;
        unsigned long long fired_time = 0;
@@ -198,7 +198,7 @@ bool accel_device::update_value_input_event(void)
        while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) {
                int len = read(m_node_handle, &accel_input, sizeof(accel_input));
                if (len != sizeof(accel_input)) {
-                       _E("accel_file read fail, read_len = %d",len);
+                       _E("accel_file read fail, read_len = %d", len);
                        return false;
                }
 
index 36c958d2a625e2bc9d1b4eb5df52e71f361606cb..6c4b02b2e492095555961736856b98782c4b5e1d 100644 (file)
@@ -53,7 +53,7 @@ private:
        std::string m_enable_node;
        std::string m_interval_node;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index 94df7b715affef25948cce80335e17cbbb814b2d..c7635aeddc38a7a2b6298a76f3ef8367af566df0 100644 (file)
@@ -180,8 +180,8 @@ bool gyro_device::set_interval(uint32_t id, unsigned long val)
 
 bool gyro_device::update_value_input_event(void)
 {
-       int gyro_raw[3] = {0,};
-       bool x,y,z;
+       int gyro_raw[3] = {0, };
+       bool x, y, z;
        int read_input_cnt = 0;
        const int INPUT_MAX_BEFORE_SYN = 10;
        unsigned long long fired_time = 0;
index f2abfb04dad9aa385974782c4cd32d28d14ba34d..994c1b2ed949cf137fc9b6ca21b561e2d1e716ab 100644 (file)
@@ -52,7 +52,7 @@ private:
        std::string m_enable_node;
        std::string m_interval_node;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index 4f6755dbed0dfc9b419991970d221919a528ea7b..8dc1408cd3e2fdb7a52d2ad53b12959b0cd42ee8 100644 (file)
@@ -173,8 +173,8 @@ bool gyro_uncal_device::set_interval(uint32_t id, unsigned long val)
 
 bool gyro_uncal_device::update_value_input_event(void)
 {
-       int gyro_uncal_raw[6] = {0,};
-       bool x,y,z,x_offset,y_offset,z_offset;
+       int gyro_uncal_raw[6] = {0, };
+       bool x, y, z, x_offset, y_offset, z_offset;
        int read_input_cnt = 0;
        const int INPUT_MAX_BEFORE_SYN = 10;
        unsigned long long fired_time = 0;
@@ -188,7 +188,7 @@ bool gyro_uncal_device::update_value_input_event(void)
        while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) {
                int len = read(m_node_handle, &gyro_uncal_input, sizeof(gyro_uncal_input));
                if (len != sizeof(gyro_uncal_input)) {
-                       _E("gyro_file read fail, read_len = %d",len);
+                       _E("uncalibrated gyroscope read fail, read_len = %d", len);
                        return false;
                }
 
@@ -218,7 +218,7 @@ bool gyro_uncal_device::update_value_input_event(void)
                                break;
                        case REL_WHEEL:
                                gyro_uncal_raw[5] = (int)gyro_uncal_input.value;
-                               z_offset= true;
+                               z_offset = true;
                                break;
                        default:
                                _E("gyro_uncal_input event[type = %d, code = %d] is unknown.", gyro_uncal_input.type, gyro_uncal_input.code);
@@ -246,11 +246,11 @@ bool gyro_uncal_device::update_value_input_event(void)
        if (z)
                m_z =  gyro_uncal_raw[2];
        if (x_offset)
-               m_x_offset=  gyro_uncal_raw[3];
+               m_x_offset =  gyro_uncal_raw[3];
        if (y_offset)
-               m_y_offset=  gyro_uncal_raw[4];
+               m_y_offset =  gyro_uncal_raw[4];
        if (z_offset)
-               m_z_offset=  gyro_uncal_raw[5];
+               m_z_offset =  gyro_uncal_raw[5];
 
        m_fired_time = fired_time;
 
index 557b5617b8720c622ca6b9ead120d74e92e7bc7d..8f0b30df3755b845ae5802d78de114a430b0f316 100644 (file)
@@ -56,7 +56,7 @@ private:
        std::string m_enable_node;
        std::string m_interval_node;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index 827ca5d1baf8816ed5271e5473fcb66cff924bbd..222da21ad6b9350ad76cfd8dae376f4b9d5af4af 100644 (file)
@@ -181,7 +181,7 @@ bool hrm_device::update_value_input_event(void)
 {
        const float SNR_SIG_FIGS = 10000.0f;
        const int HR_MAX = 300;
-       int hrm_raw[4] = {0,};
+       int hrm_raw[4] = {0, };
        unsigned long long fired_time = 0;
        int read_input_cnt = 0;
        const int INPUT_MAX_BEFORE_SYN = 10;
index 693648c5d18713b8df6f937fb374aaf87d6da535..6600f05ea795b816558000be536d4fd30563839d 100644 (file)
@@ -55,7 +55,7 @@ private:
        std::string m_enable_node;
        std::string m_interval_node;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index b44241d7a13f5e716d99f205157741911201a868..14ac6f7c218d35fe902d513b68d72d35237cbfa7 100644 (file)
@@ -55,7 +55,7 @@ private:
        std::string m_enable_node;
        std::string m_interval_node;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index 24f4bca4c86cffc212c6069843d83bae540cfea7..1a8e916be922f4a036991d1b8cae84ac80a363f6 100644 (file)
@@ -51,7 +51,7 @@ private:
        std::string m_data_node;
        std::string m_interval_node;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index be67896b0ed2326d436baac4325c9b6ccee27a2d..12cdb3f1dcb5b6e944659777443d9941439d2bce 100644 (file)
@@ -173,7 +173,7 @@ bool pressure_device::set_interval(uint32_t id, unsigned long val)
 
 bool pressure_device::update_value_input_event(void)
 {
-       int pressure_raw[3] = {0,};
+       int pressure_raw[3] = {0, };
        bool pressure = false;
        bool sea_level = false;
        bool temperature = false;
@@ -188,7 +188,7 @@ bool pressure_device::update_value_input_event(void)
        while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) {
                int len = read(m_node_handle, &pressure_event, sizeof(pressure_event));
                if (len != sizeof(pressure_event)) {
-                       _E("pressure_file read fail, read_len = %d\n",len);
+                       _E("pressure read fail, read_len = %d\n", len);
                        return false;
                }
 
index b377b1a67c837ae7b0a487a085d8ab628a8adb76..c46b3204d8feb7c01fd0597fbd731aedc4856601 100644 (file)
@@ -53,7 +53,7 @@ private:
        std::string m_enable_node;
        std::string m_interval_node;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index 8e593e2b228def850554c435d6a4846871d77cd7..ac9e8c255899122b98e17dcab6f911969331e0c7 100644 (file)
 #endif
 #define LOG_TAG        "SENSOR"
 
-#define LOG_DUMP(fp, fmt, arg...) do { if (fp) fprintf(fp, fmt, ##arg); else _E(fmt, ##arg); } while(0)
+#define LOG_DUMP(fp, fmt, arg...) do { if (fp) fprintf(fp, fmt, ##arg); else _E(fmt, ##arg); } while (0)
 
 #ifdef _DEBUG
 #define DBG SLOGD
 #else
-#define DBG(...) do{} while(0)
+#define DBG(...) do { } while (0)
 #endif
 
 #define ERR SLOGE
index e725c3a94f9b52e2d9145eadd361e3ac530b3d65..a75ff25380f52821636dd76b87b8c2b9eef6b5f7 100644 (file)
@@ -153,7 +153,6 @@ static bool get_input_method(const string &key, int &method, string &device_num)
        bool find = false;
 
        for (int i = 0; i < input_info_len; ++i) {
-
                prefix_size = input_info[i].prefix.size();
 
                dir = opendir(input_info[i].dir_path.c_str());