Fix the trivial compiler warnings in debugger/ when compiling with -W

- moved inline statements to front
- fixed the trivial cases of signed/unsigned comparisons
This commit is contained in:
Joerg Mayer 2000-12-26 01:28:51 +00:00 committed by Alexandre Julliard
parent 099f4c3786
commit d18140cef4
4 changed files with 27 additions and 25 deletions

View File

@ -106,7 +106,7 @@ struct expr
#define EXPR_TYPE_CAST 11 #define EXPR_TYPE_CAST 11
static char expr_list[4096]; static char expr_list[4096];
static int next_expr_free = 0; static unsigned int next_expr_free = 0;
/* /*
* This is how we turn an expression address into the actual value. * This is how we turn an expression address into the actual value.

View File

@ -304,7 +304,7 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
DBG_VALUE value; DBG_VALUE value;
char buffer[512]; char buffer[512];
char bufstr[256]; char bufstr[256];
int i; unsigned int i;
IMAGE_SECTION_HEADER pe_seg; IMAGE_SECTION_HEADER pe_seg;
DWORD pe_seg_ofs; DWORD pe_seg_ofs;
IMAGE_DATA_DIRECTORY dir; IMAGE_DATA_DIRECTORY dir;
@ -351,7 +351,7 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile,
WORD* ordinals = NULL; WORD* ordinals = NULL;
void** functions = NULL; void** functions = NULL;
DWORD* names = NULL; DWORD* names = NULL;
int j; unsigned int j;
if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir.VirtualAddress), if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir.VirtualAddress),
&exports, sizeof(exports)) && &exports, sizeof(exports)) &&
@ -512,7 +512,7 @@ static int DEBUG_ModuleCompare(const void* p1, const void* p2)
* *
* returns TRUE is wmod_child is contained (inside bounds) of wmod_cntnr * returns TRUE is wmod_child is contained (inside bounds) of wmod_cntnr
*/ */
static BOOL inline DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr, static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr,
const DBG_MODULE* wmod_child) const DBG_MODULE* wmod_child)
{ {
return wmod_cntnr->load_addr < wmod_child->load_addr && return wmod_cntnr->load_addr < wmod_child->load_addr &&

View File

@ -214,9 +214,10 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
PIMAGE_SYMBOL coff_symbols; PIMAGE_SYMBOL coff_symbols;
struct CoffFileSet coff_files; struct CoffFileSet coff_files;
int curr_file_idx = -1; int curr_file_idx = -1;
int i; unsigned int i;
int j; int j;
int k; int k;
int l;
int linetab_indx; int linetab_indx;
const char * nampnt; const char * nampnt;
int naux; int naux;
@ -476,7 +477,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
*/ */
for(j=0; j < coff_files.nfiles; j++) for(j=0; j < coff_files.nfiles; j++)
{ {
i = 0; l = 0;
if( coff_files.files[j].neps != 0 ) if( coff_files.files[j].neps != 0 )
for(k=0; k < coff_files.files[j].linecnt; k++) for(k=0; k < coff_files.files[j].linecnt; k++)
{ {
@ -487,12 +488,12 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
*/ */
while(TRUE) while(TRUE)
{ {
if (i+1 >= coff_files.files[j].neps) break; if (l+1 >= coff_files.files[j].neps) break;
DEBUG_GetSymbolAddr(coff_files.files[j].entries[i+1], &new_value.addr); DEBUG_GetSymbolAddr(coff_files.files[j].entries[l+1], &new_value.addr);
if( (((unsigned int)module->load_addr + if( (((unsigned int)module->load_addr +
linepnt->Type.VirtualAddress) >= new_value.addr.off) ) linepnt->Type.VirtualAddress) >= new_value.addr.off) )
{ {
i++; l++;
} else break; } else break;
} }
@ -501,8 +502,8 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root )
* start of the function, so we need to subtract that offset * start of the function, so we need to subtract that offset
* first. * first.
*/ */
DEBUG_GetSymbolAddr(coff_files.files[j].entries[i], &new_value.addr); DEBUG_GetSymbolAddr(coff_files.files[j].entries[l], &new_value.addr);
DEBUG_AddLineNumber(coff_files.files[j].entries[i], DEBUG_AddLineNumber(coff_files.files[j].entries[l],
linepnt->Linenumber, linepnt->Linenumber,
(unsigned int) module->load_addr (unsigned int) module->load_addr
+ linepnt->Type.VirtualAddress + linepnt->Type.VirtualAddress
@ -1092,7 +1093,7 @@ union codeview_fieldtype
#define MAX_BUILTIN_TYPES 0x480 #define MAX_BUILTIN_TYPES 0x480
static struct datatype * cv_basic_types[MAX_BUILTIN_TYPES]; static struct datatype * cv_basic_types[MAX_BUILTIN_TYPES];
static int num_cv_defined_types = 0; static unsigned int num_cv_defined_types = 0;
static struct datatype **cv_defined_types = NULL; static struct datatype **cv_defined_types = NULL;
void void
@ -2041,7 +2042,8 @@ DEBUG_MapCVOffset( DBG_MODULE *module, unsigned int offset )
static struct name_hash * static struct name_hash *
DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen, DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen,
int type, int seg, int offset, int size, int cookie, int flags, int type, unsigned int seg, unsigned int offset,
int size, int cookie, int flags,
struct codeview_linetab_hdr *linetab ) struct codeview_linetab_hdr *linetab )
{ {
int nsect = module->msc_info->nsect; int nsect = module->msc_info->nsect;
@ -2106,7 +2108,7 @@ DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen,
*/ */
if ( linetab ) if ( linetab )
{ {
int i; unsigned int i;
for ( i = 0; i < linetab->nline; i++ ) for ( i = 0; i < linetab->nline; i++ )
if ( linetab->offtab[i] >= offset if ( linetab->offtab[i] >= offset
&& linetab->offtab[i] < offset + size ) && linetab->offtab[i] < offset + size )
@ -2448,11 +2450,11 @@ static void *pdb_read( LPBYTE image, WORD *block_list, int size )
return buffer; return buffer;
} }
static void *pdb_read_file( LPBYTE image, PPDB_TOC toc, int fileNr ) static void *pdb_read_file( LPBYTE image, PPDB_TOC toc, DWORD fileNr )
{ {
PPDB_HEADER pdb = (PPDB_HEADER)image; PPDB_HEADER pdb = (PPDB_HEADER)image;
WORD *block_list; WORD *block_list;
int i; DWORD i;
if ( !toc || fileNr >= toc->nFiles ) if ( !toc || fileNr >= toc->nFiles )
return NULL; return NULL;
@ -2768,7 +2770,7 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root )
{ {
PCV_DIRECTORY_HEADER hdr = (PCV_DIRECTORY_HEADER)(root + cv->lfoDirectory); PCV_DIRECTORY_HEADER hdr = (PCV_DIRECTORY_HEADER)(root + cv->lfoDirectory);
PCV_DIRECTORY_ENTRY ent, prev, next; PCV_DIRECTORY_ENTRY ent, prev, next;
int i; unsigned int i;
ent = (PCV_DIRECTORY_ENTRY)((LPBYTE)hdr + hdr->cbDirHeader); ent = (PCV_DIRECTORY_ENTRY)((LPBYTE)hdr + hdr->cbDirHeader);
for ( i = 0; i < hdr->cDir; i++, ent = next ) for ( i = 0; i < hdr->cDir; i++, ent = next )

View File

@ -264,7 +264,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
static int DEBUG_PTS_ReadID(struct ParseTypedefData* ptd) static int DEBUG_PTS_ReadID(struct ParseTypedefData* ptd)
{ {
char* first = ptd->ptr; char* first = ptd->ptr;
int len; unsigned int len;
if ((ptd->ptr = strchr(ptd->ptr, ':')) == NULL) return -1; if ((ptd->ptr = strchr(ptd->ptr, ':')) == NULL) return -1;
len = ptd->ptr - first; len = ptd->ptr - first;
@ -316,7 +316,7 @@ static int DEBUG_PTS_ReadRange(struct ParseTypedefData* ptd, struct datatype** d
return 0; return 0;
} }
static int inline DEBUG_PTS_ReadAggregate(struct ParseTypedefData* ptd, struct datatype* sdt) static inline int DEBUG_PTS_ReadAggregate(struct ParseTypedefData* ptd, struct datatype* sdt)
{ {
int sz, ofs; int sz, ofs;
char* last; char* last;
@ -356,7 +356,7 @@ static int inline DEBUG_PTS_ReadAggregate(struct ParseTypedefData* ptd, struct d
return 0; return 0;
} }
static int inline DEBUG_PTS_ReadEnum(struct ParseTypedefData* ptd, struct datatype* edt) static inline int DEBUG_PTS_ReadEnum(struct ParseTypedefData* ptd, struct datatype* edt)
{ {
int ofs; int ofs;
int idx; int idx;
@ -373,7 +373,7 @@ static int inline DEBUG_PTS_ReadEnum(struct ParseTypedefData* ptd, struct dataty
return 0; return 0;
} }
static int inline DEBUG_PTS_ReadArray(struct ParseTypedefData* ptd, struct datatype* adt) static inline int DEBUG_PTS_ReadArray(struct ParseTypedefData* ptd, struct datatype* adt)
{ {
int lo, hi; int lo, hi;
struct datatype* rdt; struct datatype* rdt;
@ -612,12 +612,12 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset,
int i; int i;
int in_external_file = FALSE; int in_external_file = FALSE;
int last_nso = -1; int last_nso = -1;
int len; unsigned int len;
DBG_VALUE new_value; DBG_VALUE new_value;
int nstab; int nstab;
char * ptr; char * ptr;
char * stabbuff; char * stabbuff;
int stabbufflen; unsigned int stabbufflen;
struct stab_nlist * stab_ptr; struct stab_nlist * stab_ptr;
char * strs; char * strs;
int strtabinc; int strtabinc;