CHILL patch for prototypes & const, part 3/3

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Aug 24 12:31:00 GMT 1999


        This is part 3/3.  Bootstrapped on Irix6.  Okay to install?
 
                Thanks,
                --Kaveh


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

	* parse.c (ch_parse_init, check_end_label, end_function,
	build_prefix_clause, PEEK_TOKEN, peek_token_, pushback_token,
	forward_token_, require, check_token, expect, define__PROCNAME__):
	Add static prototypes.
	(build_prefix_clause, expect): Constify a char*.
	(parse_expression, parse_primval, parse_untyped_expr,
	parse_opt_untyped_expr, parse_opt_actions): Add void prototype
	argument.
	(parse_opt_name_string, parse_simple_name_string,
	parse_name_string, parse_defining_occurrence, parse_name,
	parse_optlabel, parse_opt_end_label_semi_colon, parse_modulion,
	parse_spec_module, parse_semi_colon,
	parse_defining_occurrence_list, parse_mode_definition,
	parse_mode_definition_statement, parse_synonym_definition,
	parse_synonym_definition_statement, parse_on_exception_list,
	parse_on_alternatives, parse_loc_declaration,
	parse_declaration_statement, parse_optforbid, parse_postfix,
	parse_postfix_list, parse_rename_clauses, parse_opt_prefix_clause,
	parse_grant_statement, parse_seize_statement,
	parse_param_name_list, parse_param_attr, parse_formpar,
	parse_formparlist, parse_opt_result_spec, parse_opt_except,
	parse_opt_recursive, parse_procedureattr, parse_proc_body,
	parse_procedure_definition, parse_processpar,
	parse_processparlist, parse_process_definition,
	parse_signal_definition, parse_signal_definition_statement,
	parse_then_clause, parse_opt_else_clause, parse_expr_list,
	parse_range_list_clause, pushback_paren_expr, parse_case_label,
	parse_case_label_list, parse_case_label_specification,
	parse_single_dimension_case_action,
	parse_multi_dimension_case_action, parse_case_action,
	parse_asm_operands, parse_asm_clobbers, ch_expand_asm_operands,
	parse_asm_action, parse_begin_end_block, parse_if_action,
	parse_iteration, parse_delay_case_event_list,
	parse_delay_case_action, parse_do_action, parse_receive_spec,
	parse_receive_case_action, parse_send_action, parse_start_action,
	parse_call, parse_tuple_fieldname_list, parse_tuple_element,
	parse_opt_element_list, parse_tuple, parse_operand6,
	parse_operand5, parse_operand4, parse_operand3, parse_operand2,
	parse_operand1, parse_operand0, parse_case_expression,
	parse_then_alternative, parse_else_alternative,
	parse_if_expression, parse_index_mode, parse_set_mode, parse_pos,
	parse_step, parse_opt_layout, parse_field_name_list,
	parse_fixed_field, parse_variant_field_list,
	parse_variant_alternative, parse_field, parse_structure_mode,
	parse_opt_queue_size, parse_procedure_mode, parse_program,
	parse_pass_1_2): Add static prototypes.
	(parse_process_definition): Remove extra argument in function call.
	(parse_range_list_clause): Likewise.

	* satisfy.c (satisfy, cycle_error_print, safe_satisfy_decl,
	satisfy_list, satisfy_list_values): Add static prototype.
	(safe_satisfy_decl): Cast DECL_TASKING_CODE_DECL() to (tree).

	* tasking.c (make_process_struct): Remove unused prototype.
	(validate_process_parameters, get_struct_variable_name,
	decl_tasking_code_variable, get_struct_debug_type_name,
	get_process_wrapper_name, build_tasking_enum,
	build_tasking_message_type, build_receive_signal_case_label,
	build_receive_buffer_case_label, build_receive_buffer_case_end,
	build_receive_signal_case_end): Add static prototypes.
	(struct_name, struct_debug_name, data_name, wrapper_name,
	get_struct_type_name, get_struct_debug_type_name,
	get_tasking_code_name, get_struct_variable_name,
	get_process_wrapper_name): Constify a char*.
	(validate_process_parameters, get_struct_variable_name,
	decl_tasking_code_variable): Hide unused functions.
	(build_start_process, add_taskstuff_to_list, build_queue_length):
	Constify a char*.

	* tree.c (make_powerset_type): Add static prototype.
	(get_identifier3, build_alias_decl, decl_check_rename): Constify a
	char*.

	* typeck.c (extract_constant_from_buffer,
	expand_constant_to_buffer, build_empty_string,
	make_chill_pointer_type, make_chill_range_type,
	apply_chill_array_layout, field_decl_cmp, make_chill_struct_type,
	apply_chill_field_layout): Add static prototype.
	(valid_array_index_p, extract_constant_from_buffer,
	chill_expand_tuple): Constify a char*.
	(layout_chill_struct_type): Cast the function argument of qsort.



	
