Commit 3c3a9b50 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dbghelp: Remove superfluous pointer casts.

parent a2187cad
......@@ -72,7 +72,7 @@ static void dump(const void* ptr, unsigned len)
int i, j;
BYTE msg[128];
static const char hexof[] = "0123456789abcdef";
const BYTE* x = (const BYTE*)ptr;
const BYTE* x = ptr;
for (i = 0; i < len; i += 16)
{
......
......@@ -282,13 +282,13 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name,
static BOOL WINAPI fetch_pe_module_info_cb(PCWSTR name, DWORD64 base, ULONG size,
PVOID user)
{
struct dump_context* dc = (struct dump_context*)user;
struct dump_context* dc = user;
IMAGE_NT_HEADERS nth;
if (!validate_addr64(base)) return FALSE;
if (pe_load_nt_header(dc->hProcess, base, &nth))
add_module((struct dump_context*)user, name, base, size,
add_module(user, name, base, size,
nth.FileHeader.TimeDateStamp, nth.OptionalHeader.CheckSum,
FALSE);
return TRUE;
......@@ -302,7 +302,7 @@ static BOOL WINAPI fetch_pe_module_info_cb(PCWSTR name, DWORD64 base, ULONG size
static BOOL fetch_elf_module_info_cb(const WCHAR* name, unsigned long base,
void* user)
{
struct dump_context* dc = (struct dump_context*)user;
struct dump_context* dc = user;
DWORD rbase, size, checksum;
/* FIXME: there's no relevant timestamp on ELF modules */
......@@ -971,7 +971,7 @@ BOOL WINAPI MiniDumpReadDumpStream(PVOID base, ULONG str_idx,
PMINIDUMP_DIRECTORY* pdir,
PVOID* stream, ULONG* size)
{
MINIDUMP_HEADER* mdHead = (MINIDUMP_HEADER*)base;
MINIDUMP_HEADER* mdHead = base;
if (mdHead->Signature == MINIDUMP_SIGNATURE)
{
......
......@@ -71,7 +71,7 @@ static void dump(const void* ptr, unsigned len)
unsigned int i, j;
char msg[128];
const char* hexof = "0123456789abcdef";
const BYTE* x = (const BYTE*)ptr;
const BYTE* x = ptr;
for (i = 0; i < len; i += 16)
{
......@@ -2150,7 +2150,7 @@ static void pdb_convert_symbol_file(const PDB_SYMBOLS* symbols,
{
if (symbols->version < 19970000)
{
const PDB_SYMBOL_FILE *sym_file = (const PDB_SYMBOL_FILE*)image;
const PDB_SYMBOL_FILE *sym_file = image;
memset(sfile, 0, sizeof(*sfile));
sfile->file = sym_file->file;
sfile->range.index = sym_file->range.index;
......@@ -2385,7 +2385,7 @@ static void pdb_process_symbol_imports(const struct process* pcs,
imp = (const PDB_SYMBOL_IMPORT*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) +
symbols->module_size + symbols->offset_size +
symbols->hash_size + symbols->srcmodule_size);
first = (const char*)imp;
first = imp;
last = (const char*)imp + symbols->pdbimport_size;
while (imp < (const PDB_SYMBOL_IMPORT*)last)
{
......
......@@ -234,7 +234,7 @@ static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse,
strcpyW(buffer + pos, fd.cFileName);
if (recurse && (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
found = do_searchW(file, buffer, TRUE, cb, user);
else if (SymMatchFileNameW(buffer, (WCHAR*)file, NULL, NULL))
else if (SymMatchFileNameW(buffer, file, NULL, NULL))
{
if (!cb || cb(buffer, user)) found = TRUE;
}
......@@ -340,13 +340,13 @@ struct sffip
*/
static BOOL CALLBACK sffip_cb(PCWSTR buffer, PVOID user)
{
struct sffip* s = (struct sffip*)user;
struct sffip* s = user;
if (!s->cb) return TRUE;
/* yes, EnumDirTree/do_search and SymFindFileInPath callbacks use the opposite
* convention to stop/continue enumeration. sigh.
*/
return !(s->cb)((WCHAR*)buffer, s->user);
return !(s->cb)(buffer, s->user);
}
/******************************************************************
......@@ -461,7 +461,7 @@ struct module_find
*/
static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
{
struct module_find* mf = (struct module_find*)user;
struct module_find* mf = user;
DWORD size, checksum, timestamp;
unsigned matched = 0;
......@@ -580,7 +580,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
{
const IMAGE_SEPARATE_DEBUG_HEADER* hdr;
hdr = (const IMAGE_SEPARATE_DEBUG_HEADER*)mapping;
hdr = mapping;
if (hdr->Signature == IMAGE_SEPARATE_DEBUG_SIGNATURE)
{
......
......@@ -435,7 +435,7 @@ PVOID WINAPI ImageDirectoryEntryToDataEx( PVOID base, BOOLEAN image, USHORT dir,
*size = nt->OptionalHeader.DataDirectory[dir].Size;
if (image || addr < nt->OptionalHeader.SizeOfHeaders) return (char *)base + addr;
return RtlImageRvaToVa( nt, (HMODULE)base, addr, section );
return RtlImageRvaToVa( nt, base, addr, section );
}
/***********************************************************************
......
......@@ -1046,7 +1046,7 @@ struct sym_enumerate
static BOOL CALLBACK sym_enumerate_cb(PSYMBOL_INFO syminfo, ULONG size, void* ctx)
{
struct sym_enumerate* se = (struct sym_enumerate*)ctx;
struct sym_enumerate* se = ctx;
return (se->cb)(syminfo->Name, syminfo->Address, syminfo->Size, se->ctx);
}
......@@ -1073,7 +1073,7 @@ struct sym_enumerate64
static BOOL CALLBACK sym_enumerate_cb64(PSYMBOL_INFO syminfo, ULONG size, void* ctx)
{
struct sym_enumerate64* se = (struct sym_enumerate64*)ctx;
struct sym_enumerate64* se = ctx;
return (se->cb)(syminfo->Name, syminfo->Address, syminfo->Size, se->ctx);
}
......@@ -1473,7 +1473,7 @@ BOOL WINAPI SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line)
if (!module_get_debug(&pair)) return FALSE;
if (Line->Key == 0) return FALSE;
li = (struct line_info*)Line->Key;
li = Line->Key;
/* things are a bit complicated because when we encounter a DLIT_SOURCEFILE
* element we have to go back until we find the prev one to get the real
* source file name for the DLIT_OFFSET element just before
......@@ -1523,7 +1523,7 @@ BOOL symt_get_func_line_next(const struct module* module, PIMAGEHLP_LINE line)
struct line_info* li;
if (line->Key == 0) return FALSE;
li = (struct line_info*)line->Key;
li = line->Key;
while (!li->is_last)
{
li++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment