On 2012.09.17 09:44, Hans de Goede wrote:
> my patch those would return "**UNKNOWN**", and know if the amount
> transfered is small enough they may return a "LIBUSB_TRANSFER_FOO" string.

And now I realize that libusb_transfer_status is an enum, and not a set 
of negative defines... This changes the deal a bit.

> Which brings us to Peter's point that it may be better to have 2 functions
> for this. I'm not sure what is best, but I tend towards keeping a single
> function for this:

I'd tend towards that too.

> So I propose to amend the patch to document that error_name should only
> be called in case of error, and that the behavior is undefined when called
> on success results.

If you know me, then you'll know that I don't like the idea of expecting 
people to refer to docs to find non intuitive quirks... However, 
switching the transfer_status space into a negative one ( separate from 
LIBUSB_ERROR) is probably not much of an option before 2.0, so this will 
probably have to do for now.

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