summaryrefslogtreecommitdiffstats
path: root/loader/win32.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-02-27 19:15:13 +0100
committerUoti Urpala <uau@mplayer2.org>2012-03-01 00:22:30 +0200
commit24be34f1e9e37111a06108c090324426aff6f1db (patch)
treeaa28674a6d69dfb18fd102608f72e3081df6d1dd /loader/win32.c
parent25417a626d0b9077bfbb940952f3858d7b8b549b (diff)
downloadmpv-24be34f1e9e37111a06108c090324426aff6f1db.tar.bz2
mpv-24be34f1e9e37111a06108c090324426aff6f1db.tar.xz
cleanup: Silence compilation warnings on MinGW-w64
Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
Diffstat (limited to 'loader/win32.c')
-rw-r--r--loader/win32.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/loader/win32.c b/loader/win32.c
index 50ca797e8d..fb7f48b09e 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -597,7 +597,7 @@ static HMODULE WINAPI expGetModuleHandleW(const uint16_t* name)
int pos = 0;
while (*name) {
if (*name > 256 || pos >= sizeof(aname) - 1)
- return NULL;
+ return 0;
aname[pos++] = *name++;
}
aname[pos] = 0;
@@ -2015,15 +2015,15 @@ static DWORD WINAPI expSignalObjectAndWait(HANDLE hObjectToSignal,
expSetEvent(mlist);
break;
case 1: // Semaphore
- expReleaseSemaphore(mlist, 1, NULL);
+ expReleaseSemaphore((long)mlist, 1, NULL);
break;
case 2: // Mutex
- expReleaseMutex(mlist);
+ expReleaseMutex((long)mlist);
break;
default:
dbgprintf("Signalling unknown object type %d!\n", hObjectToSignal);
}
- return expWaitForSingleObject(hObjectToWaitOn, dwMilliseconds);
+ return (DWORD)expWaitForSingleObject((void*)hObjectToWaitOn, dwMilliseconds);
}
static long WINAPI expRegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey)
@@ -2747,7 +2747,7 @@ static int WINAPI expEnumDisplayMonitors(void *dc, RECT *r,
{
dbgprintf("EnumDisplayMonitors(0x%x, 0x%x, 0x%x, 0x%x) => ?\n",
dc, r, callback_proc, callback_param);
- return callback_proc(0, dc, r, callback_param);
+ return callback_proc(0, (HDC)dc, r, (LPARAM)callback_param);
}
#if 0
@@ -2847,8 +2847,8 @@ static int WINAPI expEnumWindows(int (*callback_func)(HWND, LPARAM), void *callb
{
int i, i2;
dbgprintf("EnumWindows(0x%x, 0x%x) => 1\n", callback_func, callback_param);
- i = callback_func(0, callback_param);
- i2 = callback_func(1, callback_param);
+ i = callback_func(0, (LPARAM)callback_param);
+ i2 = callback_func(1, (LPARAM)callback_param);
return i && i2;
}
@@ -4223,7 +4223,7 @@ static int exp_initterm(int v1, int v2)
}
#else
/* merged from wine - 2002.04.21 */
-typedef void (*INITTERMFUNC)();
+typedef void (*INITTERMFUNC)(void);
static int exp_initterm(INITTERMFUNC *start, INITTERMFUNC *end)
{
dbgprintf("_initterm(0x%x, 0x%x) %p\n", start, end, *start);
@@ -4900,7 +4900,7 @@ static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl)
dbgprintf("CreatePalette(%x) => NULL\n", lpgpl);
i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY));
- test = malloc(i);
+ test = (HPALETTE)malloc(i);
memcpy((void *)test, lpgpl, i);
return test;