* cg_arcs.c (num_cycles): Change to unsigned int.
(numarcs): Likewise.
(arc_add): Change maxarcs to unsigned int.
(cg_assemble): Change index to unsigned int.
* cg_arcs.h (num_cycles, numarcs): Update declarations.
* cg_print.c (cg_print): Change index to unsigned int.
(cg_print_index): Change index, nnames, todo, i, and j to unsigned
int.
(cg_print_file_ordering): Change symbol_count and index2 to
unsigned int.
* core.c (symbol_map_count): Change to unsigned int.
(core_create_function_syms): Change j to unsigned int.
(core_create_line_syms): Add cast to avoid warning.
* hist.c (hist_assign_samples): Change j to unsigned int.
(hist_print): Change index to unsigned i nt. Add cast to avoid
warning.
* sym_ids.c (parse_spec): Add casts to avoid warning.
* symtab.c (symtab_finalize): Change j to unsigned int.
(sym_lookup): Update printf format strings.
* symtab.h (Sym_Table): Change len to unsigned int.
* tahoe.c (tahoe_reladdr): Add casts to avoid warnings.
+Sat Mar 28 23:09:08 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Fix some gcc -Wall warnings:
+ * cg_arcs.c (num_cycles): Change to unsigned int.
+ (numarcs): Likewise.
+ (arc_add): Change maxarcs to unsigned int.
+ (cg_assemble): Change index to unsigned int.
+ * cg_arcs.h (num_cycles, numarcs): Update declarations.
+ * cg_print.c (cg_print): Change index to unsigned int.
+ (cg_print_index): Change index, nnames, todo, i, and j to unsigned
+ int.
+ (cg_print_file_ordering): Change symbol_count and index2 to
+ unsigned int.
+ * core.c (symbol_map_count): Change to unsigned int.
+ (core_create_function_syms): Change j to unsigned int.
+ (core_create_line_syms): Add cast to avoid warning.
+ * hist.c (hist_assign_samples): Change j to unsigned int.
+ (hist_print): Change index to unsigned i nt. Add cast to avoid
+ warning.
+ * sym_ids.c (parse_spec): Add casts to avoid warning.
+ * symtab.c (symtab_finalize): Change j to unsigned int.
+ (sym_lookup): Update printf format strings.
+ * symtab.h (Sym_Table): Change len to unsigned int.
+ * tahoe.c (tahoe_reladdr): Add casts to avoid warnings.
+
Tue Mar 24 19:00:11 1998 Ian Lance Taylor <ian@cygnus.com>
Add --demangle and --no-demangle options:
#include "sym_ids.h"
Sym *cycle_header;
-int num_cycles;
+unsigned int num_cycles;
Arc **arcs;
-int numarcs;
+unsigned int numarcs;
/*
* Return TRUE iff PARENT has an arc to covers the address
DEFUN (arc_add, (parent, child, count),
Sym * parent AND Sym * child AND int count)
{
- static int maxarcs = 0;
+ static unsigned int maxarcs = 0;
Arc *arc, **newarcs;
DBG (TALLYDEBUG, printf ("[arc_add] %d arcs from %s to %s\n",
DEFUN_VOID (cg_assemble)
{
Sym *parent, **time_sorted_syms, **top_sorted_syms;
- long index;
+ unsigned int index;
Arc *arc;
/*
}
Arc;
-extern int num_cycles; /* number of cycles discovered */
+extern unsigned int num_cycles; /* number of cycles discovered */
extern Sym *cycle_header; /* cycle headers */
extern void arc_add PARAMS ((Sym * parent, Sym * child, int count));
extern Arc *arc_lookup PARAMS ((Sym * parent, Sym * child));
extern Sym **cg_assemble PARAMS ((void));
extern Arc **arcs;
-extern int numarcs;
+extern unsigned int numarcs;
#endif /* cg_arcs_h */
void
DEFUN (cg_print, (timesortsym), Sym ** timesortsym)
{
- int index;
+ unsigned int index;
Sym *parent;
if (print_descriptions && bsd_style_output)
void
DEFUN_VOID (cg_print_index)
{
- int index, nnames, todo, i, j, col, starting_col;
+ unsigned int index;
+ unsigned int nnames, todo, i, j;
+ int col, starting_col;
Sym **name_sorted_syms, *sym;
const char *filename;
char buf[20];
unsigned long scratch_arc_count, index;
Arc **scratch_arcs;
extern struct function_map *symbol_map;
- extern int symbol_map_count;
+ extern unsigned int symbol_map_count;
char *last;
scratch_arc_count = 0;
last = NULL;
for (index = 0; index < symbol_map_count; index++)
{
- int index2;
+ unsigned int index2;
/* Don't bother searching if this symbol is the
same as the previous one. */
};
struct function_map *symbol_map;
-int symbol_map_count;
+unsigned int symbol_map_count;
extern void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
{
bfd_vma min_vma = ~0, max_vma = 0;
int class;
- long i, j, found, skip;
+ long i, found, skip;
+ unsigned int j;
/* pass 1 - determine upper bound on number of function names: */
symtab.len = 0;
memcpy (ltab.limit, symtab.base, symtab.len * sizeof (Sym));
ltab.limit += symtab.len;
- if (ltab.limit - ltab.base != ltab.len)
+ if ((unsigned int) (ltab.limit - ltab.base) != ltab.len)
{
fprintf (stderr,
"%s: somebody miscounted: ltab.len=%d instead of %ld\n",
bfd_vma bin_low_pc, bin_high_pc;
bfd_vma sym_low_pc, sym_high_pc;
bfd_vma overlap, addr;
- int bin_count, i, j;
+ int bin_count, i;
+ unsigned int j;
double time, credit;
/* read samples and assign to symbols: */
DEFUN_VOID (hist_print)
{
Sym **time_sorted_syms, *top_dog, *sym;
- int index, log_scale;
+ unsigned int index;
+ int log_scale;
double top_time, time;
bfd_vma addr;
{
top_time /= hz;
while (SItab[log_scale].scale * top_time < 1000.0
- && log_scale < sizeof (SItab) / sizeof (SItab[0]) - 1)
+ && ((size_t) log_scale
+ < sizeof (SItab) / sizeof (SItab[0]) - 1))
{
++log_scale;
}
spec = colon + 1;
if (strlen (spec))
{
- if (isdigit (spec[0]))
+ if (isdigit ((unsigned char) spec[0]))
{
sym->line_num = atoi (spec);
}
sym->file = &non_existent_file;
}
}
- else if (isdigit (*spec))
+ else if (isdigit ((unsigned char) *spec))
{
sym->line_num = atoi (spec);
}
tab->len = tab->limit - tab->base;
DBG (AOUTDEBUG | IDDEBUG,
- int j;
+ unsigned int j;
for (j = 0; j < tab->len; ++j)
{
else
{
DBG (LOOKUPDEBUG,
- printf ("[sym_lookup] %d probes (symtab->len=%d)\n",
+ printf ("[sym_lookup] %d probes (symtab->len=%u)\n",
probes, symtab->len - 1));
return &sym[mid];
}
}
else
{
- DBG (LOOKUPDEBUG, printf ("[sym_lookup] %d (%d) probes, fall off\n",
+ DBG (LOOKUPDEBUG, printf ("[sym_lookup] %d (%u) probes, fall off\n",
probes, symtab->len - 1));
return &sym[mid + 1];
}
*/
typedef struct
{
- int len; /* # of symbols in this table */
+ unsigned int len; /* # of symbols in this table */
Sym *base; /* first element in symbol table */
Sym *limit; /* limit = base + len */
}
case byterel:
return (bfd_vma) (cp + sizeof *cp + *cp);
case wordrel:
- for (i = 0; i < sizeof *sp; i++)
+ for (i = 0; (size_t) i < sizeof *sp; i++)
value = (value << 8) + (cp[i] & 0xff);
return (bfd_vma) (cp + sizeof *sp + value);
case longrel:
- for (i = 0; i < sizeof *lp; i++)
+ for (i = 0; (size_t) i < sizeof *lp; i++)
value = (value << 8) + (cp[i] & 0xff);
return (bfd_vma) (cp + sizeof *lp + value);
}