descriptor: Minor improvements to the parse_descriptor() function
authorChris Dickens <christopher.a.dickens@gmail.com>
Fri, 17 Apr 2020 20:22:34 +0000 (13:22 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Fri, 17 Apr 2020 20:22:34 +0000 (13:22 -0700)
commite873677b9196b191d6cdbdf9783c6d6a18379249
treef083f210da89a4647b76d881fc9ef6796c847ff7
parent9ececdb0ecbbb77edd5a40cb8914ddc54b77dea2
descriptor: Minor improvements to the parse_descriptor() function

Change the type of the source pointer to 'void' so that callers need not
cast to 'unsigned char'. Also change working types to 'uint8_t' to make
it explicit that we are dealing with 8-bit types.

Refactor the parsing loop to avoid unnecessary stack variables. The
generated assembly with this change is more efficient.

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