Re: [PATCH BlueZ v5 01/14] core: Control connections based on adapter state

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

 



Hi,

On Tue, Sep 04, 2012, João Paulo Rechi Vita wrote:
> +static void set_auto_connect(gpointer data, gpointer user_data)
> +{
> +	struct btd_device *device = data;
> +	gboolean enable = GPOINTER_TO_INT(user_data);
> +
> +	device_set_auto_connect(device, enable);
> +}
> +
>  static void call_adapter_powered_callbacks(struct btd_adapter *adapter,
>  						gboolean powered)
>  {
> @@ -2125,7 +2133,10 @@ static void call_adapter_powered_callbacks(struct btd_adapter *adapter,
>  		btd_adapter_powered_cb cb = l->data;
>  
>  		cb(adapter, powered);
> -       }
> +	}
> +
> +	g_slist_foreach(adapter->devices, set_auto_connect,
> +						GINT_TO_POINTER(powered));

Instead of this GINT_TO_POINTER magic on a variable that isn't even a
gint couldn't you just pass &powered to g_slist_foreach and then in the
callback do:

	gboolean enable = *(gboolean *) user_data;

or

	gboolean *enable = user_data;

	device_set_auto_connect(device, *enable);

Johan
--
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