Makefile.in (ch-version.c): Constify a char*.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sun, 29 Aug 1999 13:34:10 +0000 (13:34 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sun, 29 Aug 1999 13:34:10 +0000 (13:34 +0000)
* 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.

* expr.c (chill_expand_expr, chill_expand_case_expr,
check_arglist_length, internal_build_compound_expr,
is_really_instance, invalid_operand, invalid_right_operand,
build_chill_abstime, build_allocate_memory_call,
build_allocate_global_memory_call, build_return_memory,
build_chill_duration, build_chill_floatcall,
build_allocate_getstack, build_chill_allocate,
build_chill_getstack, build_chill_terminate, build_chill_inttime,
build_chill_lower_or_upper, build_max_min,
build_chill_pred_or_succ, expand_packed_set, fold_set_expr,
build_compare_set_expr, scalar_to_string, build_concat_expr,
build_compare_string_expr, compare_records, string_char_rep,
build_boring_bitstring): Add static prototypes.
(check_have_mode, chill_expand_expr, build_chill_floatcall,
build_allocate_getstack, build_max_min, build_chill_function_call,
expand_packed_set, build_compare_set_expr, build_chill_addr_expr,
string_char_rep): Constify a char*.

* gperf (hash, in_word_set): Add prototypes.

* grant.c (newstring, strfree, append, prepend,
grant_use_seizefile, decode_layout, grant_array_type,
grant_array_type_selective, get_tag_value,
get_tag_value_selective, print_enumeral, print_enumeral_selective,
print_integer_type, find_enum_parent, print_integer_selective,
print_struct, print_struct_selective, print_proc_exceptions,
print_proc_tail, print_proc_tail_selective, find_in_decls,
in_ridpointers, grant_seized_identifier, globalize_decl,
grant_one_decl_selective, compare_memory_file, search_in_list,
really_grant_this): Add static prototypes.
(newstring, append, prepend, grant_use_seizefile,
print_integer_type, decode_constant, grant_one_decl_selective,
header_template): Constify a char *.

* inout.c (add_enum_to_list, build_chill_io_list_type,
build_io_types, declare_predefined_file, build_access_part,
textlocation_mode, check_assoc, assoc_call, check_transfer,
connect_process_optionals, connect_text, connect_access,
check_access, check_text, get_final_type_and_range,
process_io_list, check_format_string, get_max_size,
check_exprlist): Add static prototypes.
(declare_predefined_file, check_assoc, assoc_call, check_transfer,
check_access, check_text, process_io_list): Constify a char*.

* lang.c (deep_const_expr, chill_print_error_function): Add static
prototypes.

* lex.c (close_input_file, maybe_number, string_or_char): Constify
a char*.
(ch_lex_init, skip_directive, same_file, getlc, yywrap,
yy_refill): Add static prototypes.
(build_chill_string, same_file, register_seize_path): Constify a
char*.

* lex.h (finish_chill_seizes): Remove unused prototypes.

* loop.c (build_temporary_variable, maybe_make_for_temp,
get_unique_identifier): Constify a char*.

* 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.

From-SVN: r28965

21 files changed:
gcc/ch/ChangeLog
gcc/ch/Makefile.in
gcc/ch/actions.c
gcc/ch/ch-tree.h
gcc/ch/convert.c
gcc/ch/decl.c
gcc/ch/except.c
gcc/ch/expr.c
gcc/ch/gperf
gcc/ch/grant.c
gcc/ch/hash.h
gcc/ch/inout.c
gcc/ch/lang.c
gcc/ch/lex.c
gcc/ch/lex.h
gcc/ch/loop.c
gcc/ch/parse.c
gcc/ch/satisfy.c
gcc/ch/tasking.c
gcc/ch/tree.c
gcc/ch/typeck.c

index 35d7c277e3494994eed2331f5d48617632bc53ac..0b6da80ad16e29252d7f82bbdba6be2714cd2e34 100644 (file)
@@ -1,3 +1,201 @@
+1999-08-29  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.
+
+       * expr.c (chill_expand_expr, chill_expand_case_expr,
+       check_arglist_length, internal_build_compound_expr,
+       is_really_instance, invalid_operand, invalid_right_operand,
+       build_chill_abstime, build_allocate_memory_call,
+       build_allocate_global_memory_call, build_return_memory,
+       build_chill_duration, build_chill_floatcall,
+       build_allocate_getstack, build_chill_allocate,
+       build_chill_getstack, build_chill_terminate, build_chill_inttime,
+       build_chill_lower_or_upper, build_max_min,
+       build_chill_pred_or_succ, expand_packed_set, fold_set_expr,
+       build_compare_set_expr, scalar_to_string, build_concat_expr,
+       build_compare_string_expr, compare_records, string_char_rep,
+       build_boring_bitstring): Add static prototypes.
+       (check_have_mode, chill_expand_expr, build_chill_floatcall,
+       build_allocate_getstack, build_max_min, build_chill_function_call,
+       expand_packed_set, build_compare_set_expr, build_chill_addr_expr,
+       string_char_rep): Constify a char*.
+
+       * gperf (hash, in_word_set): Add prototypes.
+
+       * grant.c (newstring, strfree, append, prepend,
+       grant_use_seizefile, decode_layout, grant_array_type,
+       grant_array_type_selective, get_tag_value,
+       get_tag_value_selective, print_enumeral, print_enumeral_selective,
+       print_integer_type, find_enum_parent, print_integer_selective,
+       print_struct, print_struct_selective, print_proc_exceptions,
+       print_proc_tail, print_proc_tail_selective, find_in_decls,
+       in_ridpointers, grant_seized_identifier, globalize_decl,
+       grant_one_decl_selective, compare_memory_file, search_in_list,
+       really_grant_this): Add static prototypes.
+       (newstring, append, prepend, grant_use_seizefile,
+       print_integer_type, decode_constant, grant_one_decl_selective,
+       header_template): Constify a char *.
+
+       * inout.c (add_enum_to_list, build_chill_io_list_type,
+       build_io_types, declare_predefined_file, build_access_part,
+       textlocation_mode, check_assoc, assoc_call, check_transfer,
+       connect_process_optionals, connect_text, connect_access,
+       check_access, check_text, get_final_type_and_range,
+       process_io_list, check_format_string, get_max_size,
+       check_exprlist): Add static prototypes.
+       (declare_predefined_file, check_assoc, assoc_call, check_transfer,
+       check_access, check_text, process_io_list): Constify a char*.
+
+       * lang.c (deep_const_expr, chill_print_error_function): Add static
+       prototypes.
+
+       * lex.c (close_input_file, maybe_number, string_or_char): Constify
+       a char*.
+       (ch_lex_init, skip_directive, same_file, getlc, yywrap,
+       yy_refill): Add static prototypes.
+       (build_chill_string, same_file, register_seize_path): Constify a
+       char*.
+
+       * lex.h (finish_chill_seizes): Remove unused prototypes.
+
+       * loop.c (build_temporary_variable, maybe_make_for_temp,
+       get_unique_identifier): Constify a char*.
+
+       * 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.
+
 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
         * actions.c (lang_identify): Constify a char*.
index 5dbc26a238a899b17be00301321e574f9b5cefe3..2cd85442174ddfd2319751c33fe384ac08625ae4 100644 (file)
@@ -316,7 +316,7 @@ typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
        $(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
index e44e215c6f791e16b736b835cf8bb6d534c44c5f..e121cb441f99463fc2efc81d046599f3dffabbc9 100644 (file)
@@ -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)
 \f
 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_warned = 0;
 
 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, place)
 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_return)
      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 (selector_list, label_spec)
 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, count)
          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, count)
              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))
