Avoid warnings on all-zero static struct entries.
This commit is contained in:
parent
84cbaf77b4
commit
1685c27619
|
@ -143,6 +143,15 @@
|
||||||
libusb_handle_events_timeout(ctx, tv)
|
libusb_handle_events_timeout(ctx, tv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Static definitions of structs ending with an all-zero entry are a
|
||||||
|
* problem when compiling with -Wmissing-field-initializers: GCC
|
||||||
|
* suppresses the warning only with { 0 }, clang wants { } */
|
||||||
|
#ifdef __clang__
|
||||||
|
#define ALL_ZERO { }
|
||||||
|
#else
|
||||||
|
#define ALL_ZERO { 0 }
|
||||||
|
#endif
|
||||||
|
|
||||||
struct sr_context {
|
struct sr_context {
|
||||||
#ifdef HAVE_LIBUSB_1_0
|
#ifdef HAVE_LIBUSB_1_0
|
||||||
libusb_context *libusb_ctx;
|
libusb_context *libusb_ctx;
|
||||||
|
|
|
@ -235,7 +235,7 @@ static int cleanup(struct sr_output *o)
|
||||||
|
|
||||||
static struct sr_option options[] = {
|
static struct sr_option options[] = {
|
||||||
{ "width", "Width", "Number of samples per line", NULL, NULL },
|
{ "width", "Width", "Number of samples per line", NULL, NULL },
|
||||||
{ 0 }
|
ALL_ZERO
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct sr_option *get_options(void)
|
static const struct sr_option *get_options(void)
|
||||||
|
|
|
@ -221,7 +221,7 @@ static int cleanup(struct sr_output *o)
|
||||||
|
|
||||||
static struct sr_option options[] = {
|
static struct sr_option options[] = {
|
||||||
{ "width", "Width", "Number of samples per line", NULL, NULL },
|
{ "width", "Width", "Number of samples per line", NULL, NULL },
|
||||||
{ 0 }
|
ALL_ZERO
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct sr_option *get_options(void)
|
static const struct sr_option *get_options(void)
|
||||||
|
|
|
@ -235,7 +235,7 @@ static int cleanup(struct sr_output *o)
|
||||||
|
|
||||||
static struct sr_option options[] = {
|
static struct sr_option options[] = {
|
||||||
{ "width", "Width", "Number of samples per line", NULL, NULL },
|
{ "width", "Width", "Number of samples per line", NULL, NULL },
|
||||||
{ 0 }
|
ALL_ZERO
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct sr_option *get_options(void)
|
static const struct sr_option *get_options(void)
|
||||||
|
|
|
@ -336,7 +336,7 @@ static int cleanup(struct sr_output *o)
|
||||||
|
|
||||||
static struct sr_option options[] = {
|
static struct sr_option options[] = {
|
||||||
{ "scale", "Scale", "Scale values by factor", NULL, NULL },
|
{ "scale", "Scale", "Scale values by factor", NULL, NULL },
|
||||||
{ 0 }
|
ALL_ZERO
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct sr_option *get_options(void)
|
static const struct sr_option *get_options(void)
|
||||||
|
|
Loading…
Reference in New Issue