summaryrefslogtreecommitdiffstats
path: root/loader/module.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/module.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/module.c')
-rw-r--r--loader/module.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/loader/module.c b/loader/module.c
index 78d46d5c15..aa921c52d6 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -440,7 +440,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
int i;
// sse hack moved from patch dll into runtime patching
- if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x1000)) {
+ if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x1000)) {
fprintf(stderr, "VP3 DLL found\n");
for (i=0;i<18;i++) RVA(0x4bd6)[i]=0x90;
}
@@ -450,7 +450,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
if (strstr(libname,"vp5vfw.dll") && wm)
{
int i;
- if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3930)) {
+ if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3930)) {
for (i=0;i<3;i++) RVA(0x4e86)[i]=0x90;
for (i=0;i<3;i++) RVA(0x5a23)[i]=0x90;
for (i=0;i<3;i++) RVA(0x5bff)[i]=0x90;
@@ -463,12 +463,12 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
if (strstr(libname,"vp6vfw.dll") && wm)
{
int i;
- if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3ef0)) {
+ if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3ef0)) {
// looks like VP 6.1.0.2
for (i=0;i<6;i++) RVA(0x7268)[i]=0x90;
for (i=0;i<6;i++) RVA(0x7e83)[i]=0x90;
for (i=0;i<6;i++) RVA(0x806a)[i]=0x90;
- } else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x4120)) {
+ } else if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x4120)) {
// looks like VP 6.2.0.10
for (i=0;i<6;i++) RVA(0x7688)[i]=0x90;
for (i=0;i<6;i++) RVA(0x82c3)[i]=0x90;
@@ -476,7 +476,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
for (i=0;i<6;i++) RVA(0x1d2cc)[i]=0x90;
for (i=0;i<6;i++) RVA(0x2179d)[i]=0x90;
for (i=0;i<6;i++) RVA(0x1977f)[i]=0x90;
- } else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3e70)) {
+ } else if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3e70)) {
// looks like VP 6.0.7.3
for (i=0;i<6;i++) RVA(0x7559)[i]=0x90;
for (i=0;i<6;i++) RVA(0x81c3)[i]=0x90;
@@ -492,7 +492,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
{
// The codec calls IsRectEmpty with coords 0,0,0,0 => result is 0
// but it really wants the rectangle to be not empty
- if (PE_FindExportedFunction(wm, "CreateInstance", TRUE)==RVA(0xb812)) {
+ if ((char*)PE_FindExportedFunction(wm, "CreateInstance", TRUE)==RVA(0xb812)) {
// Dll version is 10.0.0.3645
*RVA(0x8b0f)=0xeb; // Jump always, ignoring IsRectEmpty result
} else {
@@ -509,7 +509,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
// dispatch_addr = GetProcAddress(wm->module, "theQuickTimeDispatcher", TRUE);
dispatch_addr = PE_FindExportedFunction(wm, "theQuickTimeDispatcher", TRUE);
- if (dispatch_addr == RVA(0x124c30))
+ if ((char*)dispatch_addr == RVA(0x124c30))
{
fprintf(stderr, "QuickTime5 DLLs found\n");
ptr = (void **)RVA(0x375ca4); // dispatch_ptr
@@ -537,7 +537,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
RVA(0x08e0ae)[0] = 0xc3; // font/dc remover
for (i=0;i<24;i++) RVA(0x07a1ad)[i]=0x90; // destroy window
#endif
- } else if (dispatch_addr == RVA(0x13b330))
+ } else if ((char*)dispatch_addr == RVA(0x13b330))
{
fprintf(stderr, "QuickTime6 DLLs found\n");
ptr = (void **)RVA(0x3b9524); // dispatcher_ptr
@@ -546,7 +546,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
for (i=0;i<5;i++) RVA(0x273122)[i]=0x90; // jmp_to_call_loadbitmap
for (i=0;i<9;i++) RVA(0x273131)[i]=0x90; // call__calls_OLE_shit
for (i=0;i<96;i++) RVA(0x2ac852)[i]=0x90; // disable threads
- } else if (dispatch_addr == RVA(0x13c3e0))
+ } else if ((char*)dispatch_addr == RVA(0x13c3e0))
{
fprintf(stderr, "QuickTime6.3 DLLs found\n");
ptr = (void **)RVA(0x3ca01c); // dispatcher_ptr
@@ -825,7 +825,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t
// memory management:
case 0x150011: //NewPtrClear
case 0x150012: //NewPtrSysClear
- reg->eax = malloc(((uint32_t *)stack_base)[1]);
+ reg->eax = (uint32_t)malloc(((uint32_t *)stack_base)[1]);
memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
@@ -833,7 +833,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t
return 1;
case 0x15000F: //NewPtr
case 0x150010: //NewPtrSys
- reg->eax = malloc(((uint32_t *)stack_base)[1]);
+ reg->eax = (uint32_t)malloc(((uint32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
#endif