Module: wine Branch: master Commit: 922a3360635fb3455552819d046d79118039a58a URL: http://source.winehq.org/git/wine.git/?a=commit;h=922a3360635fb3455552819d04...
Author: Michael Stefaniuc mstefani@redhat.de Date: Sun Nov 2 00:20:49 2008 +0100
winedump: Remove casts of void pointers to other pointer types.
---
tools/winedump/debug.c | 4 ++-- tools/winedump/emf.c | 8 ++++---- tools/winedump/minidump.c | 2 +- tools/winedump/misc.c | 6 +++--- tools/winedump/pe.c | 5 ++--- tools/winedump/search.c | 4 ++-- 6 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/tools/winedump/debug.c b/tools/winedump/debug.c index 86ffd14..0920786 100644 --- a/tools/winedump/debug.c +++ b/tools/winedump/debug.c @@ -514,7 +514,7 @@ static const char *get_coff_name( const IMAGE_SYMBOL *coff_sym, const char *coff
void dump_coff(unsigned long coffbase, unsigned long len, const void* pmt) { - const IMAGE_COFF_SYMBOLS_HEADER *coff = (const IMAGE_COFF_SYMBOLS_HEADER *)PRD(coffbase, len); + const IMAGE_COFF_SYMBOLS_HEADER *coff = PRD(coffbase, len); const IMAGE_SYMBOL *coff_sym; const IMAGE_SYMBOL *coff_symbols = (const IMAGE_SYMBOL *) ((const char *)coff + coff->LvaToFirstSymbol); @@ -592,7 +592,7 @@ void dump_frame_pointer_omission(unsigned long base, unsigned long len) printf("Range #loc #pmt Prlg #reg Info\n" "-----------------+----+----+----+----+------------\n");
- fpo = (const FPO_DATA*)PRD(base, len); + fpo = PRD(base, len); if (!fpo) {printf("Couldn't get FPO blob\n"); return;} last = (const FPO_DATA*)((const char*)fpo + len);
diff --git a/tools/winedump/emf.c b/tools/winedump/emf.c index f3b6f50..a2ea1c7 100644 --- a/tools/winedump/emf.c +++ b/tools/winedump/emf.c @@ -115,7 +115,7 @@ static int dump_emfrecord(void)
case EMR_INTERSECTCLIPRECT: { - const EMRINTERSECTCLIPRECT *clip = (const EMRINTERSECTCLIPRECT *)PRD(offset, sizeof(*clip)); + const EMRINTERSECTCLIPRECT *clip = PRD(offset, sizeof(*clip));
printf("%-20s %08x\n", "EMR_INTERSECTCLIPRECT", length); printf("rect %d,%d - %d, %d\n", @@ -170,7 +170,7 @@ static int dump_emfrecord(void)
case EMR_EXTSELECTCLIPRGN: { - const EMREXTSELECTCLIPRGN *clip = (const EMREXTSELECTCLIPRGN *)PRD(offset, sizeof(*clip)); + const EMREXTSELECTCLIPRGN *clip = PRD(offset, sizeof(*clip)); const RGNDATA *data = (RGNDATA *)clip->RgnData; DWORD i, rc_count = 0; RECT *rc; @@ -195,7 +195,7 @@ static int dump_emfrecord(void)
case EMR_EXTCREATEFONTINDIRECTW: { - const EMREXTCREATEFONTINDIRECTW *pf = (const EMREXTCREATEFONTINDIRECTW *)PRD(offset, sizeof(*pf)); + const EMREXTCREATEFONTINDIRECTW *pf = PRD(offset, sizeof(*pf)); const LOGFONTW *plf = &pf->elfw.elfLogFont;
printf("%-20s %08x\n", "EMR_EXTCREATEFONTINDIRECTW", length); @@ -216,7 +216,7 @@ static int dump_emfrecord(void)
case EMR_EXTTEXTOUTW: { - const EMREXTTEXTOUTW *etoW = (const EMREXTTEXTOUTW *)PRD(offset, sizeof(*etoW)); + const EMREXTTEXTOUTW *etoW = PRD(offset, sizeof(*etoW));
printf("%-20s %08x\n", "EMR_EXTTEXTOUTW", length); printf("pt (%d,%d) rect (%d,%d - %d,%d) flags %#x, %s\n", diff --git a/tools/winedump/minidump.c b/tools/winedump/minidump.c index b411c36..76aaa58 100644 --- a/tools/winedump/minidump.c +++ b/tools/winedump/minidump.c @@ -72,7 +72,7 @@ enum FileSig get_kind_mdmp(void)
void mdmp_dump(void) { - const MINIDUMP_HEADER* hdr = (const MINIDUMP_HEADER*)PRD(0, sizeof(MINIDUMP_HEADER)); + const MINIDUMP_HEADER* hdr = PRD(0, sizeof(MINIDUMP_HEADER)); ULONG idx, ndir = 0; const MINIDUMP_DIRECTORY* dir; const void* stream; diff --git a/tools/winedump/misc.c b/tools/winedump/misc.c index 82e0bd8..17c35cc 100644 --- a/tools/winedump/misc.c +++ b/tools/winedump/misc.c @@ -41,7 +41,7 @@ char *str_create(size_t num_str, ...) len += strlen (t); va_end (args);
- if (!(tmp = (char *) malloc (len))) + if (!(tmp = malloc (len))) fatal ("Out of memory");
tmp[0] = '\0'; @@ -72,7 +72,7 @@ char *str_create_num(size_t num_str, int num, ...) len += strlen (t); va_end (args);
- if (!(tmp = (char *) malloc (len))) + if (!(tmp = malloc (len))) fatal ("Out of memory");
tmp[0] = '\0'; @@ -98,7 +98,7 @@ char *str_substring(const char *start, const char *end)
assert (start && end && end > start);
- if (!(newstr = (char *) malloc (end - start + 1))) + if (!(newstr = malloc (end - start + 1))) fatal ("Out of memory");
memcpy (newstr, start, end - start); diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 955d627..31a744e 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -664,7 +664,7 @@ static void dump_dir_delay_imported_functions(void)
printf(" Ordn Name\n");
- il = (const IMAGE_THUNK_DATA32 *)RVA(importDesc->pINT - offset, sizeof(DWORD)); + il = RVA(importDesc->pINT - offset, sizeof(DWORD));
if (!il) printf("Can't grab thunk data, going to next imported DLL\n"); @@ -1321,8 +1321,7 @@ static void do_grab_sym( void )
/* dll_close(); */
- if (!(dll_symbols = (dll_symbol *) malloc((exportDir->NumberOfFunctions + 1) * - sizeof (dll_symbol)))) + if (!(dll_symbols = malloc((exportDir->NumberOfFunctions + 1) * sizeof(dll_symbol)))) fatal ("Out of memory"); if (exportDir->AddressOfFunctions != exportDir->NumberOfNames || exportDir->Base > 1) globals.do_ordinals = 1; diff --git a/tools/winedump/search.c b/tools/winedump/search.c index aa89fc9..2893697 100644 --- a/tools/winedump/search.c +++ b/tools/winedump/search.c @@ -50,10 +50,10 @@ int symbol_search (parsed_symbol *sym) return - 1;
if (!grep_buff) - grep_buff = (char *) malloc (MAX_RESULT_LEN); + grep_buff = malloc (MAX_RESULT_LEN);
if (!fgrep_buff) - fgrep_buff = (char *) malloc (MAX_RESULT_LEN); + fgrep_buff = malloc (MAX_RESULT_LEN);
if (!grep_buff || !fgrep_buff) fatal ("Out of Memory");