Introduce convertible module #49
|
@ -11,6 +11,51 @@
|
|||
static DbusAccelerometer* accelerometer_dbus;
|
||||
|
||||
|
||||
|
||||
raster
commented
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
some are
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?
rafspiny
commented
Corrected the linting for function to be
Also in the headers
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
|
||||
*/
|
||||
raster
commented
if calloc fails? if calloc fails?
rafspiny
commented
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;
|
||||
|
||||
raster
commented
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...
rafspiny
commented
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
|
||||
raster
commented
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". :)
rafspiny
commented
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
raster
commented
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)
|
||||
{
|
||||
|
|
shouldnt accelerometer_dbus be static?
Made it static.