[Spice-devel] [PATCH usbclerk 5/6] Fix a lot of gcc warnings

Uri Lublin uril at redhat.com
Tue Feb 19 07:39:12 PST 2013


On 02/19/2013 12:35 PM, Marc-André Lureau wrote:
> ---
>   Makefile.am      |  4 ++--
>   usbclerk.cpp     | 59 ++++++++++++++++++++++++++++----------------------------
>   usbclerktest.cpp | 16 +++++++--------
>   vdlog.cpp        |  2 +-
>   vdlog.h          |  2 +-
>   5 files changed, 42 insertions(+), 41 deletions(-)
>
>
> @@ -650,10 +650,10 @@ bool USBClerk::get_dev_props(HDEVINFO devs, SP_DEVINFO_DATA *dev_info,
>       *cls = *subcls = *proto = 0;
>       if (!SetupDiGetDeviceRegistryProperty(devs, dev_info, SPDRP_COMPATIBLEIDS, NULL,
>               (PBYTE)compat_ids, sizeof(compat_ids), NULL)) {
> -        vd_printf("Cannot get compatible id %u", GetLastError());
> +        vd_printf("Cannot get compatible id %ld", GetLastError());
>           return false;
>       }
>

Hi Marc-Andre,

GetLastError() [1] returns DWORD [2]  which is a 32 bit unsigned integer.
But in windef.h (which comes with mingw-headers) it is defined as 
unsigned long.

I'm not sure what to do with it. I guess it's ok, if it does not break 
the Visual Studio build.

[1] http://msdn.microsoft.com/en-us/library/ms679360%28VS.85%29.aspx
[2] 
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx


nitpick: would be nice if we are consistent and use "%lu".


More information about the Spice-devel mailing list