diff options
author | Sean McBride <sean@rogue-research.com> | 2012-10-12 17:34:25 -0400 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2013-05-15 20:43:35 +0200 |
commit | 6e501b377dd0bccaefce5604616614deb2abb3fc (patch) | |
tree | fe6af5161f22ff7ca61f39230b3ce1e832cb80f5 | |
parent | b247ea165cf5662fa76876662dbc5ea77a020b07 (diff) | |
download | libusb-6e501b377dd0bccaefce5604616614deb2abb3fc.tar.gz |
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>
-rw-r--r-- | libusb/libusbi.h | 24 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 22 insertions, 4 deletions
diff --git a/libusb/libusbi.h b/libusb/libusbi.h index 1b59175..531e419 100644 --- a/libusb/libusbi.h +++ b/libusb/libusbi.h @@ -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( diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 7871963..be2c3cd 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10664 +#define LIBUSB_NANO 10665 |