Mercurial > mplayer.hg
comparison loader/win32.c @ 8451:fb88ccbc5ccc
compiler warning fixes
based on patch by Dominik Mierzejewski <dominik@rangers.eu.org>
author | arpi |
---|---|
date | Sat, 14 Dec 2002 17:56:35 +0000 |
parents | 08e71f6a7531 |
children | 637d2d7387b0 |
comparison
equal
deleted
inserted
replaced
8450:8cfc9309f0cc | 8451:fb88ccbc5ccc |
---|---|
38 #include "win32.h" | 38 #include "win32.h" |
39 | 39 |
40 #include "registry.h" | 40 #include "registry.h" |
41 #include "loader.h" | 41 #include "loader.h" |
42 #include "com.h" | 42 #include "com.h" |
43 #include "ext.h" | |
43 | 44 |
44 #include <stdlib.h> | 45 #include <stdlib.h> |
45 #include <assert.h> | 46 #include <assert.h> |
46 #include <stdarg.h> | 47 #include <stdarg.h> |
47 #include <ctype.h> | 48 #include <ctype.h> |
818 static void* WINAPI expWaitForMultipleObjects(int count, const void** objects, | 819 static void* WINAPI expWaitForMultipleObjects(int count, const void** objects, |
819 int WaitAll, int duration) | 820 int WaitAll, int duration) |
820 { | 821 { |
821 int i; | 822 int i; |
822 void *object; | 823 void *object; |
823 int ret; | 824 void *ret; |
824 | 825 |
825 dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n", | 826 dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n", |
826 count, objects, WaitAll, duration); | 827 count, objects, WaitAll, duration); |
827 | 828 |
828 for (i = 0; i < count; i++) | 829 for (i = 0; i < count; i++) |
844 } | 845 } |
845 | 846 |
846 static HANDLE WINAPI expCreateMutexA(void *pSecAttr, | 847 static HANDLE WINAPI expCreateMutexA(void *pSecAttr, |
847 char bInitialOwner, const char *name) | 848 char bInitialOwner, const char *name) |
848 { | 849 { |
849 HANDLE mlist = expCreateEventA(pSecAttr, 0, 0, name); | 850 HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name); |
850 | 851 |
851 if (name) | 852 if (name) |
852 dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n", | 853 dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n", |
853 pSecAttr, bInitialOwner, name, mlist); | 854 pSecAttr, bInitialOwner, name, mlist); |
854 else | 855 else |
1374 } | 1375 } |
1375 cs->locked=0; | 1376 cs->locked=0; |
1376 pthread_mutex_unlock(&(cs->mutex)); | 1377 pthread_mutex_unlock(&(cs->mutex)); |
1377 return; | 1378 return; |
1378 } | 1379 } |
1380 | |
1381 static void expfree(void* mem); /* forward declaration */ | |
1382 | |
1379 static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) | 1383 static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) |
1380 { | 1384 { |
1381 #ifdef CRITSECS_NEWTYPE | 1385 #ifdef CRITSECS_NEWTYPE |
1382 struct CRITSECT* cs = critsecs_get_unix(c); | 1386 struct CRITSECT* cs = critsecs_get_unix(c); |
1383 #else | 1387 #else |
2490 | 2494 |
2491 lpmi->dwFlags = 1; /* primary monitor */ | 2495 lpmi->dwFlags = 1; /* primary monitor */ |
2492 | 2496 |
2493 if (lpmi->cbSize == sizeof(MONITORINFOEX)) | 2497 if (lpmi->cbSize == sizeof(MONITORINFOEX)) |
2494 { | 2498 { |
2495 LPMONITORINFOEX lpmiex = lpmi; | 2499 LPMONITORINFOEX lpmiex = (LPMONITORINFOEX)lpmi; |
2496 dbgprintf("MONITORINFOEX!\n"); | 2500 dbgprintf("MONITORINFOEX!\n"); |
2497 strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME); | 2501 strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME); |
2498 } | 2502 } |
2499 | 2503 |
2500 return 1; | 2504 return 1; |
3527 #else | 3531 #else |
3528 strcpy(lpFilePart, lpFileName); | 3532 strcpy(lpFilePart, lpFileName); |
3529 #endif | 3533 #endif |
3530 #else | 3534 #else |
3531 if (strrchr(lpFileName, '\\')) | 3535 if (strrchr(lpFileName, '\\')) |
3532 *lpFilePart = strrchr(lpFileName, '\\'); | 3536 lpFilePart = strrchr(lpFileName, '\\'); |
3533 else | 3537 else |
3534 *lpFilePart = lpFileName; | 3538 lpFilePart = lpFileName; |
3535 #endif | 3539 #endif |
3536 strcpy(lpBuffer, lpFileName); | 3540 strcpy(lpBuffer, lpFileName); |
3537 // strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName); | 3541 // strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName); |
3538 return strlen(lpBuffer); | 3542 return strlen(lpBuffer); |
3539 } | 3543 } |
4401 return TRUE; | 4405 return TRUE; |
4402 } | 4406 } |
4403 | 4407 |
4404 static void WINAPI expExitProcess( DWORD status ) | 4408 static void WINAPI expExitProcess( DWORD status ) |
4405 { | 4409 { |
4406 printf("EXIT - code %d\n",status); | 4410 printf("EXIT - code %ld\n",status); |
4407 exit(status); | 4411 exit(status); |
4408 } | 4412 } |
4409 | 4413 |
4410 static INT WINAPI expMessageBoxA(HWND hWnd, LPCSTR text, LPCSTR title, UINT type){ | 4414 static INT WINAPI expMessageBoxA(HWND hWnd, LPCSTR text, LPCSTR title, UINT type){ |
4411 printf("MSGBOX '%s' '%s' (%d)\n",text,title,type); | 4415 printf("MSGBOX '%s' '%s' (%d)\n",text,title,type); |
4460 } | 4464 } |
4461 | 4465 |
4462 static int expDirectDrawCreate(void) | 4466 static int expDirectDrawCreate(void) |
4463 { | 4467 { |
4464 dbgprintf("DirectDrawCreate(...) => NULL\n"); | 4468 dbgprintf("DirectDrawCreate(...) => NULL\n"); |
4465 return NULL; | 4469 return 0; |
4466 } | 4470 } |
4467 | 4471 |
4468 #if 1 | 4472 #if 1 |
4469 typedef struct tagPALETTEENTRY { | 4473 typedef struct tagPALETTEENTRY { |
4470 BYTE peRed; | 4474 BYTE peRed; |
4486 int i; | 4490 int i; |
4487 | 4491 |
4488 dbgprintf("CreatePalette(%x) => NULL\n", lpgpl); | 4492 dbgprintf("CreatePalette(%x) => NULL\n", lpgpl); |
4489 | 4493 |
4490 i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY)); | 4494 i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY)); |
4491 test = malloc(i); | 4495 test = (HPALETTE)malloc(i); |
4492 memcpy(test, lpgpl, i); | 4496 memcpy((void *)test, lpgpl, i); |
4493 | 4497 |
4494 return test; | 4498 return test; |
4495 } | 4499 } |
4496 #else | 4500 #else |
4497 static int expCreatePalette(void) | 4501 static int expCreatePalette(void) |