winedump: Use BOOL type where appropriate.
This commit is contained in:
parent
ee681d5a48
commit
cd99b5a773
|
@ -101,7 +101,7 @@
|
||||||
extern const IMAGE_NT_HEADERS* PE_nt_headers;
|
extern const IMAGE_NT_HEADERS* PE_nt_headers;
|
||||||
static const void* cv_base /* = 0 */;
|
static const void* cv_base /* = 0 */;
|
||||||
|
|
||||||
static int dump_cv_sst_module(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_module(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
const OMFModule* module;
|
const OMFModule* module;
|
||||||
const OMFSegDesc* segDesc;
|
const OMFSegDesc* segDesc;
|
||||||
|
@ -130,7 +130,7 @@ static int dump_cv_sst_module(const OMFDirEntry* omfde)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_global_pub(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_global_pub(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
long fileoffset;
|
long fileoffset;
|
||||||
const OMFSymHash* header;
|
const OMFSymHash* header;
|
||||||
|
@ -153,25 +153,25 @@ static int dump_cv_sst_global_pub(const OMFDirEntry* omfde)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_global_sym(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_global_sym(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
/*** NOT YET IMPLEMENTED ***/
|
/*** NOT YET IMPLEMENTED ***/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_static_sym(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_static_sym(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
/*** NOT YET IMPLEMENTED ***/
|
/*** NOT YET IMPLEMENTED ***/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_libraries(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_libraries(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
/*** NOT YET IMPLEMENTED ***/
|
/*** NOT YET IMPLEMENTED ***/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_global_types(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_global_types(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
long fileoffset;
|
long fileoffset;
|
||||||
const OMFGlobalTypes*types;
|
const OMFGlobalTypes*types;
|
||||||
|
@ -200,7 +200,7 @@ static int dump_cv_sst_global_types(const OMFDirEntry* omfde)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_seg_map(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_seg_map(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
const OMFSegMap* segMap;
|
const OMFSegMap* segMap;
|
||||||
const OMFSegMapDesc* segMapDesc;
|
const OMFSegMapDesc* segMapDesc;
|
||||||
|
@ -231,13 +231,13 @@ static int dump_cv_sst_seg_map(const OMFDirEntry* omfde)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_file_index(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_file_index(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
/*** NOT YET IMPLEMENTED ***/
|
/*** NOT YET IMPLEMENTED ***/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_src_module(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_src_module(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
const BYTE* rawdata;
|
const BYTE* rawdata;
|
||||||
|
@ -327,7 +327,7 @@ static int dump_cv_sst_src_module(const OMFDirEntry* omfde)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dump_cv_sst_align_sym(const OMFDirEntry* omfde)
|
static BOOL dump_cv_sst_align_sym(const OMFDirEntry* omfde)
|
||||||
{
|
{
|
||||||
const char* rawdata = PRD(Offset(cv_base) + omfde->lfo, omfde->cb);
|
const char* rawdata = PRD(Offset(cv_base) + omfde->lfo, omfde->cb);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ static void do_include (const char *arg)
|
||||||
free(globals.directory);
|
free(globals.directory);
|
||||||
globals.directory = newIncludes;
|
globals.directory = newIncludes;
|
||||||
}
|
}
|
||||||
globals.do_code = 1;
|
globals.do_code = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,8 +68,8 @@ static void do_demangle (const char *arg)
|
||||||
{
|
{
|
||||||
if (globals.mode != NONE) fatal("Only one mode can be specified\n");
|
if (globals.mode != NONE) fatal("Only one mode can be specified\n");
|
||||||
globals.mode = DMGL;
|
globals.mode = DMGL;
|
||||||
globals.do_code = 1;
|
globals.do_code = TRUE;
|
||||||
globals.do_demangle = 1;
|
globals.do_demangle = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,44 +77,44 @@ static void do_dump (const char *arg)
|
||||||
{
|
{
|
||||||
if (globals.mode != NONE) fatal("Only one mode can be specified\n");
|
if (globals.mode != NONE) fatal("Only one mode can be specified\n");
|
||||||
globals.mode = DUMP;
|
globals.mode = DUMP;
|
||||||
globals.do_code = 1;
|
globals.do_code = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void do_code (const char *arg)
|
static void do_code (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_code = 1;
|
globals.do_code = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void do_trace (const char *arg)
|
static void do_trace (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_trace = 1;
|
globals.do_trace = TRUE;
|
||||||
globals.do_code = 1;
|
globals.do_code = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void do_forward (const char *arg)
|
static void do_forward (const char *arg)
|
||||||
{
|
{
|
||||||
globals.forward_dll = arg;
|
globals.forward_dll = arg;
|
||||||
globals.do_trace = 1;
|
globals.do_trace = TRUE;
|
||||||
globals.do_code = 1;
|
globals.do_code = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_document (const char *arg)
|
static void do_document (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_documentation = 1;
|
globals.do_documentation = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_cdecl (const char *arg)
|
static void do_cdecl (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_cdecl = 1;
|
globals.do_cdecl = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void do_quiet (const char *arg)
|
static void do_quiet (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_quiet = 1;
|
globals.do_quiet = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,18 +160,18 @@ static void do_symfile (const char *arg)
|
||||||
|
|
||||||
static void do_verbose (const char *arg)
|
static void do_verbose (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_verbose = 1;
|
globals.do_verbose = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void do_symdmngl (const char *arg)
|
static void do_symdmngl (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_demangle = 1;
|
globals.do_demangle = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_dumphead (const char *arg)
|
static void do_dumphead (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_dumpheader = 1;
|
globals.do_dumpheader = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_dumpsect (const char* arg)
|
static void do_dumpsect (const char* arg)
|
||||||
|
@ -181,20 +181,20 @@ static void do_dumpsect (const char* arg)
|
||||||
|
|
||||||
static void do_rawdebug (const char *arg)
|
static void do_rawdebug (const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_debug = 1;
|
globals.do_debug = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_dumpall(const char *arg)
|
static void do_dumpall(const char *arg)
|
||||||
{
|
{
|
||||||
globals.do_dumpheader = 1;
|
globals.do_dumpheader = TRUE;
|
||||||
globals.do_dump_rawdata = 1;
|
globals.do_dump_rawdata = TRUE;
|
||||||
globals.do_symbol_table = 1;
|
globals.do_symbol_table = TRUE;
|
||||||
globals.dumpsect = "ALL";
|
globals.dumpsect = "ALL";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_symtable(const char* arg)
|
static void do_symtable(const char* arg)
|
||||||
{
|
{
|
||||||
globals.do_symbol_table = 1;
|
globals.do_symbol_table = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct my_option
|
struct my_option
|
||||||
|
@ -346,15 +346,15 @@ static void set_module_name(unsigned setUC)
|
||||||
|
|
||||||
/* Marks the symbol as 'found'! */
|
/* Marks the symbol as 'found'! */
|
||||||
/* return: perform-search */
|
/* return: perform-search */
|
||||||
static int symbol_searched(int count, const char *symbolname)
|
static BOOL symbol_searched(int count, const char *symbolname)
|
||||||
{
|
{
|
||||||
search_symbol *search_symbol;
|
search_symbol *search_symbol;
|
||||||
|
|
||||||
if (!(count >= globals.start_ordinal
|
if (!(count >= globals.start_ordinal
|
||||||
&& (!globals.end_ordinal || count <= globals.end_ordinal)))
|
&& (!globals.end_ordinal || count <= globals.end_ordinal)))
|
||||||
return 0;
|
return FALSE;
|
||||||
if (!globals.search_symbol)
|
if (!globals.search_symbol)
|
||||||
return 1;
|
return TRUE;
|
||||||
for (search_symbol = globals.search_symbol;
|
for (search_symbol = globals.search_symbol;
|
||||||
search_symbol;
|
search_symbol;
|
||||||
search_symbol = search_symbol->next)
|
search_symbol = search_symbol->next)
|
||||||
|
@ -362,17 +362,17 @@ static int symbol_searched(int count, const char *symbolname)
|
||||||
if (!strcmp(symbolname, search_symbol->symbolname))
|
if (!strcmp(symbolname, search_symbol->symbolname))
|
||||||
{
|
{
|
||||||
search_symbol->found = 1;
|
search_symbol->found = 1;
|
||||||
return 1;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return: some symbols weren't found */
|
/* return: some symbols weren't found */
|
||||||
static int symbol_finish(void)
|
static BOOL symbol_finish(void)
|
||||||
{
|
{
|
||||||
const search_symbol *search_symbol;
|
const search_symbol *search_symbol;
|
||||||
int started = 0;
|
BOOL started = FALSE;
|
||||||
|
|
||||||
for (search_symbol = globals.search_symbol;
|
for (search_symbol = globals.search_symbol;
|
||||||
search_symbol;
|
search_symbol;
|
||||||
|
@ -384,7 +384,7 @@ static int symbol_finish(void)
|
||||||
{
|
{
|
||||||
/* stderr? not a practice here */
|
/* stderr? not a practice here */
|
||||||
puts("These requested <symfile> symbols weren't found:");
|
puts("These requested <symfile> symbols weren't found:");
|
||||||
started = 1;
|
started = TRUE;
|
||||||
}
|
}
|
||||||
printf("\t%s\n",search_symbol->symbolname);
|
printf("\t%s\n",search_symbol->symbolname);
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ int main (int argc, char *argv[])
|
||||||
switch (globals.mode)
|
switch (globals.mode)
|
||||||
{
|
{
|
||||||
case DMGL:
|
case DMGL:
|
||||||
VERBOSE = 1;
|
VERBOSE = TRUE;
|
||||||
|
|
||||||
if (globals.input_name == NULL)
|
if (globals.input_name == NULL)
|
||||||
fatal("No symbol name has been given\n");
|
fatal("No symbol name has been given\n");
|
||||||
|
|
|
@ -867,7 +867,7 @@ static void codeview_dump_one_type(unsigned curr_type, const union codeview_type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int codeview_dump_types_from_offsets(const void* table, const DWORD* offsets, unsigned num_types)
|
BOOL codeview_dump_types_from_offsets(const void* table, const DWORD* offsets, unsigned num_types)
|
||||||
{
|
{
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
|
|
||||||
|
@ -880,7 +880,7 @@ int codeview_dump_types_from_offsets(const void* table, const DWORD* offsets, un
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int codeview_dump_types_from_block(const void* table, unsigned long len)
|
BOOL codeview_dump_types_from_block(const void* table, unsigned long len)
|
||||||
{
|
{
|
||||||
unsigned int curr_type = 0x1000;
|
unsigned int curr_type = 0x1000;
|
||||||
const unsigned char*ptr = table;
|
const unsigned char*ptr = table;
|
||||||
|
@ -897,7 +897,7 @@ int codeview_dump_types_from_block(const void* table, unsigned long len)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int codeview_dump_symbols(const void* root, unsigned long size)
|
BOOL codeview_dump_symbols(const void* root, unsigned long size)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int length;
|
int length;
|
||||||
|
@ -1380,7 +1380,7 @@ int codeview_dump_symbols(const void* root, unsigned long size)
|
||||||
dump_data((const void*)sym, sym->generic.len + 2, " ");
|
dump_data((const void*)sym, sym->generic.len + 2, " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void codeview_dump_linetab(const char* linetab, BOOL pascal_str, const char* pfx)
|
void codeview_dump_linetab(const char* linetab, BOOL pascal_str, const char* pfx)
|
||||||
|
|
|
@ -280,8 +280,8 @@ void output_c_preamble (void)
|
||||||
void output_c_symbol (const parsed_symbol *sym)
|
void output_c_symbol (const parsed_symbol *sym)
|
||||||
{
|
{
|
||||||
unsigned int i, start = sym->flags & SYM_THISCALL ? 1 : 0;
|
unsigned int i, start = sym->flags & SYM_THISCALL ? 1 : 0;
|
||||||
int is_void;
|
BOOL is_void;
|
||||||
static int has_thiscall = 0;
|
static BOOL has_thiscall = FALSE;
|
||||||
|
|
||||||
assert (cfile);
|
assert (cfile);
|
||||||
assert (sym && sym->symbol);
|
assert (sym && sym->symbol);
|
||||||
|
@ -313,7 +313,7 @@ void output_c_symbol (const parsed_symbol *sym)
|
||||||
"#define THISCALL_NAME(func) __ASM_NAME(#func)\n"
|
"#define THISCALL_NAME(func) __ASM_NAME(#func)\n"
|
||||||
"#define DEFINE_THISCALL_WRAPPER(func) /* nothing */\n\n"
|
"#define DEFINE_THISCALL_WRAPPER(func) /* nothing */\n\n"
|
||||||
"#endif /* __i386__ */\n\n", cfile);
|
"#endif /* __i386__ */\n\n", cfile);
|
||||||
has_thiscall = 1;
|
has_thiscall = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
output_c_banner(sym);
|
output_c_banner(sym);
|
||||||
|
|
|
@ -264,13 +264,13 @@ int symbol_get_type (const char *string)
|
||||||
|
|
||||||
if (VERBOSE)
|
if (VERBOSE)
|
||||||
{
|
{
|
||||||
int known = 0;
|
BOOL known = FALSE;
|
||||||
|
|
||||||
tab = known_longs;
|
tab = known_longs;
|
||||||
while (*tab++)
|
while (*tab++)
|
||||||
if (strstr (string, tab[-1]))
|
if (strstr (string, tab[-1]))
|
||||||
{
|
{
|
||||||
known = 1;
|
known = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Unknown types passed by value can be 'grep'ed out for fixup later */
|
/* Unknown types passed by value can be 'grep'ed out for fixup later */
|
||||||
|
|
|
@ -105,25 +105,25 @@ typedef struct __globals
|
||||||
Mode mode; /* SPEC, DEMANGLE or DUMP */
|
Mode mode; /* SPEC, DEMANGLE or DUMP */
|
||||||
|
|
||||||
/* Options: generic */
|
/* Options: generic */
|
||||||
int do_quiet; /* -q */
|
BOOL do_quiet; /* -q */
|
||||||
int do_verbose; /* -v */
|
BOOL do_verbose; /* -v */
|
||||||
|
|
||||||
/* Option arguments: generic */
|
/* Option arguments: generic */
|
||||||
const char *input_name; /* */
|
const char *input_name; /* */
|
||||||
const char *input_module; /* input module name generated after input_name according mode */
|
const char *input_module; /* input module name generated after input_name according mode */
|
||||||
|
|
||||||
/* Options: spec mode */
|
/* Options: spec mode */
|
||||||
int do_code; /* -c, -t, -f */
|
BOOL do_code; /* -c, -t, -f */
|
||||||
int do_trace; /* -t, -f */
|
BOOL do_trace; /* -t, -f */
|
||||||
int do_cdecl; /* -C */
|
BOOL do_cdecl; /* -C */
|
||||||
int do_documentation; /* -D */
|
BOOL do_documentation; /* -D */
|
||||||
|
|
||||||
/* Options: dump mode */
|
/* Options: dump mode */
|
||||||
int do_demangle; /* -d */
|
BOOL do_demangle; /* -d */
|
||||||
int do_dumpheader; /* -f */
|
BOOL do_dumpheader; /* -f */
|
||||||
int do_dump_rawdata; /* -x */
|
BOOL do_dump_rawdata; /* -x */
|
||||||
int do_debug; /* -G == 1, -g == 2 */
|
BOOL do_debug; /* -G == 1, -g == 2 */
|
||||||
int do_symbol_table; /* -t */
|
BOOL do_symbol_table; /* -t */
|
||||||
|
|
||||||
/* Option arguments: spec mode */
|
/* Option arguments: spec mode */
|
||||||
int start_ordinal; /* -s */
|
int start_ordinal; /* -s */
|
||||||
|
@ -256,9 +256,9 @@ void fnt_dump( void );
|
||||||
enum FileSig get_kind_msft(void);
|
enum FileSig get_kind_msft(void);
|
||||||
void msft_dump(void);
|
void msft_dump(void);
|
||||||
|
|
||||||
int codeview_dump_symbols(const void* root, unsigned long size);
|
BOOL codeview_dump_symbols(const void* root, unsigned long size);
|
||||||
int codeview_dump_types_from_offsets(const void* table, const DWORD* offsets, unsigned num_types);
|
BOOL codeview_dump_types_from_offsets(const void* table, const DWORD* offsets, unsigned num_types);
|
||||||
int codeview_dump_types_from_block(const void* table, unsigned long len);
|
BOOL codeview_dump_types_from_block(const void* table, unsigned long len);
|
||||||
void codeview_dump_linetab(const char* linetab, BOOL pascal_str, const char* pfx);
|
void codeview_dump_linetab(const char* linetab, BOOL pascal_str, const char* pfx);
|
||||||
void codeview_dump_linetab2(const char* linetab, DWORD size, const char* strimage, DWORD strsize, const char* pfx);
|
void codeview_dump_linetab2(const char* linetab, DWORD size, const char* strimage, DWORD strsize, const char* pfx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue