examples: testlibusb: Formatting, whitespace and functional cleanup
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 13 Jan 2020 20:23:02 +0000 (12:23 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 13 Jan 2020 20:36:59 +0000 (12:36 -0800)
commit88ded79caa4c388739de140d709ccba6397ddd14
tree72d0a757bb42fd98d7f171504a602c47042107dc
parent0bf84e4d516c4488e5fcf4b10e3a7263c13019e1
examples: testlibusb: Formatting, whitespace and functional cleanup

Make the coding style and whitespace consistent with the rest of the
library source code.

In the print_device() function, the 'level' argument is unnecessary, so
remove it and the associated space padding. Switch to use printf()
directly instead of formatting the description into a single buffer.
This not only simplifies the code but avoids truncating the description
for devices with larger descriptor strings.

Make the output formatting consistent by lining up all the printed
values and using the same notation for all hexadecimal values.

Inspired by PR #452, enable printing all available BOS device
capability descriptors, not just the first one.

Closes #452

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
examples/testlibusb.c
libusb/version_nano.h