sensor: hal: emul: fix coding rule violations 60/149260/1
authorkibak.yoon <kibak.yoon@samsung.com>
Tue, 12 Sep 2017 03:16:51 +0000 (12:16 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Tue, 12 Sep 2017 03:16:51 +0000 (12:16 +0900)
Change-Id: I2bad9fe102fa444afbbebf190772ac6902d68fe6
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
18 files changed:
src/accel/accel_device.cpp
src/accel/accel_device.h
src/geomag/geomag_device.cpp
src/geomag/geomag_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/light/light_device.h
src/pressure/pressure_device.cpp
src/pressure/pressure_device.h
src/proxi/proxi_device.cpp
src/proxi/proxi_device.h
src/sensor_log.h
src/ultraviolet/uv_device.h
src/util.cpp

index e3b0b4c3f51e7ba92e3ae6420f90631f8cf7795e..7d3fef3424316c446a453a10824268e30020729c 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 a0f626ee7859601a81526e03a3370d4e3e940155..de45ea671146f914f92b282d6e0429c1910f1e97 100644 (file)
@@ -178,7 +178,7 @@ bool geomag_device::set_interval(uint32_t id, unsigned long val)
 
 bool geomag_device::update_value_input_event(void)
 {
-       int geo_raw[4] = {0,};
+       int geo_raw[4] = {0, };
        bool x, y, z, hdst;
        int read_input_cnt = 0;
        const int INPUT_MAX_BEFORE_SYN = 10;
@@ -193,7 +193,7 @@ bool geomag_device::update_value_input_event(void)
        while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) {
                int len = read(m_node_handle, &geo_input, sizeof(geo_input));
                if (len != sizeof(geo_input)) {
-                       _E("geo_file read fail, read_len = %d",len);
+                       _E("geo_file read fail, read_len = %d", len);
                        return false;
                }
 
index ccd7142837e8c03233130c97e97a40b6d8497656..eba671f56c26cfb5af71ce61ca60d17d68124da6 100644 (file)
@@ -58,7 +58,7 @@ private:
        long a_y;
        long a_z;
 
-       std::function<bool (void)> update_value;
+       std::function<bool(void)> update_value;
 
        std::vector<uint32_t> event_ids;
 
index b618d473247581471df43a96b09e90652b55eb48..a5be86bad22b2803b2e913be3a6f805b4e0e41ec 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 b692f0468171f637cd98b431f56b09201291aa51..fde7c7c699fdee68a1e3f4060abb2447b98dc45e 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("gyro_file 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 41ab0c3abe0672337c376d138afcdef3f6457bbe..39087ae6ae6c9bb1ed1c4db1e5560a7a283cb851 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 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 ebcd6ba4aebb7ec5b18bd5f2a9c57dff1c983dbb..806c60455200ac3635e86f73cda8849fcad4ab1e 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_file 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 569fa4eb6b5f388440e2bf33ea761a7420e55770..72936b9d6caa08f29a90a64184c51d35c5812567 100644 (file)
@@ -164,7 +164,7 @@ bool proxi_device::update_value_input_event(void)
                return false;
 
        if (proxi_event.value != PROXIMITY_NODE_STATE_FAR && proxi_event.value != PROXIMITY_NODE_STATE_NEAR) {
-               _E("PROXIMITY_STATE Unknown: %d",proxi_event.value);
+               _E("PROXIMITY_STATE Unknown: %d", proxi_event.value);
                return false;
        }
 
index 2ddb5e48d2ee314ecf877a56845994cbe6c1e1d4..f9cf22bee29b3cfe146838d8b0dfce22a4ec8fd7 100644 (file)
@@ -53,7 +53,7 @@ private:
        std::string m_data_node;
        std::string m_enable_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 85f5a4e2c70416ab5c41db00beead2f519a91e57..635ff82bd3b8ea2c19fac80f663d894c09e514d5 100644 (file)
@@ -51,7 +51,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 345b8b4b6456e7b123a62c3f14fa656e78c62400..86d572d55a5d8e28d9ec3886b9366bf1952b08c4 100644 (file)
@@ -163,7 +163,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());