diff -rup orig/egcs-CVS19990820/gcc/ch/parse.c egcs-CVS19990820/gcc/ch/parse.c
--- orig/egcs-CVS19990820/gcc/ch/parse.c	Tue Jan 19 17:32:36 1999
+++ egcs-CVS19990820/gcc/ch/parse.c	Sat Aug 21 03:17:55 1999
@@ -80,6 +80,18 @@ extern struct rtx_def *expand_expr  	PRO
 					       enum machine_mode, int));
 
 static int parse_action				PROTO((void));
+static void ch_parse_init			PROTO((void));
+static void check_end_label			PROTO((tree, tree));
+static void end_function       			PROTO((void));
+static tree build_prefix_clause			PROTO((tree));
+static enum terminal PEEK_TOKEN			PROTO((void));
+static int peek_token_				PROTO((int));
+static void pushback_token			PROTO((int, tree));
+static void forward_token_			PROTO((void));
+static void require				PROTO((enum terminal));
+static int check_token				PROTO((enum terminal));
+static int expect				PROTO((enum terminal, const char *));
+static void define__PROCNAME__			PROTO((void));
 
 extern int  lineno;
 extern char *input_filename;
@@ -226,7 +238,7 @@ build_prefix_clause (id)
   if (!id)
     {
       if (current_module && current_module->name)
-	{ char *module_name = IDENTIFIER_POINTER (current_module->name);
+	{ const char *module_name = IDENTIFIER_POINTER (current_module->name);
 	  if (module_name[0] && module_name[0] != '_')
 	    return current_module->name;
 	}
@@ -315,7 +327,7 @@ forward_token_()
 /* Skip the next token.
    if it isn't TOKEN, the parser is broken. */
 
-void
+static void
 require(token)
      enum terminal token;
 {
@@ -328,7 +340,7 @@ require(token)
   FORWARD_TOKEN();
 }
 
-int
+static int
 check_token (token)
      enum terminal token;
 {
@@ -341,10 +353,10 @@ check_token (token)
 /* return 0 if expected token was not found,
    else return 1.
 */
-int
+static int
 expect(token, message)
      enum terminal token;
-     char *message;
+     const char *message;
 {
   if (PEEK_TOKEN() != token)
     {
@@ -363,7 +375,7 @@ expect(token, message)
 static void
 define__PROCNAME__ ()
 {
-  char *fname;
+  const char *fname;
   tree string;
   tree procname;
 
@@ -378,17 +390,114 @@ define__PROCNAME__ ()
 }
 
 /* Forward declarations. */
-static tree parse_expression ();
-static tree parse_primval ();
+static tree parse_expression PROTO((void));
+static tree parse_primval PROTO((void));
 static tree parse_mode PROTO((void));
 static tree parse_opt_mode PROTO((void));
-static tree parse_untyped_expr ();
-static tree parse_opt_untyped_expr ();
+static tree parse_untyped_expr PROTO((void));
+static tree parse_opt_untyped_expr PROTO((void));
 static int parse_definition PROTO((int));
-static void parse_opt_actions ();
+static void parse_opt_actions PROTO((void));
 static void parse_body PROTO((void));
 static tree parse_if_expression_body PROTO((void));
 static tree parse_opt_handler PROTO((void));
+static tree parse_opt_name_string PROTO((int));
+static tree parse_simple_name_string PROTO((void));
+static tree parse_name_string PROTO((void));
+static tree parse_defining_occurrence PROTO((void));
+static tree parse_name PROTO((void));
+static tree parse_optlabel PROTO((void));
+static void parse_opt_end_label_semi_colon PROTO((tree));
+static void parse_modulion PROTO((tree));
+static void parse_spec_module PROTO((tree));
+static void parse_semi_colon PROTO((void));
+static tree parse_defining_occurrence_list PROTO((void));
+static void parse_mode_definition PROTO((int));
+static void parse_mode_definition_statement PROTO((int));
+static void parse_synonym_definition PROTO((void));
+static void parse_synonym_definition_statement PROTO((void));
+static tree parse_on_exception_list PROTO((void));
+static void parse_on_alternatives PROTO((void));
+static void parse_loc_declaration PROTO((int));
+static void parse_declaration_statement PROTO((int));
+static tree parse_optforbid PROTO((void));
+static tree parse_postfix PROTO((enum terminal));
+static tree parse_postfix_list PROTO((enum terminal));
+static void parse_rename_clauses PROTO((enum terminal));
+static tree parse_opt_prefix_clause PROTO((void));
+static void parse_grant_statement PROTO((void));
+static void parse_seize_statement PROTO((void));
+static tree parse_param_name_list PROTO((void));
+static tree parse_param_attr PROTO((void));
+static tree parse_formpar PROTO((void));
+static tree parse_formparlist PROTO((void));
+static tree parse_opt_result_spec PROTO((void));
+static tree parse_opt_except PROTO((void));
+static tree parse_opt_recursive PROTO((void));
+static tree parse_procedureattr PROTO((void));
+static void parse_proc_body PROTO((tree, tree));
+static void parse_procedure_definition PROTO((int));
+static tree parse_processpar PROTO((void));
+static tree parse_processparlist PROTO((void));
+static void parse_process_definition PROTO((int));
+static void parse_signal_definition PROTO((void));
+static void parse_signal_definition_statement PROTO((void));
+static void parse_then_clause PROTO((void));
+static void parse_opt_else_clause PROTO((void));
+static tree parse_expr_list PROTO((void));
+static tree parse_range_list_clause PROTO((void));
+static void pushback_paren_expr PROTO((tree));
+static tree parse_case_label PROTO((void));
+static tree parse_case_label_list PROTO((tree, int));
+static tree parse_case_label_specification PROTO((tree));
+static void parse_single_dimension_case_action PROTO((tree));
+static void parse_multi_dimension_case_action PROTO((tree));
+static void parse_case_action PROTO((tree));
+static tree parse_asm_operands PROTO((void));
+static tree parse_asm_clobbers PROTO((void));
+static void ch_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
+static void parse_asm_action PROTO((void));
+static void parse_begin_end_block PROTO((tree));
+static void parse_if_action PROTO((tree));
+static void parse_iteration PROTO((void));
+static tree parse_delay_case_event_list PROTO((void));
+static void parse_delay_case_action PROTO((tree));
+static void parse_do_action PROTO((tree));
+static tree parse_receive_spec PROTO((void));
+static void parse_receive_case_action PROTO((tree));
+static void parse_send_action PROTO((void));
+static void parse_start_action PROTO((void));
+static tree parse_call PROTO((tree));
+static tree parse_tuple_fieldname_list PROTO((void));
+static tree parse_tuple_element PROTO((void));
+static tree parse_opt_element_list PROTO((void));
+static tree parse_tuple PROTO((tree));
+static tree parse_operand6 PROTO((void));
+static tree parse_operand5 PROTO((void));
+static tree parse_operand4 PROTO((void));
+static tree parse_operand3 PROTO((void));
+static tree parse_operand2 PROTO((void));
+static tree parse_operand1 PROTO((void));
+static tree parse_operand0 PROTO((void));
+static tree parse_case_expression PROTO((void));
+static tree parse_then_alternative PROTO((void));
+static tree parse_else_alternative PROTO((void));
+static tree parse_if_expression PROTO((void));
+static tree parse_index_mode PROTO((void));
+static tree parse_set_mode PROTO((void));
+static tree parse_pos PROTO((void));
+static tree parse_step PROTO((void));
+static tree parse_opt_layout PROTO((int));
+static tree parse_field_name_list PROTO((void));
+static tree parse_fixed_field PROTO((void));
+static tree parse_variant_field_list PROTO((void));
+static tree parse_variant_alternative PROTO((void));
+static tree parse_field PROTO((void));
+static tree parse_structure_mode PROTO((void));
+static tree parse_opt_queue_size PROTO((void));
+static tree parse_procedure_mode PROTO((void));
+static void parse_program PROTO((void));
+static void parse_pass_1_2 PROTO((void));
 
 static tree
 parse_opt_name_string (allow_all)
@@ -622,7 +731,7 @@ parse_mode_definition (is_newmode)
   ignoring = save_ignoring;
 }
 
-void
+static void
 parse_mode_definition_statement (is_newmode)
      int is_newmode;
 {
@@ -883,7 +992,7 @@ parse_declaration_statement (in_spec_mod
   parse_semi_colon ();
 }
 
-tree
+static tree
 parse_optforbid ()
 {
   if (check_token (FORBID) == 0)
@@ -905,7 +1014,7 @@ parse_optforbid ()
 /* Matches: <grant postfix> or <seize postfix>
    Returns: A (singleton) TREE_LIST. */
 
-tree
+static tree
 parse_postfix (grant_or_seize)
      enum terminal grant_or_seize;
 {
@@ -921,7 +1030,7 @@ parse_postfix (grant_or_seize)
   return build_tree_list (forbid, name);
 }
 
-tree
+static tree
 parse_postfix_list (grant_or_seize)
      enum terminal grant_or_seize;
 {
@@ -931,7 +1040,7 @@ parse_postfix_list (grant_or_seize)
   return list;
 }
 
-void
+static void
 parse_rename_clauses (grant_or_seize)
      enum terminal grant_or_seize;
 {
@@ -972,7 +1081,7 @@ parse_opt_prefix_clause ()
   return build_prefix_clause (parse_opt_name_string (0));
 }
 
-void
+static void
 parse_grant_statement ()
 {
   require (GRANT);
@@ -988,7 +1097,7 @@ parse_grant_statement ()
     }
 }
 
-void
+static void
 parse_seize_statement ()
 {
   require (SEIZE);
@@ -1282,7 +1391,7 @@ parse_process_definition (in_spec_module
     ignoring = 0;
   require (COLON); require (PROCESS);
   expect (LPRN, "missing '(' after PROCESS");
-  params = parse_processparlist (in_spec_module);
+  params = parse_processparlist ();
   expect (RPRN, "missing ')' in PROCESS");
   ignoring = save_ignoring;
   if (in_spec_module)
@@ -1479,7 +1588,7 @@ parse_range_list_clause ()
     return NULL_TREE;
   while (check_token (COMMA))
     {
-      name = parse_name_string (0);
+      name = parse_name_string ();
     }
   if (check_token (SC))
     {
@@ -1899,7 +2008,7 @@ parse_asm_clobbers ()
   return list;
 }
 
-void
+static void
 ch_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
      tree string, outputs, inputs, clobbers;
      int vol;
@@ -4166,7 +4275,7 @@ parse_program()
   finish_outer_function ();
 }
 
-void
+static void
 parse_pass_1_2()
 {
   parse_program();
diff -rup orig/egcs-CVS19990820/gcc/ch/satisfy.c egcs-CVS19990820/gcc/ch/satisfy.c
--- orig/egcs-CVS19990820/gcc/ch/satisfy.c	Mon Jan 11 08:17:32 1999
+++ egcs-CVS19990820/gcc/ch/satisfy.c	Sat Aug 21 03:17:55 1999
@@ -35,8 +35,12 @@ struct decl_chain
   tree decl;
 };
 
-/* forward declaration */
-tree satisfy PROTO((tree, struct decl_chain *));
+/* forward declarations */
+static tree satisfy		PROTO ((tree, struct decl_chain *));
+static void cycle_error_print	PROTO ((struct decl_chain *, tree));
+static tree safe_satisfy_decl	PROTO ((tree, struct decl_chain *));
+static void satisfy_list	PROTO ((tree, struct decl_chain *));
+static void satisfy_list_values	PROTO ((tree, struct decl_chain *));
 
 static struct decl_chain dummy_chain;
 #define LOOKUP_ONLY (chain==&dummy_chain)
@@ -55,7 +59,7 @@ cycle_error_print (chain, decl)
     }
 }
 
-tree
+static tree
 safe_satisfy_decl (decl, prev_chain)
      tree decl;
      struct decl_chain *prev_chain;
@@ -200,8 +204,7 @@ safe_satisfy_decl (decl, prev_chain)
     case FUNCTION_DECL:
       SATISFY (TREE_TYPE (decl));
       if (CH_DECL_PROCESS (decl))
-	safe_satisfy_decl (DECL_TASKING_CODE_DECL (decl), 
-			   prev_chain);
+	safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
       break;
     case PARM_DECL:
       SATISFY (TREE_TYPE (decl));
@@ -211,8 +214,7 @@ safe_satisfy_decl (decl, prev_chain)
     case TYPE_DECL:
       SATISFY (TREE_TYPE (decl));
       if (CH_DECL_SIGNAL (decl))
-	safe_satisfy_decl (DECL_TASKING_CODE_DECL (decl), 
-			   prev_chain);
+	safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
       if (!LOOKUP_ONLY)
 	{
 	  if (TYPE_NAME (TREE_TYPE (decl)) == NULL_TREE)
@@ -300,7 +302,7 @@ satisfy_list_values (exp, chain)
     }
 }
 
-tree
+static tree
 satisfy (exp, chain)
      tree exp;
      struct decl_chain *chain;
diff -rup orig/egcs-CVS19990820/gcc/ch/tasking.c egcs-CVS19990820/gcc/ch/tasking.c
--- orig/egcs-CVS19990820/gcc/ch/tasking.c	Tue Jan 19 17:32:38 1999
+++ egcs-CVS19990820/gcc/ch/tasking.c	Sat Aug 21 03:17:56 1999
@@ -44,8 +44,19 @@ tree generic_signal_type_node;
 tree chill_taskingcode_type_node;
 
 /* forward declarations */
-void validate_process_parameters PROTO((tree));
-tree make_process_struct         PROTO((tree, tree));
+#if 0
+static void validate_process_parameters		PROTO((tree));
+static tree get_struct_variable_name		PROTO((tree));
+static tree decl_tasking_code_variable		PROTO((tree, tree *, int));
+#endif
+static tree get_struct_debug_type_name		PROTO((tree));
+static tree get_process_wrapper_name		PROTO((tree));
+static tree build_tasking_enum			PROTO((void));
+static void build_tasking_message_type		PROTO((void));
+static tree build_receive_signal_case_label	PROTO((tree, tree));
+static tree build_receive_buffer_case_label	PROTO((tree, tree));
+static void build_receive_buffer_case_end	PROTO((tree, tree));
+static void build_receive_signal_case_end	PROTO((tree, tree));
 
 /* list of this module's process, buffer, etc. decls.
  This is a list of TREE_VECs, chain by their TREE_CHAINs. */
@@ -58,18 +69,18 @@ tree tasking_list = NULL_TREE;
 #define TASK_INFO_STUFF_TYPE(NODE) TREE_VEC_ELT(NODE,4)
 
 /* name template for process argument type */
-static char * struct_name = "__tmp_%s_arg_type";
+static const char * struct_name = "__tmp_%s_arg_type";
 
 /* name template for process arguments for debugging type */
-static char * struct_debug_name = "__tmp_%s_debug_type";
+static const char * struct_debug_name = "__tmp_%s_debug_type";
 
 #if 0
 /* name template for process argument variable */
-static char * data_name = "__tmp_%s_arg_variable";
+static const char * data_name = "__tmp_%s_arg_variable";
 #endif
 
 /* name template for process wrapper */
-static char * wrapper_name = "__tmp_%s_wrapper";
+static const char * wrapper_name = "__tmp_%s_wrapper";
 
 extern int ignoring;
 static tree void_ftype_void;
@@ -80,18 +91,18 @@ tree
 get_struct_type_name (name)
      tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);        /* process name */
+  const char *idp = IDENTIFIER_POINTER (name);        /* process name */
   char *tmpname = xmalloc (strlen (idp) + strlen (struct_name) + 1);
 
   sprintf (tmpname, struct_name, idp);
   return get_identifier (tmpname);
 }
 
-tree
+static tree
 get_struct_debug_type_name (name)
      tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);        /* process name */
