Hi Johan, On Fri, Mar 22, 2013 at 6:57 AM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote: > Hi Mikel, > > On Tue, Mar 19, 2013, Mikel Astiz wrote: >> +static gint service_state_cmp(gconstpointer a, gconstpointer b) >> +{ >> + struct btd_service *service = (gpointer) a; > > Couldn't you just declare the local variable const to avoid the ugly > cast? > >> + service_state_t state = (service_state_t) GPOINTER_TO_INT(b); > > I think it'd be cleaner to just have: > > const service_state_t *state = b; > >> + if (service_get_state(service) == state) > > And this would then become: > > if (service_get_state(service) == *state) I don't think these are equivalent, unless the caller is also changed to use "&state" instead of "GINT_TO_POINTER(state)". Regards, -- Anderson Lizardo Instituto Nokia de Tecnologia - 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