mirror of https://github.com/nirenjan/libx52.git
Initialize variables to avoid maybe-uninitialized warnings
When building the package for PPA, gcc throws errors indicating that some variables may be used uninitialized. This is not a real problem that shows up during the CI build, but only when building using dpkg-buildpackage. This change adds some dummy initialization so that it avoids triggering those warnings during debuild/dpkg-buildpackage.update-lkm
parent
d4412aba3e
commit
03c0376e7c
|
@ -31,7 +31,9 @@ static libusb_device_handle *libusbx52_init(void)
|
||||||
int rc;
|
int rc;
|
||||||
ssize_t count;
|
ssize_t count;
|
||||||
int i;
|
int i;
|
||||||
libusb_device **list;
|
libusb_device dummy = { 0 };
|
||||||
|
libusb_device *dummy_list[] = { &dummy };
|
||||||
|
libusb_device **list = dummy_list;
|
||||||
libusb_device_handle *hdl = NULL;
|
libusb_device_handle *hdl = NULL;
|
||||||
struct libusb_device_descriptor desc;
|
struct libusb_device_descriptor desc;
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,8 @@ static int group_teardown(void **state)
|
||||||
{ \
|
{ \
|
||||||
libx52io_context *ctx = *state; \
|
libx52io_context *ctx = *state; \
|
||||||
int rc; \
|
int rc; \
|
||||||
int32_t min, max; \
|
int32_t min = 0; \
|
||||||
|
int32_t max = 0; \
|
||||||
ctx->pid = X52_PROD_X52 ## prodid; \
|
ctx->pid = X52_PROD_X52 ## prodid; \
|
||||||
_x52io_set_axis_range(ctx); \
|
_x52io_set_axis_range(ctx); \
|
||||||
rc = libx52io_get_axis_range(ctx, LIBX52IO_AXIS_ ## axis, &min, &max); \
|
rc = libx52io_get_axis_range(ctx, LIBX52IO_AXIS_ ## axis, &min, &max); \
|
||||||
|
|
Loading…
Reference in New Issue