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]

CHILL patch for prototypes & const, part 1/3


	This patch set zaps all the prototype and const warnings from
the ch directory except for a couple which depend on coordination with
the top level dir.

	This is part 1/3.  Bootstrapped on Irix6.  Okay to install?

		Thanks,
		--Kaveh


1999-08-24  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* Makefile.in (ch-version.c): Constify a char*.

	* actions.c (id_cmp, warn_unhandled, adjust_return_value,
	update_else_range_for_int_const, update_else_range_for_range,
	update_else_range_for_range_expr, update_else_range_for_type,
	compute_else_range, check_case_value,
	chill_handle_case_label_range,
	chill_handle_multi_case_label_range,
	chill_handle_multi_case_else_label, chill_handle_multi_case_label,
	chill_handle_multi_case_label_list print_missing_cases): Add
	static prototypes.
	(build_exception_variant): Cast the function argument of qsort.
	(build_rts_call, warn_unhandled, chill_convert_for_assignment,
	adjust_return_value, chill_expand_result,
	build_multi_case_selector_expression, print_missing_cases):
	Constify a char*.
	(print_missing_cases): Introduce an intermediary non-const ptr.
	Add brackets and indent.

	* ch-tree.h (maybe_building_objc_message_expr,
	maybe_objc_comptypes, comptypes_record_hook): Remove declarations.
	(push_handler, pop_handler): Add prototypes.
	(builtin_function, valid_array_index_p,
	build_chill_exception_decl, build_rts_call,
	chill_convert_for_assignment, display_int_cst,
	build_chill_addr_expr, check_have_mode, get_identifier3,
	build_chill_string, register_seize_path, get_unique_identifier,
	add_taskstuff_to_list, gnuchill_version): Constify a char*.
	(finish_chill_function): Add void prototype argument.

	* convert.c (convert_to_reference, convert_to_boolean,
	convert_to_char, base_type_size_in_bytes, remove_tree_element,
	check_ps_range, digest_powerset_tuple, digest_structure_tuple,
	digest_array_tuple, convert1): Add static prototypes.
	(base_type_size_in_bytes): Hide unused function.
	(display_int_cst, digest_array_tuple): Constify a char*.

	* decl.c (set_nesting_level, make_chill_variants, fix_identifier,
	proclaim_decl, maybe_acons, push_scope_decls, pop_scope_decls,
	build_implied_names, bind_sub_modules, layout_array_type,
	do_based_decl, handle_one_level, label_value_cmp,
	find_implied_types): Add static prototypes.
	(boolean_code_name, chill_tree_code_type, chill_tree_code_name):
	Constify a char*.
	(layout_chill_variants): Cast the function argument of qsort.
	(start_chill_function, fix_identifier, init_decl_processing):
	Constify a char*.
	(init_decl_processing): Prefer memcpy over bcopy to avoid casts.
	Use xcalloc instead of xmalloc/bzero.
	(builtin_function, build_chill_exception_decl,
	finish_outer_function): Constify a char*.

	* except.c (start_handler_array, finish_handler_array): Add static
	prototypes.


