This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

CHILL patch for prototypes & const, part 2/3


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

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

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

	
diff -rup orig/egcs-CVS19990820/gcc/ch/expr.c egcs-CVS19990820/gcc/ch/expr.c
--- orig/egcs-CVS19990820/gcc/ch/expr.c	Tue Jan 19 17:32:32 1999
+++ egcs-CVS19990820/gcc/ch/expr.c	Sat Aug 21 03:17:55 1999
@@ -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)
 
 /* 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, m
   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, 
 }
 
 
-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, 
 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, ch
 }
 
 /* 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, exp
  
   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, exp
     }
   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)
 
 /* 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, op
   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;
diff -rup orig/egcs-CVS19990820/gcc/ch/gperf egcs-CVS19990820/gcc/ch/gperf
--- orig/egcs-CVS19990820/gcc/ch/gperf	Wed Mar 31 10:32:57 1999
+++ egcs-CVS19990820/gcc/ch/gperf	Sat Aug 21 12:22:26 1999
@@ -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
diff -rup orig/egcs-CVS19990820/gcc/ch/grant.c egcs-CVS19990820/gcc/ch/grant.c
--- orig/egcs-CVS19990820/gcc/ch/grant.c	Mon Jan 11 08:17:21 1999
+++ egcs-CVS19990820/gcc/ch/grant.c	Sat Aug 21 03:17:55 1999
@@ -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_selecti
 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 
 
 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;
 }
 
-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_decl
 
 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)
 
 /* 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";
 
diff -rup orig/egcs-CVS19990820/gcc/ch/inout.c egcs-CVS19990820/gcc/ch/inout.c
--- orig/egcs-CVS19990820/gcc/ch/inout.c	Tue Jan 19 17:32:34 1999
+++ egcs-CVS19990820/gcc/ch/inout.c	Sat Aug 21 03:17:55 1999
@@ -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 ()
 
 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, 
     {
       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,
@@ -3821,6 +3843,9 @@ static unsigned long  repetition;
 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;
diff -rup orig/egcs-CVS19990820/gcc/ch/lang.c egcs-CVS19990820/gcc/ch/lang.c
--- orig/egcs-CVS19990820/gcc/ch/lang.c	Sat Aug 21 12:55:33 1999
+++ egcs-CVS19990820/gcc/ch/lang.c	Sat Aug 21 03:17:55 1999
@@ -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 *));
 
 /* 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;
 {
diff -rup orig/egcs-CVS19990820/gcc/ch/lex.c egcs-CVS19990820/gcc/ch/lex.c
--- orig/egcs-CVS19990820/gcc/ch/lex.c	Mon Jan 11 08:17:26 1999
+++ egcs-CVS19990820/gcc/ch/lex.c	Sat Aug 21 03:17:55 1999
@@ -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              PRO
 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);
 }
 
-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 + 
 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 (restrict
 /*
  * 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);
diff -rup orig/egcs-CVS19990820/gcc/ch/lex.h egcs-CVS19990820/gcc/ch/lex.h
--- orig/egcs-CVS19990820/gcc/ch/lex.h	Mon Jan 11 08:17:28 1999
+++ egcs-CVS19990820/gcc/ch/lex.h	Sat Aug 21 03:17:55 1999
@@ -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));
diff -rup orig/egcs-CVS19990820/gcc/ch/loop.c egcs-CVS19990820/gcc/ch/loop.c
--- orig/egcs-CVS19990820/gcc/ch/loop.c	Mon Jan 11 08:17:29 1999
+++ egcs-CVS19990820/gcc/ch/loop.c	Sat Aug 21 03:17:55 1999
@@ -41,8 +41,8 @@ static int  initialize_iter_var      PRO
 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]