From 20f0a040ddc6a91c13ce35a4cb42facfb61200c8 Mon Sep 17 00:00:00 2001 From: ghazi Date: Tue, 26 Oct 1999 18:13:38 +0000 Subject: [PATCH] * c-parse.in (cast_expr): Constify. * cccp.c (special_symbol): Likewise. * cse.c (hash_cse_reg_info, cse_reg_info_equal_p): Likewise. * dwarf2out.c (base_type_die): Likewise. * global.c (allocno_compare): Likewise. * local-alloc.c (qty_compare_1, qty_sugg_compare_1): Likewise. * regclass.c (fix_register): Likewise. * rtl.h (fix_register): Likewise. * stupid.c (stupid_reg_compare): Likewise. * toplev.c (decode_f_option): Likewise. * tree.c (build_complex_type): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30196 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 24 ++++++++++++++++++++++++ gcc/c-parse.c | 2 +- gcc/c-parse.in | 2 +- gcc/c-parse.y | 2 +- gcc/cccp.c | 2 +- gcc/cse.c | 6 +++--- gcc/dwarf2out.c | 2 +- gcc/global.c | 2 +- gcc/local-alloc.c | 4 ++-- gcc/objc/objc-parse.c | 2 +- gcc/objc/objc-parse.y | 2 +- gcc/regclass.c | 2 +- gcc/rtl.h | 2 +- gcc/stupid.c | 2 +- gcc/toplev.c | 8 ++++---- gcc/tree.c | 2 +- 16 files changed, 45 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9baf2f178cb..bfa6bb9c9f7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,27 @@ +Tue Oct 26 14:10:23 1999 Kaveh R. Ghazi + + * c-parse.in (cast_expr): Constify. + + * cccp.c (special_symbol): Likewise. + + * cse.c (hash_cse_reg_info, cse_reg_info_equal_p): Likewise. + + * dwarf2out.c (base_type_die): Likewise. + + * global.c (allocno_compare): Likewise. + + * local-alloc.c (qty_compare_1, qty_sugg_compare_1): Likewise. + + * regclass.c (fix_register): Likewise. + + * rtl.h (fix_register): Likewise. + + * stupid.c (stupid_reg_compare): Likewise. + + * toplev.c (decode_f_option): Likewise. + + * tree.c (build_complex_type): Likewise. + Tue Oct 26 18:35:25 1999 Richard Earnshaw * output.h: Don't unnecessarily conditionalize prototypes on TREE_CODE. diff --git a/gcc/c-parse.c b/gcc/c-parse.c index e358450a9c1..80cb75cd7da 100644 --- a/gcc/c-parse.c +++ b/gcc/c-parse.c @@ -2046,7 +2046,7 @@ case 61: break;} case 62: #line 481 "c-parse.y" -{ char *name; +{ const char *name; tree result = pop_init_level (0); tree type = yyvsp[-5].ttype; finish_init (); diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 3259ecac2b6..6811b45b98e 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -523,7 +523,7 @@ cast_expr: $2 = groktypename ($2); really_start_incremental_init ($2); } initlist_maybe_comma '}' %prec UNARY - { char *name; + { const char *name; tree result = pop_init_level (0); tree type = $2; finish_init (); diff --git a/gcc/c-parse.y b/gcc/c-parse.y index f9092d7aed6..0e0b36bc30e 100644 --- a/gcc/c-parse.y +++ b/gcc/c-parse.y @@ -478,7 +478,7 @@ cast_expr: $2 = groktypename ($2); really_start_incremental_init ($2); } initlist_maybe_comma '}' %prec UNARY - { char *name; + { const char *name; tree result = pop_init_level (0); tree type = $2; finish_init (); diff --git a/gcc/cccp.c b/gcc/cccp.c index 2a56b232190..b5f31a1ab2a 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -4261,7 +4261,7 @@ special_symbol (hp, op) #ifdef STDC_0_IN_SYSTEM_HEADERS if (ip->system_header_p && hp->length == 8 && bcmp (hp->name, "__STDC__", 8) == 0 - && !lookup ((U_CHAR *) "__STRICT_ANSI__", -1, -1)) + && !lookup ((const U_CHAR *) "__STRICT_ANSI__", -1, -1)) buf = "0"; #endif if (pcp_inside_if && pcp_outfile) diff --git a/gcc/cse.c b/gcc/cse.c index a304bc605d5..d729cb29a1a 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -899,7 +899,7 @@ static unsigned int hash_cse_reg_info (el_ptr) hash_table_entry_t el_ptr; { - return ((struct cse_reg_info *) el_ptr)->regno; + return ((const struct cse_reg_info *) el_ptr)->regno; } static int @@ -907,8 +907,8 @@ cse_reg_info_equal_p (el_ptr1, el_ptr2) hash_table_entry_t el_ptr1; hash_table_entry_t el_ptr2; { - return (((struct cse_reg_info *) el_ptr1)->regno - == ((struct cse_reg_info *) el_ptr2)->regno); + return (((const struct cse_reg_info *) el_ptr1)->regno + == ((const struct cse_reg_info *) el_ptr2)->regno); } /* Clear the hash table and initialize each register with its own quantity, diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6732e5811de..a9ee93c5334 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -6165,7 +6165,7 @@ base_type_die (type) register tree type; { register dw_die_ref base_type_result; - register char *type_name; + register const char *type_name; register enum dwarf_type encoding; register tree name = TYPE_NAME (type); diff --git a/gcc/global.c b/gcc/global.c index 17bfaf4246d..3ca1d9ccd03 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -594,7 +594,7 @@ allocno_compare (v1p, v2p) const PTR v1p; const PTR v2p; { - int v1 = *(int *)v1p, v2 = *(int *)v2p; + int v1 = *(const int *)v1p, v2 = *(const int *)v2p; /* Note that the quotient will never be bigger than the value of floor_log2 times the maximum number of times a register can occur in one insn (surely less than 100). diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index b45f339e0fd..ee72b7d794e 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1503,7 +1503,7 @@ qty_compare_1 (q1p, q2p) const PTR q1p; const PTR q2p; { - register int q1 = *(int *)q1p, q2 = *(int *)q2p; + register int q1 = *(const int *)q1p, q2 = *(const int *)q2p; register int tem = QTY_CMP_PRI (q2) - QTY_CMP_PRI (q1); if (tem != 0) @@ -1543,7 +1543,7 @@ qty_sugg_compare_1 (q1p, q2p) const PTR q1p; const PTR q2p; { - register int q1 = *(int *)q1p, q2 = *(int *)q2p; + register int q1 = *(const int *)q1p, q2 = *(const int *)q2p; register int tem = QTY_CMP_SUGG (q1) - QTY_CMP_SUGG (q2); if (tem != 0) diff --git a/gcc/objc/objc-parse.c b/gcc/objc/objc-parse.c index 0a9eb500d4a..1445dbda9ff 100644 --- a/gcc/objc/objc-parse.c +++ b/gcc/objc/objc-parse.c @@ -2529,7 +2529,7 @@ case 64: break;} case 65: #line 507 "objc-parse.y" -{ char *name; +{ const char *name; tree result = pop_init_level (0); tree type = yyvsp[-5].ttype; finish_init (); diff --git a/gcc/objc/objc-parse.y b/gcc/objc/objc-parse.y index 24d39f0ae46..5292430d00b 100644 --- a/gcc/objc/objc-parse.y +++ b/gcc/objc/objc-parse.y @@ -504,7 +504,7 @@ cast_expr: $2 = groktypename ($2); really_start_incremental_init ($2); } initlist_maybe_comma '}' %prec UNARY - { char *name; + { const char *name; tree result = pop_init_level (0); tree type = $2; finish_init (); diff --git a/gcc/regclass.c b/gcc/regclass.c index 1b960858694..a2258b73ffa 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -571,7 +571,7 @@ choose_hard_reg_mode (regno, nregs) void fix_register (name, fixed, call_used) - char *name; + const char *name; int fixed, call_used; { int i; diff --git a/gcc/rtl.h b/gcc/rtl.h index 575c01a3f46..629e062dad9 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1565,7 +1565,7 @@ extern void regclass_init PROTO ((void)); extern void regclass PROTO ((rtx, int)); extern void reg_scan PROTO ((rtx, int, int)); extern void reg_scan_update PROTO ((rtx, rtx, int)); -extern void fix_register PROTO ((char *, int, int)); +extern void fix_register PROTO ((const char *, int, int)); /* In regmove.c */ #ifdef BUFSIZ diff --git a/gcc/stupid.c b/gcc/stupid.c index b61f7444ccc..09ea8babc74 100644 --- a/gcc/stupid.c +++ b/gcc/stupid.c @@ -446,7 +446,7 @@ stupid_reg_compare (r1p, r2p) const PTR r1p; const PTR r2p; { - register int r1 = *(int *)r1p, r2 = *(int *)r2p; + register int r1 = *(const int *)r1p, r2 = *(const int *)r2p; register int len1 = reg_where_dead[r1] - REG_WHERE_BORN (r1); register int len2 = reg_where_dead[r2] - REG_WHERE_BORN (r2); int tem; diff --git a/gcc/toplev.c b/gcc/toplev.c index d8c5819c641..3f0118991ab 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4833,14 +4833,14 @@ decode_f_option (arg) read_integral_parameter (arg + 13, arg - 2, inline_max_insns); #ifdef INSN_SCHEDULING else if (!strncmp (arg, "sched-verbose=", 14)) - fix_sched_param ("verbose", (char *)(arg + 14)); + fix_sched_param ("verbose", (const char *)(arg + 14)); #endif else if (!strncmp (arg, "fixed-", 6)) - fix_register ((char *)(arg + 6), 1, 1); + fix_register ((const char *)(arg + 6), 1, 1); else if (!strncmp (arg, "call-used-", 10)) - fix_register ((char *)(arg + 10), 0, 1); + fix_register ((const char *)(arg + 10), 0, 1); else if (!strncmp (arg, "call-saved-", 11)) - fix_register ((char *)(arg + 11), 0, 0); + fix_register ((const char *)(arg + 11), 0, 0); else if (!strncmp (arg, "align-loops=", 12)) align_loops = read_integral_parameter (arg + 12, arg - 2, align_loops); else if (!strncmp (arg, "align-functions=", 16)) diff --git a/gcc/tree.c b/gcc/tree.c index 7d01d7cca27..0d3a7761c5b 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4528,7 +4528,7 @@ build_complex_type (component_type) since complex is a fundamental type. */ if (write_symbols == DWARF2_DEBUG && ! TYPE_NAME (t)) { - char *name; + const char *name; if (component_type == char_type_node) name = "complex char"; else if (component_type == signed_char_type_node) -- 2.11.0