Fix the trivial compiler warnings in debugger/ when compiling with -W
- moved inline statements to front
- fixed the trivial cases of signed/unsigned comparisons
diff --git a/debugger/expr.c b/debugger/expr.c
index 3352c33..1051efa 100644
--- a/debugger/expr.c
+++ b/debugger/expr.c
@@ -106,7 +106,7 @@
#define EXPR_TYPE_CAST 11
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.
diff --git a/debugger/module.c b/debugger/module.c
index ee7c2d1..20176dc 100644
--- a/debugger/module.c
+++ b/debugger/module.c
@@ -304,7 +304,7 @@
DBG_VALUE value;
char buffer[512];
char bufstr[256];
- int i;
+ unsigned int i;
IMAGE_SECTION_HEADER pe_seg;
DWORD pe_seg_ofs;
IMAGE_DATA_DIRECTORY dir;
@@ -351,7 +351,7 @@
WORD* ordinals = NULL;
void** functions = NULL;
DWORD* names = NULL;
- int j;
+ unsigned int j;
if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir.VirtualAddress),
&exports, sizeof(exports)) &&
@@ -512,7 +512,7 @@
*
* 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)
{
return wmod_cntnr->load_addr < wmod_child->load_addr &&
diff --git a/debugger/msc.c b/debugger/msc.c
index 97719a6..41cb1d0 100644
--- a/debugger/msc.c
+++ b/debugger/msc.c
@@ -214,9 +214,10 @@
PIMAGE_SYMBOL coff_symbols;
struct CoffFileSet coff_files;
int curr_file_idx = -1;
- int i;
- int j;
- int k;
+ unsigned int i;
+ int j;
+ int k;
+ int l;
int linetab_indx;
const char * nampnt;
int naux;
@@ -476,7 +477,7 @@
*/
for(j=0; j < coff_files.nfiles; j++)
{
- i = 0;
+ l = 0;
if( coff_files.files[j].neps != 0 )
for(k=0; k < coff_files.files[j].linecnt; k++)
{
@@ -487,12 +488,12 @@
*/
while(TRUE)
{
- if (i+1 >= coff_files.files[j].neps) break;
- DEBUG_GetSymbolAddr(coff_files.files[j].entries[i+1], &new_value.addr);
+ if (l+1 >= coff_files.files[j].neps) break;
+ DEBUG_GetSymbolAddr(coff_files.files[j].entries[l+1], &new_value.addr);
if( (((unsigned int)module->load_addr +
linepnt->Type.VirtualAddress) >= new_value.addr.off) )
{
- i++;
+ l++;
} else break;
}
@@ -501,8 +502,8 @@
* start of the function, so we need to subtract that offset
* first.
*/
- DEBUG_GetSymbolAddr(coff_files.files[j].entries[i], &new_value.addr);
- DEBUG_AddLineNumber(coff_files.files[j].entries[i],
+ DEBUG_GetSymbolAddr(coff_files.files[j].entries[l], &new_value.addr);
+ DEBUG_AddLineNumber(coff_files.files[j].entries[l],
linepnt->Linenumber,
(unsigned int) module->load_addr
+ linepnt->Type.VirtualAddress
@@ -1092,7 +1093,7 @@
#define MAX_BUILTIN_TYPES 0x480
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;
void
@@ -2041,7 +2042,8 @@
static struct name_hash *
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 )
{
int nsect = module->msc_info->nsect;
@@ -2106,7 +2108,7 @@
*/
if ( linetab )
{
- int i;
+ unsigned int i;
for ( i = 0; i < linetab->nline; i++ )
if ( linetab->offtab[i] >= offset
&& linetab->offtab[i] < offset + size )
@@ -2448,11 +2450,11 @@
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;
WORD *block_list;
- int i;
+ DWORD i;
if ( !toc || fileNr >= toc->nFiles )
return NULL;
@@ -2768,7 +2770,7 @@
{
PCV_DIRECTORY_HEADER hdr = (PCV_DIRECTORY_HEADER)(root + cv->lfoDirectory);
PCV_DIRECTORY_ENTRY ent, prev, next;
- int i;
+ unsigned int i;
ent = (PCV_DIRECTORY_ENTRY)((LPBYTE)hdr + hdr->cbDirHeader);
for ( i = 0; i < hdr->cDir; i++, ent = next )
diff --git a/debugger/stabs.c b/debugger/stabs.c
index 90aebf2..c6b5e52 100644
--- a/debugger/stabs.c
+++ b/debugger/stabs.c
@@ -264,7 +264,7 @@
static int DEBUG_PTS_ReadID(struct ParseTypedefData* ptd)
{
char* first = ptd->ptr;
- int len;
+ unsigned int len;
if ((ptd->ptr = strchr(ptd->ptr, ':')) == NULL) return -1;
len = ptd->ptr - first;
@@ -316,7 +316,7 @@
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;
char* last;
@@ -356,7 +356,7 @@
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 idx;
@@ -373,7 +373,7 @@
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;
struct datatype* rdt;
@@ -612,12 +612,12 @@
int i;
int in_external_file = FALSE;
int last_nso = -1;
- int len;
+ unsigned int len;
DBG_VALUE new_value;
int nstab;
char * ptr;
char * stabbuff;
- int stabbufflen;
+ unsigned int stabbufflen;
struct stab_nlist * stab_ptr;
char * strs;
int strtabinc;