Re: [PATCH] Fix handlig for gboolean mce_bt_set field

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

 



On Thu, Sep 30, 2010 at 4:51 AM, Gustavo F. Padovan
<padovan@xxxxxxxxxxxxxx> wrote:
>> diff --git a/plugins/maemo6.c b/plugins/maemo6.c
>> index c96731d..45d96b8 100644
>> --- a/plugins/maemo6.c
>> +++ b/plugins/maemo6.c
>> @@ -71,7 +71,8 @@ static gboolean mce_signal_callback(DBusConnection *connection,
>>
>>               /* set the adapter according to the mce signal
>>                  and remember the value */
>> -             mce_bt_set = sigvalue & MCE_RADIO_STATE_BLUETOOTH;
>> +             mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) ==
>> +                                             MCE_RADIO_STATE_BLUETOOTH;
>
> Alternatively you can do
>        mce_bt_set = !!(sigvalue & MCE_RADIO_STATE_BLUETOOTH)

I'm a bit late, but:

mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) != 0;

would equally work.

PS: yes, I know it's already commited. :). Interestingly, there is
only one more occurrence of this idiom already in bluez code:

input/device.c:	connected = !!g_slist_find_custom(idev->connections, NULL,

Regards,
-- 
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
--
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