[MPlayer-dev-eng] Re: [PATCH] loader compiler warnings

adland adland123 at yahoo.com
Fri Apr 9 07:42:17 CEST 2004


> If HANDLE isn't a pointer type, then casting NULL to a HANDLE is even
> more dumb. You should return 0.
> 
> Rich
> 

looked into the file loader/wine/windef.h to see the definition

it is somewhat complicated it may be a pointer in some cases.

typedef unsigned int    UINT;

/* FIXME: Wine does not compile with strict on, therefore strict
 * handles are presently only usable on machines where sizeof(UINT) ==
 * sizeof(void*).  HANDLEs are supposed to be void* but a large amount
 * of WINE code operates on HANDLES as if they are UINTs. So to WINE
 * they exist as UINTs but to the Winelib user who turns on strict,
 * they exist as void*. If there is a size difference between UINT and
 * void* then things get ugly.  */
#ifdef STRICT
typedef VOID*           HANDLE;
#else
typedef UINT            HANDLE;
#endif

seems to have a definition which depends on STRICT
which is only true if sizeof (UINT) == sizeof (void*)
according to the text

testing.c

#include <stdio.h>

int main (int argc,char **argv)
{
    printf ("%d %d\n",sizeof(unsigned int),sizeof (void *));
    return 0;
}

gcc testing.c -o testing

./testing
4 4 
or true on my x86 athlon machine








More information about the MPlayer-dev-eng mailing list