summaryrefslogtreecommitdiffstats
path: root/loader
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
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')
-rw-r--r--loader/afl.c2
-rw-r--r--loader/dmo/DMO_VideoDecoder.c5
-rw-r--r--loader/dshow/DS_Filter.c4
-rw-r--r--loader/dshow/DS_VideoDecoder.c4
-rw-r--r--loader/dshow/allocator.c2
-rw-r--r--loader/dshow/graph.c32
-rw-r--r--loader/dshow/graph.h19
-rw-r--r--loader/dshow/outputpin.c6
-rw-r--r--loader/ext.c7
-rw-r--r--loader/module.c22
-rw-r--r--loader/pe_image.c14
-rw-r--r--loader/registry.c3
-rw-r--r--loader/win32.c18
-rw-r--r--loader/wine/winbase.h4
-rw-r--r--loader/wine/windef.h12
15 files changed, 69 insertions, 85 deletions
diff --git a/loader/afl.c b/loader/afl.c
index 337cbcd551..b29471cdce 100644
--- a/loader/afl.c
+++ b/loader/afl.c
@@ -227,7 +227,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
return MMSYSERR_ERROR;
}
- pad->pfnDriverProc = GetProcAddress(pad->hDrvr, "DriverProc");
+ pad->pfnDriverProc = (DRIVERPROC)GetProcAddress(pad->hDrvr, "DriverProc");
/* insert new pad at beg of list */
pad->pNextACMDriver = padid->pACMDriverList;
diff --git a/loader/dmo/DMO_VideoDecoder.c b/loader/dmo/DMO_VideoDecoder.c
index db0cd4c995..dcc0affe2c 100644
--- a/loader/dmo/DMO_VideoDecoder.c
+++ b/loader/dmo/DMO_VideoDecoder.c
@@ -361,7 +361,7 @@ int DMO_VideoDecoder_DecodeInternal(DMO_VideoDecoder *this, const void* src, int
int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int csp)
{
HRESULT result;
- int should_test=1;
+ //int should_test=1;
Debug printf("DMO_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp);
@@ -467,7 +467,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c
else
this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER);
-
+#if 0
switch(csp)
{
case fccYUY2:
@@ -499,6 +499,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c
should_test=false;
break;
}
+#endif
#ifdef WIN32_LOADER
Setup_FS_Segment();
diff --git a/loader/dshow/DS_Filter.c b/loader/dshow/DS_Filter.c
index 693d59c25f..88f881523a 100644
--- a/loader/dshow/DS_Filter.c
+++ b/loader/dshow/DS_Filter.c
@@ -216,7 +216,7 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
enum_pins->vt->Reset(enum_pins);
result = enum_pins->vt->Next(enum_pins, (ULONG)256, (IPin**)array, &fetched);
- enum_pins->vt->Release(enum_pins);
+ enum_pins->vt->Release((IUnknown*)enum_pins);
Debug printf("Pins enumeration returned %ld pins, error is %x\n", fetched, (int)result);
for (i = 0; i < fetched; i++)
@@ -306,7 +306,7 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
init++;
break;
}
- tempAll->vt->Release(tempAll);
+ tempAll->vt->Release((IUnknown*)tempAll);
if (!init)
{
diff --git a/loader/dshow/DS_VideoDecoder.c b/loader/dshow/DS_VideoDecoder.c
index 8af025b475..c8cc988b61 100644
--- a/loader/dshow/DS_VideoDecoder.c
+++ b/loader/dshow/DS_VideoDecoder.c
@@ -600,8 +600,8 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp
}
if(this->m_pDS_Filter->m_pAll)
- this->m_pDS_Filter->m_pAll->vt->Release(this->m_pDS_Filter->m_pAll);
- this->m_pDS_Filter->m_pAll=MemAllocatorCreate();
+ this->m_pDS_Filter->m_pAll->vt->Release((IUnknown*)this->m_pDS_Filter->m_pAll);
+ this->m_pDS_Filter->m_pAll=(IMemAllocator*)MemAllocatorCreate();
if (!this->m_pDS_Filter->m_pAll)
{
printf("Call to MemAllocatorCreate failed\n");
diff --git a/loader/dshow/allocator.c b/loader/dshow/allocator.c
index a90bd9d3d2..744debf968 100644
--- a/loader/dshow/allocator.c
+++ b/loader/dshow/allocator.c
@@ -114,6 +114,7 @@ static inline avm_list_t* avm_list_find(avm_list_t* head, void* member)
return NULL;
}
+#ifdef WIN32_LOADER
static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** ppv)
{
IUnknown* p;
@@ -130,6 +131,7 @@ static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** pp
return result;
}
+#endif
static HRESULT STDCALL MemAllocator_SetProperties(IMemAllocator * This,
/* [in] */ ALLOCATOR_PROPERTIES *pRequest,
diff --git a/loader/dshow/graph.c b/loader/dshow/graph.c
index 01bf6c7253..14517a627f 100644
--- a/loader/dshow/graph.c
+++ b/loader/dshow/graph.c
@@ -34,6 +34,7 @@
// Used for knowing when to register and unregister the class in COM.
static int GraphKeeper = 0;
+#ifdef WIN32_LOADER
static long FilterGraph_CreateGraph(GUID* clsid, const GUID* iid, void** ppv)
{
IUnknown* p;
@@ -50,6 +51,7 @@ static long FilterGraph_CreateGraph(GUID* clsid, const GUID* iid, void** ppv)
return result;
}
+#endif
static void FilterGraph_Destroy(FilterGraph* This)
{
@@ -62,56 +64,56 @@ static void FilterGraph_Destroy(FilterGraph* This)
free(This);
}
-HRESULT STDCALL FilterGraph_AddFilter(FilterGraph* This,
- IBaseFilter* pFilter,
- unsigned short* pName)
+static HRESULT STDCALL FilterGraph_AddFilter(IFilterGraph* This,
+ IBaseFilter* pFilter,
+ unsigned short* pName)
{
Debug printf("FilterGraph_AddFilter(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_RemoveFilter(FilterGraph* This, IBaseFilter* pFilter)
+static HRESULT STDCALL FilterGraph_RemoveFilter(IFilterGraph* This, IBaseFilter* pFilter)
{
Debug printf("FilterGraph_RemoveFilter(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_EnumFilters(FilterGraph* This, IEnumFilters** ppEnum)
+static HRESULT STDCALL FilterGraph_EnumFilters(IFilterGraph* This, IEnumFilters** ppEnum)
{
Debug printf("FilterGraph_EnumFilters(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_FindFilterByName(FilterGraph* This,
- unsigned short* pName,
- IBaseFilter** ppFilter)
+static HRESULT STDCALL FilterGraph_FindFilterByName(IFilterGraph* This,
+ unsigned short* pName,
+ IBaseFilter** ppFilter)
{
Debug printf("FilterGraph_FindFilterByName(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_ConnectDirect(FilterGraph* This,
- IPin* ppinOut,
- IPin* ppinIn,
- const AM_MEDIA_TYPE* pmt)
+static HRESULT STDCALL FilterGraph_ConnectDirect(IFilterGraph* This,
+ IPin* ppinOut,
+ IPin* ppinIn,
+ const AM_MEDIA_TYPE* pmt)
{
Debug printf("FilterGraph_ConnectDirect(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_Reconnect(FilterGraph* This, IPin* ppin)
+static HRESULT STDCALL FilterGraph_Reconnect(IFilterGraph* This, IPin* ppin)
{
Debug printf("FilterGraph_Reconnect(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_Disconnect(FilterGraph* This, IPin* ppin)
+static HRESULT STDCALL FilterGraph_Disconnect(IFilterGraph* This, IPin* ppin)
{
Debug printf("FilterGraph_Disconnect(%p) called\n", This);
return E_NOTIMPL;
}
-HRESULT STDCALL FilterGraph_SetDefaultSyncSource(FilterGraph* This)
+static HRESULT STDCALL FilterGraph_SetDefaultSyncSource(IFilterGraph* This)
{
Debug printf("FilterGraph_SetDefaultSyncSource(%p) called\n", This);
return E_NOTIMPL;
diff --git a/loader/dshow/graph.h b/loader/dshow/graph.h
index 2fa72b49b4..7667f5a39e 100644
--- a/loader/dshow/graph.h
+++ b/loader/dshow/graph.h
@@ -52,25 +52,6 @@ struct FilterGraph {
HRESULT STDCALL (*SetDefaultSyncSource)(FilterGraph* This);
};
-
-HRESULT STDCALL FilterGraph_AddFilter(FilterGraph* This,
- IBaseFilter* pFilter,
- unsigned short* pName);
-HRESULT STDCALL FilterGraph_RemoveFilter(FilterGraph* This,
- IBaseFilter* pFilter);
-HRESULT STDCALL FilterGraph_EnumFilters(FilterGraph* This,
- IEnumFilters** ppEnum);
-HRESULT STDCALL FilterGraph_FindFilterByName(FilterGraph* This,
- unsigned short* pName,
- IBaseFilter** ppFilter);
-HRESULT STDCALL FilterGraph_ConnectDirect(FilterGraph* This,
- IPin* ppinOut,
- IPin* ppinIn,
- const AM_MEDIA_TYPE* pmt);
-HRESULT STDCALL FilterGraph_Reconnect(FilterGraph* This, IPin* ppin);
-HRESULT STDCALL FilterGraph_Disconnect(FilterGraph* This, IPin* ppin);
-HRESULT STDCALL FilterGraph_SetDefaultSyncSource(FilterGraph* This);
-
FilterGraph* FilterGraphCreate(void);
#endif /* MPLAYER_GRAPH_H */
diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c
index ad53303df5..a1baf80116 100644
--- a/loader/dshow/outputpin.c
+++ b/loader/dshow/outputpin.c
@@ -552,8 +552,8 @@ static HRESULT STDCALL COutputPin_NewSegment(IPin * This,
/* [in] */ REFERENCE_TIME tStop,
/* [in] */ double dRate)
{
- Debug printf("COutputPin_NewSegment(%Ld,%Ld,%f) called\n",
- tStart, tStop, dRate);
+ Debug printf("COutputPin_NewSegment(%d,%d,%f) called\n",
+ (int)tStart, (int)tStop, dRate);
return 0;
}
@@ -749,7 +749,7 @@ static HRESULT STDCALL COutputMemPin_ReceiveMultiple(IMemInputPin * This,
/* [in] */ long nSamples,
/* [out] */ long *nSamplesProcessed)
{
- HRESULT hr;
+ HRESULT hr = 0;
Debug printf("COutputMemPin_ReceiveMultiple(%p) %ld\n", This,nSamples);
for(*nSamplesProcessed=0; *nSamplesProcessed < nSamples; *nSamplesProcessed++) {
hr = This->vt->Receive(This,pSamples[*nSamplesProcessed]);
diff --git a/loader/ext.c b/loader/ext.c
index d91ab4a3de..feab985167 100644
--- a/loader/ext.c
+++ b/loader/ext.c
@@ -443,12 +443,12 @@ LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, DWORD type, DWORD protec
if (type&MEM_RESERVE && (unsigned)address&0xffff) {
size += (unsigned)address&0xffff;
- address = (unsigned)address&~0xffff;
+ address = (void*)((unsigned)address&~0xffff);
}
pgsz = sysconf(_SC_PAGESIZE);
if (type&MEM_COMMIT && (unsigned)address%pgsz) {
size += (unsigned)address%pgsz;
- address -= (unsigned)address%pgsz;
+ address = (void*)((unsigned)address - (unsigned)address%pgsz);
}
if (type&MEM_RESERVE && size<0x10000) size = 0x10000;
@@ -531,7 +531,6 @@ LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, DWORD type, DWORD protec
WIN_BOOL WINAPI VirtualFree(LPVOID address, SIZE_T dwSize, DWORD dwFreeType)//not sure
{
virt_alloc* str=vm;
- int answer;
//printf("VirtualFree(0x%08X, %d, 0x%08X)\n", (unsigned)address, dwSize, dwFreeType);
while(str)
@@ -542,7 +541,7 @@ WIN_BOOL WINAPI VirtualFree(LPVOID address, SIZE_T dwSize, DWORD dwFreeType)//n
continue;
}
//printf(" VirtualFree(...) munmap(0x%08X, %d)\n", (unsigned)str->address, str->mapping_size);
- answer=munmap(str->address, str->mapping_size);
+ munmap(str->address, str->mapping_size);
if(str->next)str->next->prev=str->prev;
if(str->prev)str->prev->next=str->next;
if(vm==str)vm=str->prev;
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
diff --git a/loader/pe_image.c b/loader/pe_image.c
index 85b56ab4f2..fed5780fb1 100644
--- a/loader/pe_image.c
+++ b/loader/pe_image.c
@@ -73,7 +73,7 @@ static void dump_exports( HMODULE hModule )
char *Module;
unsigned int i, j;
unsigned short *ordinal;
- unsigned long *function,*functions;
+ unsigned long *function;
unsigned char **name;
unsigned int load_addr = hModule;
@@ -84,14 +84,17 @@ static void dump_exports( HMODULE hModule )
IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
Module = (char*)RVA(pe_exports->Name);
+ (void)Module; //silence compiler warning
TRACE("*******EXPORT DATA*******\n");
TRACE("Module name is %s, %ld functions, %ld names\n",
Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames);
ordinal=(unsigned short*) RVA(pe_exports->AddressOfNameOrdinals);
- functions=function=(unsigned long*) RVA(pe_exports->AddressOfFunctions);
+ function=(unsigned long*) RVA(pe_exports->AddressOfFunctions);
name=(unsigned char**) RVA(pe_exports->AddressOfNames);
+ (void)name; //silence compiler warning
+
TRACE(" Ord RVA Addr Name\n" );
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
{
@@ -135,7 +138,6 @@ FARPROC PE_FindExportedFunction(
IMAGE_EXPORT_DIRECTORY *exports = pem->pe_export;
unsigned int load_addr = wm->module;
unsigned long rva_start, rva_end, addr;
- char * forward;
if (HIWORD(funcName))
TRACE("(%s)\n",funcName);
@@ -152,7 +154,6 @@ FARPROC PE_FindExportedFunction(
ordinals= (unsigned short*) RVA(exports->AddressOfNameOrdinals);
function= (unsigned long*) RVA(exports->AddressOfFunctions);
name = (unsigned char **) RVA(exports->AddressOfNames);
- forward = NULL;
rva_start = PE_HEADER(wm->module)->OptionalHeader
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
rva_end = rva_start + PE_HEADER(wm->module)->OptionalHeader
@@ -247,14 +248,9 @@ static DWORD fixup_imports( WINE_MODREF *wm )
PE_MODREF *pem;
unsigned int load_addr = wm->module;
int i,characteristics_detection=1;
- char *modname;
assert(wm->type==MODULE32_PE);
pem = &(wm->binfmt.pe);
- if (pem->pe_export)
- modname = (char*) RVA(pem->pe_export->Name);
- else
- modname = "<unknown>";
TRACE("Dumping imports list\n");
diff --git a/loader/registry.c b/loader/registry.c
index 2eb449124c..b87c160e67 100644
--- a/loader/registry.c
+++ b/loader/registry.c
@@ -339,7 +339,6 @@ long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved, long a
{
char* full_name;
reg_handle_t* t;
- struct reg_value* v;
TRACE("Opening key %s\n", subkey);
if(!regs)
@@ -357,7 +356,7 @@ long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved, long a
if(!full_name)
return -1;
TRACE("Opening key Fullname %s\n", full_name);
- v=find_value_by_name(full_name);
+ find_value_by_name(full_name);
t=insert_handle(generate_handle(), full_name);
*newkey=t->handle;
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;
diff --git a/loader/wine/winbase.h b/loader/wine/winbase.h
index 19394bc81d..b5c5ebe25c 100644
--- a/loader/wine/winbase.h
+++ b/loader/wine/winbase.h
@@ -786,8 +786,8 @@ typedef struct tagSYSTEM_INFO
struct {
WORD wProcessorArchitecture;
WORD wReserved;
- } DUMMYSTRUCTNAME;
- } DUMMYUNIONNAME;
+ } s;
+ } u;
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;
diff --git a/loader/wine/windef.h b/loader/wine/windef.h
index b46607969b..ee455dc3f8 100644
--- a/loader/wine/windef.h
+++ b/loader/wine/windef.h
@@ -47,6 +47,8 @@
# define NONAMELESSUNION
#endif /* !defined(NONAMELESSUNION) */
+#if 0
+
#ifndef NONAMELESSSTRUCT
#define DUMMYSTRUCTNAME
#define DUMMYSTRUCTNAME1
@@ -79,6 +81,8 @@
#define DUMMYUNIONNAME5 u5
#endif /* !defined(NONAMELESSUNION) */
+#endif
+
/* Calling conventions definitions */
#ifdef __i386__
@@ -301,8 +305,8 @@ typedef LRESULT CALLBACK (*DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
typedef INT CALLBACK (*EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
typedef INT CALLBACK (*EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
-typedef LRESULT CALLBACK (*FARPROC)();
-typedef INT CALLBACK (*PROC)();
+typedef LRESULT CALLBACK (*FARPROC)(void);
+typedef INT CALLBACK (*PROC)(void);
typedef WIN_BOOL CALLBACK (*GRAYSTRINGPROC)(HDC,LPARAM,INT);
typedef LRESULT CALLBACK (*HOOKPROC)(INT,WPARAM,LPARAM);
typedef WIN_BOOL CALLBACK (*PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
@@ -434,8 +438,8 @@ typedef struct
typedef LRESULT CALLBACK (*DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
typedef WIN_BOOL16 CALLBACK (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef INT16 CALLBACK (*EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
-typedef LRESULT CALLBACK (*FARPROC16)();
-typedef INT16 CALLBACK (*PROC16)();
+typedef LRESULT CALLBACK (*FARPROC16)(void);
+typedef INT16 CALLBACK (*PROC16)(void);
typedef WIN_BOOL16 CALLBACK (*GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
typedef LRESULT CALLBACK (*HOOKPROC16)(INT16,WPARAM16,LPARAM);
typedef WIN_BOOL16 CALLBACK (*PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);