libshut.c riello_ser.c nut-scanner bits: banish non-standard u_char and u_short#866
Conversation
…and u_short Probably standard C99 "uint8_t" and 16(?) bit short would be more proper, especially for serial-line protocols. But the original code used types derived from hardware implementation sized "char" and "short" - so they stayed this way here.
aquette
left a comment
There was a problem hiding this comment.
Seems indeed good, with a 5 seconds review. Testable for non reg on any Eaton unit with a serial port and having USB HID (ie not older power ware with XCP)
|
Thanks @aquette for the suggestion, now I intend to test this on an OmniOS box that has Eaton 9PX 5000i UPS attached by USB cable as well as seen over SNMP :) Not sure how much the USB drivers would help with bug-hunt in serial port code, but at least similar variable type change in SNMP code is more auditable. Not sure what to look out for, probably diff's of outputs from |
|
testing through USB won't give anything, since libshut is the equivalent marshaling layer of libusb. |
|
In this case, my physical setup that is stranded in the now-inaccessible office won't be of much help. I looked at systems headers I could get at, everywhere that has an I suppose a further pedantic change to turn such arch-dependent cases into |
Probably standard C99 "uint8_t" and 16(?) bit short would be more proper,
especially for serial-line protocols. But the original code used types
derived from hardware implementation sized "char" and "short" - so they
stayed this way here.
Stems from efforts on #823 and #844 to get more clean and green system setups in CI. Due to the comment above, review would be welcome.