supercollider / hidapi

A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
http://www.signal11.us/oss/hidapi/
Other
13 stars 14 forks source link

Fix compiler warning #9

Closed mossheim closed 4 years ago

mossheim commented 7 years ago

This covers a compiler warning in the case where the HIDElementType is Collection.

The solution used was to add a default statement to the switch.

@sensestage do you have any thoughts on this? It seems to me like there's no consistent exception handling system here, so I just printed a warning. Since this is lower-level and designed for robust performance, I thought attempting a solution rather than failing via exception or assert would be more graceful and appropriate to this library.

mossheim commented 7 years ago

pinging this. @kisielk / @joshpar ? just want a sanity check before i start merging stuff into hidapi

kisielk commented 7 years ago

I think the best fix would be to have hid_parse_element_info return a flag so that hid_read_descriptor (which seems to be the only caller) can then return NULL to indicate an error.