sensord: write void explicitly when no parameters allowed 86/71086/1
authorkibak.yoon <kibak.yoon@samsung.com>
Tue, 24 May 2016 04:36:59 +0000 (13:36 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Tue, 24 May 2016 04:36:59 +0000 (13:36 +0900)
- 6.7.5.3 Function declarators
  * The special case of an unnamed parameter of type void as the only
  item in the list specifies that the function has no parameters.

Change-Id: I5a9afdd938a317c23a86d7fc4cd0514a91f0b6b5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
29 files changed:
src/client/sensor_client_info.cpp
src/sensor/auto_rotation/auto_rotation_sensor.cpp
src/sensor/auto_rotation/auto_rotation_sensor.h
src/sensor/gravity/gravity_sensor.cpp
src/sensor/gravity/gravity_sensor.h
src/sensor/linear_accel/linear_accel_sensor.cpp
src/sensor/orientation/orientation_sensor.cpp
src/sensor/rotation_vector/rotation_vector_sensor.cpp
src/sensor/sensor_fusion/orientation_filter.h
src/sensor/sensor_fusion/quaternion.h
src/server/client_info_manager.cpp
src/server/client_info_manager.h
src/server/permission_checker.cpp
src/server/permission_checker.h
src/server/physical_sensor.cpp
src/server/physical_sensor.h
src/server/sensor_base.cpp
src/server/sensor_base.h
src/server/sensor_event_dispatcher.cpp
src/server/sensor_event_dispatcher.h
src/server/sensor_event_poller.cpp
src/server/sensor_event_queue.cpp
src/server/sensor_event_queue.h
src/server/sensor_loader.cpp
src/server/sensor_loader.h
src/server/server.cpp
src/server/server.h
src/shared/cmutex.cpp
src/shared/cmutex.h

index a7dbf7e..ecb453e 100644 (file)
@@ -85,7 +85,7 @@ bool sensor_client_info::delete_handle(int handle)
        return true;
 }
 
-bool sensor_client_info::is_active()
+bool sensor_client_info::is_active(void)
 {
        AUTOLOCK(m_handle_info_lock);
 
index b3f0784..0cebedd 100644 (file)
@@ -214,7 +214,7 @@ bool auto_rotation_sensor::on_stop(void)
        return deactivate();
 }
 
-auto_rotation_alg *auto_rotation_sensor::get_alg()
+auto_rotation_alg *auto_rotation_sensor::get_alg(void)
 {
        auto_rotation_alg *alg = new(std::nothrow) auto_rotation_alg_emul();
        retvm_if(!alg, NULL, "Failed to allocate memory");
index 506f244..ddd4e3c 100644 (file)
@@ -59,7 +59,7 @@ private:
        virtual bool on_start(void);
        virtual bool on_stop(void);
 
-       auto_rotation_alg *get_alg();
+       auto_rotation_alg *get_alg(void);
 };
 
 #endif /* _AUTO_ROTATION_SENSOR_H_ */
index e071226..931940a 100644 (file)
@@ -71,7 +71,7 @@ gravity_sensor::~gravity_sensor()
        _I("gravity_sensor is destroyed!\n");
 }
 
-bool gravity_sensor::init()
+bool gravity_sensor::init(void)
 {
        /* Acc (+ Gyro) fusion */
        m_accel_sensor = sensor_loader::get_instance().get_sensor(ACCELEROMETER_SENSOR);
@@ -323,7 +323,7 @@ void gravity_sensor::fusion_set_gyro(const sensor_event_t& event)
        m_time_new = event.data->timestamp;
 }
 
-void gravity_sensor::fusion_update_angle()
+void gravity_sensor::fusion_update_angle(void)
 {
        _D("AngleIn: (%f, %f, %f)", m_angle_n[0], m_angle_n[1], m_angle_n[2]);
        _D("AngAccl: (%f, %f, %f)", m_velocity[0], m_velocity[1], m_velocity[2]);
@@ -341,7 +341,7 @@ void gravity_sensor::fusion_update_angle()
        _D("Angle' : (%f, %f, %f)", m_angle[0], m_angle[1], m_angle[2]);
 }
 