+  const char *idp = IDENTIFIER_POINTER (name);        /* process name */
   char *tmpname = xmalloc (strlen (idp) + strlen (struct_debug_name) + 1);
 
   sprintf (tmpname, struct_debug_name, idp);
@@ -103,8 +114,8 @@ tree
 get_tasking_code_name (name)
      tree name;
 {
-  char *skelname = "__tmp_%s_code";
-  char *name_str = IDENTIFIER_POINTER (name);
+  const char *skelname = "__tmp_%s_code";
+  const char *name_str = IDENTIFIER_POINTER (name);
   char *tmpname  = (char *)alloca (IDENTIFIER_LENGTH (name) +
 				   strlen (skelname) + 1);
 
@@ -117,7 +128,7 @@ static tree
 get_struct_variable_name (name)
      tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);        /* process name */
+  const char *idp = IDENTIFIER_POINTER (name);        /* process name */
   char *tmpname = xmalloc (strlen (idp) + strlen (data_name) + 1);
 
   sprintf (tmpname, data_name, idp);
@@ -129,7 +140,7 @@ static tree
 get_process_wrapper_name (name)
     tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);
+  const char *idp = IDENTIFIER_POINTER (name);
   char *tmpname = xmalloc (strlen (idp) + strlen (wrapper_name) + 1);
     
   sprintf (tmpname, wrapper_name, idp);
