sensor: hal: emul: fix coding rule violations
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 e3b0b4c..7d3fef3 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 36c958d..6c4b02b 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 a0f626e..de45ea6 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 ccd7142..eba671f 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 b618d47..a5be86b 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 f2abfb0..994c1b2 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 b692f04..fde7c7c 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 557b561..8f0b30d 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 41ab0c3..39087ae 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 693648c..6600f05 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 24f4bca..1a8e916 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 ebcd6ba..806c604 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 b377b1a..c46b320 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 569fa4e..72936b9 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 2ddb5e4..f9cf22b 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 8e593e2..ac9e8c2 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 85f5a4e..635ff82 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 345b8b4..86d572d 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());