Introduce convertible module #49

Merged
raster merged 35 commits from rafspiny/enlightenment:master into master 2024-03-12 07:20:21 -07:00
1 changed files with 46 additions and 46 deletions
Showing only changes of commit 6939a34c1d - Show all commits

View File

@ -11,6 +11,51 @@
static DbusAccelerometer* accelerometer_dbus;

shouldnt accelerometer_dbus be static?

shouldnt accelerometer_dbus be static?

Made it static.

Made it static.

functions in C that take NO arguments are (void) not (). () means "i accept any number of arguments of an undefined type". :)

also some funcs are

int func(int x)
{
}

some are

int
func(int x)
{
}

with return type on previous line - be consistent and maybe do the latter?

functions in C that take NO arguments are (void) not (). () means "i accept any number of arguments of an undefined type". :) also some funcs are int func(int x) { } some are int func(int x) { } with return type on previous line - be consistent and maybe do the latter?

Corrected the linting for function to be

int
func(int x)
{
}

Also in the headers

int
func(int x);

Do we have a linting configi file somewhere? So we can get this kind of comments automatically? Like clang

Corrected the linting for function to be ``` int func(int x) { } ``` Also in the headers ``` int func(int x); ``` Do we have a linting configi file somewhere? So we can get this kind of comments automatically? Like clang
/**
* Helper function to extract ta boolean property from the message
* @param msg The message coming from the get property invocation
* @param variant
* @param boolean_property_value The boolean property pointer where the value should be stored, if read
* @return
*/

if calloc fails?

if calloc fails?

I think in most case I can use EINA_SAFETY_ON_NULL_RETURN_VAL. Am I correct?

I think in most case I can use EINA_SAFETY_ON_NULL_RETURN_VAL. Am I correct?
static Eina_Bool
_access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value)
{
char *type;
Eina_Bool res = EINA_TRUE;

do we really need this? eldnbus should alredy be initted by e before any module loads...

do we really need this? eldnbus should alredy be initted by e before any module loads...

Removed it.

Removed it.
if (!eldbus_message_arguments_get(msg, "v", variant))
{
WARN("Error getting arguments.");
res = EINA_FALSE;
}
type = eldbus_message_iter_signature_get((*variant));
if (type == NULL)
{
WARN("Unable to get the type.");
res = EINA_FALSE;
return res;
}
if (type[1])
{
WARN("It is a complex type, not handle yet.");
res = EINA_FALSE;
}
if (type[0] != 'b')
{
WARN("Expected type is int.");
res = EINA_FALSE;
}
if (!eldbus_message_iter_arguments_get((*variant), "b", boolean_property_value))
{
WARN("error in eldbus_message_iter_arguments_get()");
res = EINA_FALSE;
}
free(type);
return res;
}
/**
* Callback definition to handle the execution of the ReleaseAccelerometer() method of DBUS
* interface net.hadess.SensorProxy

functions in C that take NO arguments are (void) not (). () means "i accept any number of arguments of an undefined type". :)

functions in C that take NO arguments are (void) not (). () means "i accept any number of arguments of an undefined type". :)

I think I fixed all of them.

I think I fixed all of them.
@ -152,7 +197,7 @@ _is_device_a_touch_pointer(int dev_counter, int num_properties, char **iterator)
/**
* Helper to get the interface
rafspiny marked this conversation as resolved Outdated

no need for void * cast

no need for void * cast
* */
statis Eldbus_Proxy *
static Eldbus_Proxy *
get_dbus_interface(const char *IFACE)
{
DBG("Working on interface: %s", IFACE);
@ -235,51 +280,6 @@ _access_string_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant
return rotation;
}
/**
* Helper function to extract ta boolean property from the message
* @param msg The message coming from the get property invocation
* @param variant
* @param boolean_property_value The boolean property pointer where the value should be stored, if read
* @return
*/
Eina_Bool
_access_bool_property(const Eldbus_Message *msg, Eldbus_Message_Iter **variant, Eina_Bool *boolean_property_value)
{
char *type;
Eina_Bool res = EINA_TRUE;
if (!eldbus_message_arguments_get(msg, "v", variant))
{
WARN("Error getting arguments.");
res = EINA_FALSE;
}
type = eldbus_message_iter_signature_get((*variant));
if (type == NULL)
{
WARN("Unable to get the type.");
res = EINA_FALSE;
return res;
}
if (type[1])
{
WARN("It is a complex type, not handle yet.");
res = EINA_FALSE;
}
if (type[0] != 'b')
{
WARN("Expected type is int.");
res = EINA_FALSE;
}
if (!eldbus_message_iter_arguments_get((*variant), "b", boolean_property_value))
{
WARN("error in eldbus_message_iter_arguments_get()");
res = EINA_FALSE;
}
free(type);
return res;
}
void
on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{