* class.c (count_fields, add_fields_to_vec): Add static prototype.
* cp-tree.h (opname_tab, assignop_tab, operator_name_string,
get_id_2, composite_pointer_type, dump_node_to_file): Constify a
char*.
* decl.c (named_label_list, cp_finish_decl, grokdeclarator):
Constify a char*.
* decl2.c (finish_static_data_member_decl, grokfield): Constify a
char*.
* dump.c (queue_and_dump_index, dump_int, dump_string,
dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
a char*.
(dump_stmt): Add static prototype.
* errfn.c (cp_thing): Constify a char*.
* error.c (dump_unary_op, dump_binary_op, aggr_variety,
dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
dump_expr): Constify a char*.
* lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
read_line_number): Add static prototype.
(opname_tab, assignop_tab, operator_name_string): Constify a char*.
(real_yylex): Move label `letter' into the scope where it is used.
* method.c (build_mangled_template_parm_index, build_overload_int,
build_decl_overload_real, get_id_2): Constify a char*.
* search.c (check_final_overrider): Make static.
* typeck.c (composite_pointer_type): Constify a char*.
From-SVN: r28588
+1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * class.c (count_fields, add_fields_to_vec): Add static prototype.
+
+ * cp-tree.h (opname_tab, assignop_tab, operator_name_string,
+ get_id_2, composite_pointer_type, dump_node_to_file): Constify a
+ char*.
+
+ * decl.c (named_label_list, cp_finish_decl, grokdeclarator):
+ Constify a char*.
+
+ * decl2.c (finish_static_data_member_decl, grokfield): Constify a
+ char*.
+
+ * dump.c (queue_and_dump_index, dump_int, dump_string,
+ dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
+ a char*.
+ (dump_stmt): Add static prototype.
+
+ * errfn.c (cp_thing): Constify a char*.
+
+ * error.c (dump_unary_op, dump_binary_op, aggr_variety,
+ dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
+ dump_expr): Constify a char*.
+
+ * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
+ read_line_number): Add static prototype.
+ (opname_tab, assignop_tab, operator_name_string): Constify a char*.
+ (real_yylex): Move label `letter' into the scope where it is used.
+
+ * method.c (build_mangled_template_parm_index, build_overload_int,
+ build_decl_overload_real, get_id_2): Constify a char*.
+
+ * search.c (check_final_overrider): Make static.
+
+ * typeck.c (composite_pointer_type): Constify a char*.
+
1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (bad_specifiers): It's OK to have an EH spec on a function
static void build_vtable_entry_ref PROTO((tree, tree, tree));
static tree build_vtable_entry_for_fn PROTO((tree, tree));
static tree build_vtbl_initializer PROTO((tree));
+static int count_fields PROTO((tree));
+static int add_fields_to_vec PROTO((tree, tree, int));
/* Way of stacking language names. */
tree *current_lang_base, *current_lang_stack;
/* Indexed by TREE_CODE, these tables give C-looking names to
operators represented by TREE_CODES. For example,
opname_tab[(int) MINUS_EXPR] == "-". */
-extern char **opname_tab, **assignop_tab;
+extern const char **opname_tab, **assignop_tab;
\f
/* in call.c */
extern int check_dtor_name PROTO((tree, tree));
extern tree make_reference_declarator PROTO((tree, tree));
extern tree make_call_declarator PROTO((tree, tree, tree, tree));
extern void set_quals_and_spec PROTO((tree, tree, tree));
-extern char *operator_name_string PROTO((tree));
+extern const char *operator_name_string PROTO((tree));
extern void lang_init PROTO((void));
extern void lang_finish PROTO((void));
#if 0
extern tree make_thunk PROTO((tree, int));
extern void emit_thunk PROTO((tree));
extern void synthesize_method PROTO((tree));
-extern tree get_id_2 PROTO((char *, tree));
+extern tree get_id_2 PROTO((const char *, tree));
/* in pt.c */
extern void check_template_shadow PROTO ((tree));
extern tree delta2_from_ptrmemfunc PROTO((tree));
extern tree pfn_from_ptrmemfunc PROTO((tree));
extern tree type_after_usual_arithmetic_conversions PROTO((tree, tree));
-extern tree composite_pointer_type PROTO((tree, tree, tree, tree, char*));
+extern tree composite_pointer_type PROTO((tree, tree, tree, tree,
+ const char*));
/* in typeck2.c */
extern tree error_not_base_type PROTO((tree, tree));
extern void GNU_xref_member PROTO((tree, tree));
/* in dump.c */
-extern void dump_node_to_file PROTO ((tree, char *));
+extern void dump_node_to_file PROTO ((tree, const char *));
/* -- end of C++ */
struct binding_level *binding_level;
tree names_in_scope;
tree label_decl;
- char *filename_o_goto;
+ const char *filename_o_goto;
int lineno_o_goto;
struct named_label_list *next;
};
tree cleanup = NULL_TREE, ttype = NULL_TREE;
int was_incomplete;
int temporary = allocation_temporary_p ();
- char *asmspec = NULL;
+ const char *asmspec = NULL;
int was_readonly = 0;
int already_used = 0;
tree core_type;
int defaulted_int = 0;
int opaque_typedef = 0;
tree typedef_decl = NULL_TREE;
- char *name;
+ const char *name;
tree typedef_type = NULL_TREE;
int funcdef_flag = 0;
enum tree_code innermost_code = ERROR_MARK;
int need_pop;
int flags;
{
- char* asmspec = 0;
+ const char *asmspec = 0;
if (asmspec_tree)
asmspec = TREE_STRING_POINTER (asmspec_tree);
tree declarator, declspecs, init, asmspec_tree, attrlist;
{
register tree value;
- char *asmspec = 0;
+ const char *asmspec = 0;
int flags = LOOKUP_ONLYCONVERTING;
/* Convert () initializers to = initializers. */
static unsigned int queue PROTO ((dump_info_p, tree, int));
static void dump_index PROTO ((dump_info_p, unsigned int));
-static void queue_and_dump_index PROTO ((dump_info_p, char *, tree, int));
+static void queue_and_dump_index PROTO ((dump_info_p, const char *, tree, int));
static void queue_and_dump_type PROTO ((dump_info_p, tree, int));
static void dequeue_and_dump PROTO ((dump_info_p));
static void dump_new_line PROTO ((dump_info_p));
static void dump_maybe_newline PROTO ((dump_info_p));
-static void dump_int PROTO ((dump_info_p, char *, int));
-static void dump_string PROTO ((dump_info_p, char *));
-static void dump_string_field PROTO ((dump_info_p, char *, char *));
+static void dump_int PROTO ((dump_info_p, const char *, int));
+static void dump_string PROTO ((dump_info_p, const char *));
+static void dump_string_field PROTO ((dump_info_p, const char *, const char *));
static void dump_node PROTO ((tree, FILE *));
+static void dump_stmt PROTO ((dump_info_p, tree));
/* Add T to the end of the queue of nodes to dump. If DUMP_CHILDREN_P
is non-zero, then its children should be dumped as well. Returns
static void
queue_and_dump_index (di, field, t, flags)
dump_info_p di;
- char *field;
+ const char *field;
tree t;
int flags;
{
static void
dump_int (di, field, i)
dump_info_p di;
- char *field;
+ const char *field;
int i;
{
dump_maybe_newline (di);
static void
dump_string (di, string)
dump_info_p di;
- char *string;
+ const char *string;
{
dump_maybe_newline (di);
fprintf (di->stream, "%-13s ", string);
static void
dump_string_field (di, field, string)
dump_info_p di;
- char *field;
- char *string;
+ const char *field;
+ const char *string;
{
dump_maybe_newline (di);
fprintf (di->stream, "%-4s: %-7s ", field, string);
/* And a source position. */
if (DECL_SOURCE_FILE (t))
{
- char *filename = rindex (DECL_SOURCE_FILE (t), '/');
+ const char *filename = rindex (DECL_SOURCE_FILE (t), '/');
if (!filename)
filename = DECL_SOURCE_FILE (t);
else
void
dump_node_to_file (t, file)
tree t;
- char *file;
+ const char *file;
{
FILE *f;
if (function || *f == 's')
{
- char *p;
+ const char *p;
int plen;
if (*f == 's')
if (atarg)
{
- char *file = cp_file_of (atarg);
+ const char *file = cp_file_of (atarg);
int line = cp_line_of (atarg);
(*errfn) (file, line, "%s", buf);
}
static void dump_decl PROTO((tree, int));
static void dump_function_decl PROTO((tree, int));
static void dump_expr PROTO((tree, int));
-static void dump_unary_op PROTO((char *, tree, int));
-static void dump_binary_op PROTO((char *, tree));
+static void dump_unary_op PROTO((const char *, tree, int));
+static void dump_binary_op PROTO((const char *, tree));
static void dump_aggr_type PROTO((tree, int, int));
static void dump_type_prefix PROTO((tree, int, int));
static void dump_type_suffix PROTO((tree, int, int));
static void dump_char PROTO((int));
static void dump_parameters PROTO((tree, int, int));
static void dump_exception_spec PROTO((tree, int));
-static char *aggr_variety PROTO((tree));
+static const char *aggr_variety PROTO((tree));
static tree ident_fndecl PROTO((tree));
static int interesting_scope_p PROTO((tree));
}
}
-static char *
+static const char *
aggr_variety (t)
tree t;
{
int canonical_name;
{
tree name;
- char *variety = aggr_variety (t);
+ const char *variety = aggr_variety (t);
dump_qualifiers (t, after);
dump_global_iord (t)
tree t;
{
- char *name = IDENTIFIER_POINTER (t);
+ const char *name = IDENTIFIER_POINTER (t);
OB_PUTS ("(static ");
if (name [sizeof (GLOBAL_THING) - 1] == 'I')
}
else if (IDENTIFIER_OPNAME_P (t))
{
- char *name_string = operator_name_string (t);
+ const char *name_string = operator_name_string (t);
OB_PUTS ("operator ");
OB_PUTCP (name_string);
}
}
else if (IDENTIFIER_OPNAME_P (name))
{
- char *name_string = operator_name_string (name);
+ const char *name_string = operator_name_string (name);
OB_PUTS ("operator ");
OB_PUTCP (name_string);
}
/* If it's an enum, output its tag, rather than its value. */
if (TREE_CODE (type) == ENUMERAL_TYPE)
{
- char *p = enum_name_string (t, type);
+ const char *p = enum_name_string (t, type);
OB_PUTCP (p);
}
else if (type == boolean_type_node)
sprintf (digit_buffer, "%g", TREE_REAL_CST (t));
#else
{
- unsigned char *p = (unsigned char *) &TREE_REAL_CST (t);
+ const unsigned char *p = (const unsigned char *) &TREE_REAL_CST (t);
size_t i;
strcpy (digit_buffer, "0x");
for (i = 0; i < sizeof TREE_REAL_CST (t); i++)
case STRING_CST:
{
- char *p = TREE_STRING_POINTER (t);
+ const char *p = TREE_STRING_POINTER (t);
int len = TREE_STRING_LENGTH (t) - 1;
int i;
static void
dump_binary_op (opstring, t)
- char *opstring;
+ const char *opstring;
tree t;
{
OB_PUTC ('(');
static void
dump_unary_op (opstring, t, nop)
- char *opstring;
+ const char *opstring;
tree t;
int nop;
{
static void parse_float PROTO((PTR));
static int is_global PROTO((tree));
static void init_filename_times PROTO((void));
+static void extend_token_buffer_to PROTO((int));
+#ifdef HANDLE_PRAGMA
+static int pragma_getc PROTO((void));
+static void pragma_ungetc PROTO((int));
+#endif
+static int read_line_number PROTO((int *));
/* Given a file name X, return the nondirectory portion.
Keep in mind that X can be computed more than once. */
/* Holds translations from TREE_CODEs to operator name strings,
i.e., opname_tab[PLUS_EXPR] == "+". */
-char **opname_tab;
-char **assignop_tab;
+const char **opname_tab;
+const char **assignop_tab;
\f
extern int yychar; /* the lookahead symbol */
extern YYSTYPE yylval; /* the semantic value of the */
tree ansi_opname[LAST_CPLUS_TREE_CODE];
tree ansi_assopname[LAST_CPLUS_TREE_CODE];
-char *
+const char *
operator_name_string (name)
tree name;
{
(char *)(tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
(LAST_CPLUS_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (char *));
- opname_tab = (char **)oballoc ((int)LAST_CPLUS_TREE_CODE * sizeof (char *));
+ opname_tab = (const char **)oballoc ((int)LAST_CPLUS_TREE_CODE * sizeof (char *));
bzero ((char *)opname_tab, (int)LAST_CPLUS_TREE_CODE * sizeof (char *));
- assignop_tab = (char **)oballoc ((int)LAST_CPLUS_TREE_CODE * sizeof (char *));
+ assignop_tab = (const char **)oballoc ((int)LAST_CPLUS_TREE_CODE * sizeof (char *));
bzero ((char *)assignop_tab, (int)LAST_CPLUS_TREE_CODE * sizeof (char *));
ansi_opname[0] = get_identifier ("<invalid operator>");
case 'z':
case '_':
case '$':
- letter:
#if USE_CPPLIB
+ letter:
if (cpp_token == CPP_NAME)
{
/* Note that one character has already been read from
static int check_ktype PROTO((tree, int));
static int issue_ktype PROTO((tree));
static void build_overload_scope_ref PROTO((tree));
-static void build_mangled_template_parm_index PROTO((char *, tree));
+static void build_mangled_template_parm_index PROTO((const char *, tree));
#if HOST_BITS_PER_WIDE_INT >= 64
static void build_mangled_C9x_name PROTO((int));
#endif
int i;
int operands = tree_code_length[(int) TREE_CODE (value)];
tree id;
- char* name;
+ const char *name;
id = ansi_opname [(int) TREE_CODE (value)];
my_friendly_assert (id != NULL_TREE, 0);
static void
build_mangled_template_parm_index (s, index)
- char* s;
+ const char *s;
tree index;
{
OB_PUTCP (s);
tree targs;
int for_method;
{
- char *name = IDENTIFIER_POINTER (dname);
+ const char *name = IDENTIFIER_POINTER (dname);
/* member operators new and delete look like methods at this point. */
if (! for_method && parms != NULL_TREE && TREE_CODE (parms) == TREE_LIST
tree
get_id_2 (name, name2)
- char *name;
+ const char *name;
tree name2;
{
OB_INIT ();
/* Check that virtual overrider OVERRIDER is acceptable for base function
BASEFN. Issue diagnostic, and return zero, if unacceptable. */
-int
+static int
check_final_overrider (overrider, basefn)
tree overrider, basefn;
{
tree t2;
tree arg1;
tree arg2;
- char* location;
+ const char* location;
{
tree result_type;