This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Patch to fix htab_create function return types


Some of the functions passed to htab_create are declared incorrectly.
I.e. they specify unsigned int as the return type instead of
hashval_t.  At the moment, hashval_t is an unsigned int, but in case
it changes we should be consistent.

This patch should have no effect, but I bootstrapped it on
sparc-sun-solaris2.7 to check for typos and just to be safe.

Ok to install?

		Thanks,
		--Kaveh


2002-10-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* conflict.c (arc_hash): Change return type to hashval_t.
	* cselib.c (get_value_hash): Likewise.
	* genautomata.c (automaton_decl_hash, insn_decl_hash, decl_hash,
	state_hash, automata_list_hash): Likewise.
	* read-rtl.c (def_hash): Likewise.
	* tree.c (type_hash_hash): Likewise.

diff -rup orig/egcc-CVS20021008/gcc/conflict.c egcc-CVS20021008/gcc/conflict.c
--- orig/egcc-CVS20021008/gcc/conflict.c	2002-09-21 22:51:16.000000000 -0400
+++ egcc-CVS20021008/gcc/conflict.c	2002-10-09 10:43:19.774088938 -0400
@@ -112,7 +112,7 @@ struct conflict_graph_def
    R1 and R2.  R1 is assumed to be smaller or equal to R2.  */
 #define CONFLICT_HASH_FN(R1, R2) ((R2) * ((R2) - 1) / 2 + (R1))
 
-static unsigned arc_hash	PARAMS ((const void *));
+static hashval_t arc_hash	PARAMS ((const void *));
 static int arc_eq		PARAMS ((const void *, const void *));
 static int print_conflict	PARAMS ((int, int, void *));
 static void mark_reg		PARAMS ((rtx, rtx, void *));
