sensor: hal: tm2: fix coding rule violations 28/149228/1 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.012812 accepted/tizen/unified/20170913.071913 submit/tizen/20170912.122717 submit/tizen_5.0/20181101.000001
authorkibak.yoon <kibak.yoon@samsung.com>
Tue, 12 Sep 2017 02:16:20 +0000 (11:16 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Tue, 12 Sep 2017 02:16:20 +0000 (11:16 +0900)
Change-Id: Ifaa8baa771092c30cb54c61c3d1d844b1ae25659
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
12 files changed:
src/accel/accel_device.cpp
src/accel/accel_device.h
src/gyro/gyro_device.cpp
src/gyro/gyro_device.h
src/light/light_device.cpp
src/light/light_device.h
src/pressure/pressure_device.cpp
src/pressure/pressure_device.h
src/sensor_log.h
src/ultraviolet/uv_device.cpp
src/ultraviolet/uv_device.h
src/util.cpp

index d47909e..c25a5e5 100644 (file)
@@ -184,8 +184,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;
@@ -199,7 +199,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 e84d7bd..dfeff56 100644 (file)
@@ -181,8 +181,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 d75e8ba..ebcc681 100644 (file)
@@ -58,7 +58,7 @@
 #define MAX_LUX_VALUE     150000
 #define MAX_ALS_VALUE     0xFFFF
 #define GAB (0.15)
-#define min_t(a,b) (((a) < (b)) ? (a) : (b))
+#define min_t(a, b) (((a) < (b)) ? (a) : (b))
 
 static sensor_info_t sensor_info = {
        id: 0x1,
@@ -195,7 +195,7 @@ bool light_device::update_value_lux(void)
        while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) {
                int len = read(m_node_handle, &light_event, sizeof(light_event));
                if (len != sizeof(light_event)) {
-                       _E("light_file read fail, read_len = %d\n",len);
+                       _E("light_file read fail, read_len = %d\n", len);
                        return false;
                }
 
index bac7648..3f87ad4 100644 (file)
@@ -52,7 +52,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 529dec6..78bd930 100644 (file)
@@ -184,7 +184,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;
@@ -199,7 +199,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 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 341ebe7..b5ad725 100644 (file)
@@ -181,7 +181,7 @@ bool uv_device::update_value_input_event(void)
        while ((syn == false) && (read_input_cnt < INPUT_MAX_BEFORE_SYN)) {
                int len = read(m_node_handle, &ultraviolet_event, sizeof(ultraviolet_event));
                if (len != sizeof(ultraviolet_event)) {
-                       _E("ultraviolet file read fail, read_len = %d\n",len);
+                       _E("ultraviolet file read fail, read_len = %d\n", len);
                        return false;
                }
 
index 34b536e..799f3f1 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 e725c3a..a75ff25 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());