-void gravity_sensor::fusion_get_gravity()
+void gravity_sensor::fusion_get_gravity(void)
 {
        double x = 0, y = 0, z = 0;
        double norm;
index c9ed7d7..093465c 100644 (file)
@@ -81,8 +81,8 @@ private:
 
        void fusion_set_accel(const sensor_event_t& event);
        void fusion_set_gyro(const sensor_event_t& event);
-       void fusion_update_angle();
-       void fusion_get_gravity();
+       void fusion_update_angle(void);
+       void fusion_get_gravity(void);
        double complementary(double angle, double angle_in, double vel, double delta_t, double alpha);
        void complementary(unsigned long long time_diff);
 };
index 7e89700..f5ad037 100644 (file)
@@ -58,7 +58,7 @@ linear_accel_sensor::~linear_accel_sensor()
        _I("linear_accel_sensor is destroyed!\n");
 }
 
-bool linear_accel_sensor::init()
+bool linear_accel_sensor::init(void)
 {
        m_accel_sensor = sensor_loader::get_instance().get_sensor(ACCELEROMETER_SENSOR);
 
index 940aed3..8f4bd79 100644 (file)
@@ -52,7 +52,7 @@ orientation_sensor::~orientation_sensor()
        _I("%s is destroyed!", SENSOR_NAME);
 }
 
-bool orientation_sensor::init()
+bool orientation_sensor::init(void)
 {
        m_rotation_vector_sensor = sensor_loader::get_instance().get_sensor(ROTATION_VECTOR_SENSOR);
 
index 17c3655..93c03db 100644 (file)
@@ -59,7 +59,7 @@ rotation_vector_sensor::~rotation_vector_sensor()
        _I("%s is destroyed!", SENSOR_NAME);
 }
 
-bool rotation_vector_sensor::init()
+bool rotation_vector_sensor::init(void)
 {
        m_accel_sensor = sensor_loader::get_instance().get_sensor(ACCELEROMETER_SENSOR);
        m_mag_sensor = sensor_loader::get_instance().get_sensor(GEOMAGNETIC_SENSOR);
index ea6143d..d55b7c1 100644 (file)
@@ -75,17 +75,17 @@ public:
 
        int m_magnetic_alignment_factor;
 
-       orientation_filter();
-       ~orientation_filter();
+       orientation_filter(void);
+       ~orientation_filter(void);
 
        inline void initialize_sensor_data(const sensor_data<TYPE> *accel,
                        const sensor_data<TYPE> *gyro, const sensor_data<TYPE> *magnetic);
-       inline void orientation_triad_algorithm();
-       inline void compute_accel_orientation();
-       inline void compute_covariance();
-       inline void time_update();
-       inline void time_update_gaming_rv();
-       inline void measurement_update();
+       inline void orientation_triad_algorithm(void);
+       inline void compute_accel_orientation(void);
+       inline void compute_covariance(void);
+       inline void time_update(void);
+       inline void time_update_gaming_rv(void);
+       inline void measurement_update(void);
 
        void get_device_orientation(const sensor_data<TYPE> *accel,
                        const sensor_data<TYPE> *gyro, const sensor_data<TYPE> *magnetic);
index 539a952..cbe9bf4 100644 (file)
@@ -37,7 +37,7 @@ public:
        ~quaternion();
 
        quaternion<TYPE> operator =(const quaternion<TYPE>& q);
-       void quat_normalize();
+       void quat_normalize(void);
 
        template<typename T> friend quaternion<T> operator *(const quaternion<T> q,
                        const T val);
index d065592..efdaec0 100644 (file)
@@ -36,7 +36,7 @@ client_info_manager::~client_info_manager()
        m_clients.clear();
 }
 