index 29161d23dd41f5c44af3f94c3d5a2cb0417cb190..51a25652a0a374a52c3043236b07b23369172ab4 100644 (file)
@@ -374,9 +374,6 @@ struct mode_chain;  /* Forward reference */
 #define CH_REFERABLE(EXPR) chill_referable(EXPR)
 #define CH_LOCATION_P(EXPR) chill_location (EXPR)
 \f
-extern int maybe_objc_comptypes ();
-extern tree maybe_building_objc_message_expr ();
-\f
 /* 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           PROTO((void));
 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                      PROTO((tree, tree));
 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               PROTO((enum chill_tree_code, tre
 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                   PROTO((tree));
 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         PROTO((tree));
 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                             PROTO((tree, tree, int, int, tre
 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          PROTO((int));
 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             PROTO((enum tree_code,
                                                       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              PROTO((tree, tree, tree));
 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              PROTO((void));
 /* 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          PROTO((tree));
 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             PROTO((void));
 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
index 1f4345d4424dbbad19be0c5f0d305f14bf72457b..84093b8c5fd1c4695f77c3fe7803f529d6b675a7 100644 (file)
@@ -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));
 \f
 static tree
 convert_to_reference (reftype, expr)
@@ -143,7 +156,8 @@ convert_to_char (type, expr)
   }
 }
 \f
-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_missing_elements)
 
       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_missing_elements)
        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_missing_elements)
            }
          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))
index 84c7b2d0560682d9744ca99663dd4f5472cff572..880478a4fe7b453f1641f8f601ea1de9c9f81243 100644 (file)
@@ -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_string_string;
 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)
 \f
 /* 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);
 }
 \f
-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, parms, exceptlist, attrs)
     {
       /* 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));
 \f
 /* 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;
index 8b9c4c38763350d7034955221589bb1a06ce86af..82ab16d35ab6d61dde1a39b575df223256c6cb27 100644 (file)
@@ -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 5e689a21c291c216c2011a1d35975338a337975f..5781e38c19b39cb3be9c28d59665e7fb55c29ede 100644 (file)
@@ -52,9 +52,43 @@ extern int  special_UC;
 #define HOURS_MAX                                         1193
 #define DAYS_MAX                                            49
 
-/* forward declaration */
-rtx chill_expand_expr PROTO((tree, rtx, enum machine_mode, 
-                            enum expand_modifier));
+/* forward declarations */
+static rtx chill_expand_expr           PROTO ((tree, rtx, enum machine_mode, 
+                                               enum expand_modifier));
+static tree chill_expand_case_expr     PROTO ((tree));
+static int check_arglist_length                PROTO ((tree, int, int, tree));
+static tree internal_build_compound_expr PROTO ((tree, int));
+static int is_really_instance          PROTO ((tree));
+static int invalid_operand             PROTO ((enum chill_tree_code,
+                                               tree, int));
+static int invalid_right_operand       PROTO ((enum chill_tree_code, tree));
+static tree build_chill_abstime                PROTO ((tree));
+static tree build_allocate_memory_call PROTO ((tree, tree));
+static tree build_allocate_global_memory_call PROTO ((tree, tree));
+static tree build_return_memory                PROTO ((tree));
+static tree build_chill_duration       PROTO ((tree, unsigned long,
+                                               tree, unsigned long));
+static tree build_chill_floatcall      PROTO ((tree, const char *,
+                                               const char *));
+static tree build_allocate_getstack    PROTO ((tree, tree, const char *,
+                                               const char *, tree, tree));
+static tree build_chill_allocate       PROTO ((tree, tree));
+static tree build_chill_getstack       PROTO ((tree, tree));
+static tree build_chill_terminate      PROTO ((tree));
+static tree build_chill_inttime                PROTO ((tree, tree));
+static tree build_chill_lower_or_upper PROTO ((tree, int));
+static tree build_max_min              PROTO ((tree, int));
+static tree build_chill_pred_or_succ   PROTO ((tree, enum tree_code));
+static tree expand_packed_set          PROTO ((const char *, int, tree));
+static tree fold_set_expr              PROTO ((enum chill_tree_code,
+                                               tree, tree));
+static tree build_compare_set_expr     PROTO ((enum tree_code, tree, tree));
+static tree scalar_to_string           PROTO ((tree));
+static tree build_concat_expr          PROTO ((tree, tree));
+static tree build_compare_string_expr  PROTO ((enum tree_code, tree, tree));
+static tree compare_records            PROTO ((tree, tree));
+static tree string_char_rep            PROTO ((int, tree));
+static tree build_boring_bitstring     PROTO ((long, int));
 
 /* variable to hold the type the DESCR built-in returns */
 static tree descr_type = NULL_TREE;
