diff options
Diffstat (limited to 'src/libw32dll/wine/win32.c')
-rw-r--r-- | src/libw32dll/wine/win32.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index 64a36867a..6bf7341c0 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -238,11 +238,16 @@ typedef struct th_list_t{ // have to be cleared by GARBAGE COLLECTOR -static unsigned char* heap=NULL; -static int heap_counter=0; static tls_t* g_tls=NULL; static th_list* list=NULL; +#undef MEMORY_DEBUG + +#ifdef MEMORY_DEBUG + +static unsigned char* heap=NULL; +static int heap_counter=0; + static void test_heap(void) { int offset=0; @@ -263,10 +268,6 @@ static void test_heap(void) printf("Free heap corruption at address %d\n", offset); } } -#undef MEMORY_DEBUG - -#ifdef MEMORY_DEBUG - static void* my_mreq(int size, int to_zero) { static int test=0; @@ -819,7 +820,7 @@ static void* WINAPI expWaitForMultipleObjects(int count, const void** objects, { int i; void *object; - int ret; + void *ret; dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n", count, objects, WaitAll, duration); @@ -845,7 +846,7 @@ static void WINAPI expExitThread(int retcode) static HANDLE WINAPI expCreateMutexA(void *pSecAttr, char bInitialOwner, const char *name) { - HANDLE mlist = expCreateEventA(pSecAttr, 0, 0, name); + HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name); if (name) dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n", @@ -858,7 +859,7 @@ static HANDLE WINAPI expCreateMutexA(void *pSecAttr, waits for ever, else it works ;) */ return mlist; #else - return NULL; + return 0; #endif } @@ -892,7 +893,9 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si) /* FIXME: better values for the two entries below... */ static int cache = 0; static SYSTEM_INFO cachedsi; +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__) unsigned int regs[4]; +#endif dbgprintf("GetSystemInfo(%p) =>\n", si); if (cache) { @@ -2529,7 +2532,7 @@ static int WINAPI expGetMonitorInfoA(void *mon, LPMONITORINFO lpmi) if (lpmi->cbSize == sizeof(MONITORINFOEX)) { - LPMONITORINFOEX lpmiex = lpmi; + LPMONITORINFOEX lpmiex = (LPMONITORINFOEX)lpmi; dbgprintf("MONITORINFOEX!\n"); strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME); } @@ -3570,9 +3573,9 @@ static DWORD WINAPI expGetFullPathNameA #endif #else if (strrchr(lpFileName, '\\')) - *lpFilePart = strrchr(lpFileName, '\\'); + *lpFilePart = (int)strrchr(lpFileName, '\\'); else - *lpFilePart = lpFileName; + *lpFilePart = (int)lpFileName; #endif strcpy(lpBuffer, lpFileName); // strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName); @@ -4170,14 +4173,14 @@ static double expcos(double x) return cos(x); } +#else + /* doens't work */ static long exp_ftol_wrong(double x) { return (long) x; } -#else - static void explog10(void) { __asm__ __volatile__ @@ -4413,7 +4416,7 @@ static void WINAPI expGlobalMemoryStatus( lpmem->dwAvailPageFile = 16*1024*1024; } expGetSystemInfo(&si); - lpmem->dwTotalVirtual = si.lpMaximumApplicationAddress-si.lpMinimumApplicationAddress; + lpmem->dwTotalVirtual = (char *)si.lpMaximumApplicationAddress-(char *)si.lpMinimumApplicationAddress; /* FIXME: we should track down all the already allocated VM pages and substract them, for now arbitrarily remove 64KB so that it matches NT */ lpmem->dwAvailVirtual = lpmem->dwTotalVirtual-64*1024; memcpy(&cached_memstatus,lpmem,sizeof(MEMORYSTATUS)); @@ -4444,7 +4447,7 @@ static WIN_BOOL WINAPI expSetThreadPriority( static void WINAPI expExitProcess( DWORD status ) { - printf("EXIT - code %d\n",status); + printf("EXIT - code %d\n",(int)status); exit(status); } @@ -4503,7 +4506,7 @@ static int expSysStringByteLen(void *str) static int expDirectDrawCreate(void) { dbgprintf("DirectDrawCreate(...) => NULL\n"); - return NULL; + return 0; } #if 1 @@ -4529,8 +4532,8 @@ static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl) dbgprintf("CreatePalette(%x) => NULL\n", lpgpl); i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY)); - test = malloc(i); - memcpy(test, lpgpl, i); + test = (HPALETTE)malloc(i); + memcpy((void *)test, lpgpl, i); return test; } @@ -5133,9 +5136,9 @@ void* LookupExternal(const char* library, int ordinal) hand, func); return func; } -#endif no_dll: +#endif if(pos>150)return 0; sprintf(export_names[pos], "%s:%d", library, ordinal); return add_stub(); |