[PATCH] main: Always use libusb context

Tormod Volden lists.tormod at gmail.com
Wed Aug 31 21:34:31 CEST 2011


On Wed, Aug 31, 2011 at 7:20 PM, Stefan Schmidt wrote:
> Patch looks fine. Just wondering if you hit any problems without the
> context being set? Or did you do the change based on the comment that
> the context needs to be set?

No, it was just to make it consistent. The context was being used some
places and some places not. Well, I saw the comment and wondered why
it was not used at that very spot , but I guess it was because there
was some work to have the context passed through the whole chain of
functions :)

The alternative would be to not use the context anywhere. It is not so
useful for a small, free-standing program. But it follows the book,
and if at some point the code will be embedded in a bigger program
doing other libusb stuff, it can only help.

> I'm just curious as I wrote the comment but haven't ben totally sure
> if its needed or we are fine with the default context (used if set to
> NULL).
>
> Besides that it looks fine and I'm going to apply it after some
> testing.

Thanks, another bunch of patches will come soon.

Tormod



More information about the devel mailing list