@@ -120,7 +120,7 @@ static void mark_reg		PARAMS ((rtx, rtx,
 /* Callback function to compute the hash value of an arc.  Uses
    current_graph to locate the graph to which the arc belongs.  */
 
-static unsigned
+static hashval_t
 arc_hash (arcp)
      const void *arcp;
 {
diff -rup orig/egcc-CVS20021008/gcc/cselib.c egcc-CVS20021008/gcc/cselib.c
--- orig/egcc-CVS20021008/gcc/cselib.c	2002-09-20 16:00:22.000000000 -0400
+++ egcc-CVS20021008/gcc/cselib.c	2002-10-09 10:46:39.994684776 -0400
@@ -39,7 +39,7 @@ Software Foundation, 59 Temple Place - S
 #include "cselib.h"
 
 static int entry_and_rtx_equal_p	PARAMS ((const void *, const void *));
-static unsigned int get_value_hash	PARAMS ((const void *));
+static hashval_t get_value_hash		PARAMS ((const void *));
 static struct elt_list *new_elt_list	PARAMS ((struct elt_list *,
 						 cselib_val *));
 static struct elt_loc_list *new_elt_loc_list PARAMS ((struct elt_loc_list *,
@@ -274,7 +274,7 @@ entry_and_rtx_equal_p (entry, x_arg)
    hash_rtx when adding an element; this function just extracts the hash
    value from a cselib_val structure.  */
 
-static unsigned int
+static hashval_t
 get_value_hash (entry)
      const void *entry;
 {
diff -rup orig/egcc-CVS20021008/gcc/genautomata.c egcc-CVS20021008/gcc/genautomata.c
--- orig/egcc-CVS20021008/gcc/genautomata.c	2002-08-22 07:00:35.000000000 -0400
+++ egcc-CVS20021008/gcc/genautomata.c	2002-10-09 10:45:53.359145060 -0400
@@ -221,7 +221,7 @@ static regexp_t gen_regexp_sequence PARA
 static regexp_t gen_regexp          PARAMS ((char *));
 
 static unsigned string_hash         PARAMS ((const char *));
-static unsigned automaton_decl_hash PARAMS ((const void *));
+static hashval_t automaton_decl_hash PARAMS ((const void *));
 static int automaton_decl_eq_p      PARAMS ((const void *,
 						   const void *));
 static decl_t insert_automaton_decl       PARAMS ((decl_t));
@@ -229,7 +229,7 @@ static decl_t find_automaton_decl       
 static void initiate_automaton_decl_table PARAMS ((void));
 static void finish_automaton_decl_table   PARAMS ((void));
 
-static unsigned insn_decl_hash            PARAMS ((const void *));
+static hashval_t insn_decl_hash           PARAMS ((const void *));
 static int insn_decl_eq_p                 PARAMS ((const void *,
 						   const void *));
 static decl_t insert_insn_decl            PARAMS ((decl_t));
@@ -237,7 +237,7 @@ static decl_t find_insn_decl            
 static void initiate_insn_decl_table      PARAMS ((void));
 static void finish_insn_decl_table        PARAMS ((void));
 
-static unsigned decl_hash                 PARAMS ((const void *));
+static hashval_t decl_hash                PARAMS ((const void *));
 static int decl_eq_p                      PARAMS ((const void *,
 						   const void *));
 static decl_t insert_decl                 PARAMS ((decl_t));
@@ -303,7 +303,7 @@ static void output_cycle_reservs       P
 static void output_reserv_sets         PARAMS ((FILE *, reserv_sets_t));
 static state_t get_free_state          PARAMS ((int, automaton_t));
 static void free_state                 PARAMS ((state_t));
-static unsigned state_hash             PARAMS ((const void *));
+static hashval_t state_hash            PARAMS ((const void *));
 static int state_eq_p                  PARAMS ((const void *, const void *));
 static state_t insert_state            PARAMS ((state_t));
 static void set_state_reserv           PARAMS ((state_t, int, int));
@@ -325,7 +325,7 @@ static void finish_arcs        PARAMS ((
 static automata_list_el_t get_free_automata_list_el PARAMS ((void));
 static void free_automata_list_el PARAMS ((automata_list_el_t));
 static void free_automata_list PARAMS ((automata_list_el_t));
-static unsigned automata_list_hash PARAMS ((const void *));
+static hashval_t automata_list_hash PARAMS ((const void *));
 static int automata_list_eq_p PARAMS ((const void *, const void *));
 static void initiate_automata_lists PARAMS ((void));
 static void automata_list_start PARAMS ((void));
@@ -2095,7 +2095,7 @@ string_hash (string)
 /* The function evaluates hash value of an automaton declaration.  The
    function is used by abstract data `hashtab'.  The function returns
    hash value (0..UINT_MAX) of given automaton declaration.  */
-static unsigned
+static hashval_t
 automaton_decl_hash (automaton_decl)
      const void *automaton_decl;
 {
@@ -2199,7 +2199,7 @@ finish_automaton_decl_table ()
 /* The function evaluates hash value of an insn declaration.  The
    function is used by abstract data `hashtab'.  The function returns
    hash value (0..UINT_MAX) of given insn declaration.  */
-static unsigned
+static hashval_t
 insn_decl_hash (insn_decl)
      const void *insn_decl;
 {
@@ -2302,7 +2302,7 @@ finish_insn_decl_table ()
 /* The function evaluates hash value of a declaration.  The function
    is used by abstract data `hashtab'.  The function returns hash
    value (0..UINT_MAX) of given declaration.  */
-static unsigned
+static hashval_t
 decl_hash (decl)
      const void *decl;
 {
@@ -3982,7 +3982,7 @@ free_state (state)
    simply hash value of the corresponding reservation set.  Otherwise
    it is formed from hash values of the component deterministic
    states.  One more key is order number of state automaton.  */
-static unsigned
+static hashval_t
 state_hash (state)
      const void *state;
 {
@@ -4354,7 +4354,7 @@ free_automata_list (automata_list)
 }
 
 /* Hash value of AUTOMATA_LIST.  */
-static unsigned
+static hashval_t
 automata_list_hash (automata_list)
      const void *automata_list;
 {
diff -rup orig/egcc-CVS20021008/gcc/read-rtl.c egcc-CVS20021008/gcc/read-rtl.c
--- orig/egcc-CVS20021008/gcc/read-rtl.c	2002-07-23 07:00:24.000000000 -0400
+++ egcc-CVS20021008/gcc/read-rtl.c	2002-10-09 10:44:03.919821382 -0400
@@ -35,7 +35,7 @@ static char *read_string	PARAMS ((struct
 static char *read_quoted_string	PARAMS ((struct obstack *, FILE *));
 static char *read_braced_string	PARAMS ((struct obstack *, FILE *));
 static void read_escape		PARAMS ((struct obstack *, FILE *));
-static unsigned def_hash PARAMS ((const void *));
+static hashval_t def_hash	PARAMS ((const void *));
 static int def_name_eq_p PARAMS ((const void *, const void *));
 static void read_constants PARAMS ((FILE *infile, char *tmp_char));
 static void validate_const_int PARAMS ((FILE *, const char *));
@@ -401,7 +401,7 @@ atoll (p)
 #endif
 
 /* Given a constant definition, return a hash code for its name.  */
-static unsigned
+static hashval_t
 def_hash (def)
      const void *def;
 {
diff -rup orig/egcc-CVS20021008/gcc/tree.c egcc-CVS20021008/gcc/tree.c
--- orig/egcc-CVS20021008/gcc/tree.c	2002-09-27 10:58:29.000000000 -0400
+++ egcc-CVS20021008/gcc/tree.c	2002-10-09 10:47:25.360227460 -0400
@@ -119,7 +119,7 @@ static GTY ((if_marked ("type_hash_marke
 static void set_type_quals PARAMS ((tree, int));
 static void append_random_chars PARAMS ((char *));
 static int type_hash_eq PARAMS ((const void *, const void *));
-static unsigned int type_hash_hash PARAMS ((const void *));
+static hashval_t type_hash_hash PARAMS ((const void *));
 static void print_type_hash_statistics PARAMS((void));
 static void finish_vector_type PARAMS((tree));
 static tree make_vector PARAMS ((enum machine_mode, tree, int));
@@ -2936,7 +2936,7 @@ type_hash_eq (va, vb)
 
 /* Return the cached hash value.  */
 
-static unsigned int
+static hashval_t
 type_hash_hash (item)
      const void *item;
 {


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