@@ -182,7 +193,8 @@ generate_tasking_code_variable (name, ta
  * be initialized.  The other module will do that.  This is just 
  * for BUFFERs and EVENTs.
  */
-tree
+#if 0
+static tree
 decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
      tree name, *tasking_code_ptr;
      int  quasi_flag;
@@ -223,6 +235,7 @@ decl_tasking_code_variable (name, taskin
 				     *tasking_code_ptr));
   return decl;
 }
+#endif
 
 /*
  * Transmute a process parameter list into an argument structure 
@@ -492,11 +505,13 @@ build_process_wrapper (plabel, processda
     property"
  */
 
-void
+#if 0
+static void
 validate_process_parameters (parms)
      tree parms ATTRIBUTE_UNUSED;
 {
 }
+#endif
 
 /*
  * build the tree for a start process action.  Loop through the
@@ -612,7 +627,7 @@ build_start_process (process_name, copyn
   
       if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
 	{
-	  char *errstr = "too many arguments to process";
+	  const char *errstr = "too many arguments to process";
 	  if (process_name)
 	    error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
 	  else
@@ -620,7 +635,7 @@ build_start_process (process_name, copyn
 	}
       else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
 	{
-	  char *errstr = "too few arguments to process";
+	  const char *errstr = "too few arguments to process";
 	  if (process_name)
 	    error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
 	  else
@@ -926,7 +941,7 @@ void
 add_taskstuff_to_list (code_decl, stufftype, stuffnumber,
 		       proc_decl, entry)
      tree code_decl;
-     char *stufftype;
+     const char *stufftype;
      tree stuffnumber, proc_decl, entry;
 {
   if (pass == 1)
@@ -1101,7 +1116,7 @@ build_queue_length (buf_ev)
   if (CH_IS_BUFFER_MODE (TREE_TYPE (buf_ev)) ||
       CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
     {
-      char *field_name;
+      const char *field_name;
       tree  arg1, arg2;
 
       if (CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
@@ -1217,7 +1232,7 @@ build_instance_type ()
  *
 #endif
 
-void
+static void
 build_tasking_message_type ()
 {
   tree type_name;
diff -rup orig/egcs-CVS19990820/gcc/ch/tree.c egcs-CVS19990820/gcc/ch/tree.c
--- orig/egcs-CVS19990820/gcc/ch/tree.c	Mon Jan 11 08:17:36 1999
+++ egcs-CVS19990820/gcc/ch/tree.c	Sat Aug 21 03:17:56 1999
@@ -33,6 +33,8 @@ extern struct obstack permanent_obstack;
 /* This is special sentinel used to communicate from build_string_type
    to layout_chill_range_type for the index range of a string. */
 tree string_index_type_dummy;
