From 83182544dbfc89d2d974431383d61039cac9b773 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Thu, 13 Sep 2001 14:37:29 +0000 Subject: c-parse.in (yyerror): Const-ification and/or static-ization. * c-parse.in (yyerror): Const-ification and/or static-ization. * c-typeck.c (push_member_name): Likewise. * collect2.c (main): Likewise. * dbxout.c (dbxout_parms): Likewise. * diagnostic.c (format_with_decl): Likewise. * dwarf2out.c (output_ranges): Likewise. * dwarfout.c (fundamental_type_code): Likewise. * except.c (dw2_output_call_site_table): Likewise. * gcc.c (do_spec_1): Likewise. * genopinit.c (optabs): Likewise. * objc/objc-act.c (synth_id_with_class_suffix, start_class, gen_declaration_1, handle_impent): Likewise. * protoize.c (default_include, in_system_include_dir, abspath): Likewise. * sched-vis.c (visualize_stall_cycles): Likewise. * sdbout.c (plain_type_1, sdbout_end_function, sdbout_end_epilogue): Likewise. * varasm.c (decode_reg_name): Likewise. * 1750a.c (mod_regno_adjust): Likewise. * alpha.c (alpha_write_one_linkage, unicosmk_output_default_externs): Likewise. * arm.c (arm_condition_codes): Likewise. * arm.h (arm_condition_codes): Likewise. * avr.c (output_movsisf, encode_section_info): Likewise. * darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL): Likewise. * i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise. * m88k.c (output_function_profiler): Likewise. * mips.c (mips_output_conditional_branch): Likewise. * ns32k.c (ns32k_out_reg_names): Likewise. * ns32k.h (ns32k_out_reg_names): Likewise. * pj.c (pj_output_rval): Likewise. * rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise. * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue): Likewise. cp: * decl.c (warn_extern_redeclared_static, cp_make_fname_decl): Const-ification. * pt.c (tsubst_decl): Likewise. f: * bad.c (ffebad_finish): Const-ification and/or static-ization. * intrin.c (ffeintrin_cmp_name_): Likewise. * stc.c (ffestc_R904): Likewise. java: * expr.c (expand_invoke): Const-ification. * parse.y (patch_method_invocation): Likewise. From-SVN: r45581 --- gcc/java/ChangeLog | 5 +++++ gcc/java/expr.c | 2 +- gcc/java/parse.y | 14 +++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'gcc/java') diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index ba4a3b2..95aafb3 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2001-09-13 Kaveh R. Ghazi + + * expr.c (expand_invoke): Const-ification. + * parse.y (patch_method_invocation): Likewise. + 2001-09-12 Kaveh R. Ghazi * gjavah.c (cxx_keywords): Const-ification. diff --git a/gcc/java/expr.c b/gcc/java/expr.c index d1cc19e..ff0a327 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -1916,7 +1916,7 @@ expand_invoke (opcode, method_ref_index, nargs) tree method_name = COMPONENT_REF_NAME (¤t_jcf->cpool, method_ref_index); tree self_type = get_class_constant (current_jcf, COMPONENT_REF_CLASS_INDEX(¤t_jcf->cpool, method_ref_index)); - const char *self_name + const char *const self_name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (self_type))); tree call, func, method, arg_list, method_type; tree check = NULL_TREE; diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 62f231c..ee528dc 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -10308,15 +10308,15 @@ patch_method_invocation (patch, primary, where, from_super, /* Calls to clone() on array types are permitted as a special-case. */ && !is_array_clone_call) { - const char *fct_name = IDENTIFIER_POINTER (DECL_NAME (list)); - const char *access = + const char *const fct_name = IDENTIFIER_POINTER (DECL_NAME (list)); + const char *const access = java_accstring_lookup (get_access_flags_from_decl (list)); - const char *klass = + const char *const klass = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (list)))); - const char *refklass = + const char *const refklass = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))); - const char *what = (DECL_CONSTRUCTOR_P (list) - ? "constructor" : "method"); + const char *const what = (DECL_CONSTRUCTOR_P (list) + ? "constructor" : "method"); /* FIXME: WFL yields the wrong message here but I don't know what else to use. */ parse_error_context (wfl, @@ -14828,7 +14828,7 @@ array_constructor_check_entry (type, entry) /* Check and report errors */ if (!new_value) { - const char *msg = (!valid_cast_to_p (type_value, type) ? + const char *const msg = (!valid_cast_to_p (type_value, type) ? "Can't" : "Explicit cast needed to"); if (!array_type_string) array_type_string = xstrdup (lang_printable_name (type, 1)); -- cgit v1.1