libusb: don't use typedef's

Libusb defines both the struct and a typedef to the struct using
the same struct name. It's then possible to use either 'struct x'
and 'x'. E.g.:
	typedef struct libusb_device libusb_device;

OpenOCD is not consistent and uses a mix of 'struct x' and 'x'.

To make OpenOCD code uniform, stick at project's coding style and
use 'struct x' in place of the typedef'd name.

Change-Id: I901458b680e42830d3f371e47997157f91b7f675
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6165
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Reviewed-by: Marc Schink <dev@zapb.de>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo
2021-04-14 23:44:57 +02:00
parent a60979b069
commit 11d918d9c1
12 changed files with 40 additions and 40 deletions

View File

@@ -349,8 +349,8 @@ static void aice_unpack_dthmb(uint8_t *cmd_ack_code, uint8_t *target_id,
/* calls the given usb_bulk_* function, allowing for the data to
* trickle in with some timeouts */
static int usb_bulk_with_retries(
int (*f)(libusb_device_handle *, int, char *, int, int, int *),
libusb_device_handle *dev, int ep,
int (*f)(struct libusb_device_handle *, int, char *, int, int, int *),
struct libusb_device_handle *dev, int ep,
char *bytes, int size, int timeout, int *transferred)
{
int tries = 3, count = 0;
@@ -369,7 +369,7 @@ static int usb_bulk_with_retries(
return ERROR_OK;
}
static int wrap_usb_bulk_write(libusb_device_handle *dev, int ep,
static int wrap_usb_bulk_write(struct libusb_device_handle *dev, int ep,
char *buff, int size, int timeout, int *transferred)
{
@@ -379,7 +379,7 @@ static int wrap_usb_bulk_write(libusb_device_handle *dev, int ep,
return 0;
}
static inline int usb_bulk_write_ex(libusb_device_handle *dev, int ep,
static inline int usb_bulk_write_ex(struct libusb_device_handle *dev, int ep,
char *bytes, int size, int timeout)
{
int tr = 0;