+
+static tree make_powerset_type				PROTO ((tree));
 
 /* Build a chill string type.
    For a character string, ELT_TYPE==char_type_node; 
@@ -88,7 +90,7 @@ build_string_type (elt_type, length)
   return t;
 }
 
-tree
+static tree
 make_powerset_type (domain)
      tree domain;
 {
@@ -156,7 +158,7 @@ build_bitstring_type (size_in_bits)
 
 tree
 get_identifier3 (part1, part2, part3)
-     char *part1, *part2, *part3;
+     const char *part1, *part2, *part3;
 {
   char *buf = (char*)
     alloca (strlen(part1) + strlen(part2) + strlen(part3) + 1);
@@ -173,7 +175,7 @@ build_alias_decl (old_prefix, new_prefix
 {
   tree decl = make_node (ALIAS_DECL);
 
-  char *postfix_pointer = IDENTIFIER_POINTER (postfix);
+  const char *postfix_pointer = IDENTIFIER_POINTER (postfix);
   int postfix_length = IDENTIFIER_LENGTH (postfix);
   int old_length = old_prefix ? IDENTIFIER_LENGTH(old_prefix) : 0;
   int new_length = new_prefix ? IDENTIFIER_LENGTH(new_prefix) : 0;
@@ -234,7 +236,7 @@ tree
 decl_check_rename (alias, old_name)
      tree alias, old_name;
 {
-  char *old_pointer = IDENTIFIER_POINTER (old_name);
+  const char *old_pointer = IDENTIFIER_POINTER (old_name);
   int old_len = IDENTIFIER_LENGTH (old_name);
   if (DECL_OLD_PREFIX (alias))
     {
diff -rup orig/egcs-CVS19990820/gcc/ch/typeck.c egcs-CVS19990820/gcc/ch/typeck.c
--- orig/egcs-CVS19990820/gcc/ch/typeck.c	Tue Jan 19 17:32:39 1999
+++ egcs-CVS19990820/gcc/ch/typeck.c	Sat Aug 21 03:17:56 1999
@@ -56,8 +56,15 @@ extern tree unsigned_intTI_type_node;
 
 /* forward declarations */
 static int chill_l_equivalent PROTO((tree, tree, struct mode_chain*));
