Commit e1def31b by Kaveh R. Ghazi Committed by Kaveh Ghazi

cp-tree.h (fndecl_as_string, [...]): Constify a char*.

	* cp-tree.h (fndecl_as_string, type_as_string,
	type_as_string_real, args_as_string, decl_as_string,
	expr_as_string, code_as_string, language_as_string,
	parm_as_string, op_as_string, assop_as_string, cv_as_string,
	lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.

	* errfn.c (cp_printer): Likewise.

	* error.c (cp_printer, fndecl_as_string, type_as_string_real,
	type_as_string, expr_as_string, decl_as_string, lang_decl_name,
	cp_file_of, code_as_string, language_as_string, parm_as_string,
	op_as_string, assop_as_string, args_as_string, cv_as_string):
	Likewise.

	* tree.c (lang_printable_name): Likewise.

From-SVN: r28968
parent fa74c0f6
1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-tree.h (fndecl_as_string, type_as_string,
type_as_string_real, args_as_string, decl_as_string,
expr_as_string, code_as_string, language_as_string,
parm_as_string, op_as_string, assop_as_string, cv_as_string,
lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
* errfn.c (cp_printer): Likewise.
* error.c (cp_printer, fndecl_as_string, type_as_string_real,
type_as_string, expr_as_string, decl_as_string, lang_decl_name,
cp_file_of, code_as_string, language_as_string, parm_as_string,
op_as_string, assop_as_string, args_as_string, cv_as_string):
Likewise.
* tree.c (lang_printable_name): Likewise.
1999-08-28 Richard Henderson <rth@cygnus.com> 1999-08-28 Richard Henderson <rth@cygnus.com>
* decl2.c (arg_assoc_class): Bail if the class is a builtin type. * decl2.c (arg_assoc_class): Bail if the class is a builtin type.
......
...@@ -3067,20 +3067,20 @@ extern void cp_deprecated PROTO((const char*)); ...@@ -3067,20 +3067,20 @@ extern void cp_deprecated PROTO((const char*));
/* in error.c */ /* in error.c */
extern void init_error PROTO((void)); extern void init_error PROTO((void));
extern char *fndecl_as_string PROTO((tree, int)); extern const char *fndecl_as_string PROTO((tree, int));
extern char *type_as_string PROTO((tree, int)); extern const char *type_as_string PROTO((tree, int));
extern char *type_as_string_real PROTO((tree, int, int)); extern const char *type_as_string_real PROTO((tree, int, int));
extern char *args_as_string PROTO((tree, int)); extern const char *args_as_string PROTO((tree, int));
extern char *decl_as_string PROTO((tree, int)); extern const char *decl_as_string PROTO((tree, int));
extern char *expr_as_string PROTO((tree, int)); extern const char *expr_as_string PROTO((tree, int));
extern char *code_as_string PROTO((enum tree_code, int)); extern const char *code_as_string PROTO((enum tree_code, int));
extern char *language_as_string PROTO((enum languages, int)); extern const char *language_as_string PROTO((enum languages, int));
extern char *parm_as_string PROTO((int, int)); extern const char *parm_as_string PROTO((int, int));
extern char *op_as_string PROTO((enum tree_code, int)); extern const char *op_as_string PROTO((enum tree_code, int));
extern char *assop_as_string PROTO((enum tree_code, int)); extern const char *assop_as_string PROTO((enum tree_code, int));
extern char *cv_as_string PROTO((tree, int)); extern const char *cv_as_string PROTO((tree, int));
extern char *lang_decl_name PROTO((tree, int)); extern const char *lang_decl_name PROTO((tree, int));
extern char *cp_file_of PROTO((tree)); extern const char *cp_file_of PROTO((tree));
extern int cp_line_of PROTO((tree)); extern int cp_line_of PROTO((tree));
/* in except.c */ /* in except.c */
...@@ -3459,7 +3459,7 @@ extern tree fnaddr_from_vtable_entry PROTO((tree)); ...@@ -3459,7 +3459,7 @@ extern tree fnaddr_from_vtable_entry PROTO((tree));
extern tree function_arg_chain PROTO((tree)); extern tree function_arg_chain PROTO((tree));
extern int promotes_to_aggr_type PROTO((tree, enum tree_code)); extern int promotes_to_aggr_type PROTO((tree, enum tree_code));
extern int is_aggr_type_2 PROTO((tree, tree)); extern int is_aggr_type_2 PROTO((tree, tree));
extern char *lang_printable_name PROTO((tree, int)); extern const char *lang_printable_name PROTO((tree, int));
extern tree build_exception_variant PROTO((tree, tree)); extern tree build_exception_variant PROTO((tree, tree));
extern tree copy_template_template_parm PROTO((tree)); extern tree copy_template_template_parm PROTO((tree));
extern tree copy_to_permanent PROTO((tree)); extern tree copy_to_permanent PROTO((tree));
......
...@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
with all memory management; the functions in this file will not free with all memory management; the functions in this file will not free
the char*s returned. See error.c for an example use of this code. */ the char*s returned. See error.c for an example use of this code. */
typedef char* cp_printer PROTO((tree, int)); typedef const char *cp_printer PROTO((tree, int));
extern cp_printer * cp_printers[256]; extern cp_printer * cp_printers[256];
/* Whether or not we should try to be quiet for errors and warnings; this is /* Whether or not we should try to be quiet for errors and warnings; this is
......
...@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h" #include "obstack.h"
#include "toplev.h" #include "toplev.h"
typedef char* cp_printer (); typedef const char *cp_printer ();
#define A args_as_string #define A args_as_string
#define C code_as_string #define C code_as_string
...@@ -1871,7 +1871,7 @@ dump_unary_op (opstring, t, nop) ...@@ -1871,7 +1871,7 @@ dump_unary_op (opstring, t, nop)
/* Print a function decl with exception specification included. */ /* Print a function decl with exception specification included. */
char * const char *
fndecl_as_string (fndecl, print_default_args_p) fndecl_as_string (fndecl, print_default_args_p)
tree fndecl; tree fndecl;
int print_default_args_p; int print_default_args_p;
...@@ -1891,7 +1891,7 @@ fndecl_as_string (fndecl, print_default_args_p) ...@@ -1891,7 +1891,7 @@ fndecl_as_string (fndecl, print_default_args_p)
when describing a typedef, we use the name of the type described, when describing a typedef, we use the name of the type described,
rather than the name of the typedef. */ rather than the name of the typedef. */
char * const char *
type_as_string_real (typ, v, canonical_name) type_as_string_real (typ, v, canonical_name)
tree typ; tree typ;
int v; int v;
...@@ -1907,7 +1907,7 @@ type_as_string_real (typ, v, canonical_name) ...@@ -1907,7 +1907,7 @@ type_as_string_real (typ, v, canonical_name)
} }
char * const char *
type_as_string (typ, v) type_as_string (typ, v)
tree typ; tree typ;
int v; int v;
...@@ -1915,7 +1915,7 @@ type_as_string (typ, v) ...@@ -1915,7 +1915,7 @@ type_as_string (typ, v)
return type_as_string_real (typ, v, 0); return type_as_string_real (typ, v, 0);
} }
char * const char *
expr_as_string (decl, v) expr_as_string (decl, v)
tree decl; tree decl;
int v ATTRIBUTE_UNUSED; int v ATTRIBUTE_UNUSED;
...@@ -1932,7 +1932,7 @@ expr_as_string (decl, v) ...@@ -1932,7 +1932,7 @@ expr_as_string (decl, v)
/* A cross between type_as_string and fndecl_as_string. /* A cross between type_as_string and fndecl_as_string.
Only called from substitute_nice_name. */ Only called from substitute_nice_name. */
char * const char *
decl_as_string (decl, v) decl_as_string (decl, v)
tree decl; tree decl;
int v; int v;
...@@ -1948,7 +1948,7 @@ decl_as_string (decl, v) ...@@ -1948,7 +1948,7 @@ decl_as_string (decl, v)
/* Generate the three forms of printable names for lang_printable_name. */ /* Generate the three forms of printable names for lang_printable_name. */
char * const char *
lang_decl_name (decl, v) lang_decl_name (decl, v)
tree decl; tree decl;
int v; int v;
...@@ -1980,7 +1980,7 @@ lang_decl_name (decl, v) ...@@ -1980,7 +1980,7 @@ lang_decl_name (decl, v)
} }
char * const char *
cp_file_of (t) cp_file_of (t)
tree t; tree t;
{ {
...@@ -2018,7 +2018,7 @@ cp_line_of (t) ...@@ -2018,7 +2018,7 @@ cp_line_of (t)
return line; return line;
} }
char * const char *
code_as_string (c, v) code_as_string (c, v)
enum tree_code c; enum tree_code c;
int v ATTRIBUTE_UNUSED; int v ATTRIBUTE_UNUSED;
...@@ -2026,7 +2026,7 @@ code_as_string (c, v) ...@@ -2026,7 +2026,7 @@ code_as_string (c, v)
return tree_code_name [c]; return tree_code_name [c];
} }
char * const char *
language_as_string (c, v) language_as_string (c, v)
enum languages c; enum languages c;
int v ATTRIBUTE_UNUSED; int v ATTRIBUTE_UNUSED;
...@@ -2050,7 +2050,7 @@ language_as_string (c, v) ...@@ -2050,7 +2050,7 @@ language_as_string (c, v)
/* Return the proper printed version of a parameter to a C++ function. */ /* Return the proper printed version of a parameter to a C++ function. */
char * const char *
parm_as_string (p, v) parm_as_string (p, v)
int p; int p;
int v ATTRIBUTE_UNUSED; int v ATTRIBUTE_UNUSED;
...@@ -2062,7 +2062,7 @@ parm_as_string (p, v) ...@@ -2062,7 +2062,7 @@ parm_as_string (p, v)
return digit_buffer; return digit_buffer;
} }
char * const char *
op_as_string (p, v) op_as_string (p, v)
enum tree_code p; enum tree_code p;
int v ATTRIBUTE_UNUSED; int v ATTRIBUTE_UNUSED;
...@@ -2076,7 +2076,7 @@ op_as_string (p, v) ...@@ -2076,7 +2076,7 @@ op_as_string (p, v)
return buf; return buf;
} }
char * const char *
assop_as_string (p, v) assop_as_string (p, v)
enum tree_code p; enum tree_code p;
int v ATTRIBUTE_UNUSED; int v ATTRIBUTE_UNUSED;
...@@ -2090,7 +2090,7 @@ assop_as_string (p, v) ...@@ -2090,7 +2090,7 @@ assop_as_string (p, v)
return buf; return buf;
} }
char * const char *
args_as_string (p, v) args_as_string (p, v)
tree p; tree p;
int v; int v;
...@@ -2115,7 +2115,7 @@ args_as_string (p, v) ...@@ -2115,7 +2115,7 @@ args_as_string (p, v)
return (char *)obstack_base (&scratch_obstack); return (char *)obstack_base (&scratch_obstack);
} }
char * const char *
cv_as_string (p, v) cv_as_string (p, v)
tree p; tree p;
int v ATTRIBUTE_UNUSED; int v ATTRIBUTE_UNUSED;
......
...@@ -1460,7 +1460,7 @@ is_aggr_type_2 (t1, t2) ...@@ -1460,7 +1460,7 @@ is_aggr_type_2 (t1, t2)
#define PRINT_RING_SIZE 4 #define PRINT_RING_SIZE 4
char * const char *
lang_printable_name (decl, v) lang_printable_name (decl, v)
tree decl; tree decl;
int v; int v;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment