OSDN Git Service

* gcc.c (default_compilers): Const-ify.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jan 2002 23:18:59 +0000 (23:18 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jan 2002 23:18:59 +0000 (23:18 +0000)
* mips-tdump.c (stab_names): Likewise.
* mips-tfile.c (map_coff_types, map_coff_storage,
map_coff_sym_type, map_coff_derived_type, stabs_symbol,
pseudo_ops_t, pseudo_ops): Likewise.
* protoize.c (default_include): Likewise

f:
* com.c (clear_binding_level): Const-ify.
(ffecom_arglist_expr_): Likewise.
* info.c (ffeinfo_types_): Don't needlessly zero init.
* lex.c (ffelex_hash_kludge): Const-ify.

java:
* parse.y (src_parse_roots): Don't needlessly zero init.

libiberty:
* cp-demangle.c (long_options): Const-ify.
* cplus-dem.c (long_options): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48485 138bc75d-0d04-0410-961f-82ee72b054a4

14 files changed:
gcc/ChangeLog
gcc/f/ChangeLog
gcc/f/com.c
gcc/f/info.c
gcc/f/lex.c
gcc/gcc.c
gcc/java/ChangeLog
gcc/java/parse.y
gcc/mips-tdump.c
gcc/mips-tfile.c
gcc/protoize.c
libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/cplus-dem.c

index b093ea9..64c0b4d 100644 (file)
@@ -1,5 +1,12 @@
 2002-01-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
 2002-01-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+       * gcc.c (default_compilers): Const-ify.
+       * mips-tdump.c (stab_names): Likewise.
+       * mips-tfile.c (map_coff_types, map_coff_storage,
+       map_coff_sym_type, map_coff_derived_type, stabs_symbol,
+       pseudo_ops_t, pseudo_ops): Likewise.
+       * protoize.c (default_include): Likewise
+
        * real.c (GET_REAL, PUT_REAL): Don't cast away const-ness.
        (ezero, ehalf, eone, etwo, e32, elog2, esqrt2, epi): Const-ify.
        Add array size in declaration.
        * real.c (GET_REAL, PUT_REAL): Don't cast away const-ness.
        (ezero, ehalf, eone, etwo, e32, elog2, esqrt2, epi): Const-ify.
        Add array size in declaration.
index dce4853..54d0728 100644 (file)
@@ -1,3 +1,10 @@
+Wed Jan  2 18:13:11 2002  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * com.c (clear_binding_level): Const-ify.
+       (ffecom_arglist_expr_): Likewise.
+       * info.c (ffeinfo_types_): Don't needlessly zero init.
+       * lex.c (ffelex_hash_kludge): Const-ify.
+
 Sun Dec 23 10:45:09 2001  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * com.c (ffecom_gfrt_volatile_, ffecom_gfrt_complex_,
 Sun Dec 23 10:45:09 2001  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * com.c (ffecom_gfrt_volatile_, ffecom_gfrt_complex_,
index 823f18d..9abab69 100644 (file)
@@ -563,7 +563,7 @@ static struct binding_level *global_binding_level;
 
 /* Binding level structures are initialized by copying this one.  */
 
 
 /* Binding level structures are initialized by copying this one.  */
 
-static struct binding_level clear_binding_level
+static const struct binding_level clear_binding_level
 =
 {NULL, NULL, NULL, NULL_BINDING_LEVEL, 0};
 
 =
 {NULL, NULL, NULL, NULL_BINDING_LEVEL, 0};
 
@@ -1283,7 +1283,7 @@ ffecom_arglist_expr_ (const char *c, ffebld expr)
   tree item;
   bool ptr = FALSE;
   tree wanted = NULL_TREE;
   tree item;
   bool ptr = FALSE;
   tree wanted = NULL_TREE;
-  static char zed[] = "0";
+  static const char zed[] = "0";
 
   if (c == NULL)
     c = &zed[0];
 
   if (c == NULL)
     c = &zed[0];
index b3ceef1..b632f41 100644 (file)
@@ -98,8 +98,7 @@ static const char *const ffeinfo_where_string_[]
 #include "info-w.def"
 #undef FFEINFO_WHERE
 };
 #include "info-w.def"
 #undef FFEINFO_WHERE
 };
-static ffetype ffeinfo_types_[FFEINFO_basictype][FFEINFO_kindtype]
-  = { { NULL } };
+static ffetype ffeinfo_types_[FFEINFO_basictype][FFEINFO_kindtype];
 
 /* Static functions (internal). */
 
 
 /* Static functions (internal). */
 
index 6169656..acbb4d3 100644 (file)
@@ -3898,10 +3898,10 @@ ffelex_hash_kludge (FILE *finput)
   /* If you change this constant string, you have to change whatever
      code might thus be affected by it in terms of having to use
      ffelex_getc_() instead of getc() in the lexers and _hash_.  */
   /* If you change this constant string, you have to change whatever
      code might thus be affected by it in terms of having to use
      ffelex_getc_() instead of getc() in the lexers and _hash_.  */
-  static char match[] = "# 1 \"";
+  static const char match[] = "# 1 \"";
   static int kludge[ARRAY_SIZE (match) + 1];
   int c;
   static int kludge[ARRAY_SIZE (match) + 1];
   int c;
-  char *p;
+  const char *p;
   int *q;
 
   /* Read chars as long as they match the target string.
   int *q;
 
   /* Read chars as long as they match the target string.
index 25cbeb5..bb2b0c4 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -807,7 +807,7 @@ static int n_compilers;
 
 /* The default list of file name suffixes and their compilation specs.  */
 
 
 /* The default list of file name suffixes and their compilation specs.  */
 
-static struct compiler default_compilers[] =
+static const struct compiler default_compilers[] =
 {
   /* Add lists of suffixes of known languages here.  If those languages
      were not present when we built the driver, we will hit these copies
 {
   /* Add lists of suffixes of known languages here.  If those languages
      were not present when we built the driver, we will hit these copies
index e3ba451..c2a66ee 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * parse.y (src_parse_roots): Don't needlessly zero init.
+
 2001-12-31  Tom Tromey  <tromey@redhat.com>
 
        * parse.y (dump_java_tree): New function.
 2001-12-31  Tom Tromey  <tromey@redhat.com>
 
        * parse.y (dump_java_tree): New function.
index e198143..2ca0197 100644 (file)
@@ -421,7 +421,7 @@ static tree currently_caught_type_list;
    `ctxp->current_loop'.  */
 static tree case_label_list; 
 
    `ctxp->current_loop'.  */
 static tree case_label_list; 
 
-static tree src_parse_roots[1] = { NULL_TREE };
+static tree src_parse_roots[1];
 
 /* All classes seen from source code */
 #define gclass_list src_parse_roots[0]
 
 /* All classes seen from source code */
 #define gclass_list src_parse_roots[0]
index 32f2bc2..d7040d9 100644 (file)
@@ -247,7 +247,7 @@ extern int   opterr;
 /* Create a table of debugging stab-codes and corresponding names.  */
 
 #define __define_stab(NAME, CODE, STRING) {(int)CODE, STRING},
 /* Create a table of debugging stab-codes and corresponding names.  */
 
 #define __define_stab(NAME, CODE, STRING) {(int)CODE, STRING},
-struct {short code; char string[10];} stab_names[]  = {
+const struct {const short code; const char string[10];} stab_names[]  = {
 #include "stab.def"
 #undef __define_stab
 };
 #include "stab.def"
 #undef __define_stab
 };
index 167742a..9e49713 100644 (file)
@@ -1273,7 +1273,7 @@ static EXTR         *last_func_eptr;
    Maybe this will be fixed in 2.10 or 2.20 of the MIPS compiler
    suite, but for now go with what works.  */
 
    Maybe this will be fixed in 2.10 or 2.20 of the MIPS compiler
    suite, but for now go with what works.  */
 
-static bt_t map_coff_types[ (int)T_MAX ] = {
+static const bt_t map_coff_types[ (int)T_MAX ] = {
   bt_Nil,                      /* T_NULL */
   bt_Nil,                      /* T_ARG */
   bt_Char,                     /* T_CHAR */
   bt_Nil,                      /* T_NULL */
   bt_Nil,                      /* T_ARG */
   bt_Char,                     /* T_CHAR */
@@ -1293,7 +1293,7 @@ static bt_t map_coff_types[ (int)T_MAX ] = {
 };
 
 /* Convert COFF storage class to ECOFF storage class.  */
 };
 
 /* Convert COFF storage class to ECOFF storage class.  */
-static sc_t map_coff_storage[ (int)C_MAX ] = {
+static const sc_t map_coff_storage[ (int)C_MAX ] = {
   sc_Nil,                      /*   0: C_NULL */
   sc_Abs,                      /*   1: C_AUTO    auto var */
   sc_Undefined,                        /*   2: C_EXT     external */
   sc_Nil,                      /*   0: C_NULL */
   sc_Abs,                      /*   1: C_AUTO    auto var */
   sc_Undefined,                        /*   2: C_EXT     external */
@@ -1404,7 +1404,7 @@ static sc_t map_coff_storage[ (int)C_MAX ] = {
 };
 
 /* Convert COFF storage class to ECOFF symbol type.  */
 };
 
 /* Convert COFF storage class to ECOFF symbol type.  */
-static st_t map_coff_sym_type[ (int)C_MAX ] = {
+static const st_t map_coff_sym_type[ (int)C_MAX ] = {
   st_Nil,                      /*   0: C_NULL */
   st_Local,                    /*   1: C_AUTO    auto var */
   st_Global,                   /*   2: C_EXT     external */
   st_Nil,                      /*   0: C_NULL */
   st_Local,                    /*   1: C_AUTO    auto var */
   st_Global,                   /*   2: C_EXT     external */
@@ -1515,7 +1515,7 @@ static st_t map_coff_sym_type[ (int)C_MAX ] = {
 };
 
 /* Map COFF derived types to ECOFF type qualifiers.  */
 };
 
 /* Map COFF derived types to ECOFF type qualifiers.  */
-static tq_t map_coff_derived_type[ (int)DT_MAX ] = {
+static const tq_t map_coff_derived_type[ (int)DT_MAX ] = {
   tq_Nil,                      /* 0: DT_NON    no more qualifiers */
   tq_Ptr,                      /* 1: DT_PTR    pointer */
   tq_Proc,                     /* 2: DT_FCN    function */
   tq_Nil,                      /* 0: DT_NON    no more qualifiers */
   tq_Ptr,                      /* 1: DT_PTR    pointer */
   tq_Proc,                     /* 2: DT_FCN    function */
@@ -1594,7 +1594,7 @@ static int        stabs_seen      = 0;            /* != 0 if stabs have been seen */
 #define STABS_SYMBOL "@stabs"
 #endif
 
 #define STABS_SYMBOL "@stabs"
 #endif
 
-static char stabs_symbol[] = STABS_SYMBOL;
+static const char stabs_symbol[] = STABS_SYMBOL;
 
 \f
 /* Forward reference for functions.  See the definition for more details.  */
 
 \f
 /* Forward reference for functions.  See the definition for more details.  */
@@ -1715,12 +1715,12 @@ extern int   opterr;
    do......  */
 
 typedef struct _pseudo_ops {
    do......  */
 
 typedef struct _pseudo_ops {
-  const char *name;                    /* pseudo-op in ascii */
-  int len;                             /* length of name to compare */
-  void (*func) PARAMS ((const char *));        /* function to handle line */
+  const char *const name;                      /* pseudo-op in ascii */
+  const int len;                               /* length of name to compare */
+  void (*const func) PARAMS ((const char *));  /* function to handle line */
 } pseudo_ops_t;
 
 } pseudo_ops_t;
 
-static pseudo_ops_t pseudo_ops[] = {
+static const pseudo_ops_t pseudo_ops[] = {
   { "#.def",   sizeof("#.def")-1,      parse_def },
   { "#.begin", sizeof("#.begin")-1,    parse_begin },
   { "#.bend",  sizeof("#.bend")-1,     parse_bend },
   { "#.def",   sizeof("#.def")-1,      parse_def },
   { "#.begin", sizeof("#.begin")-1,    parse_begin },
   { "#.bend",  sizeof("#.bend")-1,     parse_bend },
index 0ab5118..34fdb2b 100644 (file)
@@ -207,7 +207,7 @@ static const int hash_mask = (HASH_TABLE_SIZE - 1);
 
 static const struct default_include { const char *const fname; 
                         const char *const component;
 
 static const struct default_include { const char *const fname; 
                         const char *const component;
-                        int x1, x2; } include_defaults[]
+                        const int x1, x2; } include_defaults[]
 #ifdef INCLUDE_DEFAULTS
   = INCLUDE_DEFAULTS;
 #else
 #ifdef INCLUDE_DEFAULTS
   = INCLUDE_DEFAULTS;
 #else
index 9292971..fdccb59 100644 (file)
@@ -1,5 +1,8 @@
 2002-01-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
 2002-01-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+       * cp-demangle.c (long_options): Const-ify.
+       * cplus-dem.c (long_options): Likewise.
+
        * cplus-dem.c (mystrstr): Delete.  All callers changed to use
        strstr instead.
 
        * cplus-dem.c (mystrstr): Delete.  All callers changed to use
        strstr instead.
 
index b61ff2c..457a09f 100644 (file)
@@ -3945,7 +3945,7 @@ print_usage (fp, exit_value)
 }
 
 /* Option specification for getopt_long.  */
 }
 
 /* Option specification for getopt_long.  */
-static struct option long_options[] = 
+static const struct option long_options[] = 
 {
   { "help",    no_argument, NULL, 'h' },
   { "strict",  no_argument, NULL, 's' },
 {
   { "help",    no_argument, NULL, 'h' },
   { "strict",  no_argument, NULL, 's' },
index 691eb71..5af8826 100644 (file)
@@ -4947,7 +4947,7 @@ extern int prepends_underscore;
 
 int strip_underscore = 0;
 
 
 int strip_underscore = 0;
 
-static struct option long_options[] = {
+static const struct option long_options[] = {
   {"strip-underscores", no_argument, 0, '_'},
   {"format", required_argument, 0, 's'},
   {"help", no_argument, 0, 'h'},
   {"strip-underscores", no_argument, 0, '_'},
   {"format", required_argument, 0, 's'},
   {"help", no_argument, 0, 'h'},