From: kibak.yoon Date: Tue, 12 Sep 2017 03:16:51 +0000 (+0900) Subject: sensor: hal: emul: fix coding rule violations X-Git-Tag: accepted/tizen/unified/20170913.071921~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6cbf0ff65588c28c9aa8c8f04c67f338af9d73e;p=platform%2Fadaptation%2Femulator%2Fsensor-hal-emulator.git sensor: hal: emul: fix coding rule violations Change-Id: I2bad9fe102fa444afbbebf190772ac6902d68fe6 Signed-off-by: kibak.yoon --- diff --git a/src/accel/accel_device.cpp b/src/accel/accel_device.cpp index e3b0b4c..7d3fef3 100644 --- a/src/accel/accel_device.cpp +++ b/src/accel/accel_device.cpp @@ -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; } diff --git a/src/accel/accel_device.h b/src/accel/accel_device.h index 36c958d..6c4b02b 100644 --- a/src/accel/accel_device.h +++ b/src/accel/accel_device.h @@ -53,7 +53,7 @@ private: std::string m_enable_node; std::string m_interval_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/geomag/geomag_device.cpp b/src/geomag/geomag_device.cpp index a0f626e..de45ea6 100644 --- a/src/geomag/geomag_device.cpp +++ b/src/geomag/geomag_device.cpp @@ -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; } diff --git a/src/geomag/geomag_device.h b/src/geomag/geomag_device.h index ccd7142..eba671f 100644 --- a/src/geomag/geomag_device.h +++ b/src/geomag/geomag_device.h @@ -58,7 +58,7 @@ private: long a_y; long a_z; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/gyro/gyro_device.cpp b/src/gyro/gyro_device.cpp index b618d47..a5be86b 100644 --- a/src/gyro/gyro_device.cpp +++ b/src/gyro/gyro_device.cpp @@ -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; diff --git a/src/gyro/gyro_device.h b/src/gyro/gyro_device.h index f2abfb0..994c1b2 100644 --- a/src/gyro/gyro_device.h +++ b/src/gyro/gyro_device.h @@ -52,7 +52,7 @@ private: std::string m_enable_node; std::string m_interval_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/gyro_uncal/gyro_uncal_device.cpp b/src/gyro_uncal/gyro_uncal_device.cpp index b692f04..fde7c7c 100644 --- a/src/gyro_uncal/gyro_uncal_device.cpp +++ b/src/gyro_uncal/gyro_uncal_device.cpp @@ -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; diff --git a/src/gyro_uncal/gyro_uncal_device.h b/src/gyro_uncal/gyro_uncal_device.h index 557b561..8f0b30d 100644 --- a/src/gyro_uncal/gyro_uncal_device.h +++ b/src/gyro_uncal/gyro_uncal_device.h @@ -56,7 +56,7 @@ private: std::string m_enable_node; std::string m_interval_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/hrm/hrm_device.cpp b/src/hrm/hrm_device.cpp index 41ab0c3..39087ae 100644 --- a/src/hrm/hrm_device.cpp +++ b/src/hrm/hrm_device.cpp @@ -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; diff --git a/src/hrm/hrm_device.h b/src/hrm/hrm_device.h index 693648c..6600f05 100644 --- a/src/hrm/hrm_device.h +++ b/src/hrm/hrm_device.h @@ -55,7 +55,7 @@ private: std::string m_enable_node; std::string m_interval_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/light/light_device.h b/src/light/light_device.h index 24f4bca..1a8e916 100644 --- a/src/light/light_device.h +++ b/src/light/light_device.h @@ -51,7 +51,7 @@ private: std::string m_data_node; std::string m_interval_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/pressure/pressure_device.cpp b/src/pressure/pressure_device.cpp index ebcd6ba..806c604 100644 --- a/src/pressure/pressure_device.cpp +++ b/src/pressure/pressure_device.cpp @@ -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; } diff --git a/src/pressure/pressure_device.h b/src/pressure/pressure_device.h index b377b1a..c46b320 100644 --- a/src/pressure/pressure_device.h +++ b/src/pressure/pressure_device.h @@ -53,7 +53,7 @@ private: std::string m_enable_node; std::string m_interval_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/proxi/proxi_device.cpp b/src/proxi/proxi_device.cpp index 569fa4e..72936b9 100644 --- a/src/proxi/proxi_device.cpp +++ b/src/proxi/proxi_device.cpp @@ -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; } diff --git a/src/proxi/proxi_device.h b/src/proxi/proxi_device.h index 2ddb5e4..f9cf22b 100644 --- a/src/proxi/proxi_device.h +++ b/src/proxi/proxi_device.h @@ -53,7 +53,7 @@ private: std::string m_data_node; std::string m_enable_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/sensor_log.h b/src/sensor_log.h index 8e593e2..ac9e8c2 100644 --- a/src/sensor_log.h +++ b/src/sensor_log.h @@ -29,12 +29,12 @@ #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 diff --git a/src/ultraviolet/uv_device.h b/src/ultraviolet/uv_device.h index 85f5a4e..635ff82 100644 --- a/src/ultraviolet/uv_device.h +++ b/src/ultraviolet/uv_device.h @@ -51,7 +51,7 @@ private: std::string m_enable_node; std::string m_interval_node; - std::function update_value; + std::function update_value; std::vector event_ids; diff --git a/src/util.cpp b/src/util.cpp index 345b8b4..86d572d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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());