Hi Hendrik, On Wed, Nov 9, 2011 at 9:53 AM, Hendrik Sattler <post@xxxxxxxxxxxxxxxxxx> wrote: >> The idea here is to return 0 if they are same or non zero if they are >> not same. The actual sign is not relevant because the comparison is >> for finding items, not sorting them (in this case). > > Kind of a lazy approach, no? > Ah well... I agree with you, and maybe it is even risky if soneone reuses these functions for list sorting as well without extending them, but this is the current procedure on BlueZ as a whole: $ grep -R 'return.*handle - ' src/ attrib/ src/sdpd-database.c: return rec1->handle - rec2->handle; src/sdpd-database.c: return rec1->handle - rec2->handle; src/device.c: return r1->handle - r2->handle; src/attrib-server.c: return attrib->handle - handle; src/attrib-server.c: return attrib1->handle - attrib2->handle; attrib/client.c: return chr->handle - handle; (all these handles are unsigned.) Note that I'm not defending the current usage, but then it would need be "fixed" in a separate commit to fix all cases and maintain consistency. 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