core: Narrow the types passed to certain backend functions
authorChris Dickens <christopher.a.dickens@gmail.com>
Wed, 29 Apr 2020 05:04:11 +0000 (22:04 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Wed, 29 Apr 2020 05:04:11 +0000 (22:04 -0700)
commite9eec3a680cad3b2c9c5213fb7d60148cf6900da
treef525022f61d24aba50da630ed851807f8c3104d6
parent14a302a2f55cb2e619158854f94845f2ca2c8214
core: Narrow the types passed to certain backend functions

Backend functions dealing with interfaces and alternate settings should
use a type whose range represents that of valid values for interfaces
and alternate settings. Switch to use uint8_t instead of int so that
backends do not have to cast values or do range checks.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
18 files changed:
libusb/core.c
libusb/libusbi.h
libusb/os/darwin_usb.c
libusb/os/darwin_usb.h
libusb/os/haiku_usb.h
libusb/os/haiku_usb_backend.cpp
libusb/os/haiku_usb_raw.cpp
libusb/os/linux_usbfs.c
libusb/os/netbsd_usb.c
libusb/os/null_usb.c
libusb/os/openbsd_usb.c
libusb/os/sunos_usb.c
libusb/os/windows_common.c
libusb/os/windows_common.h
libusb/os/windows_usbdk.c
libusb/os/windows_winusb.c
libusb/os/windows_winusb.h
libusb/version_nano.h