This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sweep gas with 'findstatic.pl'


A bunch of cleanups suggested by findstatic.pl.  I'm quite happy to revert any parts
of this patch which people might object with .. :-)

Cheers, Ben


2005-04-27  Ben Elliston  <bje@au.ibm.com>

	* Makefile.am (GAS_CFILES): Remove bignum-copy.c.
	(GENERIC_OBJS): Likewise, remove bignum-copy.o.
	(bignum-copy.o): Remove.
	* Makefile.in: Regenerate.
	* symbols.h (local_symbol_make): Remove declaration.
	(verify_symbol_chain_2): Likewise.
	* symbols.c (local_symbol_make): Make static.
	(max_indent_level): Likewise.
	(verify_symbol_chain_2): Remove.
	* macro.c (macro_hash): Make static.
	* messages.c (fprint_value): Remove.
	* read.h (get_absolute_expr): Remove.
	(emit_leb128_expr): Likewise.
	(do_s_func): Likewise.
	* read.c (do_s_func): Make static.
	(emit_leb128_expr): Likewise.
	(get_absolute_expr): Likewise.
	* as.h (as_howmuch): Remove declaration.
	(fprint_value): Likewise.
	* as.c (myname): Make static.
	* input-scrub.c (as_howmuch): Remove.
	(as_1_char): Likewise.
	* input-file.h (input_file_is_open): Remove.
	* input-file.c (input_file_is_open): Likewise.
	* expr.h (expr_build_unary): Remove declaration.
	(expr_build_binary): Likewise.
	* expr.c (expr_build_unary): Remove.
	(expr_build_binary): Likewise.
	* hash.h (hash_replace): Remove declaration.
	(hash_delete): Likewise.
	* hash.c (hash_replace): Remove.
	(hash_delete): Likewise.
	* bignum-copy.c (bignum_copy): Move from here ..
	* config/tc-vax.c (bignum_copy): .. to here.
	* bignum.h (LOG_TO_BASE_2_OF_10): Remove.
	(bignum_copy): Remove extern declaration.
	* sb.h (string_count): Remove extern declaration.
	(sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise.
	(sb_name): Likewise.
	* sb.c (dsize): Replace preprocessor macro with static int.
	(string_count): Make static.
	(sb_build, sb_add_buffer, sb_print, sb_print_at): Likewise.
	(sb_name): Likewise.
	* config/obj-coff.c (dim_index): Make static.
	* config/tc-i386.c (GOT_symbol): Likewise.
	(output_invalid_buf): Likewise.
	* doc/internals.texi (Warning and error messages): Remove the
	prototype for fprint_value.


Index: Makefile.am
===================================================================
RCS file: /home/bje/src-cvs/src/gas/Makefile.am,v
retrieving revision 1.108
diff -u -p -r1.108 Makefile.am
--- Makefile.am	19 Apr 2005 07:23:03 -0000	1.108
+++ Makefile.am	27 Apr 2005 00:31:10 -0000
@@ -177,7 +177,6 @@ GAS_CFILES = \
 	app.c \
 	as.c \
 	atof-generic.c \
-	bignum-copy.c \
 	cond.c \
 	depend.c \
 	dwarf2dbg.c \
@@ -427,7 +426,6 @@ GENERIC_OBJS = \
 	app.o \
 	as.o \
 	atof-generic.o \
-	bignum-copy.o \
 	cond.o \
 	depend.o \
 	dwarf2dbg.o \
@@ -2444,7 +2442,6 @@ as.o: as.c $(INCDIR)/symcat.h subsegs.h
   output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h hash.h \
   $(INCDIR)/elf/dwarf2.h $(BFDVER_H)
 atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h
-bignum-copy.o: bignum-copy.c $(INCDIR)/symcat.h
 cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h
 depend.o: depend.c $(INCDIR)/symcat.h
 dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h dwarf2dbg.h \
Index: Makefile.in
===================================================================
RCS file: /home/bje/src-cvs/src/gas/Makefile.in,v
retrieving revision 1.118
diff -u -p -r1.118 Makefile.in
--- Makefile.in	19 Apr 2005 07:23:03 -0000	1.118
+++ Makefile.in	27 Apr 2005 00:31:10 -0000
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.9.3 from Makefile.am.
+# Makefile.in generated by automake 1.9.4 from Makefile.am.
 # @configure_input@

 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -64,15 +64,15 @@ CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES = gdb.ini .gdbinit po/Makefile.in
 PROGRAMS = $(noinst_PROGRAMS)
 am__objects_1 = app.$(OBJEXT) as.$(OBJEXT) atof-generic.$(OBJEXT) \
-	bignum-copy.$(OBJEXT) cond.$(OBJEXT) depend.$(OBJEXT) \
-	dwarf2dbg.$(OBJEXT) dw2gencfi.$(OBJEXT) ecoff.$(OBJEXT) \
-	ehopt.$(OBJEXT) expr.$(OBJEXT) flonum-copy.$(OBJEXT) \
-	flonum-konst.$(OBJEXT) flonum-mult.$(OBJEXT) frags.$(OBJEXT) \
-	hash.$(OBJEXT) input-file.$(OBJEXT) input-scrub.$(OBJEXT) \
-	listing.$(OBJEXT) literal.$(OBJEXT) macro.$(OBJEXT) \
-	messages.$(OBJEXT) output-file.$(OBJEXT) read.$(OBJEXT) \
-	sb.$(OBJEXT) stabs.$(OBJEXT) subsegs.$(OBJEXT) \
-	symbols.$(OBJEXT) write.$(OBJEXT)
+	cond.$(OBJEXT) depend.$(OBJEXT) dwarf2dbg.$(OBJEXT) \
+	dw2gencfi.$(OBJEXT) ecoff.$(OBJEXT) ehopt.$(OBJEXT) \
+	expr.$(OBJEXT) flonum-copy.$(OBJEXT) flonum-konst.$(OBJEXT) \
+	flonum-mult.$(OBJEXT) frags.$(OBJEXT) hash.$(OBJEXT) \
+	input-file.$(OBJEXT) input-scrub.$(OBJEXT) listing.$(OBJEXT) \
+	literal.$(OBJEXT) macro.$(OBJEXT) messages.$(OBJEXT) \
+	output-file.$(OBJEXT) read.$(OBJEXT) sb.$(OBJEXT) \
+	stabs.$(OBJEXT) subsegs.$(OBJEXT) symbols.$(OBJEXT) \
+	write.$(OBJEXT)
 am_as_new_OBJECTS = $(am__objects_1)
 as_new_OBJECTS = $(am_as_new_OBJECTS)
 am__DEPENDENCIES_1 = tc-@target_cpu_type@.o
@@ -405,7 +405,6 @@ GAS_CFILES = \
 	app.c \
 	as.c \
 	atof-generic.c \
-	bignum-copy.c \
 	cond.c \
 	depend.c \
 	dwarf2dbg.c \
@@ -654,7 +653,6 @@ GENERIC_OBJS = \
 	app.o \
 	as.o \
 	atof-generic.o \
-	bignum-copy.o \
 	cond.o \
 	depend.o \
 	dwarf2dbg.o \
@@ -3361,7 +3359,6 @@ as.o: as.c $(INCDIR)/symcat.h subsegs.h
   output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h hash.h \
   $(INCDIR)/elf/dwarf2.h $(BFDVER_H)
 atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h
-bignum-copy.o: bignum-copy.c $(INCDIR)/symcat.h
 cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h
 depend.o: depend.c $(INCDIR)/symcat.h
 dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h dwarf2dbg.h \
Index: as.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/as.c,v
retrieving revision 1.60
diff -u -p -r1.60 as.c
--- as.c	14 Apr 2005 09:00:35 -0000	1.60
+++ as.c	27 Apr 2005 00:31:10 -0000
@@ -99,7 +99,7 @@ static enum debug_info_type (*md_debug_f
 int max_macro_nest = 100;

 /* argv[0]  */
-char * myname;
+static char * myname;

 /* The default obstack chunk size.  If we set this to zero, the
    obstack code will use whatever will fit in a 4096 byte block.  */
Index: as.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/as.h,v
retrieving revision 1.46
diff -u -p -r1.46 as.h
--- as.h	9 Apr 2005 03:48:09 -0000	1.46
+++ as.h	27 Apr 2005 00:31:10 -0000
@@ -563,7 +563,6 @@ PRINTF_WHERE_LIKE (as_warn_where);

 void   as_assert (const char *, int, const char *);
 void   as_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
-void   fprint_value (FILE *, addressT);
 void   sprint_value (char *, addressT);
 int    had_errors (void);
 int    had_warnings (void);
@@ -585,7 +584,6 @@ void   cond_finish_check (int);
 void   cond_exit_macro (int);
 int    seen_at_least_1_file (void);
 void   app_pop (char *);
-void   as_howmuch (FILE *);
 void   as_perror (const char *, const char *);
 void   as_where (char **, unsigned int *);
 void   bump_line_counters (void);
Index: bignum.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/bignum.h,v
retrieving revision 1.4
diff -u -p -r1.4 bignum.h
--- bignum.h	3 Mar 2005 01:29:52 -0000	1.4
+++ bignum.h	27 Apr 2005 00:31:10 -0000
@@ -1,5 +1,5 @@
 /* bignum.h-arbitrary precision integers
-   Copyright 1987, 1992, 2003 Free Software Foundation, Inc.
+   Copyright 1987, 1992, 2003, 2005 Free Software Foundation, Inc.

    This file is part of GAS, the GNU Assembler.

@@ -39,14 +39,3 @@
 #endif

 typedef unsigned short LITTLENUM_TYPE;
-
-/* JF truncated this to get around a problem with GCC */
-#define	LOG_TO_BASE_2_OF_10 (3.3219280948873623478703194294893901758651)
-/* WARNING: I haven't checked that the trailing digits are correct! */
-
-/* lengths are in sizeof(littlenum)s */
-
-int bignum_copy (LITTLENUM_TYPE * in, int in_length,
-		 LITTLENUM_TYPE * out, int out_length);
-
-/* end of bignum.h */
Index: expr.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/expr.c,v
retrieving revision 1.56
diff -u -p -r1.56 expr.c
--- expr.c	15 Mar 2005 15:41:31 -0000	1.56
+++ expr.c	27 Apr 2005 00:31:10 -0000
@@ -157,33 +157,6 @@ expr_build_uconstant (offsetT value)
   return make_expr_symbol (&e);
 }

-/* Build an expression for OP s1.  */
-
-symbolS *
-expr_build_unary (operatorT op, symbolS *s1)
-{
-  expressionS e;
-
-  e.X_op = op;
-  e.X_add_symbol = s1;
-  e.X_add_number = 0;
-  return make_expr_symbol (&e);
-}
-
-/* Build an expression for s1 OP s2.  */
-
-symbolS *
-expr_build_binary (operatorT op, symbolS *s1, symbolS *s2)
-{
-  expressionS e;
-
-  e.X_op = op;
-  e.X_add_symbol = s1;
-  e.X_op_symbol = s2;
-  e.X_add_number = 0;
-  return make_expr_symbol (&e);
-}
-
 /* Build an expression for the current location ('.').  */

 symbolS *
@@ -213,8 +186,6 @@ FLONUM_TYPE generic_floating_point_numbe
   0				/* sign.  */
 };