@@ -84,7 +118,7 @@ force_addr_of (value)
 tree
 check_have_mode (exp, context)
      tree exp;
-     char *context;
+     const char *context;
 {
   if (TREE_CODE (exp) != ERROR_MARK && TREE_TYPE (exp) == NULL_TREE)
     {
@@ -134,7 +168,7 @@ check_case_selector_list (list)
   return nreverse(return_list);
 }
 
-tree
+static tree
 chill_expand_case_expr (expr)
      tree expr;
 {
@@ -208,7 +242,7 @@ chill_expand_case_expr (expr)
 \f
 /* Hook used by expand_expr to expand CHILL-specific tree codes.  */
 
-rtx
+static rtx
 chill_expand_expr (exp, target, tmode, modifier)
      tree exp;
      rtx target;
@@ -221,7 +255,7 @@ chill_expand_expr (exp, target, tmode, modifier)
   rtx original_target = target;
   rtx op0, op1;
   int ignore = target == const0_rtx;
-  char *lib_func;                   /* name of library routine */
+  const char *lib_func;                   /* name of library routine */
 
   if (ignore)
     target = 0, original_target = 0;
@@ -1189,7 +1223,7 @@ build_chill_abs (expr)
   return temp;
 }
 
-tree
+static tree
 build_chill_abstime (exprlist)
      tree exprlist;
 {
@@ -1242,7 +1276,7 @@ build_chill_abstime (exprlist)
 }
 
 
-tree
+static tree
 build_allocate_memory_call (ptr, size)
   tree ptr, size;
 {
@@ -1283,7 +1317,7 @@ build_allocate_memory_call (ptr, size)
 }
 
 
-tree
+static tree
 build_allocate_global_memory_call (ptr, size)
   tree ptr, size;
 {
@@ -1324,7 +1358,7 @@ build_allocate_global_memory_call (ptr, size)
 }
 
 
-tree
+static tree
 build_return_memory (ptr)
   tree ptr;
 {
@@ -1484,7 +1518,7 @@ build_chill_descr (expr)
    MILLISECS, SECS, MINUTES, HOURS and DAYS.
    The built duration value is in milliseconds. */
 
-tree
+static tree
 build_chill_duration (expr, multiplier, fnname, maxvalue)
      tree           expr;
      unsigned long  multiplier;
@@ -1516,8 +1550,8 @@ build_chill_duration (expr, multiplier, fnname, maxvalue)
 static tree
 build_chill_floatcall (expr, chillname, funcname)
      tree expr;
-     char *chillname;
-     char *funcname;
+     const char *chillname;
+     const char *funcname;
 {
   tree result;
   tree type;
@@ -1545,8 +1579,8 @@ static tree
 build_allocate_getstack (mode, value, chill_name, fnname, filename, linenumber)
      tree mode;
      tree value;
-     char *chill_name;
-     char *fnname;
+     const char *chill_name;
+     const char *fnname;
      tree filename;
      tree linenumber;
 {
@@ -1622,7 +1656,7 @@ build_allocate_getstack (mode, value, chill_name, fnname, filename, linenumber)
 }
 
 /* process the ALLOCATE built-in */
-tree
+static tree
 build_chill_allocate (mode, value)
      tree mode;
      tree value;
@@ -1632,7 +1666,7 @@ build_chill_allocate (mode, value)
 }
 
 /* process the GETSTACK built-in */
-tree
+static tree
 build_chill_getstack (mode, value)
      tree mode;
      tree value;
@@ -1642,7 +1676,7 @@ build_chill_getstack (mode, value)
 }
 
 /* process the TERMINATE built-in */
-tree
+static tree
 build_chill_terminate (ptr)
      tree ptr;
 {
@@ -1686,7 +1720,7 @@ build_chill_inttime_type ()
   satisfy_decl (decl, 0);
 }
 
-tree
+static tree
 build_chill_inttime (t, loclist)
      tree t, loclist;
 {
@@ -1993,7 +2027,7 @@ build_max_min (expr, max_min)
       else
        {
          tree parmlist, filename, lineno;
-         char *funcname;
+         const char *funcname;
          
          /* set up to call appropriate runtime function */
          if (max_min)
@@ -2479,7 +2513,7 @@ build_chill_function_call (function, expr)
  
   if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
     {
-      char *errstr = "too many arguments to procedure";
+      const char *errstr = "too many arguments to procedure";
       if (name)
        error ("%s `%s'", errstr, IDENTIFIER_POINTER (name));
       else
@@ -2488,7 +2522,7 @@ build_chill_function_call (function, expr)
     }
   else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
     {
-      char *errstr = "too few arguments to procedure";
+      const char *errstr = "too few arguments to procedure";
       if (name)
        error ("%s `%s'", errstr, IDENTIFIER_POINTER (name));
       else
@@ -2985,9 +3019,9 @@ build_generalized_call (func, args)
 \f
 /* Given a set stored as one bit per char (in BUFFER[0 .. BIT_SIZE-1]),
    return a CONTRUCTOR, of type TYPE (a SET_TYPE). */
-tree
+static tree
 expand_packed_set (buffer, bit_size, type)
-     char *buffer;
+     const char *buffer;
      int   bit_size;
      tree type;
 {
@@ -3131,7 +3165,7 @@ build_compare_set_expr (code, op0, op1)
      tree op0, op1;
 {
   tree result_type = NULL_TREE;
-  char *fnname;
+  const char *fnname;
   tree x;
 
   /* These conversions are needed if -fold-strings. */
@@ -3428,7 +3462,7 @@ build_compare_string_expr (code, op0, op1)
   return build (code, boolean_type_node, op0, op1);
 }
 
-tree
+static tree
 compare_records (exp0, exp1)
      tree exp0, exp1;
 {
@@ -4017,7 +4051,7 @@ build_chill_arrow_expr (ref, force)
 tree
 build_chill_addr_expr (ref, errormsg)
      tree ref;
-     char *errormsg;
+     const char *errormsg;
 {
   if (ref == error_mark_node)
     return ref;
@@ -4067,7 +4101,7 @@ build_chill_binary_op (code, op0, op1)
 /*
  * process a string repetition phrase '(' COUNT ')' STRING
  */
-tree
+static tree
 string_char_rep (count, string)
      int count;
      tree string;
@@ -4075,7 +4109,7 @@ string_char_rep (count, string)
   int slen, charindx, repcnt;
   char ch;
   char *temp;
-  char *inp;
+  const char *inp;
   char *outp;
   tree type;
 
@@ -4102,7 +4136,7 @@ string_char_rep (count, string)
 /* Build a bit-string constant containing with the given LENGTH
    containing all ones (if VALUE is true), or all zeros (if VALUE is false). */
 
-tree
+static tree
 build_boring_bitstring (length, value)
      long length;
      int value;
index 20d05961aa7afbfa0701a404bdac432c4fd27637..c6edb6803b06de4077e304d1c22310f259e8545f 100644 (file)
@@ -5,6 +5,14 @@ struct resword {
   enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
 };
 extern tree ridpointers [];
+#ifdef __GNUC__
+__inline
+#endif
+static unsigned int hash       PARAMS ((const char *, unsigned int));
+#ifdef __GNUC__
+__inline
+#endif
+struct resword *in_word_set    PARAMS ((const char *, unsigned int));
 %%
 access,                        ACCESS,                 NORID,  RESERVED
 after,                 AFTER,                  NORID,  RESERVED
index 2809003fdab11030be550c41905938ec1f079b85..095080f50c741fb20b83089e13843821b56d26f5 100644 (file)
@@ -58,7 +58,6 @@ int chill_at_module_level = 0;
 static int spec_module_generated = 0;
 
 /* define version strings */
-extern char *gnuchill_version;
 extern char *version_string;
 
 /* define a faster string handling */
@@ -84,6 +83,34 @@ static MYSTRING *decode_constant_selective  PROTO((tree, tree));
 static MYSTRING *decode_mode_selective      PROTO((tree, tree));
 static MYSTRING *get_type_selective         PROTO((tree, tree));
 static MYSTRING *decode_decl_selective      PROTO((tree, tree));
+static MYSTRING *newstring                  PROTO((const char *));
+static void strfree                         PROTO((MYSTRING *));
+static MYSTRING *append                     PROTO((MYSTRING *, const char *));
+static MYSTRING *prepend                    PROTO((MYSTRING *, const char *));
+static void grant_use_seizefile             PROTO((const char *));
+static MYSTRING *decode_layout              PROTO((tree));
+static MYSTRING *grant_array_type           PROTO((tree));
+static MYSTRING *grant_array_type_selective PROTO((tree, tree));
+static MYSTRING *get_tag_value              PROTO((tree));
+static MYSTRING *get_tag_value_selective    PROTO((tree, tree));
+static MYSTRING *print_enumeral             PROTO((tree));
+static MYSTRING *print_enumeral_selective   PROTO((tree, tree));
+static MYSTRING *print_integer_type         PROTO((tree));
+static tree find_enum_parent                PROTO((tree, tree));
+static MYSTRING *print_integer_selective    PROTO((tree, tree));
+static MYSTRING *print_struct               PROTO((tree));
+static MYSTRING *print_struct_selective     PROTO((tree, tree));
+static MYSTRING *print_proc_exceptions      PROTO((tree));
+static MYSTRING *print_proc_tail            PROTO((tree, tree, int));
+static MYSTRING *print_proc_tail_selective  PROTO((tree, tree, tree));
+static tree find_in_decls                   PROTO((tree, tree));
+static int in_ridpointers                   PROTO((tree));
+static void grant_seized_identifier         PROTO((tree));
+static void globalize_decl                  PROTO((tree));
+static void grant_one_decl_selective        PROTO((tree, tree));
+static int compare_memory_file              PROTO((const char *, const char *));
+static int search_in_list                   PROTO((tree, tree));
+static int really_grant_this                PROTO((tree, tree));
 
 /* list of the VAR_DECLs of the module initializer entries */
 tree      module_init_list = NULL_TREE;
@@ -101,7 +128,7 @@ static seizefile_list *selective_seizes = 0;
 \f
 static MYSTRING *
 newstring (str)
-    char       *str;
+    const char *str;
 {
     MYSTRING   *tmp = (MYSTRING *) xmalloc (sizeof (MYSTRING));
     unsigned   len = strlen (str);
@@ -124,7 +151,7 @@ strfree (str)
 static MYSTRING *
 append (inout, in)
     MYSTRING   *inout;
-    char       *in;
+    const char *in;
 {
     int        inlen = strlen (in);
     int amount = ALLOCAMOUNT;
@@ -141,7 +168,7 @@ append (inout, in)
 static MYSTRING *
 prepend (inout, in)
     MYSTRING   *inout;
-    char       *in;
+    const char *in;
 {
   MYSTRING *res = inout;
   if (strlen (in))
@@ -153,9 +180,9 @@ prepend (inout, in)
   return res;
 }
 \f
-void
+static void
 grant_use_seizefile (seize_filename)
-     char *seize_filename;
+     const char *seize_filename;
 {
   APPEND (gstring, "<> USE_SEIZE_FILE \"");
   APPEND (gstring, seize_filename);
@@ -523,7 +550,7 @@ print_integer_type (type)
 {
   MYSTRING *result = newstring ("");
   MYSTRING *mode_string;
-  char     *name_ptr;
+  const char *name_ptr;
   tree     base_type;
 
   if (TREE_TYPE (type))
@@ -1683,7 +1710,7 @@ decode_constant (init)
   MYSTRING *tmp_string;
   tree     type = TREE_TYPE (init);
   tree val = init;
-  char *op;
+  const char *op;
   char wrk[256];
   MYSTRING *mode_string;
     
@@ -1835,7 +1862,7 @@ decode_constant (init)
 
     case STRING_CST:
       {
-       char *ptr = TREE_STRING_POINTER (val);
+       const char *ptr = TREE_STRING_POINTER (val);
        int i = TREE_STRING_LENGTH (val);
        APPEND (result, "\"");
        while (--i >= 0)
@@ -2586,8 +2613,8 @@ grant_one_decl_selective (decl, all_decls)
 
 static int
 compare_memory_file (fname, buf)
-    char       *fname;
-    char       *buf;
+    const char *fname;
+    const char *buf;
 {
   FILE *fb;
   int          c;
@@ -2802,7 +2829,7 @@ really_grant_this (decl, granted_decls)
 \f
 /* Write a SPEC MODULE using the declarations in the list DECLS. */
 static int header_written = 0;
-static char *header_template =
+static const char *header_template =
 "--\n-- WARNING: this file was generated by\n\
 -- GNUCHILL version %s\n-- based on gcc version %s\n--\n";
 
index 1f0d59493c2d7f83584006b036febf919607f0cd..4d7c02ab7b09d14044cab8bfa9604bfffbb310de 100644 (file)
@@ -1,12 +1,20 @@
 /* C code produced by gperf version 2.7.1 (19981006 egcs) */
 /* Command-line: gperf -L C -F , 0, 0, 0 -D -E -S1 -p -j1 -i 1 -g -o -t -k* gperf.tmp  */
 struct resword {
-  const char   *name;
+  const char  *name;
   short        token;
   enum rid     rid;
   enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
 };
 extern tree ridpointers [];
+#ifdef __GNUC__
+__inline
+#endif
+static unsigned int hash       PARAMS ((const char *, unsigned int));
+#ifdef __GNUC__
+__inline
+#endif
+struct resword *in_word_set    PARAMS ((const char *, unsigned int));
 /* maximum key range = 2815, duplicates = 6 */
 
 #ifdef __GNUC__
index bac22b412508ef326ddb5e8c9ea2b670a2d351c9..f4050fff64516abfda361bd5f909626325c02d79 100644 (file)
@@ -35,7 +35,26 @@ extern int ignore_case;
 /* set non-zero if special words are to be entered in uppercase */
 extern int special_UC;
 
-static int intsize_of_charsexpr PROTO((tree));
+static int intsize_of_charsexpr                PROTO ((tree));
+static tree add_enum_to_list           PROTO ((tree, tree));
+static void build_chill_io_list_type   PROTO ((void));
+static void build_io_types             PROTO ((void));
+static void declare_predefined_file    PROTO ((const char *, const char *));
+static tree build_access_part          PROTO ((void));
+static tree textlocation_mode          PROTO ((tree));
+static int check_assoc                 PROTO ((tree, int, const char *));
+static tree assoc_call                 PROTO ((tree, tree, const char *));
+static int check_transfer              PROTO ((tree, int, const char *));
+static int connect_process_optionals   PROTO ((tree, tree *, tree *, tree));
+static tree connect_text               PROTO ((tree, tree, tree, tree));
+static tree connect_access             PROTO ((tree, tree, tree, tree));
+static int check_access                        PROTO ((tree, int, const char *));
+static int check_text                  PROTO ((tree, int, const char *));
+static tree get_final_type_and_range   PROTO ((tree, tree *, tree *));
+static void process_io_list            PROTO ((tree, tree *, tree *, rtx *,
+                                               int, int));
+static void check_format_string                PROTO ((tree, tree, int));
+static int get_max_size                        PROTO ((tree));
 
 /* association mode */
 tree association_type_node;
@@ -1047,8 +1066,8 @@ build_io_types ()
 \f
 static void
 declare_predefined_file (name, assembler_name)
-     char *name;
-     char* assembler_name;
+     const char *name;
+     const char *assembler_name;
 {
   tree decl = build_lang_decl (VAR_DECL, get_identifier (name),
                               stdio_type_node);
@@ -1727,7 +1746,7 @@ static int
 check_assoc (assoc, argnum, errmsg)
      tree assoc;
      int argnum;
-     char *errmsg;
+     const char *errmsg;
 {
   if (assoc == NULL_TREE || TREE_CODE (assoc) == ERROR_MARK)
     return 0;
@@ -1860,7 +1879,7 @@ static tree
 assoc_call (assoc, func, name)
      tree assoc;
      tree func;
-     char *name;
+     const char *name;
 {
   tree arg1, arg2, arg3;
   tree result;
@@ -2107,7 +2126,7 @@ static int
 check_transfer (transfer, argnum, errmsg)
      tree transfer;
      int argnum;
-     char *errmsg;
+     const char *errmsg;
 {
   int result = 0;
 
@@ -2483,7 +2502,7 @@ static int
 check_access (access, argnum, errmsg)
      tree access;
      int argnum;
-     char *errmsg;
+     const char *errmsg;
 {
   if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK)
     return 1;
@@ -2719,7 +2738,7 @@ static int
 check_text (text, argnum, errmsg)
      tree text;
      int argnum;
-     char *errmsg;
+     const char *errmsg;
 {
   if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK)
     return 0;
@@ -3023,8 +3042,8 @@ process_io_list (exprlist, iolist_addr, iolist_length, iolist_rtx, do_read,
     {
       tree item = TREE_VALUE (exprlist);
       tree idx = build_int_2 (idxcnt++, 0);
-      char *fieldname = 0;
-      char *enumname = 0;
+      const char *fieldname = 0;
+      const char *enumname = 0;
       tree array_ref = build_chill_array_ref_1 (iolist, idx);
       tree item_type;
       tree range_low = NULL_TREE, range_high = NULL_TREE;
@@ -3788,6 +3807,9 @@ typedef enum
 } convcode_t;
 static convcode_t     convcode;
 
+static tree check_exprlist             PROTO ((convcode_t, tree, int,
+                                               unsigned long));
+
 typedef enum
 {
   False, True,
@@ -3822,6 +3844,9 @@ typedef enum {
   NormalEnd, EndAtParen, TextFailEnd 
 } formatexit_t;
 
+static formatexit_t scanformcont       PROTO ((char *, int, char **, int *,
+                                               tree, tree *, int, int *));
+
 /* NOTE: varibale have to be set to False before calling check_format_string */
 static Boolean empty_printed;
 
index f09316b8a265ff6ef3e69a9f37e48dcda03d4459..7be6d5c75f04dd635d0c41a1b2503985b4b12abb 100644 (file)
@@ -51,10 +51,13 @@ char* chill_real_input_filename;
 extern FILE* finput;
 
 extern int maximum_field_alignment;
+
+static int deep_const_expr                     PROTO ((tree));
+static void chill_print_error_function         PROTO ((const char *));
 \f
 /* return 1 if the expression tree given has all
    constant nodes as its leaves; return 0 otherwise. */
-int
+static int
 deep_const_expr (exp)
      tree exp;
 {
@@ -234,7 +237,7 @@ lang_decode_option (argc, argv)
   return 1;
 }
 
-void
+static void
 chill_print_error_function (file)
      const char *file;
 {
index 30096a77c0ba2d3540ff835d018ee9a1e7441e69..b7fe5f4665fef9560b2b0a249f170f83dc5f3c3f 100644 (file)
@@ -67,11 +67,11 @@ extern struct obstack permanent_obstack;
 extern struct obstack temporary_obstack;
 
 /* forward declarations */
-static void close_input_file         PROTO((char *));
+static void close_input_file         PROTO((const char *));
 static tree convert_bitstring        PROTO((char *));
 static tree convert_integer          PROTO((char *));
 static void maybe_downcase           PROTO((char *));
-static int  maybe_number             PROTO((char *));
+static int  maybe_number             PROTO((const char *));
 static tree equal_number             PROTO((void));
 static void handle_use_seizefile_directive PROTO((int));
 static int  handle_name                     PROTO((tree));
@@ -82,7 +82,11 @@ static tree read_number              PROTO((int));
 static void skip_c_comment           PROTO((void));
 static void skip_line_comment        PROTO((void));
 static int  skip_whitespace          PROTO((void));
-static tree string_or_char           PROTO((int, char *));
+static tree string_or_char           PROTO((int, const char *));
+static void ch_lex_init              PROTO((void));
+static void skip_directive           PROTO((void));
+static int same_file                 PROTO((const char *, const char *));
+static int getlc                     PROTO((FILE *));
 
 /* next variables are public, because ch-actions uses them */
 
@@ -289,7 +293,8 @@ finish_parse ()
     fclose (finput);
 }
 \f
-static int yywrap ();
+static int yywrap PROTO ((void));
+static int yy_refill PROTO ((void));
 
 #define YY_PUTBACK_SIZE 5
 #define YY_BUF_SIZE 1000
@@ -298,7 +303,8 @@ static char yy_buffer[YY_PUTBACK_SIZE + YY_BUF_SIZE];
 static char *yy_cur = yy_buffer + YY_PUTBACK_SIZE;
 static char *yy_lim = yy_buffer + YY_PUTBACK_SIZE;
 
-int yy_refill ()
+static int
+yy_refill ()
 {
   char *buf = yy_buffer + YY_PUTBACK_SIZE;
   int c, result;
@@ -593,7 +599,7 @@ yylex ()
 
 static void
 close_input_file (fn)
-  char *fn;
+  const char *fn;
 {
   if (finput == NULL)
     abort ();
@@ -838,7 +844,7 @@ read_directive ()
 tree
 build_chill_string (len, str)
     int   len;
-    char  *str;
+    const char  *str;
 {
   tree t;
 
@@ -855,7 +861,7 @@ build_chill_string (len, str)
 static tree
 string_or_char (len, str)
      int   len;
-     char *str;
+     const char *str;
 {
   tree result;
   
@@ -890,7 +896,7 @@ maybe_downcase (str)
 
 static int
 maybe_number (s)
-  char *s;
+  const char *s;
 {
   char fc;
   
@@ -1349,11 +1355,11 @@ convert_bitstring (p)
 
 static int
 same_file (filename1, filename2)
-     char *filename1;
-     char *filename2;
+     const char *filename1;
+     const char *filename2;
 {
   struct stat s[2];
-  char        *fn_input[2];
+  const char *fn_input[2];
   int         i, stat_status;
   
   if (grant_only_flag)
@@ -1457,7 +1463,7 @@ handle_use_seizefile_directive (restricted)
 /*
  * get input, convert to lower case for comparison
  */
-int
+static int
 getlc (file)
      FILE *file;
 {
@@ -2104,7 +2110,7 @@ equal_number ()
  */
 void
 register_seize_path (path)
-     char *path;
+     const char *path;
 {
   int          pathlen = strlen (path);
   char        *new_path = (char *)xmalloc (pathlen + 1);
index df533425a1c1e11e3be925a5e2cd8e00078f3493..fd7c4b92131b4482a9730a985bb7f77ca3f4a601 100644 (file)
@@ -94,6 +94,4 @@ extern tree current_seize_file;
 extern int chill_at_module_level;
 extern tree chill_initializer_name;
 
-extern void finish_chill_seizes ();
-
 extern void prepare_paren_colon PROTO((void));
index 0716ba2cd330882cf046994cd56d7f92777a812b..5a1385e916e5b65098014115ec9c6033b3854bed 100644 (file)
@@ -41,8 +41,8 @@ static int  initialize_iter_var      PROTO((void));
 static void maybe_skip_loop          PROTO((void));
 static int  bottom_loop_end_check    PROTO((void));
 static int  increment_temps          PROTO((void));
-static tree build_temporary_variable PROTO((char *, tree));
-static tree maybe_make_for_temp      PROTO((tree, char *, tree));
+static tree build_temporary_variable PROTO((const char *, tree));
+static tree maybe_make_for_temp      PROTO((tree, const char *, tree));
 #if 0
 static tree chill_unsigned_type      PROTO((tree));
 #endif
@@ -1006,7 +1006,7 @@ top_loop_end_check (condition)
        case DO_POWERSET:
          {
            tree temp1;
-           char *func_name;
+           const char *func_name;
            tree user_type = TREE_TYPE (ip->user_var);
 
            if (ip->down_flag)
@@ -1158,7 +1158,7 @@ increment_temps ()
  */
 tree
 get_unique_identifier (lead)
-     char *lead;
+     const char *lead;
 {
   char idbuf [256];
   static int idcount = 0;
@@ -1174,7 +1174,7 @@ get_unique_identifier (lead)
  */
 static tree
 build_temporary_variable (name, type)
-     char *name;
+     const char *name;
      tree type;
 {
   return decl_temp1 (get_unique_identifier (name), type, 0, NULL_TREE, 0, 0);
@@ -1190,7 +1190,7 @@ build_temporary_variable (name, type)
 static tree
 maybe_make_for_temp (exp, temp_name, exp_type)
      tree exp;
-     char *temp_name;
+     const char *temp_name;
      tree exp_type;
 {
   tree result = exp;
index 96026a105bac0c7c20c191bac8c69637e68bc2b6..72d1db68771cc6dfb09c9a00008d8761a7e3cc13 100644 (file)
@@ -80,6 +80,18 @@ extern struct rtx_def *expand_expr   PROTO((tree, struct rtx_def *,
                                               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_module)
   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();
index 61862d16100ae84df7012cdbd2c0694628249dd6..8ab22f24b01d78f22a36615597c06d21c244b916 100644 (file)
@@ -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;
index 8c3fabeffbc98ad8f5884038371bb04cc2e5841a..db8c90bf9eb9fef9d4bcbc5887fbc71aaa27cd79 100644 (file)
@@ -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, tasking_code_ptr, quasi_flag)
  * 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, tasking_code_ptr, quasi_flag)
                                     *tasking_code_ptr));
   return decl;
 }
+#endif
 \f
 /*
  * Transmute a process parameter list into an argument structure 
@@ -492,11 +505,13 @@ build_process_wrapper (plabel, processdata)
     property"
  */
 
-void
+#if 0
+static void
 validate_process_parameters (parms)
      tree parms ATTRIBUTE_UNUSED;
 {
 }
+#endif
 \f
 /*
  * build the tree for a start process action.  Loop through the
@@ -612,7 +627,7 @@ build_start_process (process_name, copynum,
   
       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, copynum,
        }
       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;
index 41ccb0e88d8d58bba9a833860b4ab34af4c29e56..6d4f9bdf06c7527e1e5db4a478c634902e79e6d1 100644 (file)
@@ -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));
 \f
 /* 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;
 }
 \f
-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, postfix)
 {
   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))
     {
index 8985476a1e8e12efa2e91e90c487bb7137f3b589..f4d8d80d9710620918fa8f84d8b6ce66ef650725 100644 (file)
@@ -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 *));
 \f
 /*
  * This function checks an array access.
@@ -72,7 +79,7 @@ static int expand_constant_to_buffer PROTO((tree, unsigned char *, int));
 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, buf_size)
 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;
 }
 \f
-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);
       }
   }