winedump: Simplify the "pointer to start of array" idiom.

This commit is contained in:
Michael Stefaniuc 2012-07-23 10:37:06 +02:00 committed by Alexandre Julliard
parent 9318528702
commit 19c9d08304
3 changed files with 9 additions and 9 deletions

View File

@ -500,7 +500,7 @@ static const char *get_coff_name( const IMAGE_SYMBOL *coff_sym, const char *coff
{ {
memcpy(namebuff, coff_sym->N.ShortName, 8); memcpy(namebuff, coff_sym->N.ShortName, 8);
namebuff[8] = '\0'; namebuff[8] = '\0';
nampnt = &namebuff[0]; nampnt = namebuff;
} }
else else
{ {

View File

@ -102,7 +102,7 @@ void mdmp_dump(void)
case ThreadListStream: case ThreadListStream:
{ {
const MINIDUMP_THREAD_LIST* mtl = (const MINIDUMP_THREAD_LIST*)stream; const MINIDUMP_THREAD_LIST* mtl = (const MINIDUMP_THREAD_LIST*)stream;
const MINIDUMP_THREAD* mt = &mtl->Threads[0]; const MINIDUMP_THREAD* mt = mtl->Threads;
unsigned int i; unsigned int i;
printf("Threads: %u\n", mtl->NumberOfThreads); printf("Threads: %u\n", mtl->NumberOfThreads);
@ -129,7 +129,7 @@ void mdmp_dump(void)
case 0xFFF0: case 0xFFF0:
{ {
const MINIDUMP_MODULE_LIST* mml = (const MINIDUMP_MODULE_LIST*)stream; const MINIDUMP_MODULE_LIST* mml = (const MINIDUMP_MODULE_LIST*)stream;
const MINIDUMP_MODULE* mm = &mml->Modules[0]; const MINIDUMP_MODULE* mm = mml->Modules;
unsigned int i; unsigned int i;
const char* p1; const char* p1;
const char* p2; const char* p2;
@ -224,7 +224,7 @@ void mdmp_dump(void)
case MemoryListStream: case MemoryListStream:
{ {
const MINIDUMP_MEMORY_LIST* mml = (const MINIDUMP_MEMORY_LIST*)stream; const MINIDUMP_MEMORY_LIST* mml = (const MINIDUMP_MEMORY_LIST*)stream;
const MINIDUMP_MEMORY_DESCRIPTOR* mmd = &mml->MemoryRanges[0]; const MINIDUMP_MEMORY_DESCRIPTOR* mmd = mml->MemoryRanges;
unsigned int i; unsigned int i;
printf("Memory Ranges: %u\n", mml->NumberOfMemoryRanges); printf("Memory Ranges: %u\n", mml->NumberOfMemoryRanges);
@ -333,7 +333,7 @@ void mdmp_dump(void)
if (msi->ProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) if (msi->ProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
{ {
printf(" x86.VendorId: %.12s\n", printf(" x86.VendorId: %.12s\n",
(const char*)&msi->Cpu.X86CpuInfo.VendorId[0]); (const char*)msi->Cpu.X86CpuInfo.VendorId);
printf(" x86.VersionInformation: %x\n", printf(" x86.VersionInformation: %x\n",
msi->Cpu.X86CpuInfo.VersionInformation); msi->Cpu.X86CpuInfo.VersionInformation);
printf(" x86.FeatureInformation: %x\n", printf(" x86.FeatureInformation: %x\n",

View File

@ -174,12 +174,12 @@ static unsigned get_stream_by_name(struct pdb_reader* reader, const char* name)
if (reader->read_file == pdb_jg_read_file) if (reader->read_file == pdb_jg_read_file)
{ {
str = &reader->u.jg.root->names[0]; str = reader->u.jg.root->names;
cbstr = reader->u.jg.root->cbNames; cbstr = reader->u.jg.root->cbNames;
} }
else else
{ {
str = &reader->u.ds.root->names[0]; str = reader->u.ds.root->names;
cbstr = reader->u.ds.root->cbNames; cbstr = reader->u.ds.root->cbNames;
} }
@ -740,7 +740,7 @@ static void pdb_jg_dump(void)
reader.u.jg.root->Age, reader.u.jg.root->Age,
(unsigned)reader.u.jg.root->cbNames); (unsigned)reader.u.jg.root->cbNames);
pdw = (DWORD*)(&reader.u.jg.root->names[0] + reader.u.jg.root->cbNames); pdw = (DWORD*)(reader.u.jg.root->names + reader.u.jg.root->cbNames);
numok = *pdw++; numok = *pdw++;
count = *pdw++; count = *pdw++;
printf("\tStreams directory:\n" printf("\tStreams directory:\n"
@ -895,7 +895,7 @@ static void pdb_ds_dump(void)
reader.u.ds.root->Age, reader.u.ds.root->Age,
get_guid_str(&reader.u.ds.root->guid), get_guid_str(&reader.u.ds.root->guid),
reader.u.ds.root->cbNames); reader.u.ds.root->cbNames);
pdw = (DWORD*)(&reader.u.ds.root->names[0] + reader.u.ds.root->cbNames); pdw = (DWORD*)(reader.u.ds.root->names + reader.u.ds.root->cbNames);
numok = *pdw++; numok = *pdw++;
count = *pdw++; count = *pdw++;
printf("\tStreams directory:\n" printf("\tStreams directory:\n"