winedump: Const correctness fixes.
This commit is contained in:
parent
07dfb1ae27
commit
a6e27ea9c0
|
@ -228,15 +228,15 @@ static void dump_le_header( const IMAGE_VXD_HEADER *le )
|
||||||
|
|
||||||
static void dump_le_objects( const void *base, const IMAGE_VXD_HEADER *le )
|
static void dump_le_objects( const void *base, const IMAGE_VXD_HEADER *le )
|
||||||
{
|
{
|
||||||
struct o32_obj *pobj;
|
const struct o32_obj *pobj;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
printf("\nObject table:\n");
|
printf("\nObject table:\n");
|
||||||
pobj = (struct o32_obj *)((const unsigned char *)le + le->e32_objtab);
|
pobj = (const struct o32_obj *)((const unsigned char *)le + le->e32_objtab);
|
||||||
for (i = 0; i < le->e32_objcnt; i++)
|
for (i = 0; i < le->e32_objcnt; i++)
|
||||||
{
|
{
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
struct o32_map *pmap=0;
|
const struct o32_map *pmap=0;
|
||||||
|
|
||||||
printf(" Obj. Rel.Base Codesize Flags Tableidx Tablesize Name\n");
|
printf(" Obj. Rel.Base Codesize Flags Tableidx Tablesize Name\n");
|
||||||
printf(" %04X %08lx %08lx %08lx %08lx %08lx ", i + 1,
|
printf(" %04X %08lx %08lx %08lx %08lx %08lx ", i + 1,
|
||||||
|
@ -272,7 +272,7 @@ static void dump_le_objects( const void *base, const IMAGE_VXD_HEADER *le )
|
||||||
|
|
||||||
printf(" Page tables:\n");
|
printf(" Page tables:\n");
|
||||||
printf(" Tableidx Offset Flags\n");
|
printf(" Tableidx Offset Flags\n");
|
||||||
pmap = (struct o32_map *)((const unsigned char *)le + le->e32_objmap);
|
pmap = (const struct o32_map *)((const unsigned char *)le + le->e32_objmap);
|
||||||
pmap = &(pmap[pobj->o32_pagemap - 1]);
|
pmap = &(pmap[pobj->o32_pagemap - 1]);
|
||||||
for (j = 0; j < pobj->o32_mapsize; j++)
|
for (j = 0; j < pobj->o32_mapsize; j++)
|
||||||
{
|
{
|
||||||
|
@ -300,7 +300,7 @@ static void dump_le_names( const void *base, const IMAGE_VXD_HEADER *le )
|
||||||
if (le->e32_cbnrestab)
|
if (le->e32_cbnrestab)
|
||||||
{
|
{
|
||||||
printf( "\nNon-resident name table:\n" );
|
printf( "\nNon-resident name table:\n" );
|
||||||
pstr = (unsigned char *)base + le->e32_nrestab;
|
pstr = (const unsigned char *)base + le->e32_nrestab;
|
||||||
while (*pstr)
|
while (*pstr)
|
||||||
{
|
{
|
||||||
printf( " %4d: %*.*s\n", get_word(pstr + *pstr + 1), *pstr, *pstr,
|
printf( " %4d: %*.*s\n", get_word(pstr + *pstr + 1), *pstr, *pstr,
|
||||||
|
|
|
@ -108,7 +108,7 @@ static void dump_ne_names( const void *base, const IMAGE_OS2_HEADER *ne )
|
||||||
if (ne->ne_cbnrestab)
|
if (ne->ne_cbnrestab)
|
||||||
{
|
{
|
||||||
printf( "\nNon-resident name table:\n" );
|
printf( "\nNon-resident name table:\n" );
|
||||||
pstr = (unsigned char *)base + ne->ne_nrestab;
|
pstr = (const unsigned char *)base + ne->ne_nrestab;
|
||||||
while (*pstr)
|
while (*pstr)
|
||||||
{
|
{
|
||||||
printf( " %4d: %*.*s\n", get_word(pstr + *pstr + 1), *pstr, *pstr, pstr + 1 );
|
printf( " %4d: %*.*s\n", get_word(pstr + *pstr + 1), *pstr, *pstr, pstr + 1 );
|
||||||
|
@ -171,7 +171,7 @@ static void dump_ne_resources( const void *base, const IMAGE_OS2_HEADER *ne )
|
||||||
static const char *get_export_name( const void *base, const IMAGE_OS2_HEADER *ne, int ordinal )
|
static const char *get_export_name( const void *base, const IMAGE_OS2_HEADER *ne, int ordinal )
|
||||||
{
|
{
|
||||||
static char name[256];
|
static char name[256];
|
||||||
BYTE *pstr;
|
const BYTE *pstr;
|
||||||
int pass = 0;
|
int pass = 0;
|
||||||
|
|
||||||
/* search the resident names */
|
/* search the resident names */
|
||||||
|
@ -180,13 +180,13 @@ static const char *get_export_name( const void *base, const IMAGE_OS2_HEADER *ne
|
||||||
{
|
{
|
||||||
if (pass == 0) /* resident names */
|
if (pass == 0) /* resident names */
|
||||||
{
|
{
|
||||||
pstr = (BYTE *)ne + ne->ne_restab;
|
pstr = (const BYTE *)ne + ne->ne_restab;
|
||||||
if (*pstr) pstr += *pstr + 1 + sizeof(WORD); /* skip first entry (module name) */
|
if (*pstr) pstr += *pstr + 1 + sizeof(WORD); /* skip first entry (module name) */
|
||||||
}
|
}
|
||||||
else /* non-resident names */
|
else /* non-resident names */
|
||||||
{
|
{
|
||||||
if (!ne->ne_cbnrestab) break;
|
if (!ne->ne_cbnrestab) break;
|
||||||
pstr = (BYTE *)base + ne->ne_nrestab;
|
pstr = (const BYTE *)base + ne->ne_nrestab;
|
||||||
}
|
}
|
||||||
while (*pstr)
|
while (*pstr)
|
||||||
{
|
{
|
||||||
|
@ -207,8 +207,8 @@ static const char *get_export_name( const void *base, const IMAGE_OS2_HEADER *ne
|
||||||
|
|
||||||
static void dump_ne_exports( const void *base, const IMAGE_OS2_HEADER *ne )
|
static void dump_ne_exports( const void *base, const IMAGE_OS2_HEADER *ne )
|
||||||
{
|
{
|
||||||
BYTE *ptr = (BYTE *)ne + ne->ne_enttab;
|
const BYTE *ptr = (const BYTE *)ne + ne->ne_enttab;
|
||||||
BYTE *end = ptr + ne->ne_cbenttab;
|
const BYTE *end = ptr + ne->ne_cbenttab;
|
||||||
int i, ordinal = 1;
|
int i, ordinal = 1;
|
||||||
|
|
||||||
if (!ne->ne_cbenttab || !*ptr) return;
|
if (!ne->ne_cbenttab || !*ptr) return;
|
||||||
|
|
Loading…
Reference in New Issue