diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-04-27 18:43:42 -0700 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-04-27 18:43:42 -0700 |
commit | a157b55656e7130c4ea118abcb1dfad21db428b8 (patch) | |
tree | 931ee516fe8c35b1361052d21a9ce57335cebaa3 /libusb/hotplug.c | |
parent | fc5132ca74d4a6fc9a8ae942451bc107b25497be (diff) | |
download | libusb-a157b55656e7130c4ea118abcb1dfad21db428b8.tar.gz |
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>
Diffstat (limited to 'libusb/hotplug.c')
-rw-r--r-- | libusb/hotplug.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libusb/hotplug.c b/libusb/hotplug.c index 0880f29..e3e83c3 100644 --- a/libusb/hotplug.c +++ b/libusb/hotplug.c @@ -315,7 +315,7 @@ int API_EXPORTED libusb_hotplug_register_callback(libusb_context *ctx, return LIBUSB_SUCCESS; } -void API_EXPORTED libusb_hotplug_deregister_callback(struct libusb_context *ctx, +void API_EXPORTED libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle callback_handle) { struct libusb_hotplug_callback *hotplug_cb; @@ -353,7 +353,7 @@ void API_EXPORTED libusb_hotplug_deregister_callback(struct libusb_context *ctx, } DEFAULT_VISIBILITY -void * LIBUSB_CALL libusb_hotplug_get_user_data(struct libusb_context *ctx, +void * LIBUSB_CALL libusb_hotplug_get_user_data(libusb_context *ctx, libusb_hotplug_callback_handle callback_handle) { struct libusb_hotplug_callback *hotplug_cb; |