From 442b34415aab3edfcb6cac178c9e9e324a8ae1ea Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 27 Jul 2012 14:09:40 +0200 Subject: [PATCH] winedbg: Simplify the "pointer to start of array" idiom. --- programs/winedbg/gdbproxy.c | 2 +- programs/winedbg/tgt_minidump.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index 58b22028580..ff845d29fbb 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -1789,7 +1789,7 @@ static enum packet_return packet_query_remote_command(struct gdb_context* gdbctx len /= 2; hex_from(buffer, hxcmd, len); - for (qd = &query_details[0]; qd->name != NULL; qd++) + for (qd = query_details; qd->name != NULL; qd++) { if (len < qd->len || strncmp(buffer, qd->name, qd->len) != 0) continue; if (!qd->with_arg && len != qd->len) continue; diff --git a/programs/winedbg/tgt_minidump.c b/programs/winedbg/tgt_minidump.c index c346070e949..b374f42b94e 100644 --- a/programs/winedbg/tgt_minidump.c +++ b/programs/winedbg/tgt_minidump.c @@ -102,7 +102,7 @@ static BOOL tgt_process_minidump_read(HANDLE hProcess, const void* addr, MemoryListStream, NULL, &stream, NULL)) { MINIDUMP_MEMORY_LIST* mml = stream; - MINIDUMP_MEMORY_DESCRIPTOR* mmd = &mml->MemoryRanges[0]; + MINIDUMP_MEMORY_DESCRIPTOR* mmd = mml->MemoryRanges; int i, found = -1; SIZE_T ilen, prev_len = 0; @@ -176,7 +176,7 @@ static BOOL is_pe_module_embedded(struct tgt_process_minidump_data* data, MINIDUMP_MODULE* mm; unsigned i; - for (i = 0, mm = &mml->Modules[0]; i < mml->NumberOfModules; i++, mm++) + for (i = 0, mm = mml->Modules; i < mml->NumberOfModules; i++, mm++) { if (get_addr64(mm->BaseOfImage) <= get_addr64(pe_mm->BaseOfImage) && get_addr64(mm->BaseOfImage) + mm->SizeOfImage >= get_addr64(pe_mm->BaseOfImage) + pe_mm->SizeOfImage) @@ -218,7 +218,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) { WCHAR* ptr; - mm = &mml->Modules[0]; + mm = mml->Modules; mds = (MINIDUMP_STRING*)((char*)data->mapping + mm->ModuleNameRva); len = mds->Length / 2; memcpy(exec_name, mds->Buffer, mds->Length); @@ -369,7 +369,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) WCHAR buffer[MAX_PATH]; mml = stream; - for (i = 0, mm = &mml->Modules[0]; i < mml->NumberOfModules; i++, mm++) + for (i = 0, mm = mml->Modules; i < mml->NumberOfModules; i++, mm++) { mds = (MINIDUMP_STRING*)((char*)data->mapping + mm->ModuleNameRva); memcpy(nameW, mds->Buffer, mds->Length); @@ -388,7 +388,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) WCHAR buffer[MAX_PATH]; mml = stream; - for (i = 0, mm = &mml->Modules[0]; i < mml->NumberOfModules; i++, mm++) + for (i = 0, mm = mml->Modules; i < mml->NumberOfModules; i++, mm++) { mds = (MINIDUMP_STRING*)((char*)data->mapping + mm->ModuleNameRva); memcpy(nameW, mds->Buffer, mds->Length);