diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1999-03-26 07:45:00 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1999-03-26 07:45:00 +0000 |
commit | d8e178a02b6adccbbbef668c0374a95b466d11b0 (patch) | |
tree | 075d74c3c5bdfacc3f051fa291e0d746c4bb5b88 /gcc/cp/xref.c | |
parent | 142413745029dfc6147595a843ed06b4b2d2c4ce (diff) | |
download | gcc-d8e178a02b6adccbbbef668c0374a95b466d11b0.zip gcc-d8e178a02b6adccbbbef668c0374a95b466d11b0.tar.gz gcc-d8e178a02b6adccbbbef668c0374a95b466d11b0.tar.bz2 |
Warning fixes:
* call.c (op_error): Const-ify a char*.
(add_candidate, source_type, add_warning): Add static prototype.
(print_z_candidates): Const-ify a char*.
* class.c (resolve_address_of_overloaded_function,
fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
(get_vtable_name, finish_struct_1): Const-ify a char*.
* cvt.c (convert_to_reference): Likewise.
* decl.c (redeclaration_error_message, record_builtin_type,
record_unknown_type, member_function_or_else, bad_specifiers):
Likewise.
(find_binding, select_decl, unqualified_namespace_lookup,
lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
Add static prototype.
(warn_extern_redeclared_static, duplicate_decls, pushdecl,
implicitly_declare, record_builtin_java_type, define_function,
grok_op_properties, tag_name): Const-ify a char*.
* cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
(define_function, finish_builtin_type): Const-ify a char*.
(cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
(file_name_nondirectory): Const-ify a char*.
(init_filename_times): Don't prototype.
(compiler_error): Prototype.
(yyerror, init_repo): Const-ify a char*.
(build_srcloc): Don't prototype.
(build_x_indirect_ref, build_indirect_ref, build_component_addr):
Const-ify a char*.
(warn_for_assignment): Don't prototype.
(convert_for_initialization, readonly_error, check_for_new_type,
GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
Const-ify a char*.
* decl2.c (acceptable_java_type, output_vtable_inherit,
setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
merge_functions, decl_namespace, validate_nonmember_using_decl,
do_nonmember_using_decl): Add static prototype.
(lang_f_options): Const-ify a char*.
(finish_builtin_type): Likewise.
(add_function, arg_assoc_namespace, arg_assoc_class): Add static
prototype.
* errfn.c: Include cp-tree.h.
(cp_thing): Add static prototype.
(compiler_error): Don't protoptype.
(cp_compiler_error): Cast `compiler_error' to `errorfn' before
passing it to `cp_thing'.
* error.c (interesting_scope_p): Add static prototype.
* except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
a char*.
* init.c (compiler_error): Don't prototype.
(member_init_ok_or_else): Const-ify a char*.
(build_java_class_ref): Add static prototype.
* lex.c (compiler_error): Don't prototype.
(get_time_identifier, interface_strcmp, extend_token_buffer,
handle_cp_pragma): Const-ify a char*.
(is_global, init_filename_times): Add static prototype.
(file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
(compiler_error): Change from fixed args to variable args.
(yyerror): Const-ify a char*.
* parse.y (cond_stmt_keyword): Const-ify a char*.
(parse_decl): Add static prototype.
* pt.c (template_args_equal, print_template_context): Likewise.
(print_candidates, check_default_tmpl_args): Const-ify a char*.
(instantiate_class_template): Likewise.
* repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
* rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
* search.c (lookup_field_info, lookup_member): Likewise.
(lookup_member): Cast the first argument of `bzero' to a PTR.
* sig.c (compiler_error): Don't prototype.
(build_signature_pointer_or_reference_nam): Const-ify a char*.
(get_sigtable_name, build_member_function_pointer): Likewise.
* tree.c (compiler_error): Don't prototype.
(no_linkage_helper, build_srcloc): Add static prototype.
(build_vbase_pointer_fields): Const-ify a char*.
(__eprintf): Don't unnecessarily handle `const' when !__STDC__.
* typeck.c (compiler_error): Don't prototype.
(convert_for_assignment): Const-ify a char*.
(comp_cv_target_types): Add static prototype.
(build_x_indirect_ref, build_indirect_ref, convert_arguments,
build_component_addr, build_unary_op, convert_for_initialization):
Const-ify a char*.
* typeck2.c (ack): Add static prototype and change from fixed args
to variable args.
(readonly_error, check_for_new_type): Const-ify a char*.
* xref.c (_XREF_FILE, find_file, filename, fctname, declname,
fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
(GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'.
(GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
gen_assign, GNU_xref_member): Const-ify a char*.
From-SVN: r25994
Diffstat (limited to 'gcc/cp/xref.c')
-rw-r--r-- | gcc/cp/xref.c | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/gcc/cp/xref.c b/gcc/cp/xref.c index e38546e..6e06eda 100644 --- a/gcc/cp/xref.c +++ b/gcc/cp/xref.c @@ -86,8 +86,8 @@ typedef struct _XREF_SCOPE * XREF_SCOPE; typedef struct _XREF_FILE { - char *name; - char *outname; + const char *name; + const char *outname; XREF_FILE next; } XREF_FILE_INFO; @@ -122,19 +122,20 @@ static tree last_fndecl = NULL; /* */ /************************************************************************/ static void gen_assign PROTO((XREF_FILE, tree)); -static XREF_FILE find_file PROTO((char *)); -static char * filename PROTO((XREF_FILE)); -static char * fctname PROTO((tree)); -static char * declname PROTO((tree)); +static XREF_FILE find_file PROTO((const char *)); +static const char * filename PROTO((XREF_FILE)); +static const char * fctname PROTO((tree)); +static const char * declname PROTO((tree)); static void simplify_type PROTO((char *)); -static char * fixname PROTO((char *, char *)); -static void open_xref_file PROTO((char *)); +static const char * fixname PROTO((const char *, char *)); +static void open_xref_file PROTO((const char *)); +static const char * classname PROTO((tree)); /* Start cross referencing. FILE is the name of the file we xref. */ void GNU_xref_begin (file) - char *file; + const char *file; { doing_xref = 1; @@ -178,7 +179,7 @@ GNU_xref_end (ect) void GNU_xref_file (name) - char *name; + const char *name; { XREF_FILE xf; @@ -209,8 +210,8 @@ GNU_xref_file (name) else { char *nmbuf - = (char *) malloc (strlen (wd_name) + strlen (FILE_NAME_JOINER) - + strlen (name) + 1); + = (char *) xmalloc (strlen (wd_name) + strlen (FILE_NAME_JOINER) + + strlen (name) + 1); sprintf (nmbuf, "%s%s%s", wd_name, FILE_NAME_JOINER, name); name = nmbuf; xf->outname = nmbuf; @@ -259,7 +260,7 @@ GNU_xref_end_scope (id,inid,prm,keep) { XREF_FILE xf; XREF_SCOPE xs,lxs,oxs; - char *stype; + const char *stype; if (!doing_xref) return; xf = find_file (input_filename); @@ -302,7 +303,7 @@ GNU_xref_end_scope (id,inid,prm,keep) void GNU_xref_ref (fndecl,name) tree fndecl; - char *name; + const char *name; { XREF_FILE xf; @@ -322,8 +323,8 @@ GNU_xref_decl (fndecl,decl) tree decl; { XREF_FILE xf,xf1; - char *cls = 0; - char *name; + const char *cls = 0; + const char *name; char buf[10240]; int uselin; @@ -432,11 +433,11 @@ GNU_xref_decl (fndecl,decl) void GNU_xref_call (fndecl, name) tree fndecl; - char *name; + const char *name; { XREF_FILE xf; char buf[1024]; - char *s; + const char *s; if (!doing_xref) return; xf = find_file (input_filename); @@ -508,7 +509,7 @@ gen_assign(xf, name) XREF_FILE xf; tree name; { - char *s; + const char *s; s = NULL; @@ -541,7 +542,7 @@ gen_assign(xf, name) fprintf(xref_file, "ASG %s %d %s\n", filename(xf), lineno, s); } -static char* +static const char * classname (cls) tree cls; { @@ -590,9 +591,9 @@ GNU_xref_member(cls, fld) tree fld; { XREF_FILE xf; - char *prot; + const char *prot; int confg, pure; - char *d; + const char *d; #ifdef XREF_SHORT_MEMBER_NAMES int i; #endif @@ -651,7 +652,7 @@ GNU_xref_member(cls, fld) static XREF_FILE find_file(name) - char *name; + const char *name; { XREF_FILE xf; @@ -664,7 +665,7 @@ find_file(name) /* Return filename for output purposes. */ -static char * +static const char * filename(xf) XREF_FILE xf; { @@ -682,12 +683,12 @@ filename(xf) /* Return function name for output purposes. */ -static char * +static const char * fctname(fndecl) tree fndecl; { static char fctbuf[1024]; - char *s; + const char *s; if (fndecl == NULL && last_fndecl == NULL) return "*"; @@ -709,7 +710,7 @@ fctname(fndecl) /* Return decl name for output purposes. */ -static char * +static const char * declname(dcl) tree dcl; { @@ -773,12 +774,13 @@ simplify_type(typ) /* Fixup a function name (take care of embedded spaces). */ -static char * +static const char * fixname(nam, buf) - char *nam; + const char *nam; char *buf; { - char *s, *t; + const char *s; + char *t; int fg; s = nam; @@ -806,9 +808,10 @@ fixname(nam, buf) static void open_xref_file(file) - char *file; + const char *file; { - char *s, *t; + const char *s; + char *t; #ifdef XREF_FILE_NAME XREF_FILE_NAME (xref_name, file); |