Clean up compiler warnings:

* bcache.h, bcache.c, c-valprint.c, coffread.c, stabsread.c,
	stack.c, valprint.c: Change variables to unsigned.
	* bcache.c: Rearrange to avoid warnings about variables not being set.
	* c-lang.c, ch-lang.c, f-lang.c, m2-lang.c: Include valprint.h
	rather than declaring print_max and repeat_count_threashold
	ourselves (incorrectly).
	* valprint.h: Do declare repeat_count_threashold.
	* ch-exp.c: Use default case for internal error.
	* findvar.c: Don't omit argument type.
	* symtab.c: Remove unused variable.
This commit is contained in:
Jim Kingdon 2000-02-08 04:39:02 +00:00
parent 1171f8d754
commit 745b8ca0fc
16 changed files with 41 additions and 28 deletions

View file

@ -1,3 +1,17 @@
2000-02-07 Jim Kingdon <kingdon@redhat.com>
Clean up compiler warnings:
* bcache.h, bcache.c, c-valprint.c, coffread.c, stabsread.c,
stack.c, valprint.c: Change variables to unsigned.
* bcache.c: Rearrange to avoid warnings about variables not being set.
* c-lang.c, ch-lang.c, f-lang.c, m2-lang.c: Include valprint.h
rather than declaring print_max and repeat_count_threashold
ourselves (incorrectly).
* valprint.h: Do declare repeat_count_threashold.
* ch-exp.c: Use default case for internal error.
* findvar.c: Don't omit argument type.
* symtab.c: Remove unused variable.
2000-02-04 Nick Clifton <nickc@cygnus.com>
* config/arm/tm-arm.h (LOWEST_PC): Define.

View file

