pavel-a / usb-relay-hid

Software for USB-connected relays with HID interface. See the WIKI for more info.
http://vusb.wikidot.com/project:driver-less-usb-relays-hid-interface
242 stars 105 forks source link

usb_relay_device_enumerate: silencing -Wunused-but-set-variable #35

Open Ricardicus opened 4 years ago

Ricardicus commented 4 years ago

I was building usb-relay-hid on my machine and ran into this warning:

../../lib/usb_relay_lib.c: In function ‘usb_relay_device_enumerate’: ../../lib/usb_relay_lib.c:382:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret; ^~~

There is a return code from usbhidEnumDevices that is not looked at. Since the returning value _pusb_relay_device_infot is a pointer-type, I figured if this error appears, NULL is returned.