diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 10 | ||||
-rw-r--r-- | gcc/cp/init.c | 2 | ||||
-rw-r--r-- | gcc/cp/lex.c | 10 |
5 files changed, 21 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 959f2efa37c..a7a008f8def 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * class.c (build_vtable_entry_ref): Const-ify. + * decl.c (predefined_identifier, + initialize_predefined_identifiers): Likewise. + * init.c (build_new_1): Likewise. + * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): + Likewise. + 2001-10-05 Alexandre Oliva <aoliva@redhat.com> * optimize.c (struct inline_data): Moved to ../tree-inline.c. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index ac71fc5baa5..97a35974102 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -435,7 +435,7 @@ static void build_vtable_entry_ref (basetype, idx) tree basetype, idx; { - static char asm_stmt[] = ".vtable_entry %c0, %c1"; + static const char asm_stmt[] = ".vtable_entry %c0, %c1"; tree s, i, i2; tree vtable = get_vtbl_decl_for_binfo (TYPE_BINFO (basetype)); tree first_fn = TYPE_BINFO_VTABLE (basetype); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0dfd8d65d32..60cceada0f7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6227,11 +6227,11 @@ record_unknown_type (type, name) typedef struct predefined_identifier { /* The name of the identifier. */ - const char *name; + const char *const name; /* The place where the IDENTIFIER_NODE should be stored. */ - tree *node; + tree *const node; /* Non-zero if this is the name of a constructor or destructor. */ - int ctor_or_dtor_p; + const int ctor_or_dtor_p; } predefined_identifier; /* Create all the predefined identifiers. */ @@ -6239,10 +6239,10 @@ typedef struct predefined_identifier static void initialize_predefined_identifiers () { - struct predefined_identifier *pid; + const predefined_identifier *pid; /* A table of identifiers to create at startup. */ - static predefined_identifier predefined_identifiers[] = { + static const predefined_identifier predefined_identifiers[] = { { "C++", &lang_name_cplusplus, 0 }, { "C", &lang_name_c, 0 }, { "Java", &lang_name_java, 0 }, diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 487543e6386..8dad82d0711 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2355,7 +2355,7 @@ build_new_1 (exp) tree class_addr, alloc_decl; tree class_decl = build_java_class_ref (true_type); tree class_size = size_in_bytes (true_type); - static char alloc_name[] = "_Jv_AllocObject"; + static const char alloc_name[] = "_Jv_AllocObject"; use_java_new = 1; alloc_decl = IDENTIFIER_GLOBAL_VALUE (get_identifier (alloc_name)); if (alloc_decl == NULL_TREE) diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 6d8fcb36ad7..cb691420243 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -213,7 +213,7 @@ int interface_unknown; /* whether or not we know this class #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, -static char cplus_tree_code_type[] = { +static const char cplus_tree_code_type[] = { 'x', #include "cp-tree.def" }; @@ -225,7 +225,7 @@ static char cplus_tree_code_type[] = { #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH, -static int cplus_tree_code_length[] = { +static const int cplus_tree_code_length[] = { 0, #include "cp-tree.def" }; @@ -390,9 +390,9 @@ init_operators () /* The reserved keyword table. */ struct resword { - const char *word; - ENUM_BITFIELD(rid) rid : 16; - unsigned int disable : 16; + const char *const word; + const ENUM_BITFIELD(rid) rid : 16; + const unsigned int disable : 16; }; /* Disable mask. Keywords are disabled if (reswords[i].disable & mask) is |