RSABASE/TESTS: Fix signed/unsigned comparison warnings

Hans Leidekker hans at it.vu.nl
Mon Aug 9 06:31:34 CDT 2004


On Monday 09 August 2004 12:17, Hans Leidekker wrote:

> variable. We somehow have to live with the fact that NTE_BAD_KEYSET
> is defined as ((HRESULT)0x80090016L), which is signed, and GetLastError()
> returning DWORD, i.e unsigned.

On a related note, I am looking at the last testsuite with signed/unsigned
comparison warnings, ntdll, and I'm trying to deal with constructs like this
one:

  NTSTATUS ntstatus;
  
  ok(ntstatus == STATUS_SUCCESS, "Call failed (%lu)\n", ntstatus);

where Wine defines STATUS_SUCCESS like so:

  #define STATUS_SUCCESS                   0x00000000

which means STATUS_SUCCESS is handled by gcc as an unsigned value. This 
generates a warning because NTSTATUS is signed. If we look at the
SDK definition we see something different:

   #define STATUS_SUCCESS                   ((NTSTATUS)0x00000000L)

Which would get rid of the warnings for us if we add the cast there too.
Should I submit a patch to do this? To add a cast in every such code sequence
is not a good alternative if you ask me, as it's a very common idiom. Any 
other solutions?

  -Hans



More information about the wine-devel mailing list