Commit 47e6be47 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Warning fixes:

        * mips-tdump.c (st_to_string, sc_to_string, glevel_to_string,
        lang_to_string, type_to_string): Make return type const char*.
        (print_symbol): Apply `const' keyword to a char*.
        (print_file_desc): Cast structure member `crfd' to ulong when
        comparing against one.
        * mips-tfile.c (pfatal_with_name): Apply `const' keyword to char*.
        (fatal, error): Add ATTRIBUTE_PRINTF_1 to prototypes.
        (progname, input_name): Apply `const' keyword to a char*.
        Don't redundantly include sys/stat.h.
        (alloc_info): Apply `const' keyword to a char*.
        (st_to_string, sc_to_string): Likewise.
        (hash_string): Cast variable `hash_string' to a symint_t when
        comparing against one.
        (add_string): Cast PAGE_USIZE to Ptrdiff_t when comparing against one.
        Likewise cast it to long when comparing against one.
        (add_local_symbol): Apply `const' keyword to a char*.
        (add_ext_symbol): Likewise.
        (add_unknown_tag): Likewise.
        (add_procedure): Cast a printf-style field width to an int.
        (add_file): Cast PAGE_USIZE to long when comparing against one
        (parse_begin): Cast a printf-style field width to an int.
        (parse_bend): Likewise.
        (parse_def): Likewise.
        (parse_end): Likewise.
        (mark_stabs): Mark parameter `start' with ATTRIBUTE_UNUSED.
        (parse_stabs_common): Fix format specifier.
        (parse_input): Change type of variable `i' to Size_t.
        (write_object): Fix arguments to match format specifiers.
        Cast variable `num_write' to long when comparing against one.
        (read_seek): Cast variable `sys_read' to symint_t when comparing
        against one.  Fix arguments to match format specifiers.  Cast
        variable `size' to long when comparing against one.
        (copy_object): Cast result of `sizeof' to int when comparing
        against one.  Fix arguments to match format specifiers.  Cast
        variable `ifd' to long when comparing against a signed value.
        Likewise, likewise.

