windows: fix DWORD format string complaints
authorSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 19 Aug 2020 22:58:35 +0000 (23:58 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 12 Sep 2020 10:50:35 +0000 (11:50 +0100)
commit4937100f4695df4893606f8aa9375cde62c2c80d
tree0611b666c3a79b4f6587687546891cfb843f8eac
parentf5515176825b1d0fc3b5ed6450b1f29510f955d5
windows: fix DWORD format string complaints

Printing DWORD variables causes Windows clang to grumble about types:

os/windows/cpu-affinity.c:263:5: error: format specifies type 'int' but the argument has type 'DWORD' (aka 'unsigned long') [-Werror,-Wformat]
                         GetLastError());
                         ^~~~~~~~~~~~~~

Since a DWORD is defined to be an unsigned 32 bit integer and is
declared to be an unsigned long
(https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2
) just use long as the format specifier. When printing the cpu mask in
hex on legacy Windows builds, cast to unsigned long long which should be
safe because there won't be more than 64 CPUs with old versions of
Windows.

(As some format strings are longer than the wrapping width, make an
exception and avoid splitting/preserve them to make greping easier)

Suggested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
engines/windowsaio.c
os/windows/cpu-affinity.c
os/windows/posix.c