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/os/linux_udev.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/os/linux_udev.c')
-rw-r--r-- | libusb/os/linux_udev.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libusb/os/linux_udev.c b/libusb/os/linux_udev.c index 33a9174..e8fb198 100644 --- a/libusb/os/linux_udev.c +++ b/libusb/os/linux_udev.c @@ -38,7 +38,7 @@ static int udev_control_pipe[2] = {-1, -1}; static struct udev_monitor *udev_monitor = NULL; static pthread_t linux_event_thread; -static void udev_hotplug_event(struct udev_device* udev_dev); +static void udev_hotplug_event(struct udev_device *udev_dev); static void *linux_udev_event_thread_main(void *arg); int linux_udev_start_event_monitor(void) @@ -168,7 +168,7 @@ static void *linux_udev_event_thread_main(void *arg) char dummy; int r; ssize_t nb; - struct udev_device* udev_dev; + struct udev_device *udev_dev; struct pollfd fds[] = { {.fd = udev_control_pipe[0], .events = POLLIN}, @@ -232,10 +232,10 @@ static int udev_device_info(struct libusb_context *ctx, int detached, dev_node, *sys_name, -1); } -static void udev_hotplug_event(struct udev_device* udev_dev) +static void udev_hotplug_event(struct udev_device *udev_dev) { - const char* udev_action; - const char* sys_name = NULL; + const char *udev_action; + const char *sys_name = NULL; uint8_t busnum = 0, devaddr = 0; int detached; int r; @@ -314,7 +314,7 @@ int linux_udev_scan_devices(struct libusb_context *ctx) void linux_udev_hotplug_poll(void) { - struct udev_device* udev_dev; + struct udev_device *udev_dev; usbi_mutex_static_lock(&linux_hotplug_lock); do { |