@ -85,19 +85,18 @@ expand_hash_table (struct bcache *bcache)
4194301, 8388617, 16777213, 33554467, 67108859, 134217757,
268435459, 536870923, 1073741827, 2147483659UL
};
int new_num_buckets;
unsigned int new_num_buckets;
struct bstring **new_buckets;
int i;
unsigned int i;
/* Find the next size. */
new_num_buckets = bcache->num_buckets * 2;
for (i = 0; i < (sizeof (sizes) / sizeof (sizes[0])); i++)
if (sizes[i] > bcache->num_buckets)
{
new_num_buckets = sizes[i];
break;
}
if (i >= (sizeof (sizes) / sizeof (sizes[0])))
new_num_buckets = bcache->num_buckets * 2;
/* Allocate the new table. */
{
@ -233,7 +232,7 @@ print_bcache_statistics (struct bcache *c, char *type)
/* Count the number of occupied buckets, and measure chain lengths. */
{
int b;
unsigned int b;
int *chain_length
= (int *) alloca (c->num_buckets * sizeof (*chain_length));
@ -275,7 +274,7 @@ print_bcache_statistics (struct bcache *c, char *type)
printf_filtered (" Cached '%s' statistics:\n", type);
printf_filtered (" Total object count: %ld\n", c->total_count);
printf_filtered (" Unique object count: %ld\n", c->unique_count);
printf_filtered (" Unique object count: %lu\n", c->unique_count);
printf_filtered (" Percentage of duplicates, by count: ");
print_percentage (c->total_count - c->unique_count, c->total_count);
printf_filtered ("\n");
@ -301,7 +300,7 @@ print_bcache_statistics (struct bcache *c, char *type)
median_chain_length);
printf_filtered (" Average hash chain length: ");
if (c->num_buckets > 0)
printf_filtered ("%3ld\n", c->unique_count / c->num_buckets);
printf_filtered ("%3lu\n", c->unique_count / c->num_buckets);
else
printf_filtered ("(not applicable)\n");
printf_filtered (" Maximum hash chain length: %3d\n", max_chain_length);

View file

@ -95,14 +95,14 @@ struct bcache {
struct obstack cache;
/* How many hash buckets we're using. */
int num_buckets;
unsigned int num_buckets;
/* Hash buckets. This table is allocated using malloc, so when we
grow the table we can return the old table to the system. */
struct bstring **bucket;
/* Statistics. */
long unique_count; /* number of unique strings */
unsigned long unique_count; /* number of unique strings */
long total_count; /* total number of strings cached, including dups */
long unique_size; /* size of unique strings, in bytes */
long total_size; /* total number of bytes cached, including dups */

View file

@ -25,6 +25,7 @@
#include "parser-defs.h"
#include "language.h"
#include "c-lang.h"
#include "valprint.h"
extern void _initialize_c_language PARAMS ((void));
static void c_emit_char (int c, struct ui_file * stream, int quoter);
@ -110,8 +111,6 @@ c_printstr (stream, string, length, width, force_ellipses)
int in_quotes = 0;
int need_comma = 0;
extern int inspect_it;
extern int repeat_count_threshold;
extern int print_max;
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in traditional C

View file

@ -87,7 +87,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
elements up to it. */
if (stop_print_at_null)
{
int temp_len;
unsigned int temp_len;
/* Look for a NULL char. */
for (temp_len = 0;

View file

@ -2192,8 +2192,8 @@ ch_lex ()
case LOC_OPTIMIZED_OUT:
error ("Symbol \"%s\" names no location.", inputname);
break;
case LOC_UNRESOLVED:
error ("unhandled SYMBOL_CLASS in ch_lex()");
default:
internal_error ("unhandled SYMBOL_CLASS in ch_lex()");
break;
}
}

View file

@ -26,6 +26,7 @@
#include "parser-defs.h"
#include "language.h"
#include "ch-lang.h"
#include "valprint.h"
extern void _initialize_chill_language PARAMS ((void));
@ -127,8 +128,6 @@ chill_printstr (stream, string, length, width, force_ellipses)
int in_control_form = 0;
int need_slashslash = 0;
unsigned int c;
extern int repeat_count_threshold;
extern int print_max;
if (length == 0)
{

View file

@ -219,7 +219,7 @@ static void read_one_sym PARAMS ((struct coff_symbol *,
struct internal_syment *,
union internal_auxent *));
static void coff_symtab_read PARAMS ((long, int, struct objfile *));
static void coff_symtab_read PARAMS ((long, unsigned int, struct objfile *));
static void find_linenos PARAMS ((bfd *, sec_ptr, PTR));
@ -605,7 +605,7 @@ coff_symfile_read (objfile, mainline)
coff_data_type *cdata = coff_data (abfd);
char *name = bfd_get_filename (abfd);
register int val;
int num_symbols;
unsigned int num_symbols;
int symtab_offset;
int stringtab_offset;
struct cleanup *back_to;
@ -755,7 +755,7 @@ coff_symfile_finish (objfile)
static void
coff_symtab_read (symtab_offset, nsyms, objfile)
long symtab_offset;
int nsyms;
unsigned int nsyms;
struct objfile *objfile;
{
register struct context_stack *new;

View file

@ -28,6 +28,7 @@
#include "parser-defs.h"
#include "language.h"
#include "f-lang.h"
#include "valprint.h"
/* The built-in types of F77. FIXME: integer*4 is missing, plain
logical is missing (builtin_type_logical is logical*4). */
@ -175,8 +176,6 @@ f_printstr (stream, string, length, width, force_ellipses)
int in_quotes = 0;
int need_comma = 0;
extern int inspect_it;
extern int repeat_count_threshold;
extern int print_max;
if (length == 0)
{

View file

@ -1006,7 +1006,7 @@ supply_register (regno, val)
#endif
CORE_ADDR
generic_target_read_pc (pid)
generic_target_read_pc (int pid)
{
#ifdef PC_REGNUM
if (PC_REGNUM >= 0)

View file

@ -26,6 +26,7 @@
#include "language.h"
#include "m2-lang.h"
#include "c-lang.h"
#include "valprint.h"
extern void _initialize_m2_language PARAMS ((void));
static struct type *m2_create_fundamental_type PARAMS ((struct objfile *, int));
@ -124,8 +125,6 @@ m2_printstr (stream, string, length, width, force_ellipses)
int in_quotes = 0;
int need_comma = 0;
extern int inspect_it;
extern int repeat_count_threshold;
extern int print_max;
if (length == 0)
{

View file

@ -294,7 +294,7 @@ static void
os9k_init_type_vector (tv)
struct type **tv;
{
int i;
unsigned int i;
for (i = 0; i < sizeof (os9k_type_vector) / sizeof (struct type **); i++)
tv[i] = (os9k_type_vector[i] == 0 ? 0 : *(os9k_type_vector[i]));
}

View file

@ -1204,7 +1204,7 @@ backtrace_command (arg, from_tty)
argc = 0;
for (i = 0; (argv[i] != (char *) NULL); i++)
{
int j;
unsigned int j;
for (j = 0; (j < strlen (argv[i])); j++)
argv[i][j] = tolower (argv[i][j]);

View file

@ -4512,7 +4512,6 @@ make_symbol_overload_list (fsym)
register struct symtab *s;
register struct partial_symtab *ps;
register struct objfile *objfile;
register struct minimal_symbol *msymbol;
register struct block *b, *surrounding_static_block = 0;
register int i;
/* The name we are completing on. */

View file

@ -684,7 +684,7 @@ print_binary_chars (stream, valaddr, len)
#define BITS_IN_BYTES 8
unsigned char *p;
int i;
unsigned int i;
int b;
/* Declared "int" so it will be signed.

View file

@ -31,6 +31,11 @@ extern int objectprint; /* Controls looking up an object's derived type
extern unsigned int print_max; /* Max # of chars for strings/vectors */
/* Print repeat counts if there are more than this many repetitions of an
element in an array. Referenced by the low level language dependent
print routines. */
extern unsigned int repeat_count_threshold;
extern int output_format;
extern int stop_print_at_null; /* Stop printing at null char? */