From: Uwe Hermann Date: Thu, 16 Apr 2015 20:33:29 +0000 (+0200) Subject: Fix various warnings when building without libusb. X-Git-Tag: libsigrok-0.4.0~523 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=468665dfa7a030ba3746e2796a196a47cacf4f76;p=libsigrok.git Fix various warnings when building without libusb. ../src/backend.c: In function 'sr_init': ../src/backend.c:435:1: warning: label 'done' defined but not used [-Wunused-label] done: ^ ../src/device.c: In function 'sr_dev_inst_connid_get': ../src/device.c:525:7: warning: unused variable 'connection_id' [-Wunused-variable] char connection_id[64]; ^ ../src/device.c:524:20: warning: unused variable 'b' [-Wunused-variable] int r, cnt, i, a, b; ^ ../src/device.c:524:17: warning: unused variable 'a' [-Wunused-variable] int r, cnt, i, a, b; ^ ../src/device.c:524:14: warning: unused variable 'i' [-Wunused-variable] int r, cnt, i, a, b; ^ ../src/device.c:524:9: warning: unused variable 'cnt' [-Wunused-variable] int r, cnt, i, a, b; ^ ../src/device.c:524:6: warning: unused variable 'r' [-Wunused-variable] int r, cnt, i, a, b; ^ ../src/device.c:523:22: warning: unused variable 'drvc' [-Wunused-variable] struct drv_context *drvc; ^ --- diff --git a/src/backend.c b/src/backend.c index b05e8d97..0103a43a 100644 --- a/src/backend.c +++ b/src/backend.c @@ -432,7 +432,9 @@ SR_API int sr_init(struct sr_context **ctx) context = NULL; ret = SR_OK; +#ifdef HAVE_LIBUSB_1_0 done: +#endif g_free(context); return ret; } diff --git a/src/device.c b/src/device.c index 3eef7b9e..d7c32567 100644 --- a/src/device.c +++ b/src/device.c @@ -520,11 +520,10 @@ SR_API const char *sr_dev_inst_sernum_get(const struct sr_dev_inst *sdi) */ SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi) { +#ifdef HAVE_LIBUSB_1_0 struct drv_context *drvc; int r, cnt, i, a, b; char connection_id[64]; - -#ifdef HAVE_LIBUSB_1_0 struct sr_usb_dev_inst *usb; struct libusb_device **devlist; struct libusb_device_descriptor des;