core: Fix some minor inconsistencies in API and coding
authorChris Dickens <christopher.a.dickens@gmail.com>
Tue, 28 Apr 2020 01:43:42 +0000 (18:43 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Tue, 28 Apr 2020 01:43:42 +0000 (18:43 -0700)
commita157b55656e7130c4ea118abcb1dfad21db428b8
tree931ee516fe8c35b1361052d21a9ce57335cebaa3
parentfc5132ca74d4a6fc9a8ae942451bc107b25497be
core: Fix some minor inconsistencies in API and coding

All of the API functions should take the typedef'ed versions of the
opaque libusb structures, but some recent additions to the API did not
follow this convention. Fix this by making the changes to the
declarations and definitions of the functions.

Make the placement of the asterisk in pointer variable declarations
consistent (always with the variable name, not the type).

Remove some unnecessary casts and initializations relating to
dynamically allocated memory. While at it, make casts within the core
library consistent in style with no space after the closing parenthesis
of the cast. Most of the core already used this style.

When using the 'sizeof' operator, dereference the pointer instead of
using the type.  Most of the core was already doing this, so fix up the
few places that weren't.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
13 files changed:
libusb/core.c
libusb/descriptor.c
libusb/hotplug.c
libusb/io.c
libusb/libusb.h
libusb/os/linux_udev.c
libusb/os/linux_usbfs.c
libusb/os/poll_windows.c
libusb/os/sunos_usb.c
libusb/os/windows_winusb.h
libusb/strerror.c
libusb/sync.c
libusb/version_nano.h