From 34e9b9ba5fc23f6d9ff2427c0e611511dfc51b80 Mon Sep 17 00:00:00 2001 From: Boram Bae Date: Fri, 13 Mar 2020 11:21:26 +0900 Subject: Fix svace issues Change-Id: I433d23c1ecd8bb1e6f781c7aa199a0de9f53a254 Signed-off-by: Boram Bae --- src/sensorhub/sensorhub_controller.cpp | 5 +++++ src/sensorhub/sensorhub_sensor.h | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/sensorhub/sensorhub_controller.cpp b/src/sensorhub/sensorhub_controller.cpp index 1b8e4bc..2df8fc0 100644 --- a/src/sensorhub/sensorhub_controller.cpp +++ b/src/sensorhub/sensorhub_controller.cpp @@ -53,6 +53,11 @@ sensorhub_controller::sensorhub_controller() m_pending_data.value_count = 0; memset(m_pending_data.values, 0, sizeof(m_pending_data.values)); + m_data.accuracy = SENSOR_ACCURACY_UNDEFINED; + m_data.timestamp = 0; + m_data.value_count = 0; + memset(m_data.values, 0, sizeof(m_data.values)); + /* initialize polling node */ m_poll_node = open_input_node(SSP_INPUT_NODE_NAME); if (m_poll_node < 0) diff --git a/src/sensorhub/sensorhub_sensor.h b/src/sensorhub/sensorhub_sensor.h index edc1a0d..672f5eb 100644 --- a/src/sensorhub/sensorhub_sensor.h +++ b/src/sensorhub/sensorhub_sensor.h @@ -67,16 +67,16 @@ public: sensor_attribute_str_vec attributes_str; protected: - const sensor_info_t *m_sensor_info; - sensorhub_controller *m_controller; + const sensor_info_t *m_sensor_info{nullptr}; + sensorhub_controller *m_controller{nullptr}; bool enable(bool enbl, const char lib_id); bool is_enabled(void); bool is_restore_mode(void); private: - std::atomic_bool m_enabled; - std::atomic_bool m_restore_mode; + std::atomic_bool m_enabled{false}; + std::atomic_bool m_restore_mode{false}; }; #endif /* _SENSORHUB_SENSOR_H_ */ -- cgit v1.2.3