-/* If nonzero, we've been asked to assemble nan, +inf or -inf.  */
-int generic_floating_point_magic;
 
 static void
 floating_constant (expressionS *expressionP)
Index: expr.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/expr.h,v
retrieving revision 1.14
diff -u -p -r1.14 expr.h
--- expr.h	3 Mar 2005 01:29:53 -0000	1.14
+++ expr.h	27 Apr 2005 00:31:10 -0000
@@ -166,6 +166,4 @@ extern symbolS *make_expr_symbol (expres
 extern int expr_symbol_where (symbolS *, char **, unsigned int *);

 extern symbolS *expr_build_uconstant (offsetT);
-extern symbolS *expr_build_unary (operatorT, symbolS *);
-extern symbolS *expr_build_binary (operatorT, symbolS *, symbolS *);
 extern symbolS *expr_build_dot (void);
Index: hash.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/hash.c,v
retrieving revision 1.15
diff -u -p -r1.15 hash.c
--- hash.c	14 Apr 2005 09:00:35 -0000	1.15
+++ hash.c	27 Apr 2005 00:31:10 -0000
@@ -294,31 +294,6 @@ hash_jam (struct hash_control *table, co
   return NULL;
 }

-/* Replace an existing entry in a hash table.  This returns the old
-   value stored for the entry.  If the entry is not found in the hash
-   table, this does nothing and returns NULL.  */
-
-PTR
-hash_replace (struct hash_control *table, const char *key, PTR value)
-{
-  struct hash_entry *p;
-  PTR ret;
-
-  p = hash_lookup (table, key, NULL, NULL);
-  if (p == NULL)
-    return NULL;
-
-#ifdef HASH_STATISTICS
-  ++table->replacements;
-#endif
-
-  ret = p->data;
-
-  p->data = value;
-
-  return ret;
-}
-
 /* Find an entry in a hash table, returning its value.  Returns NULL
    if the entry is not found.  */

@@ -330,35 +305,6 @@ hash_find (struct hash_control *table, c
   p = hash_lookup (table, key, NULL, NULL);
   if (p == NULL)
     return NULL;
-
-  return p->data;
-}
-
-/* Delete an entry from a hash table.  This returns the value stored
-   for that entry, or NULL if there is no such entry.  */
-
-PTR
-hash_delete (struct hash_control *table, const char *key)
-{
-  struct hash_entry *p;
-  struct hash_entry **list;
-
-  p = hash_lookup (table, key, &list, NULL);
-  if (p == NULL)
-    return NULL;
-
-  if (p != *list)
-    abort ();
-
-#ifdef HASH_STATISTICS
-  ++table->deletions;
-#endif
-
-  *list = p->next;
-
-  /* Note that we never reclaim the memory for this entry.  If gas
-     ever starts deleting hash table entries in a big way, this will
-     have to change.  */

   return p->data;
 }
Index: hash.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/hash.h,v
retrieving revision 1.8
diff -u -p -r1.8 hash.h
--- hash.h	14 Apr 2005 09:00:35 -0000	1.8
+++ hash.h	27 Apr 2005 00:31:10 -0000
@@ -51,22 +51,10 @@ extern const char *hash_insert (struct h
 extern const char *hash_jam (struct hash_control *,
 			     const char *key, PTR value);

-/* Replace an existing entry in a hash table.  This returns the old
-   value stored for the entry.  If the entry is not found in the hash
-   table, this does nothing and returns NULL.  */
-
-extern PTR hash_replace (struct hash_control *, const char *key,
-			 PTR value);
-
 /* Find an entry in a hash table, returning its value.  Returns NULL
    if the entry is not found.  */

 extern PTR hash_find (struct hash_control *, const char *key);
-
-/* Delete an entry from a hash table.  This returns the value stored
-   for that entry, or NULL if there is no such entry.  */
-
-extern PTR hash_delete (struct hash_control *, const char *key);

 /* Traverse a hash table.  Call the function on every entry in the
    hash table.  */
Index: input-file.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/input-file.c,v
retrieving revision 1.17
diff -u -p -r1.17 input-file.c
--- input-file.c	3 Mar 2005 01:29:53 -0000	1.17
+++ input-file.c	27 Apr 2005 00:31:10 -0000
@@ -80,12 +80,6 @@ input_file_buffer_size (void)
   return (BUFFER_SIZE);
 }

-int
-input_file_is_open (void)
-{
-  return f_in != (FILE *) 0;
-}
-
 /* Push the state of our input, returning a pointer to saved info that
    can be restored with input_file_pop ().  */

Index: input-file.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/input-file.h,v
retrieving revision 1.5
diff -u -p -r1.5 input-file.h
--- input-file.h	3 Mar 2005 01:29:53 -0000	1.5
+++ input-file.h	27 Apr 2005 00:31:10 -0000
@@ -58,7 +58,6 @@
 char *input_file_give_next_buffer (char *where);
 char *input_file_push (void);
 unsigned int input_file_buffer_size (void);
-int input_file_is_open (void);
 void input_file_begin (void);
 void input_file_close (void);
 void input_file_end (void);
Index: input-scrub.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/input-scrub.c,v
retrieving revision 1.12
diff -u -p -r1.12 input-scrub.c
--- input-scrub.c	3 Mar 2005 01:29:53 -0000	1.12
+++ input-scrub.c	27 Apr 2005 00:31:10 -0000
@@ -123,7 +123,6 @@ struct input_save {

 static struct input_save *input_scrub_push (char *saved_position);
 static char *input_scrub_pop (struct input_save *arg);
-static void as_1_char (unsigned int c, FILE * stream);

 /* Saved information about the file that .include'd this one.  When we hit EOF,
    we automatically pop to that file.  */
@@ -475,40 +474,4 @@ as_where (char **namep, unsigned int *li
       if (linep != NULL)
 	*linep = 0;
     }
-}
-
-/* Output to given stream how much of line we have scanned so far.
-   Assumes we have scanned up to and including input_line_pointer.
-   No free '\n' at end of line.  */
-
-void
-as_howmuch (FILE *stream /* Opened for write please.  */)
-{
-  register char *p;		/* Scan input line.  */
-
-  for (p = input_line_pointer - 1; *p != '\n'; --p)
-    {
-    }
-  ++p;				/* p->1st char of line.  */
-  for (; p <= input_line_pointer; p++)
-    {
-      /* Assume ASCII. EBCDIC & other micro-computer char sets ignored.  */
-      as_1_char ((unsigned char) *p, stream);
-    }
-}
-
-static void
-as_1_char (unsigned int c, FILE *stream)
-{
-  if (c > 127)
-    {
-      (void) putc ('%', stream);
-      c -= 128;
-    }
-  if (c < 32)
-    {
-      (void) putc ('^', stream);
-      c += '@';
-    }
-  (void) putc (c, stream);
 }
Index: macro.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/macro.c,v
retrieving revision 1.32
diff -u -p -r1.32 macro.c
--- macro.c	25 Apr 2005 06:43:45 -0000	1.32
+++ macro.c	27 Apr 2005 00:31:10 -0000
@@ -94,7 +94,7 @@ static void free_macro(macro_entry *);

 /* The macro hash table.  */

-struct hash_control *macro_hash;
+static struct hash_control *macro_hash;

 /* Whether any macros have been defined.  */

Index: messages.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/messages.c,v
retrieving revision 1.11
diff -u -p -r1.11 messages.c
--- messages.c	2 Mar 2005 09:03:56 -0000	1.11
+++ messages.c	27 Apr 2005 00:31:10 -0000
@@ -470,24 +470,6 @@ as_abort (const char *file, int line, co
 /* Support routines.  */

 void
-fprint_value (FILE *file, valueT val)
-{
-  if (sizeof (val) <= sizeof (long))
-    {
-      fprintf (file, "%ld", (long) val);
-      return;
-    }
-#ifdef BFD_ASSEMBLER
-  if (sizeof (val) <= sizeof (bfd_vma))
-    {
-      fprintf_vma (file, val);
-      return;
-    }
-#endif
-  abort ();
-}
-
-void
 sprint_value (char *buf, valueT val)
 {
   if (sizeof (val) <= sizeof (long))
Index: read.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/read.c,v
retrieving revision 1.99
diff -u -p -r1.99 read.c
--- read.c	26 Apr 2005 17:15:18 -0000	1.99
+++ read.c	27 Apr 2005 00:31:10 -0000
@@ -211,6 +211,7 @@ static int dwarf_file_string;
 #endif
 #endif

+static void do_s_func (int end_p, const char *default_prefix);
 static void do_align (int, char *, int, int);
 static void s_align (int, int);
 static void s_altmacro (int);
@@ -438,6 +439,27 @@ static const pseudo_typeS potable[] = {
   {NULL, NULL, 0}			/* End sentinel.  */
 };

+static offsetT
+get_absolute_expr (expressionS *exp)
+{
+  expression (exp);
+  if (exp->X_op != O_constant)
+    {
+      if (exp->X_op != O_absent)
+	as_bad (_("bad or irreducible absolute expression"));
+      exp->X_add_number = 0;
+    }
+  return exp->X_add_number;
+}
+
+offsetT
+get_absolute_expression (void)
+{
+  expressionS exp;
+
+  return get_absolute_expr (&exp);
+}
+
 static int pop_override_ok = 0;
 static const char *pop_table_name;

@@ -4461,7 +4483,7 @@ output_big_leb128 (char *p, LITTLENUM_TY
 /* Generate the appropriate fragments for a given expression to emit a
    leb128 value.  */

-void
+static void
 emit_leb128_expr (expressionS *exp, int sign)
 {
   operatorT op = exp->X_op;
@@ -4828,27 +4850,6 @@ get_known_segmented_expression (register
   return (retval);
 }

-offsetT
-get_absolute_expr (expressionS *exp)
-{
-  expression (exp);
-  if (exp->X_op != O_constant)
-    {
-      if (exp->X_op != O_absent)
-	as_bad (_("bad or irreducible absolute expression"));
-      exp->X_add_number = 0;
-    }
-  return exp->X_add_number;
-}
-
-offsetT
-get_absolute_expression (void)
-{
-  expressionS exp;
-
-  return get_absolute_expr (&exp);
-}
-
 char				/* Return terminator.  */
 get_absolute_expression_and_terminator (long *val_pointer /* Return value of
expression.  */)
 {
@@ -5209,7 +5210,7 @@ s_func (int end_p)
 /* Subroutine of s_func so targets can choose a different default prefix.
    If DEFAULT_PREFIX is NULL, use the target's "leading char".  */

-void
+static void
 do_s_func (int end_p, const char *default_prefix)
 {
   /* Record the current function so that we can issue an error message for
Index: read.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/read.h,v
retrieving revision 1.27
diff -u -p -r1.27 read.h
--- read.h	3 Mar 2005 01:29:53 -0000	1.27
+++ read.h	27 Apr 2005 00:31:10 -0000
@@ -101,7 +101,6 @@ extern void aout_process_stab (int, cons
 extern char *demand_copy_string (int *lenP);
 extern char *demand_copy_C_string (int *len_pointer);
 extern char get_absolute_expression_and_terminator (long *val_pointer);
-extern offsetT get_absolute_expr (expressionS *);
 extern offsetT get_absolute_expression (void);
 extern unsigned int next_char_of_string (void);
 extern void s_mri_sect (char *);
@@ -111,7 +110,6 @@ extern void add_include_dir (char *path)
 extern void cons (int nbytes);
 extern void demand_empty_rest_of_line (void);
 extern void emit_expr (expressionS *exp, unsigned int nbytes);
-extern void emit_leb128_expr (expressionS *, int);
 extern void equals (char *sym_name, int reassign);
 extern void float_cons (int float_type);
 extern void ignore_rest_of_line (void);
@@ -155,7 +153,6 @@ extern void s_fail (int);
 extern void s_fill (int);
 extern void s_float_space (int mult);
 extern void s_func (int);
-extern void do_s_func (int, const char *);
 extern void s_globl (int arg);
 extern void s_if (int arg);
 extern void s_ifc (int arg);
Index: sb.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/sb.c,v
retrieving revision 1.7
diff -u -p -r1.7 sb.c
--- sb.c	3 Mar 2005 01:29:53 -0000	1.7
+++ sb.c	27 Apr 2005 00:31:10 -0000
@@ -50,21 +50,18 @@

 */

-#define dsize 5
-
+static int dsize = 5;
 static void sb_check (sb *, int);

 /* Statistics of sb structures.  */
-
-int string_count[sb_max_power_two];
+static int string_count[sb_max_power_two];

 /* Free list of sb structures.  */
-
 static sb_list_vector free_list;

 /* initializes an sb.  */

-void
+static void
 sb_build (sb *ptr, int size)
 {
   /* see if we can find one to allocate */
@@ -166,54 +163,6 @@ sb_add_string (sb *ptr, const char *s)
   sb_check (ptr, len);
   memcpy (ptr->ptr + ptr->len, s, len);
   ptr->len += len;
-}
-
-/* add string at s of length len to sb at ptr */
-
-void
-sb_add_buffer (sb *ptr, const char *s, int len)
-{
-  sb_check (ptr, len);
-  memcpy (ptr->ptr + ptr->len, s, len);
-  ptr->len += len;
-}
-
-/* print the sb at ptr to the output file */
-
-void
-sb_print (FILE *outfile, sb *ptr)
-{
-  int i;
-  int nc = 0;
-
-  for (i = 0; i < ptr->len; i++)
-    {
-      if (nc)
-	{
-	  fprintf (outfile, ",");
-	}
-      fprintf (outfile, "%d", ptr->ptr[i]);
-      nc = 1;
-    }
-}
-
-void
-sb_print_at (FILE *outfile, int idx, sb *ptr)
-{
-  int i;
-  for (i = idx; i < ptr->len; i++)
-    putc (ptr->ptr[i], outfile);
-}
-
-/* put a null at the end of the sb at in and return the start of the
-   string, so that it can be used as an arg to printf %s.  */
-
-char *
-sb_name (sb *in)
-{
-  /* stick a null on the end of the string */
-  sb_add_char (in, 0);
-  return in->ptr;
 }

 /* like sb_name, but don't include the null byte in the string.  */
Index: sb.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/sb.h,v
retrieving revision 1.7
diff -u -p -r1.7 sb.h
--- sb.h	3 Mar 2005 01:29:53 -0000	1.7
+++ sb.h	27 Apr 2005 00:31:10 -0000
@@ -76,19 +76,12 @@ typedef struct
     sb_element *size[sb_max_power_two];
   } sb_list_vector;

-extern int string_count[sb_max_power_two];
-
-extern void sb_build (sb *, int);
 extern void sb_new (sb *);
 extern void sb_kill (sb *);
 extern void sb_add_sb (sb *, sb *);
 extern void sb_reset (sb *);
 extern void sb_add_char (sb *, int);
 extern void sb_add_string (sb *, const char *);
-extern void sb_add_buffer (sb *, const char *, int);
-extern void sb_print (FILE *, sb *);
-extern void sb_print_at (FILE *, int, sb *);
-extern char *sb_name (sb *);
 extern char *sb_terminate (sb *);
 extern int sb_skip_white (int, sb *);
 extern int sb_skip_comma (int, sb *);
Index: symbols.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/symbols.c,v
retrieving revision 1.61
diff -u -p -r1.61 symbols.c
--- symbols.c	20 Apr 2005 17:39:57 -0000	1.61
+++ symbols.c	27 Apr 2005 00:31:10 -0000
@@ -197,7 +197,7 @@ static unsigned long local_symbol_conver

 /* Create a local symbol and insert it into the local hash table.  */

-struct local_symbol *
+static struct local_symbol *
 local_symbol_make (const char *name, segT section, valueT value, fragS *frag)
 {
   char *name_copy;
@@ -794,19 +794,6 @@ verify_symbol_chain (symbolS *rootP, sym
   assert (lastP == symbolP);
 }

-void
-verify_symbol_chain_2 (symbolS *sym)
-{
-  symbolS *p = sym, *n = sym;
-#ifdef SYMBOLS_NEED_BACKPOINTERS
-  while (symbol_previous (p))
-    p = symbol_previous (p);
-#endif
-  while (symbol_next (n))
-    n = symbol_next (n);
-  verify_symbol_chain (p, n);
-}
-
 static void
 report_op_error (symbolS *symp, symbolS *left, symbolS *right)
 {
@@ -2361,7 +2348,7 @@ int indent_level;

 /* Maximum indent level.
    Available for modification inside a gdb session.  */
-int max_indent_level = 8;
+static int max_indent_level = 8;

 void
 print_symbol_value_1 (FILE *file, symbolS *sym)
Index: symbols.h
===================================================================
RCS file: /home/bje/src-cvs/src/gas/symbols.h,v
retrieving revision 1.20
diff -u -p -r1.20 symbols.h
--- symbols.h	20 Apr 2005 17:39:57 -0000	1.20
+++ symbols.h	27 Apr 2005 00:31:10 -0000
@@ -56,8 +56,6 @@ symbolS *symbol_new (const char *name, s
 		     fragS * frag);
 symbolS *symbol_create (const char *name, segT segment, valueT value,
 			fragS * frag);
-struct local_symbol *local_symbol_make (const char *name, segT section,
-					valueT value, fragS * frag);
 symbolS *symbol_temp_new (segT, valueT, fragS *);
 symbolS *symbol_temp_new_now (void);
 symbolS *symbol_temp_make (void);
@@ -164,7 +162,6 @@ extern symbolS *symbol_previous (symbolS
 #endif /* SYMBOLS_NEED_BACKPOINTERS */

 void verify_symbol_chain (symbolS * rootP, symbolS * lastP);
-void verify_symbol_chain_2 (symbolS * symP);

 void symbol_append (symbolS * addme, symbolS * target,
 		    symbolS ** rootP, symbolS ** lastP);
Index: config/obj-coff.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/obj-coff.c,v
retrieving revision 1.82
diff -u -p -r1.82 obj-coff.c
--- config/obj-coff.c	19 Apr 2005 15:05:07 -0000	1.82
+++ config/obj-coff.c	27 Apr 2005 00:31:10 -0000
@@ -2475,7 +2475,7 @@ c_symbol_merge (symbolS *debug, symbolS
   SF_SET_DEBUG_FIELD (normal, SF_GET_DEBUG_FIELD (debug));
 }

-unsigned int dim_index;
+static unsigned int dim_index;

 static void
 obj_coff_endef (int ignore ATTRIBUTE_UNUSED)
Index: config/tc-i386.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/tc-i386.c,v
retrieving revision 1.174
diff -u -p -r1.174 tc-i386.c
--- config/tc-i386.c	18 Apr 2005 20:59:18 -0000	1.174
+++ config/tc-i386.c	27 Apr 2005 00:31:11 -0000
@@ -324,7 +324,7 @@ static unsigned int cpu_arch_flags = Cpu
 static unsigned int no_cond_jump_promotion = 0;

 /* Pre-defined "_GLOBAL_OFFSET_TABLE_".  */
-symbolS *GOT_symbol;
+static symbolS *GOT_symbol;

 /* The dwarf2 return column, adjusted for 32 or 64 bit.  */
 unsigned int x86_dwarf2_return_column;
@@ -4971,7 +4971,7 @@ md_atof (type, litP, sizeP)
   return 0;
 }
 
-char output_invalid_buf[8];
+static char output_invalid_buf[8];

 static char *
 output_invalid (c)
Index: config/tc-vax.c
===================================================================
RCS file: /home/bje/src-cvs/src/gas/config/tc-vax.c,v
retrieving revision 1.23
diff -u -p -r1.23 tc-vax.c
--- config/tc-vax.c	1 Apr 2005 14:17:16 -0000	1.23
+++ config/tc-vax.c	27 Apr 2005 00:31:11 -0000
@@ -348,6 +348,60 @@ md_chars_to_number (con, nbytes)
     }
   return retval;
 }
+
+/*
+ * Copy a bignum from in to out.
+ * If the output is shorter than the input, copy lower-order
+ * littlenums.  Return 0 or the number of significant littlenums
+ * dropped.  Assumes littlenum arrays are densely packed: no unused
+ * chars between the littlenums. Uses memcpy() to move littlenums, and
+ * wants to know length (in chars) of the input bignum.
+ */
+
+static int
+bignum_copy (register LITTLENUM_TYPE *in,
+	     register int in_length,	/* in sizeof(littlenum)s */
+	     register LITTLENUM_TYPE *out,
+	     register int out_length	/* in sizeof(littlenum)s */)
+{
+  int significant_littlenums_dropped;
+
+  if (out_length < in_length)
+    {
+      LITTLENUM_TYPE *p;	/* -> most significant (non-zero) input
+				      littlenum.  */
+
+      memcpy ((void *) out, (void *) in,
+	      (unsigned int) out_length << LITTLENUM_SHIFT);
+      for (p = in + in_length - 1; p >= in; --p)
+	{
+	  if (*p)
+	    break;
+	}
+      significant_littlenums_dropped = p - in - in_length + 1;
+
+      if (significant_littlenums_dropped < 0)
+	{
+	  significant_littlenums_dropped = 0;
+	}
+    }
+  else
+    {
+      memcpy ((char *) out, (char *) in,
+	      (unsigned int) in_length << LITTLENUM_SHIFT);
+
+      if (out_length > in_length)
+	{
+	  memset ((char *) (out + in_length),
+		  '\0',
+		  (unsigned int) (out_length - in_length) << LITTLENUM_SHIFT);
+	}
+
+      significant_littlenums_dropped = 0;
+    }
+
+  return (significant_littlenums_dropped);
+}
 
 /* vax:md_assemble() emit frags for 1 instruction */

Index: doc/internals.texi
===================================================================
RCS file: /home/bje/src-cvs/src/gas/doc/internals.texi,v
retrieving revision 1.44
diff -u -p -r1.44 internals.texi
--- doc/internals.texi	3 Mar 2005 01:29:54 -0000	1.44
+++ doc/internals.texi	27 Apr 2005 00:31:11 -0000
@@ -1893,9 +1893,8 @@ after all input has been read, but messa
 original filename and line number that they are applicable to.
 @end deftypefun

-@deftypefun @{@} void fprint_value (FILE *@var{file}, valueT @var{val})
-@deftypefunx @{@} void sprint_value (char *@var{buf}, valueT @var{val})
-These functions are helpful for converting a @code{valueT} value into printable
+@deftypefun @{@} void sprint_value (char *@var{buf}, valueT @var{val})
+This function is helpful for converting a @code{valueT} value into printable
 format, in case it's wider than modes that @code{*printf} can handle.  If the
 type is narrow enough, a decimal number will be produced; otherwise, it will be
 in hexadecimal.  The value itself is not examined to make this determination.

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]