[PATCH 0/1] MR1852: winebus.sys: Declare a variable only when used
udev_add_device declares a variable (product) even when it is not used on all platforms. Use the same condition for the declaration that already guards the code. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1852
From: Gerald Pfeifer <gerald(a)pfeifer.com> udev_add_device declares a variable (product) even when it is not used on all platforms. Use the same condition for the declaration that already guards the code. --- dlls/winebus.sys/bus_udev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 3cd8bfd1ceb..34b3305ed88 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1329,7 +1329,9 @@ static void udev_add_device(struct udev_device *dev, int fd) if (!strcmp(subsystem, "hidraw")) { static const WCHAR hidraw[] = {'h','i','d','r','a','w',0}; +#ifdef HAVE_LINUX_HIDRAW_H char product[MAX_PATH]; +#endif if (!desc.manufacturer[0]) memcpy(desc.manufacturer, hidraw, sizeof(hidraw)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1852
Are there systems with hidraw backends which are not Linux? I'll approve this as the hidraw code isn't guarded consistently already but if it's not the case I think maybe we should probably guard all hidraw code and not just some parts. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1852#note_19916
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1852
On Tue Dec 20 15:03:53 2022 +0000, Rémi Bernon wrote:
Are there systems with hidraw backends which are not Linux? I'll approve this as the hidraw code isn't guarded consistently already but if it's not the case I think maybe we should probably guard all hidraw code and not just some parts. I'm not sure. (One benefit of not simply guarding everything at once is broader compile time evaluation.)
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1852#note_19927
participants (3)
-
Gerald Pfeifer -
Gerald Pfeifer (@gerald) -
Rémi Bernon