From-SVN: r24479
parent 736b02fd
Mon Jan 4 11:01:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* mips-tdump.c (st_to_string, sc_to_string, glevel_to_string,
lang_to_string, type_to_string): Make return type const char*.
(print_symbol): Apply `const' keyword to a char*.
(print_file_desc): Cast structure member `crfd' to ulong when
comparing against one.
* mips-tfile.c (pfatal_with_name): Apply `const' keyword to char*.
(fatal, error): Add ATTRIBUTE_PRINTF_1 to prototypes.
(progname, input_name): Apply `const' keyword to a char*.
Don't redundantly include sys/stat.h.
(alloc_info): Apply `const' keyword to a char*.
(st_to_string, sc_to_string): Likewise.
(hash_string): Cast variable `hash_string' to a symint_t when
comparing against one.
(add_string): Cast PAGE_USIZE to Ptrdiff_t when comparing against one.
Likewise cast it to long when comparing against one.
(add_local_symbol): Apply `const' keyword to a char*.
(add_ext_symbol): Likewise.
(add_unknown_tag): Likewise.
(add_procedure): Cast a printf-style field width to an int.
(add_file): Cast PAGE_USIZE to long when comparing against one
(parse_begin): Cast a printf-style field width to an int.
(parse_bend): Likewise.
(parse_def): Likewise.
(parse_end): Likewise.
(mark_stabs): Mark parameter `start' with ATTRIBUTE_UNUSED.
(parse_stabs_common): Fix format specifier.
(parse_input): Change type of variable `i' to Size_t.
(write_object): Fix arguments to match format specifiers.
Cast variable `num_write' to long when comparing against one.
(read_seek): Cast variable `sys_read' to symint_t when comparing
against one. Fix arguments to match format specifiers. Cast
variable `size' to long when comparing against one.
(copy_object): Cast result of `sizeof' to int when comparing
against one. Fix arguments to match format specifiers. Cast
variable `ifd' to long when comparing against a signed value.
Likewise, likewise.
Mon Jan 4 10:30:33 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Mon Jan 4 10:30:33 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-common.c (decl_attributes): Allow applying attribute `unused' * c-common.c (decl_attributes): Allow applying attribute `unused'
......
...@@ -78,7 +78,7 @@ xmalloc (size) ...@@ -78,7 +78,7 @@ xmalloc (size)
return value; return value;
} }
/* Do to size_t being defined in sys/types.h and different /* Due to size_t being defined in sys/types.h and different
in stddef.h, we have to do this by hand..... Note, these in stddef.h, we have to do this by hand..... Note, these
types are correct for MIPS based systems, and may not be types are correct for MIPS based systems, and may not be
correct for other systems. */ correct for other systems. */
...@@ -269,11 +269,11 @@ void print_file_desc __proto((FDR *, int)); ...@@ -269,11 +269,11 @@ void print_file_desc __proto((FDR *, int));
void print_symbol __proto((SYMR *, int, char *, AUXU *, int, FDR *)); void print_symbol __proto((SYMR *, int, char *, AUXU *, int, FDR *));
void print_aux __proto((AUXU, int, int)); void print_aux __proto((AUXU, int, int));
void emit_aggregate __proto((char *, AUXU, AUXU, const char *, FDR *)); void emit_aggregate __proto((char *, AUXU, AUXU, const char *, FDR *));
char *st_to_string __proto((st_t)); const char *st_to_string __proto((st_t));
char *sc_to_string __proto((sc_t)); const char *sc_to_string __proto((sc_t));
char *glevel_to_string __proto((glevel_t)); const char *glevel_to_string __proto((glevel_t));
char *lang_to_string __proto((lang_t)); const char *lang_to_string __proto((lang_t));
char *type_to_string __proto((AUXU *, int, FDR *)); const char *type_to_string __proto((AUXU *, int, FDR *));
#ifndef __alpha #ifndef __alpha
# ifdef NEED_DECLARATION_MALLOC # ifdef NEED_DECLARATION_MALLOC
...@@ -336,7 +336,7 @@ read_seek (ptr, size, offset, context) ...@@ -336,7 +336,7 @@ read_seek (ptr, size, offset, context)
/* Convert language code to string format. */ /* Convert language code to string format. */
char * const char *
lang_to_string (lang) lang_to_string (lang)
lang_t lang; lang_t lang;
{ {
...@@ -359,7 +359,7 @@ lang_to_string (lang) ...@@ -359,7 +359,7 @@ lang_to_string (lang)
/* Convert storage class to string. */ /* Convert storage class to string. */
char * const char *
sc_to_string(storage_class) sc_to_string(storage_class)
sc_t storage_class; sc_t storage_class;
{ {
...@@ -397,7 +397,7 @@ sc_to_string(storage_class) ...@@ -397,7 +397,7 @@ sc_to_string(storage_class)
/* Convert symbol type to string. */ /* Convert symbol type to string. */
char * const char *
st_to_string(symbol_type) st_to_string(symbol_type)
st_t symbol_type; st_t symbol_type;
{ {
...@@ -438,7 +438,7 @@ st_to_string(symbol_type) ...@@ -438,7 +438,7 @@ st_to_string(symbol_type)
/* Convert debug level to string. */ /* Convert debug level to string. */
char * const char *
glevel_to_string (g_level) glevel_to_string (g_level)
glevel_t g_level; glevel_t g_level;
{ {
...@@ -456,7 +456,7 @@ glevel_to_string (g_level) ...@@ -456,7 +456,7 @@ glevel_to_string (g_level)
/* Convert the type information to string format. */ /* Convert the type information to string format. */
char * const char *
type_to_string (aux_ptr, index, fdp) type_to_string (aux_ptr, index, fdp)
AUXU *aux_ptr; AUXU *aux_ptr;
int index; int index;
...@@ -1025,7 +1025,7 @@ print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp) ...@@ -1025,7 +1025,7 @@ print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp)
scope_ptr != (scope_t *) 0; scope_ptr != (scope_t *) 0;
scope_ptr = scope_ptr->prev) scope_ptr = scope_ptr->prev)
{ {
char *class; const char *class;
if (scope_ptr->st == st_Proc || scope_ptr->st == st_StaticProc) if (scope_ptr->st == st_Proc || scope_ptr->st == st_StaticProc)
class = "func."; class = "func.";
else if (scope_ptr->st == st_File) else if (scope_ptr->st == st_File)
...@@ -1057,7 +1057,7 @@ print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp) ...@@ -1057,7 +1057,7 @@ print_symbol (sym_ptr, number, strbase, aux_base, ifd, fdp)
if (MIPS_IS_STAB(sym_ptr)) if (MIPS_IS_STAB(sym_ptr))
{ {
register int i = sizeof(stab_names) / sizeof(stab_names[0]); register int i = sizeof(stab_names) / sizeof(stab_names[0]);
char *stab_name = "stab"; const char *stab_name = "stab";
short code = MIPS_UNMARK_STAB(sym_ptr->index); short code = MIPS_UNMARK_STAB(sym_ptr->index);
while (--i >= 0) while (--i >= 0)
if (stab_names[i].code == code) if (stab_names[i].code == code)
...@@ -1275,7 +1275,7 @@ print_file_desc (fdp, number) ...@@ -1275,7 +1275,7 @@ print_file_desc (fdp, number)
(ulong) fdp->rfdBase); (ulong) fdp->rfdBase);
rfd_ptr = rfile_desc + fdp->rfdBase; rfd_ptr = rfile_desc + fdp->rfdBase;
for (i = 0; i < fdp->crfd; i++) for (i = 0; i < (ulong) fdp->crfd; i++)
{ {
printf ("\t#%-5ld %11ld, 0x%08lx\n", i, *rfd_ptr, *rfd_ptr); printf ("\t#%-5ld %11ld, 0x%08lx\n", i, *rfd_ptr, *rfd_ptr);
rfd_ptr++; rfd_ptr++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment