From 74cd743aa09378fd553c4dd0b891be63adcbe02f Mon Sep 17 00:00:00 2001 From: rafspiny Date: Sun, 21 Jan 2024 19:40:25 +0100 Subject: [PATCH] Add typedef enum Specify no parameters on some functions --- src/modules/convertible/dbus_acceleration.c | 10 +++++----- src/modules/convertible/dbus_acceleration.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c index 9ab21b771..d665b7421 100644 --- a/src/modules/convertible/dbus_acceleration.c +++ b/src/modules/convertible/dbus_acceleration.c @@ -12,7 +12,7 @@ static DbusAccelerometer* accelerometer_dbus; static int -_convertible_rotation_get(const enum screen_rotation orientation) +_convertible_rotation_get(const screen_rotation orientation) { switch (orientation) { @@ -118,7 +118,7 @@ _fetch_X_device_input_number(void) * @param rotation The expected rotation */ static void -_fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orientation) +_fetch_and_rotate_screen(const char* randr_id, screen_rotation orientation) { DBG("Working on screen %s", randr_id); E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id); @@ -402,10 +402,10 @@ sensor_proxy_shutdown(void) * @param variant * @return Enum specifying the orientation. UNDEFINED by default */ -static enum screen_rotation +static screen_rotation _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant) { - enum screen_rotation rotation = UNDEFINED; + screen_rotation rotation = UNDEFINED; char *type = NULL; if (!eldbus_message_arguments_get(msg, "v", variant)) @@ -461,7 +461,7 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi } const char *errname, *errmsg; - enum screen_rotation orientation; + screen_rotation orientation; Eldbus_Message_Iter *variant = NULL; if (eldbus_message_error_get(msg, &errname, &errmsg)) diff --git a/src/modules/convertible/dbus_acceleration.h b/src/modules/convertible/dbus_acceleration.h index c2f864702..fcd4d2f81 100644 --- a/src/modules/convertible/dbus_acceleration.h +++ b/src/modules/convertible/dbus_acceleration.h @@ -10,14 +10,14 @@ #define EFL_DBUS_ACC_IFACE "net.hadess.SensorProxy" // This enum represents the 4 states of screen rotation plus UNDEFINED -enum screen_rotation {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP}; +typedef enum {UNDEFINED, NORMAL, RIGHT_UP, FLIPPED, LEFT_UP} screen_rotation; typedef struct _DbusAccelerometer DbusAccelerometer; struct _DbusAccelerometer { Eina_Bool has_accelerometer; - enum screen_rotation orientation; + screen_rotation orientation; Eldbus_Proxy *sensor_proxy, *sensor_proxy_properties; Eldbus_Pending *pending_has_orientation, *pending_orientation, *pending_acc_claim, *pending_acc_crelease; Eldbus_Signal_Handler *dbus_property_changed_sh; @@ -26,10 +26,10 @@ struct _DbusAccelerometer /** * Fetch the DBUS interfaces and fill the DbusAccelerometer struct * */ -DbusAccelerometer* sensor_proxy_init(); +DbusAccelerometer* sensor_proxy_init(void); -void sensor_proxy_shutdown(); +void sensor_proxy_shutdown(void); void on_has_accelerometer(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED);