mirror of
https://github.com/linux-usb-gadgets/libusbgx.git
synced 2025-07-12 21:19:43 +03:00
This fixes the following compilation error/warning: In file included from ../tests/header_checker.cpp:6: ../include/usbg/function/net.h: In function ‘int usbg_f_net_set_subclass(usbg_f_net*, unsigned int)’: ../include/usbg/function/net.h:278:67: error: narrowing conversion of ‘subclass’ from ‘unsigned int’ to ‘int’ [-Werror=narrowing] 278 | USBG_F_NET_INT_TO_ATTR_VAL(subclass)); | ^~~~~~~~ ../include/usbg/usbg.h:61:34: note: in definition of macro ‘USBG_TO_UNION’ 61 | ((union UNAME){ .FIELD = WHAT, }) | ^~~~ ../include/usbg/function/net.h:278:40: note: in expansion of macro ‘USBG_F_NET_INT_TO_ATTR_VAL’ 278 | USBG_F_NET_INT_TO_ATTR_VAL(subclass)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/usbg/function/net.h: In function ‘int usbg_f_net_set_protocol(usbg_f_net*, unsigned int)’: ../include/usbg/function/net.h:302:67: error: narrowing conversion of ‘protocol’ from ‘unsigned int’ to ‘int’ [-Werror=narrowing] 302 | USBG_F_NET_INT_TO_ATTR_VAL(protocol)); | ^~~~~~~~ ../include/usbg/usbg.h:61:34: note: in definition of macro ‘USBG_TO_UNION’ 61 | ((union UNAME){ .FIELD = WHAT, }) | ^~~~ ../include/usbg/function/net.h:302:40: note: in expansion of macro ‘USBG_F_NET_INT_TO_ATTR_VAL’ 302 | USBG_F_NET_INT_TO_ATTR_VAL(protocol)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors In the kernel qmult is also from type unsigned int which alignes with the rest of this struct and resolves the above compile issue. |
||
---|---|---|
.. | ||
function | ||
usbg.h | ||
usbg_internal.h | ||
usbg_internal_libconfig.h | ||
usbg_internal_none.h | ||
usbg_version.h.in |