hotplug: Fix definition of libusb_hotplug_register_callback()
authorChris Dickens <christopher.a.dickens@gmail.com>
Thu, 16 Apr 2020 23:47:01 +0000 (16:47 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Thu, 23 Apr 2020 18:10:31 +0000 (11:10 -0700)
commitda87201f7a5580db16565b1ecc7eefe0fcb5bb59
treea1fee02334808bc4591342f23ab1a16aed3732d9
parentbe57525e8bb78eb9dcd3efb8ec792e3395b9a140
hotplug: Fix definition of libusb_hotplug_register_callback()

The signature of the libusb_hotplug_register_callback() is slightly
incorrect in two regards:

  1) The 'events' parameter is meant to represent a bitwise OR of
     libusb_hotplug_event values. By OR'ing multiple values together,
     the result is not something that is actually a libusb_hotplug_event
     enumeration.

  2) The 'flags' parameter is meant to represent a bitwise OR of
     libusb_hotplug_flag values. The same considerations as above apply,
     though this has not practically been the case as there is currently
     only one flag value defined. However, a special value was already
     defined to represent the absence of any flags, which hinted at the
     problem with how it is currently defined.

Address these two issues by changing the types of the 'events' and
'flags' parameter to plain integers. As enumerations should already be
promoted to integers, this change should not cause any ABI concerns.

Closes #714

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/hotplug.c
libusb/libusb.h
libusb/version_nano.h