-client_info_manager& client_info_manager::get_instance()
+client_info_manager& client_info_manager::get_instance(void)
 {
        static client_info_manager inst;
        return inst;
index bed4471..b65c4bf 100644 (file)
@@ -31,7 +31,7 @@ typedef std::vector<int> client_id_vec;
 
 class client_info_manager {
 public:
-       static client_info_manager& get_instance();
+       static client_info_manager& get_instance(void);
        int create_client_record(void);
        bool remove_client_record(int client_id);
        bool has_client_record(int client_id);
index b8ece6e..72fef47 100644 (file)
@@ -60,24 +60,24 @@ static bool check_privilege_by_sockfd(int sock_fd, const char *priv)
        return (ret == CYNARA_API_ACCESS_ALLOWED);
 }
 
-permission_checker::permission_checker()
+permission_checker::permission_checker(void)
 : m_permission_set(0)
 {
        init();
 }
 
-permission_checker::~permission_checker()
+permission_checker::~permission_checker(void)
 {
        deinit();
 }
 
-permission_checker& permission_checker::get_instance()
+permission_checker& permission_checker::get_instance(void)
 {
        static permission_checker inst;
        return inst;
 }
 
-void permission_checker::init()
+void permission_checker::init(void)
 {
        AUTOLOCK(m_mutex);
 
@@ -121,7 +121,7 @@ void permission_checker::init_cynara(void)
        _I("Cynara initialized");
 }
 
-void permission_checker::deinit()
+void permission_checker::deinit(void)
 {
        AUTOLOCK(m_mutex);
 
index c7ccbb0..d47524d 100644 (file)
@@ -27,7 +27,7 @@
 
 class permission_checker {
 public:
-       static permission_checker& get_instance();
+       static permission_checker& get_instance(void);
 
        int get_permission(int sock_fd);
 
index b16561d..9bc53ea 100644 (file)
@@ -68,7 +68,7 @@ uint32_t physical_sensor::get_hal_id(void)
        return m_info->id;
 }
 
-int physical_sensor::get_poll_fd()
+int physical_sensor::get_poll_fd(void)
 {
        AUTOLOCK(m_mutex);
 
@@ -178,7 +178,7 @@ int physical_sensor::set_attribute(int32_t attribute, char *value, int value_len
        return OP_SUCCESS;
 }
 
-bool physical_sensor::on_start()
+bool physical_sensor::on_start(void)
 {
        AUTOLOCK(m_mutex);
 
@@ -188,7 +188,7 @@ bool physical_sensor::on_start()
        return m_sensor_device->enable(m_info->id);
 }
 
-bool physical_sensor::on_stop()
+bool physical_sensor::on_stop(void)
 {
        AUTOLOCK(m_mutex);
 
index cbcbc9a..3db1791 100644 (file)
@@ -39,7 +39,7 @@ public:
        virtual const char* get_name(void);
        virtual uint32_t get_hal_id(void);
 
-       int get_poll_fd();
+       int get_poll_fd(void);
 
        virtual bool on_event(const sensor_data_t *data, int data_len, int remains);
 
index dcc6623..b06b2f3 100644 (file)
@@ -66,7 +66,7 @@ unsigned int sensor_base::get_event_type(void)
        return -1;
 }
 
-const char* sensor_base::get_name()
+const char* sensor_base::get_name(void)
 {
        return NULL;
 }
@@ -76,7 +76,7 @@ bool sensor_base::get_sensor_info(sensor_info &info)
        return false;
 }
 
-bool sensor_base::is_virtual()
+bool sensor_base::is_virtual(void)
 {
        return false;
 }
@@ -116,7 +116,7 @@ int sensor_base::set_attribute(int32_t attribute, char *value, int value_size)
        return OP_SUCCESS;
 }
 
-bool sensor_base::start()
+bool sensor_base::start(void)
 {
        AUTOLOCK(m_client_mutex);
 
@@ -344,12 +344,12 @@ bool sensor_base::set_batch_latency(unsigned long latency)
        return true;
 }
 
-bool sensor_base::on_start()
+bool sensor_base::on_start(void)
 {
        return true;
 }
 
-bool sensor_base::on_stop()
+bool sensor_base::on_stop(void)
 {
        return true;
 }
index e5e07c7..22f0e66 100644 (file)
@@ -41,7 +41,7 @@ public:
        sensor_id_t get_id(void);
 
        /* sensor info */
-       virtual sensor_type_t get_type();
+       virtual sensor_type_t get_type(void);
        virtual unsigned int get_event_type(void);
        virtual const char* get_name(void);
        virtual bool is_virtual(void);
index c1fc3cb..03c4798 100644 (file)
@@ -38,7 +38,7 @@ sensor_event_dispatcher::~sensor_event_dispatcher()
 {
 }
 
-sensor_event_dispatcher& sensor_event_dispatcher::get_instance()
+sensor_event_dispatcher& sensor_event_dispatcher::get_instance(void)
 {
        static sensor_event_dispatcher inst;
        return inst;
index ee7e630..6d79e44 100644 (file)
@@ -34,7 +34,7 @@ typedef std::list<virtual_sensor *> virtual_sensors;
 
 class sensor_event_dispatcher {
 public:
-       static sensor_event_dispatcher& get_instance();
+       static sensor_event_dispatcher& get_instance(void);
 
        bool run(void);
        bool stop(void);
index 994c1f0..fa23e6f 100644 (file)
@@ -40,7 +40,7 @@ sensor_event_poller::~sensor_event_poller()
                m_poller.del_fd(it->first);
 }
 
-void sensor_event_poller::init_sensor_map()
+void sensor_event_poller::init_sensor_map(void)
 {
        int fd;
        physical_sensor *sensor;
@@ -92,7 +92,7 @@ bool sensor_event_poller::add_poll_fd(int fd)
        return m_poller.add_fd(fd);
 }
 
-bool sensor_event_poller::poll()
+bool sensor_event_poller::poll(void)
 {
        std::vector<uint32_t> ids;
        while (true) {
index b49880d..d143d49 100644 (file)
@@ -20,7 +20,7 @@
 #include <sensor_event_queue.h>
 #include <sensor_log.h>
 
-sensor_event_queue& sensor_event_queue::get_instance()
+sensor_event_queue& sensor_event_queue::get_instance(void)
 {
        static sensor_event_queue inst;
        return inst;
index f5e31ae..4f776ef 100644 (file)
@@ -27,7 +27,7 @@
 
 class sensor_event_queue {
 public:
-       static sensor_event_queue& get_instance();
+       static sensor_event_queue& get_instance(void);
 
        void push(sensor_event_t *event);
        void* pop(void);
index cf9f6ce..d43ac62 100644 (file)
@@ -71,7 +71,7 @@ sensor_loader::~sensor_loader()
        m_handles.clear();
 }
 
-sensor_loader& sensor_loader::get_instance()
+sensor_loader& sensor_loader::get_instance(void)
 {
        static sensor_loader inst;
        return inst;
index 486effe..3312c1d 100644 (file)
@@ -57,7 +57,7 @@ private:
        sensor_device_map_t m_devices;
        std::vector<void *> m_handles;
 public:
-       static sensor_loader& get_instance();
+       static sensor_loader& get_instance(void);
        bool load(void);
 
        sensor_base* get_sensor(sensor_type_t type);
index fb5882d..e3c902b 100644 (file)
@@ -294,7 +294,7 @@ void server::stop(void)
        }
 }
 
-server& server::get_instance()
+server& server::get_instance(void)
 {
        static server inst;
        return inst;
index 3dbd0d4..e285cde 100644 (file)
@@ -27,7 +27,7 @@
 
 class server {
 public:
-       static server& get_instance();
+       static server& get_instance(void);
 
 public:
        void run(void);
index 7f46633..6245b6e 100644 (file)
@@ -34,7 +34,7 @@ cmutex::~cmutex()
        pthread_mutex_destroy(&m_mutex);
 }
 
-void cmutex::lock()
+void cmutex::lock(void)
 {
 #ifdef _LOCK_DEBUG
        cbase_lock::lock(LOCK_TYPE_MUTEX, "mutex", __MODULE__, __func__, __LINE__);
@@ -58,7 +58,7 @@ int cmutex::try_lock_impl(void)
        return pthread_mutex_trylock(&m_mutex);
 }
 
-int cmutex::unlock_impl()
+int cmutex::unlock_impl(void)
 {
        return pthread_mutex_unlock(&m_mutex);
 }
index 868500a..94aa2b6 100644 (file)
@@ -33,7 +33,8 @@ public:
 protected:
        int lock_impl(void);
        int try_lock_impl(void);
-       int unlock_impl();
+       int unlock_impl(void);
+
 private:
        pthread_mutex_t m_mutex;
 };