diff -rup orig/egcs-CVS19990820/gcc/ch/Makefile.in egcs-CVS19990820/gcc/ch/Makefile.in
--- orig/egcs-CVS19990820/gcc/ch/Makefile.in	Wed Mar 31 10:32:56 1999
+++ egcs-CVS19990820/gcc/ch/Makefile.in	Sat Aug 21 03:17:54 1999
@@ -316,7 +316,7 @@ typeck.o : typeck.c $(CONFIG_H) $(CHILL_
 	$(srcdir)/../system.h $(srcdir)/../toplev.h
 ch-version.o : ch-version.c
 ch-version.c : Makefile
-	echo 'char *gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
+	echo 'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
 
 ## This is ugly, but I don't want GNU make to put these variables in
 ## the environment.  Older makes will see this as a set of targets
diff -rup orig/egcs-CVS19990820/gcc/ch/actions.c egcs-CVS19990820/gcc/ch/actions.c
--- orig/egcs-CVS19990820/gcc/ch/actions.c	Mon Aug  9 19:26:08 1999
+++ egcs-CVS19990820/gcc/ch/actions.c	Sat Aug 21 12:50:26 1999
@@ -32,6 +32,22 @@ Boston, MA 02111-1307, USA.  */
 #include "assert.h"
 #include "toplev.h"
 
+static int id_cmp PROTO ((tree *, tree *));
+static void warn_unhandled PROTO ((const char *));
+static tree adjust_return_value PROTO ((tree, const char *));
+static tree update_else_range_for_int_const PROTO ((tree, tree));
+static tree update_else_range_for_range PROTO ((tree, tree, tree));
+static tree update_else_range_for_range_expr PROTO ((tree, tree));
+static tree update_else_range_for_type PROTO ((tree, tree));
+static tree compute_else_range PROTO ((tree, tree, int));
+static tree check_case_value PROTO ((tree, tree));
+static void chill_handle_case_label_range PROTO ((tree, tree, tree));
+static tree chill_handle_multi_case_label_range PROTO ((tree, tree, tree));
+static tree chill_handle_multi_case_else_label PROTO ((tree));
+static tree chill_handle_multi_case_label PROTO ((tree, tree));
+static tree chill_handle_multi_case_label_list PROTO ((tree, tree));
+static void print_missing_cases PROTO ((tree, const unsigned char *, long));
+
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
@@ -155,7 +171,8 @@ build_exception_variant (type, raises)
 	a[i] = t;
       /* NULL terminator for list.  */
       a[i] = NULL_TREE;
-      qsort (a, i, sizeof (tree), id_cmp);
+      qsort (a, i, sizeof (tree),
+	     (int (*) PROTO((const void*, const void*))) id_cmp);
       while (i--)
 	TREE_CHAIN (a[i]) = a[i+1];
       raises = a[0];
@@ -214,7 +231,7 @@ build_exception_variant (type, raises)
 
 tree
 build_rts_call (name, type, args)
-     char *name;
+     const char *name;
      tree type, args;
 {
   tree decl = lookup_name (get_identifier (name));
@@ -262,7 +279,7 @@ static struct already_type *already_warn
 
 static void
 warn_unhandled (ex)
-     char *ex;
+     const char *ex;
 {
   struct already_type *p = already_warned;
 
@@ -460,7 +477,7 @@ check_non_null (expr)
 tree
 chill_convert_for_assignment (type, expr, place)
      tree type, expr;
-     char *place; /* location description for error messages */
+     const char *place; /* location description for error messages */
 {
   tree ttype = type;
   tree etype = TREE_TYPE (expr);
@@ -596,7 +613,7 @@ chill_convert_for_assignment (type, expr
 static tree
 adjust_return_value (expr, action)
      tree expr;
-     char *action;
+     const char *action;
 {
   tree type = TREE_TYPE (TREE_TYPE (current_function_decl));
 
@@ -632,7 +649,7 @@ chill_expand_result (expr, result_or_ret
      int result_or_return;
 {
   tree type;
-  char *action_name = result_or_return ? "RESULT" : "RETURN";
+  const char *action_name = result_or_return ? "RESULT" : "RETURN";
   
   if (pass == 1)
     return;
@@ -1352,7 +1369,7 @@ build_multi_case_selector_expression (se
 static void
 print_missing_cases (type, cases_seen, count)
      tree type;
-     unsigned char *cases_seen;
+     const unsigned char *cases_seen;
      long count;
 {
   long i;
@@ -1364,7 +1381,7 @@ print_missing_cases (type, cases_seen, c
 	  long x = i;
 	  long j;
 	  tree t = type;
-	  char *err_val_name = "???";
+	  const char *err_val_name = "???";
 	  if (TYPE_MIN_VALUE (t)
 	      && TREE_CODE (TYPE_MIN_VALUE (t)) == INTEGER_CST)
 	    x += TREE_INT_CST_LOW (TYPE_MIN_VALUE (t));
@@ -1377,24 +1394,28 @@ print_missing_cases (type, cases_seen, c
 	      err_val_name = x ? "TRUE" : "FALSE";
 	      break;
 	    case CHAR_TYPE:
-	      if ((x >= ' ' && x < 127) && x != '\'' && x != '^')
-		sprintf (buf, "'%c'", (char)x);
-	      else
-		sprintf (buf, "'^(%ld)'", x);
-	      err_val_name = buf;
-	      j = i;
-	      while (j < count && !BITARRAY_TEST(cases_seen, j))
-		j++;
-	      if (j > i + 1)
-		{
-		  long y = x+j-i-1;
-		  err_val_name += strlen (err_val_name);
-		  if ((y >= ' ' && y < 127) && y != '\'' && y != '^')
-		    sprintf (err_val_name, "%s:'%c'", buf, (char)y);
-		  else
-		    sprintf (err_val_name, "%s:'^(%ld)'", buf, y);
-		  i = j - 1;      
-		}
+	      {
+		char *bufptr;
+		if ((x >= ' ' && x < 127) && x != '\'' && x != '^')
+		  sprintf (buf, "'%c'", (char)x);
+		else
+		  sprintf (buf, "'^(%ld)'", x);
+		bufptr = buf;
+		j = i;
+		while (j < count && !BITARRAY_TEST(cases_seen, j))
+		  j++;
+		if (j > i + 1)
+		  {
+		    long y = x+j-i-1;
+		    bufptr += strlen (bufptr);
+		    if ((y >= ' ' && y < 127) && y != '\'' && y != '^')
+		      sprintf (bufptr, "%s:'%c'", buf, (char)y);
+		    else
+		      sprintf (bufptr, "%s:'^(%ld)'", buf, y);
+		    i = j - 1;      
+		  }
+		err_val_name = bufptr;
+	      }
 	      break;
 	    case ENUMERAL_TYPE:
 	      for (v = TYPE_VALUES (t);  v && x;  v = TREE_CHAIN (v))
diff -rup orig/egcs-CVS19990820/gcc/ch/ch-tree.h egcs-CVS19990820/gcc/ch/ch-tree.h
--- orig/egcs-CVS19990820/gcc/ch/ch-tree.h	Sun Jan 31 12:46:25 1999
+++ egcs-CVS19990820/gcc/ch/ch-tree.h	Sat Aug 21 03:17:55 1999
@@ -374,9 +374,6 @@ struct mode_chain;  /* Forward reference
 #define CH_REFERABLE(EXPR) chill_referable(EXPR)
 #define CH_LOCATION_P(EXPR) chill_location (EXPR)
 
-extern int maybe_objc_comptypes ();
-extern tree maybe_building_objc_message_expr ();
-
 /* Standard named or nameless data types of the C compiler.  */
 
 /* Nonzero means `$' can be in an identifier.  */
@@ -457,11 +454,6 @@ extern int flag_traditional;
 
 extern int warn_parentheses;
 
-/* Nonzero means this is a function to call to perform comptypes
-   on two record types.  */
-
-extern int (*comptypes_record_hook) ();
-
 /* Nonzero means we are reading code that came from a system header file.  */
 extern int system_header_p;
 
@@ -666,6 +658,8 @@ extern tree global_function_decl;
 
 /* in except.c */
 extern void except_init_pass_2                  PROTO((void));
+extern void push_handler			PROTO((void));
+extern void pop_handler				PROTO((int));
 
 /* in ch-loop.c */
 extern int flag_local_loop_counter;
@@ -681,7 +675,7 @@ extern void nonvalue_begin_loop_scope   
 extern void nonvalue_end_loop_scope             PROTO((void));
 
 extern tree build_enumerator                    PROTO((tree, tree));
-extern tree builtin_function                    PROTO((char *, tree, enum built_in_function function_, char *));
+extern tree builtin_function                    PROTO((const char *, tree, enum built_in_function function_, const char *));
 extern tree c_build_type_variant                PROTO((tree, int, int));
 extern int  c_decode_option                     PROTO((int, char **));
 extern void c_mark_varargs                      PROTO((void));
@@ -769,7 +763,7 @@ extern void set_init_index              
 extern void set_init_label                      PROTO((tree));
 extern void start_init                          PROTO((tree, tree, int));
 extern void store_init_value                    PROTO((tree, tree));
-extern tree valid_array_index_p                 PROTO((tree, tree, char *, int));
+extern tree valid_array_index_p                 PROTO((tree, tree, const char *, int));
 
 /* in ch/actions.c */
 extern int grant_only_flag;
@@ -782,7 +776,7 @@ extern tree build_chill_binary_op       
 extern tree build_chill_card                    PROTO((tree));
 extern tree build_chill_case_expr               PROTO((tree, tree, tree)); 
 extern tree build_cause_exception               PROTO((tree, int));
-extern tree build_chill_exception_decl          PROTO((char *));
+extern tree build_chill_exception_decl          PROTO((const char *));
 extern tree build_chill_function_call           PROTO((tree, tree));
 extern tree build_chill_length                  PROTO((tree));
 extern tree build_chill_indirect_ref            PROTO((tree, tree, int));
@@ -801,10 +795,10 @@ extern tree build_chill_upper           
 extern tree build_exception_variant             PROTO((tree, tree));
 extern tree build_generalized_call              PROTO((tree, tree));
 extern tree build_lang_decl                     PROTO((enum chill_tree_code, tree, tree));
-extern tree build_rts_call                      PROTO((char *, tree, tree));
+extern tree build_rts_call                      PROTO((const char *, tree, tree));
 extern tree build_varying_struct                PROTO((tree));
 extern void chill_check_decl                    PROTO((tree));
-extern tree chill_convert_for_assignment        PROTO((tree, tree, char*));
+extern tree chill_convert_for_assignment        PROTO((tree, tree, const char *));
 extern void chill_expand_return                 PROTO((tree, int));
 extern void chill_expand_result                 PROTO((tree, int));
 extern void chill_handle_case_default           PROTO((void));
@@ -831,7 +825,7 @@ extern tree build_array_type_for_scalar 
 extern tree convert                             PROTO((tree, tree));
 extern tree convert_from_reference              PROTO((tree));
 extern tree convert_to_class                    PROTO((ch_class, tree));
-extern char* display_int_cst			PROTO((tree));
+extern const char *display_int_cst		PROTO((tree));
 
 /* in ch/decl.c */
 extern tree build_enumerator		        PROTO((tree, tree));
@@ -844,7 +838,7 @@ extern tree do_decl                     
 extern void do_decls                            PROTO((tree, tree, int, int, tree, int));
 extern void expand_chill_outparms               PROTO((void));
 extern void find_granted_decls		        PROTO((void));
-extern void finish_chill_function               PROTO(());
+extern void finish_chill_function               PROTO((void));
 extern tree finish_enum		                PROTO((tree, tree));
 extern void fixup_chill_parms                   PROTO((tree));
 extern void finish_outer_function               PROTO((void));
@@ -885,7 +879,7 @@ extern void expand_goto_except_cleanup  
 extern int is_handled				PROTO((tree));
 
 /* in ch/expr.c */
-extern tree build_chill_addr_expr               PROTO((tree, char *));
+extern tree build_chill_addr_expr               PROTO((tree, const char *));
 extern tree build_chill_arrow_expr              PROTO((tree, int));
 extern tree build_component_ref		        PROTO((tree, tree));
 extern tree build_chill_compound_expr           PROTO((tree));
@@ -898,7 +892,7 @@ extern tree build_compare_discrete_expr	
 						       tree, tree));
 extern tree check_case_selector                 PROTO((tree));
 extern tree check_case_selector_list            PROTO((tree));
-extern tree check_have_mode                     PROTO((tree, char*));
+extern tree check_have_mode                     PROTO((tree, const char *));
 extern void init_chill_expand                   PROTO((void));
 extern void chill_expand_assignment             PROTO((tree, enum chill_tree_code, tree));
 extern void expand_assignment_action            PROTO((tree, enum chill_tree_code, tree));
@@ -934,7 +928,7 @@ extern tree build_chill_range_type      
 extern tree build_chill_reference_type          PROTO((tree));
 extern tree build_simple_array_type             PROTO((tree, tree, tree));
 extern tree const_expr                          PROTO((tree));
-extern tree get_identifier3			PROTO((char*, char*, char*));
+extern tree get_identifier3			PROTO((const char *, const char *, const char *));
 extern tree layout_chill_array_type             PROTO((tree));
 extern tree layout_chill_range_type             PROTO((tree, int));
 extern tree layout_chill_pointer_type           PROTO((tree));
@@ -950,11 +944,11 @@ extern int  recognize_objc_keyword      
 /* in ch/lex.l */
 extern tree use_seizefile_name;
 extern tree current_seizefile_name;
-extern tree build_chill_string                  PROTO((int, char *));
+extern tree build_chill_string                  PROTO((int, const char *));
 extern int  check_newline                       PROTO((void));
 extern tree get_chill_filename                  PROTO((void)); 
 extern tree get_chill_linenumber                PROTO((void));       
-extern void register_seize_path                 PROTO((char *));
+extern void register_seize_path                 PROTO((const char *));
 extern void reinit_parse_for_function           PROTO((void));
 extern void mark_use_seizefile_written          PROTO((tree));
 
@@ -962,7 +956,7 @@ extern void mark_use_seizefile_written  
 extern void begin_chill_loop                    PROTO((tree, tree));
 extern tree build_chill_iterator                PROTO((tree, tree, tree, int, int, int));
 extern void end_chill_loop                      PROTO((void));
-extern tree get_unique_identifier               PROTO((char *));
+extern tree get_unique_identifier               PROTO((const char *));
 
 /* in ch/inout.c */
 extern tree access_recordmode                   PROTO((tree));
@@ -1027,7 +1021,7 @@ extern void to_global_binding_level     
 extern tree satisfy_decl 	                PROTO((tree, int));
 
 /* in ch/tasking.c */
-extern void add_taskstuff_to_list               PROTO((tree, char *, tree, tree, tree));
+extern void add_taskstuff_to_list               PROTO((tree, const char *, tree, tree, tree));
 extern void process_buffer_decls                PROTO((tree, tree, int));
 extern tree buffer_element_mode                 PROTO((tree));
 extern void invalidate_buffer_element_mode      PROTO((tree));
@@ -1187,4 +1181,7 @@ extern struct module *current_module;
 
 /* fold a tree to constant as much as possible */
 extern tree deep_fold PROTO((tree));
+
+extern const char * const gnuchill_version;
+
 #endif
diff -rup orig/egcs-CVS19990820/gcc/ch/convert.c egcs-CVS19990820/gcc/ch/convert.c
--- orig/egcs-CVS19990820/gcc/ch/convert.c	Mon Jan 11 08:17:17 1999
+++ egcs-CVS19990820/gcc/ch/convert.c	Sat Aug 21 03:17:55 1999
@@ -36,6 +36,19 @@ Boston, MA 02111-1307, USA.  */
 extern tree bit_one_node, bit_zero_node;
 extern tree string_one_type_node;
 extern tree bitstring_one_type_node;
+
+static tree convert_to_reference	PROTO ((tree, tree));
+static tree convert_to_boolean		PROTO ((tree, tree));
+static tree convert_to_char		PROTO ((tree, tree));
+#if 0
+static tree base_type_size_in_bytes	PROTO ((tree));
+#endif
+static tree remove_tree_element		PROTO ((tree, tree *));
+static tree check_ps_range		PROTO ((tree, tree, tree));
+static tree digest_powerset_tuple	PROTO ((tree, tree));
+static tree digest_structure_tuple	PROTO ((tree, tree));
+static tree digest_array_tuple		PROTO ((tree, tree, int));
+static tree convert1			PROTO ((tree, tree));
 
 static tree
 convert_to_reference (reftype, expr)
@@ -143,7 +156,8 @@ convert_to_char (type, expr)
   }
 }
 
-tree
+#if 0
+static tree
 base_type_size_in_bytes (type)
      tree type;
 {
@@ -153,6 +167,7 @@ base_type_size_in_bytes (type)
     return error_mark_node;
   return size_in_bytes (TREE_TYPE (type));
 }
+#endif
 
 /*
  * build a singleton array type, of TYPE objects.
@@ -564,7 +579,7 @@ digest_structure_tuple (type, inits)
 /* Return a Chill representation of the INTEGER_CST VAL.
    The result may be in a static buffer, */
 
-char *
+const char *
 display_int_cst (val)
      tree val;
 {
@@ -737,7 +752,8 @@ digest_array_tuple (type, init, allow_mi
 
       if (! CH_COMPATIBLE (value, element_type))
 	{
-	  char *err_val_name = first ? display_int_cst (first) : "(default)";
+	  const char *err_val_name =
+	    first ? display_int_cst (first) : "(default)";
 	  error ("incompatible array tuple element %s", err_val_name);
 	  value = error_mark_node;
 	}
@@ -779,7 +795,7 @@ digest_array_tuple (type, init, allow_mi
 	ptr = &TREE_CHAIN (*ptr);
       if (*ptr && ! tree_int_cst_lt (CONSTRUCTOR_ELT_HI (*ptr), first))
 	{
-	  char *err_val_name = display_int_cst (first);
+	  const char *err_val_name = display_int_cst (first);
 	  error ("array tuple has duplicate index %s", err_val_name);
 	  errors++;
 	  continue;
@@ -862,7 +878,7 @@ digest_array_tuple (type, init, allow_mi
 	    }
 	  else
 	    {
-	      char *err_val_name = display_int_cst (first);
+	      const char *err_val_name = display_int_cst (first);
 	      if (TREE_CODE (last) != INTEGER_CST)
 		error ("dynamic array tuple without (*) or (ELSE)");
 	      else if (tree_int_cst_equal (first, last))
diff -rup orig/egcs-CVS19990820/gcc/ch/decl.c egcs-CVS19990820/gcc/ch/decl.c
--- orig/egcs-CVS19990820/gcc/ch/decl.c	Mon Jul 26 07:41:31 1999
+++ egcs-CVS19990820/gcc/ch/decl.c	Sat Aug 21 12:39:43 1999
@@ -243,6 +243,18 @@ int result_never_set;
 static void pushdecllist                     PROTO((tree, int));
 static int  init_nonvalue_struct             PROTO((tree));
 static int  init_nonvalue_array              PROTO((tree));
+static void set_nesting_level                PROTO((tree, int));
+static tree make_chill_variants              PROTO((tree, tree, tree));
+static tree fix_identifier                   PROTO((tree));
+static void proclaim_decl                    PROTO((tree, int));
+static tree maybe_acons                      PROTO((tree, tree));
+static void push_scope_decls                 PROTO((int));
+static void pop_scope_decls                  PROTO((tree, tree));
+static tree build_implied_names              PROTO((tree));
+static void bind_sub_modules                 PROTO((int));
+static void layout_array_type                PROTO((tree));
+static void do_based_decl                    PROTO((tree, tree, tree));
+static void handle_one_level                 PROTO((tree, tree));
 
 int current_nesting_level = BUILTIN_NESTING_LEVEL;
 int current_module_nesting_level = 0;
@@ -406,7 +418,7 @@ tree string_ftype_ptr_ptr, int_ftype_str
 tree int_ftype_cptr_cptr_sizet;
 #endif
 
-char **boolean_code_name;
+const char **boolean_code_name;
 
 /* Two expressions that are constants with value zero.
    The first is of type `int', the second of type `void *'.  */
@@ -666,7 +678,7 @@ int warn_missing_braces;
 
 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
   
-  char chill_tree_code_type[] = {
+  const char chill_tree_code_type[] = {
     'x',
 #include "ch-tree.def"
   };
@@ -689,7 +701,7 @@ int chill_tree_code_length[] = {
    Used for printing out the tree and error messages.  */
 #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
   
-char *chill_tree_code_name[] = {
+const char *chill_tree_code_name[] = {
     "@@dummy",
 #include "ch-tree.def"
   };
@@ -1038,7 +1050,7 @@ init_nonvalue_array (expr)
 
 /* This excessive piece of code sets DECL_NESTING_LEVEL (DECL) to LEVEL. */
 
-void
+static void
 set_nesting_level (decl, level)
      tree decl;
      int level;
@@ -1618,6 +1630,8 @@ struct tree_pair
   tree decl;
 };
 
+static int  label_value_cmp                  PROTO((struct tree_pair *,
+						    struct tree_pair *));
 
 /* Function to help qsort sort variant labels by value order.  */
 static int
@@ -1627,7 +1641,7 @@ label_value_cmp (x, y)
   return TREE_INT_CST_LOW (x->value) - TREE_INT_CST_LOW (y->value);
 }
 
-tree
+static tree
 make_chill_variants (tagfields, body, variantelse)
      tree tagfields;
      tree body;
@@ -1809,7 +1823,8 @@ layout_chill_variants (utype)
     {
       int limit;
       qsort (label_value_array,
-	     label_index, sizeof (struct tree_pair), label_value_cmp);
+	     label_index, sizeof (struct tree_pair),
+	     (int (*) PROTO ((const void *, const void *))) label_value_cmp);
       limit = label_index - 1;
       for (label_index = 0; label_index < limit; label_index++)
 	{
@@ -2035,7 +2050,8 @@ start_chill_function (label, rtype, parm
     {
       /* We use the same name as the keyword.
 	 This makes it easy to print and change the RESULT from gdb. */
-      char *result_str = (ignore_case || ! special_UC) ? "result" : "RESULT";
+      const char *result_str =
+	(ignore_case || ! special_UC) ? "result" : "RESULT";
       if (pass == 2 && TREE_CODE (result_type) == ERROR_MARK)
 	TREE_TYPE (current_scope->remembered_decls) = result_type;
       chill_result_decl = do_decl (get_identifier (result_str),
@@ -2331,14 +2347,14 @@ push_module (name, is_spec_module)
   return name;   /* may have generated a name */
 }
 /* Make a copy of the identifier NAME, replacing each '!' by '__'. */
-tree
+static tree
 fix_identifier (name)
      tree name;
 {
   char *buf = (char*)alloca (2 * IDENTIFIER_LENGTH (name) + 1);
   int fixed = 0;
   register char *dptr = buf;
-  register char *sptr = IDENTIFIER_POINTER (name);
+  register const char *sptr = IDENTIFIER_POINTER (name);
   for (; *sptr; sptr++)
     {
       if (*sptr == '!')
@@ -2492,7 +2508,7 @@ kept_level_p ()
    Check redefinitions at the same level.
    Suppress error messages if QUIET is true. */
 
-void
+static void
 proclaim_decl (decl, quiet)
      tree decl;
      int quiet;
@@ -2561,12 +2577,14 @@ struct path
   struct path *prev;
   tree node;
 };
+
+static tree find_implied_types            PROTO((tree, struct path *, tree));
 
 /* Look for implied types (enumeral types) implied by TYPE (a decl or type).
    Add these to list.
    Use old_path to guard against cycles. */
 
-tree
+static tree
 find_implied_types (type, old_path, list)
      tree type;
      struct path *old_path;
@@ -3503,7 +3521,7 @@ init_decl_processing ()
     sizetype = long_unsigned_type_node;
 #else
   {
-    char *size_type_c_name = SIZE_TYPE;
+    const char *size_type_c_name = SIZE_TYPE;
     if (strncmp (size_type_c_name, "long long ", 10) == 0)
       sizetype = long_long_unsigned_type_node;
     else if (strncmp (size_type_c_name, "long ", 5) == 0)
@@ -3709,20 +3727,20 @@ init_decl_processing ()
   DECL_SOURCE_LINE (temp) = 0;
   initializer_type = TREE_TYPE (temp);
 
-  bcopy (chill_tree_code_type,
-         tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
-         (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
-          * sizeof (char)));
-  bcopy ((char *) chill_tree_code_length,
-         (char *) (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE),
-         (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
-          * sizeof (int)));
-  bcopy ((char *) chill_tree_code_name,
-         (char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
-         (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
-          * sizeof (char *)));
-  boolean_code_name = (char **) xmalloc (sizeof (char *) * (int) LAST_CHILL_TREE_CODE);
-  bzero ((char *) boolean_code_name, sizeof (char *) * (int) LAST_CHILL_TREE_CODE);
+  memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
+	  chill_tree_code_type,
+	  (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
+	   * sizeof (char)));
+  memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
+	  chill_tree_code_length,
+	  (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
+	   * sizeof (int)));
+  memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
+	  chill_tree_code_name,
+	  (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
+	   * sizeof (char *)));
+  boolean_code_name = (const char **) xcalloc (sizeof (char *),
+					       (int) LAST_CHILL_TREE_CODE);
 
   boolean_code_name[EQ_EXPR] = "=";
   boolean_code_name[NE_EXPR] = "/=";
@@ -4268,10 +4286,10 @@ init_decl_processing ()
 
 tree
 builtin_function (name, type, function_code, library_name)
-     char *name;
+     const char *name;
      tree type;
      enum built_in_function function_code;
-     char *library_name;
+     const char *library_name;
 {
   tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
   DECL_EXTERNAL (decl) = 1;
@@ -4980,7 +4998,7 @@ save_expr_under_name (name, expr)
   pushdecllist (alias, 0);
 }
 
-void
+static void
 do_based_decl (name, mode, base_var)
      tree name, mode, base_var;
 {
@@ -5081,7 +5099,7 @@ static char exception_prefix [] = "__Ex_
 
 tree
 build_chill_exception_decl (name)
-     char *name;
+     const char *name;
 {
   tree decl, ex_name, ex_init, ex_type;
   int  name_len = strlen (name);
@@ -5142,7 +5160,7 @@ finish_outer_function ()
      and fill in the module's function's address. */
 
   extern tree initializer_type;
-  char *fname_str = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
+  const char *fname_str = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
   char *init_entry_name = (char *)xmalloc ((unsigned)(strlen (fname_str) + 20));
   tree  init_entry_id;
   tree  init_entry_decl;
diff -rup orig/egcs-CVS19990820/gcc/ch/except.c egcs-CVS19990820/gcc/ch/except.c
--- orig/egcs-CVS19990820/gcc/ch/except.c	Mon Jan 11 08:17:19 1999
+++ egcs-CVS19990820/gcc/ch/except.c	Sat Aug 21 03:17:55 1999
@@ -62,6 +62,8 @@ static tree unlink_handler_decl;
 static int exceptions_initialized = 0;
 static void emit_setup_handler PROTO((void));
 static void initialize_exceptions PROTO((void));
+static tree start_handler_array PROTO((void));
+static void finish_handler_array PROTO((void));
 static tree char_pointer_type_for_handler;
 
 /* If this is 1, operations to push and pop on the __exceptionStack


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