aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader/pe_image.c
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@mplayer2.org>2012-02-27 19:15:13 +0100
committerGravatar Uoti Urpala <uau@mplayer2.org>2012-03-01 00:22:30 +0200
commit24be34f1e9e37111a06108c090324426aff6f1db (patch)
treeaa28674a6d69dfb18fd102608f72e3081df6d1dd /loader/pe_image.c
parent25417a626d0b9077bfbb940952f3858d7b8b549b (diff)
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/pe_image.c')
-rw-r--r--loader/pe_image.c14
1 files changed, 5 insertions, 9 deletions
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");