tree.c (tree_node_kind_names, [...]): Qualify a char* with the `const' keyword.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Wed, 17 Feb 1999 08:04:29 +0000 (08:04 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Wed, 17 Feb 1999 08:04:29 +0000 (08:04 +0000)
        * tree.c (tree_node_kind_names, print_obstack_name,
        get_identifier, maybe_get_identifier, build_string,
        build_expr_wfl, is_attribute_p, lookup_attribute,
        print_obstack_statistics, get_file_function_name_long, tree_check,
        tree_class_check, expr_check): Qualify a char* with the `const'
        keyword.
        * tree.h (get_identifier, maybe_get_identifier, build_string,
        build_expr_wfl, is_attribute_p, lookup_attribute,
        print_obstack_statistics, print_obstack_name, tree_check,
        tree_class_check, expr_check): Likewise.

From-SVN: r25261

gcc/ChangeLog
gcc/tree.c
gcc/tree.h

index 1c89dfb..0ad15e7 100644 (file)
@@ -1,3 +1,17 @@
+Wed Feb 17 10:56:24 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * tree.c (tree_node_kind_names, print_obstack_name,
+       get_identifier, maybe_get_identifier, build_string,
+       build_expr_wfl, is_attribute_p, lookup_attribute,
+       print_obstack_statistics, get_file_function_name_long, tree_check,
+       tree_class_check, expr_check): Qualify a char* with the `const'
+       keyword.
+
+       * tree.h (get_identifier, maybe_get_identifier, build_string,
+       build_expr_wfl, is_attribute_p, lookup_attribute,
+       print_obstack_statistics, print_obstack_name, tree_check,
+       tree_class_check, expr_check): Likewise.
+
 Tue Feb 16 21:29:38 1999  Jeffrey A Law  (law@cygnus.com)
 
        * i386/freebsd-elf.h, i386/gas.h, i386/linux.h: Fix minor spacing
index 5706ece..80b6795 100644 (file)
@@ -225,7 +225,7 @@ int tree_node_counts[(int)all_kinds];
 int tree_node_sizes[(int)all_kinds];
 int id_string_size = 0;
 
-char *tree_node_kind_names[] = {
+const char *tree_node_kind_names[] = {
   "decls",
   "types",
   "blocks",
@@ -743,10 +743,10 @@ void
 print_obstack_name (object, file, prefix)
      char *object;
      FILE *file;
-     char *prefix;
+     const char *prefix;
 {
   struct obstack *obstack = NULL;
-  char *obstack_name = NULL;
+  const char *obstack_name = NULL;
   struct function *p;
 
   for (p = outer_function_chain; p; p = p->next)
@@ -1241,7 +1241,7 @@ copy_list (list)
 
 tree
 get_identifier (text)
-     register char *text;
+     register const char *text;
 {
   register int hi;
   register int i;
@@ -1304,7 +1304,7 @@ get_identifier (text)
 
 tree
 maybe_get_identifier (text)
-     register char *text;
+     register const char *text;
 {
   register int hi;
   register int i;
@@ -1502,7 +1502,7 @@ build_real_from_int_cst (type, i)
 tree
 build_string (len, str)
      int len;
-     char *str;
+     const char *str;
 {
   /* Put the string in saveable_obstack since it will be placed in the RTL
      for an "asm" statement and will also be kept around a while if
@@ -3220,10 +3220,10 @@ build_block (vars, tags, subblocks, supercontext, chain)
 tree
 build_expr_wfl (node, file, line, col)
      tree node;
-     char *file;
+     const char *file;
      int line, col;
 {
-  static char *last_file = 0;
+  static const char *last_file = 0;
   static tree  last_filenode = NULL_TREE;
   register tree wfl = make_node (EXPR_WITH_FILE_LOCATION);
 
@@ -3432,7 +3432,7 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
 
 int
 is_attribute_p (attr, ident)
-     char *attr;
+     const char *attr;
      tree ident;
 {
   int ident_len, attr_len;
@@ -3477,7 +3477,7 @@ is_attribute_p (attr, ident)
 
 tree
 lookup_attribute (attr_name, list)
-     char *attr_name;
+     const char *attr_name;
      tree list;
 {
   tree l;
@@ -4730,7 +4730,7 @@ print_inline_obstack_statistics ()
 
 void
 print_obstack_statistics (str, o)
-     char *str;
+     const char *str;
      struct obstack *o;
 {
   struct _obstack_chunk *chunk = o->chunk;
@@ -4855,7 +4855,7 @@ append_random_chars (template)
 
 tree
 get_file_function_name_long (type)
-     char *type;
+     const char *type;
 {
   char *buf;
   register char *p;
@@ -4867,8 +4867,8 @@ get_file_function_name_long (type)
       /* We don't have anything that we know to be unique to this translation
         unit, so use what we do have and throw in some randomness.  */
 
-      char *name = weak_global_object_name;
-      char *file = main_input_filename;
+      const char *name = weak_global_object_name;
+      const char *file = main_input_filename;
 
       if (! name)
        name = "";
@@ -5038,7 +5038,7 @@ tree
 tree_check (node, code, file, line, nofatal)
      tree node;
      enum tree_code code;
-     char *file;
+     const char *file;
      int line;
      int nofatal;
 {
@@ -5058,7 +5058,7 @@ tree
 tree_class_check (node, cl, file, line, nofatal)
      tree node;
      char cl;
-     char *file;
+     const char *file;
      int line;
      int nofatal;
 {
@@ -5077,7 +5077,7 @@ tree
 expr_check (node, ignored, file, line, nofatal)
      tree node;
      int ignored;
-     char *file;
+     const char *file;
      int line;
      int nofatal;
 {
index 2f1d8e6..9965a2e 100644 (file)
@@ -1416,13 +1416,13 @@ extern tree make_tree_vec               PROTO((int));
 /* Return the (unique) IDENTIFIER_NODE node for a given name.
    The name is supplied as a char *.  */
 
-extern tree get_identifier             PROTO((char *));
+extern tree get_identifier             PROTO((const char *));
 
 /* If an identifier with the name TEXT (a null-terminated string) has
    previously been referred to, return that node; otherwise return
    NULL_TREE.  */
 
-extern tree maybe_get_identifier       PROTO((char *));
+extern tree maybe_get_identifier       PROTO((const char *));
 
 /* Construct various types of nodes.  */
 
@@ -1437,14 +1437,14 @@ extern tree build_int_2_wide            PROTO((HOST_WIDE_INT, HOST_WIDE_INT));
 extern tree build_real                 PROTO((tree, REAL_VALUE_TYPE));
 extern tree build_real_from_int_cst    PROTO((tree, tree));
 extern tree build_complex              PROTO((tree, tree, tree));
-extern tree build_string               PROTO((int, char *));
+extern tree build_string               PROTO((int, const char *));
 extern tree build1                     PROTO((enum tree_code, tree, tree));
 extern tree build_tree_list            PROTO((tree, tree));
 extern tree build_decl_list            PROTO((tree, tree));
 extern tree build_expr_list            PROTO((tree, tree));
 extern tree build_decl                 PROTO((enum tree_code, tree, tree));
 extern tree build_block                        PROTO((tree, tree, tree, tree, tree));
-extern tree build_expr_wfl              PROTO((tree, char *, int, int));
+extern tree build_expr_wfl              PROTO((tree, const char *, int, int));
 
 /* Construct various nodes representing data types.  */
 
@@ -1509,12 +1509,12 @@ extern int valid_machine_attribute      PROTO((tree, tree, tree, tree));
 /* Given a tree node and a string, return non-zero if the tree node is
    a valid attribute name for the string.  */
 
-extern int is_attribute_p              PROTO((char *, tree));
+extern int is_attribute_p              PROTO((const char *, tree));
 
 /* Given an attribute name and a list of attributes, return the list element
    of the attribute or NULL_TREE if not found.  */
 
-extern tree lookup_attribute           PROTO((char *, tree));
+extern tree lookup_attribute           PROTO((const char *, tree));
 
 /* Given two attributes lists, return a list of their union.  */
 
@@ -1897,7 +1897,7 @@ extern void (*incomplete_decl_finalize_hook)      PROTO((tree));
 /* In tree.c */
 extern char *perm_calloc                       PROTO((int, long));
 extern tree get_file_function_name             PROTO((int));
-extern tree get_file_function_name_long        PROTO((char *));
+extern tree get_file_function_name_long        PROTO((const char *));
 extern tree get_set_constructor_bits           PROTO((tree, char *, int));
 extern tree get_set_constructor_bytes          PROTO((tree,
                                                       unsigned char *, int));
@@ -2153,9 +2153,10 @@ extern void rtl_in_current_obstack       PROTO ((void));
 extern void rtl_in_saveable_obstack    PROTO ((void));
 extern void init_tree_codes            PROTO ((void));
 extern void dump_tree_statistics       PROTO ((void));
-extern void print_obstack_statistics   PROTO ((char *, struct obstack *));
+extern void print_obstack_statistics   PROTO ((const char *,
+                                               struct obstack *));
 #ifdef BUFSIZ
-extern void print_obstack_name         PROTO ((char *, FILE *, char *));
+extern void print_obstack_name         PROTO ((char *, FILE *, const char *));
 #endif
 extern void expand_function_end                PROTO ((char *, int, int));
 extern void expand_function_start      PROTO ((tree, int));
@@ -2165,9 +2166,12 @@ extern void start_identifier_warnings    PROTO ((void));
 extern void gcc_obstack_init           PROTO ((struct obstack *));
 extern void init_obstacks              PROTO ((void));
 extern void obfree                     PROTO ((char *));
-extern tree tree_check                  PROTO ((tree, enum tree_code, char*, int, int));
-extern tree tree_class_check            PROTO ((tree, char, char*, int, int));
-extern tree expr_check                  PROTO ((tree, int, char*, int, int));
+extern tree tree_check                  PROTO ((tree, enum tree_code,
+                                               const char *, int, int));
+extern tree tree_class_check            PROTO ((tree, char, const char *,
+                                               int, int));
+extern tree expr_check                  PROTO ((tree, int, const char *,
+                                               int, int));
 
 /* In function.c */
 extern void setjmp_protect_args                PROTO ((void));