2009/8/10 Marcel Holtmann <[email protected]>:
>> Actually not because the USB-1.0 include files are not clean enough but
>> included with -I instead -isystem (the latter would make gcc ignore it):
>> In file included from ../../lib/usbobex.h:28,
>>                  from ../../lib/obex_transport.h:39,
>>                  from ../../lib/obex_main.h:44,
>>                  from ../../lib/obex.c:48:
>> /usr/include/libusb-1.0/libusb.h: In function ‘libusb_get_iso_packet_buffer’:
>> /usr/include/libusb-1.0/libusb.h:1057: error: comparison between signed and
>> unsigned
>> /usr/include/libusb-1.0/libusb.h:1060: error: comparison between signed and
>> unsigned
>> /usr/include/libusb-1.0/libusb.h: In function
>> ‘libusb_get_iso_packet_buffer_simple’:
>> /usr/include/libusb-1.0/libusb.h:1088: error: comparison between signed and
>> unsigned
>>
>> Maybe someone should file a bug to them.
>
> that is pretty much bad. Normally this means they have too much code
> inside the header includes :(

They're well aware of the issue - the offending lines are preceded by
this comment:

/* oops..slight bug in the API. packet is an unsigned int, but we use
 * signed integers almost everywhere else. range-check and convert to
 * signed to avoid compiler warnings. FIXME for libusb-2. */

And yes, they have a ton of utility function definitions in a public
API header that simply don't belong there IMO. Such as

static inline int libusb_get_string_descriptor(libusb_device_handle *dev,
        uint8_t desc_index, uint16_t langid, unsigned char *data, int length)
{
       return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,
                LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_STRING << 8)
| desc_index,
                langid, data, length, 1000);
}

I guess their idea is that everything in the API is nicely documented
and nobody should ever have to look at their header file.

http://git.stuge.se/?p=libusb.git;a=blob;f=libusb/libusb.h;hb=HEAD

-- 
Alexander

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to