Re: [PATCH BlueZ 2/2] core: Update gdbus function calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 17, 2012 at 1:25 PM, Anderson Lizardo
<anderson.lizardo@xxxxxxxxxxxxx> wrote:
> Hi again,
>
> On Wed, Oct 17, 2012 at 1:20 PM, Anderson Lizardo
> <anderson.lizardo@xxxxxxxxxxxxx> wrote:
>> Hi Lucas,
>>
>> On Wed, Oct 17, 2012 at 12:14 PM, Lucas De Marchi
>> <lucas.demarchi@xxxxxxxxxxxxxx> wrote:
>>> @@ -827,24 +824,21 @@ static void set_name(struct btd_adapter *adapter, const char *name,
>>>         int ret;
>>>
>>>         if (adapter->allow_name_changes == FALSE)
>>> -               return g_dbus_pending_property_error(btd_get_dbus_connection(),
>>> -                                               id, ERROR_INTERFACE ".Failed",
>>> +               return g_dbus_pending_property_error(id,
>>> +                                               ERROR_INTERFACE ".Failed",
>>>                                                 strerror(EPERM));
>>>
>>>         ret = adapter_set_name(adapter, name);
>>> -       if (ret >= 0) {
>>> -               g_dbus_pending_property_success(btd_get_dbus_connection(), id);
>>> -               return;
>>> -       }
>>> +       if (ret >= 0)
>>> +               return g_dbus_pending_property_success(id);
>>
>> Out of curiosity, is this style of returning "void" (instead of just
>> "return;") common in gdbus?
>
> Just realized that this is BlueZ specific code. Anyway, just found it
> odd (but answering my question, seems to be common).

It may be common because I used it a lot in the first conversions :-).
I don't know about other places using it. In gdbus-related code it's
very convenient because the function usually returns void as well, so
we can shortcut it with the g_dbus_pending_property_* calls.


Lucas De Marchi
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux