From 3f523326fd640e138e48e87011beeeb4e841515d Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Mon, 25 May 2015 09:58:40 +0300 Subject: [PATCH] Fix compiling on GCC 4.9 ('for' loop initial declarations not allowed with -std=gnu90) --- host/libhackrf/src/hackrf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/host/libhackrf/src/hackrf.c b/host/libhackrf/src/hackrf.c index 256948e9..cb1dafc0 100644 --- a/host/libhackrf/src/hackrf.c +++ b/host/libhackrf/src/hackrf.c @@ -269,6 +269,7 @@ int ADDCALL hackrf_exit(void) hackrf_device_list_t* ADDCALL hackrf_device_list() { + ssize_t i; libusb_device_handle* usb_device = NULL; hackrf_device_list_t* list = calloc(1, sizeof(*list)); if ( list == NULL ) @@ -285,7 +286,7 @@ hackrf_device_list_t* ADDCALL hackrf_device_list() return NULL; } - for (ssize_t i=0; iusb_devicecount; i++) { + for (i=0; iusb_devicecount; i++) { struct libusb_device_descriptor device_descriptor; libusb_get_device_descriptor(list->usb_devices[i], &device_descriptor); @@ -341,6 +342,7 @@ libusb_device_handle* hackrf_open_usb(const char* const desired_serial_number) libusb_device** devices = NULL; const ssize_t list_length = libusb_get_device_list(g_libusb_context, &devices); int match_len = 0; + ssize_t i; printf("Number of USB devices: %ld\n", list_length); @@ -353,7 +355,7 @@ libusb_device_handle* hackrf_open_usb(const char* const desired_serial_number) return NULL; } - for (ssize_t i=0; i