-static tree extract_constant_from_buffer PROTO((tree, unsigned char *, int));
+static tree extract_constant_from_buffer PROTO((tree, const unsigned char *, int));
 static int expand_constant_to_buffer PROTO((tree, unsigned char *, int));
+static tree build_empty_string PROTO((tree));
+static tree make_chill_pointer_type PROTO((tree, enum tree_code));
+static tree make_chill_range_type PROTO((tree, tree, tree));
+static void apply_chill_array_layout PROTO((tree));
+static int field_decl_cmp PROTO((tree *, tree*));
+static tree make_chill_struct_type PROTO((tree));
+static int apply_chill_field_layout PROTO((tree, int *));
 
 /*
  * This function checks an array access.
@@ -72,7 +79,7 @@ static int expand_constant_to_buffer PRO
 tree
 valid_array_index_p (array, idx, error_message, is_varying_lhs)
      tree array, idx;
-     char *error_message;
+     const char *error_message;
      int is_varying_lhs;
 {
   tree cond, low_limit, high_cond, atype, domain;
@@ -854,7 +861,7 @@ expand_constant_to_buffer (value, buffer
 static tree
 extract_constant_from_buffer (type, buffer, buf_size)
      tree type;
-     unsigned char *buffer;
+     const unsigned char *buffer;
      int buf_size;
 {
   tree value;
@@ -1287,7 +1294,7 @@ tree
 chill_expand_tuple (type, constructor)
      tree type, constructor;
 {
-  char *name;
+  const char *name;
   tree nonreft = type;
 
   if (TYPE_NAME (type) != NULL_TREE)
@@ -2407,7 +2414,7 @@ build_chill_modify_expr (lhs, rhs)
 /* Construct, lay out and return the type of pointers to TO_TYPE.
    If such a type has already been constructed, reuse it.  */
 
-tree
+static tree
 make_chill_pointer_type (to_type, code)
      tree to_type;
      enum tree_code code;  /* POINTER_TYPE or REFERENCE_TYPE */
@@ -2494,7 +2501,7 @@ build_chill_reference_type (to_type)
   return t;
 }
 
-tree
+static tree
 make_chill_range_type (type, lowval, highval)
      tree type, lowval, highval;
 {
@@ -2994,7 +3001,7 @@ field_decl_cmp (x, y)
   return (long)DECL_NAME (*x) - (long)DECL_NAME (*y);
 }
 
-tree
+static tree
 make_chill_struct_type (fieldlist)
      tree fieldlist;
 {
@@ -3302,7 +3309,8 @@ layout_chill_struct_type (t)
 	for (x = fieldlist; x; x = TREE_CHAIN (x))
 	  field_array[len++] = x;
 
-	qsort (field_array, len, sizeof (tree), field_decl_cmp);
+	qsort (field_array, len, sizeof (tree),
+	       (int (*) PROTO ((const void *, const void *))) field_decl_cmp);
       }
   }
 


More information about the Gcc-patches mailing list