mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-21 00:16:04 -04:00
Core: use C99 flexible array member when possible
Fix clang warning by using C99 flexible array member instead of zero length array gcc extension Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
committed by
Hans de Goede
parent
b247ea165c
commit
6e501b377d
+21
-3
@@ -297,7 +297,13 @@ struct libusb_device {
|
||||
struct libusb_device_descriptor device_descriptor;
|
||||
int attached;
|
||||
|
||||
unsigned char os_priv[0];
|
||||
unsigned char os_priv
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
[] /* valid C99 code */
|
||||
#else
|
||||
[0] /* non-standard, but usually working code */
|
||||
#endif
|
||||
;
|
||||
};
|
||||
|
||||
struct libusb_device_handle {
|
||||
@@ -307,7 +313,13 @@ struct libusb_device_handle {
|
||||
|
||||
struct list_head list;
|
||||
struct libusb_device *dev;
|
||||
unsigned char os_priv[0];
|
||||
unsigned char os_priv
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
[] /* valid C99 code */
|
||||
#else
|
||||
[0] /* non-standard, but usually working code */
|
||||
#endif
|
||||
;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -451,7 +463,13 @@ void usbi_fd_notification(struct libusb_context *ctx);
|
||||
struct discovered_devs {
|
||||
size_t len;
|
||||
size_t capacity;
|
||||
struct libusb_device *devices[0];
|
||||
struct libusb_device *devices
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
[] /* valid C99 code */
|
||||
#else
|
||||
[0] /* non-standard, but usually working code */
|
||||
#endif
|
||||
;
|
||||
};
|
||||
|
||||
struct discovered_devs *discovered_devs_append(
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define LIBUSB_NANO 10664
|
||||
#define LIBUSB_NANO 10665
|
||||
|
||||
Reference in New Issue
Block a user