On 2012.05.12 12:30, Ludovic Rousseau wrote:
> 2012/5/11 Pete Batard<p...@akeo.ie>:
>
>> +/** \ingroup dev
>> + * Get the list of all port numbers from root for the specified device
>> + * \param dev a device
>> + * \param path the array that should contain the port numbers
>> + * \param path_len the maximum length of the array
>
> I propose to document that a "correct" value for path_len is 7.

If by "correct" you mean the current upper limit, as per the USB 3.0 
specs, I agree.

> Maybe explicitly reference the array name "path" in the documentation.
>   * \param path_len the maximum length of the path array

I don't understand what you mean there.

> I prefer to use "uint8_t path[]" instead of "uint8_t* path" for an array.
> It is equivalent for the C compiler but more explicit for the human.

I tend to prefer the other way round myself.

While I don't have much of an issue going with [], our current 
convention, from libusb.h, is to use "type* array" rather than "type 
array[]". As a matter of fact, [] is not used in libusb.h, apart from a 
single zero-length array.

This means that if we introduce [] here, we'll lose consistency. Now, if 
you produce a patch that sets the whole API to always use [] for arrays 
(and if there's a majority that approves), I won't mind applying it, but 
otherwise, I'd say we probably want to stick with the existing 
convention, at least for individual source files.

> I don't like when affectation and test are on the same line.
>
> I propose to use something like:
>    i--;
>    if (i<  0) {

OK.

> I get a compiler warning:
> os/darwin_usb.c:188: warning: no previous prototype for
> ‘get_ioregistry_value_number’
>
> Declare the function static for internal functions:
> static int get_ioregistry_value_number (io_service_t service, CFStringRef ...

Makes sense. I don't remember seeing that one with X-Code when I tested, 
but the silent rules don't work with the version I have, which makes 
warnings harder to spot.

Regards,

/Pete

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to