OSDN Git Service

* Makefile.in (cp-demangle.o): Depend on $(INCDIR)/demangle.h.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jun 2000 20:35:43 +0000 (20:35 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jun 2000 20:35:43 +0000 (20:35 +0000)
* cp-demangle.c: Include demangle.h.
(template_arg_list_new): DeANSIfy.
(cp_demangle): Make static and add prototype.
(operator_code, operators): Constify.
(demangle_operator_name): Likewise for variables `p1', `p2' and `p'.

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

libiberty/ChangeLog
libiberty/Makefile.in
libiberty/cp-demangle.c

index db7e559..34f2908 100644 (file)
@@ -1,3 +1,13 @@
+2000-06-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * Makefile.in (cp-demangle.o): Depend on $(INCDIR)/demangle.h.
+
+       * cp-demangle.c: Include demangle.h.
+       (template_arg_list_new): DeANSIfy.
+       (cp_demangle): Make static and add prototype.
+       (operator_code, operators): Constify.
+       (demangle_operator_name): Likewise for variables `p1', `p2' and `p'.
+
 2000-06-05  Alex Samuel  <samuel@codesourcery.com>
 
        * cp-demangle.c (demangle_prefix): Cast argument to isdigit to
 2000-06-05  Alex Samuel  <samuel@codesourcery.com>
 
        * cp-demangle.c (demangle_prefix): Cast argument to isdigit to
index a789000..a95adcd 100644 (file)
@@ -263,7 +263,7 @@ choose-temp.o: config.h
 clock.o: config.h
 concat.o: $(INCDIR)/libiberty.h
 cplus-dem.o: config.h $(INCDIR)/demangle.h
 clock.o: config.h
 concat.o: $(INCDIR)/libiberty.h
 cplus-dem.o: config.h $(INCDIR)/demangle.h
-cp-demangle.o: config.h $(INCDIR)/dyn-string.h
+cp-demangle.o: config.h $(INCDIR)/dyn-string.h $(INCDIR)/demangle.h
 dyn-string.o: config.h $(INCDIR)/dyn-string.h
 fdmatch.o: $(INCDIR)/libiberty.h
 fnmatch.o: config.h $(INCDIR)/fnmatch.h
 dyn-string.o: config.h $(INCDIR)/dyn-string.h
 fdmatch.o: $(INCDIR)/libiberty.h
 fnmatch.o: config.h $(INCDIR)/fnmatch.h
index 0a37293..502035f 100644 (file)
@@ -44,6 +44,7 @@
 #include "ansidecl.h"
 #include "libiberty.h"
 #include "dyn-string.h"
 #include "ansidecl.h"
 #include "libiberty.h"
 #include "dyn-string.h"
+#include "demangle.h"
 
 /* If CP_DEMANGLE_DEBUG is defined, a trace of the grammar evaluation,
    and other debugging output, will be generated. */
 
 /* If CP_DEMANGLE_DEBUG is defined, a trace of the grammar evaluation,
    and other debugging output, will be generated. */
@@ -513,7 +514,7 @@ substitutions_print (dm, fp)
 /* Creates a new template argument list.  */
 
 static template_arg_list_t
 /* Creates a new template argument list.  */
 
 static template_arg_list_t
-template_arg_list_new (void)
+template_arg_list_new ()
 {
   template_arg_list_t new_list 
     = (template_arg_list_t) xmalloc (sizeof (struct template_arg_list_def));
 {
   template_arg_list_t new_list 
     = (template_arg_list_t) xmalloc (sizeof (struct template_arg_list_def));
@@ -775,6 +776,8 @@ static status_t demangle_local_name
   PARAMS ((demangling_t));
 static status_t demangle_discriminator 
   PARAMS ((demangling_t, int));
   PARAMS ((demangling_t));
 static status_t demangle_discriminator 
   PARAMS ((demangling_t, int));
+static status_t cp_demangle
+  PARAMS ((char *, dyn_string_t));
 
 /* When passed to demangle_bare_function_type, indicates that the
    function's return type is not encoded before its parameter types.  */
 
 /* When passed to demangle_bare_function_type, indicates that the
    function's return type is not encoded before its parameter types.  */
@@ -1308,14 +1311,14 @@ demangle_operator_name (dm, short_name, num_args)
   struct operator_code
   {
     /* The mangled code for this operator.  */
   struct operator_code
   {
     /* The mangled code for this operator.  */
-    char *code;
+    const char *code;
     /* The source name of this operator.  */
     /* The source name of this operator.  */
-    char *name;
+    const char *name;
     /* The number of arguments this operator takes.  */
     int num_args;
   };
 
     /* The number of arguments this operator takes.  */
     int num_args;
   };
 
-  struct operator_code operators[] = 
+  static const struct operator_code operators[] = 
   {
     { "aN", "&="       , 2 },
     { "aS", "="        , 2 },
   {
     { "aN", "&="       , 2 },
     { "aS", "="        , 2 },
@@ -1371,8 +1374,8 @@ demangle_operator_name (dm, short_name, num_args)
 
   int c0 = next_char (dm);
   int c1 = next_char (dm);
 
   int c0 = next_char (dm);
   int c1 = next_char (dm);
-  struct operator_code* p1 = operators;
-  struct operator_code* p2 = operators + num_operators;
+  const struct operator_code* p1 = operators;
+  const struct operator_code* p2 = operators + num_operators;
 
   DEMANGLE_TRACE ("operator-name", dm);
 
 
   DEMANGLE_TRACE ("operator-name", dm);
 
@@ -1398,7 +1401,7 @@ demangle_operator_name (dm, short_name, num_args)
   /* Perform a binary search for the operator code.  */
   while (1)
     {
   /* Perform a binary search for the operator code.  */
   while (1)
     {
-      struct operator_code* p = p1 + (p2 - p1) / 2;
+      const struct operator_code* p = p1 + (p2 - p1) / 2;
       char match0 = p->code[0];
       char match1 = p->code[1];
 
       char match0 = p->code[0];
       char match1 = p->code[1];
 
@@ -2744,7 +2747,7 @@ demangle_discriminator (dm, suppress_first)
    dyn_string_t.  On success, returns STATUS_OK.  On failure, returns
    an error message, and the contents of RESULT are unchanged.  */
 
    dyn_string_t.  On success, returns STATUS_OK.  On failure, returns
    an error message, and the contents of RESULT are unchanged.  */
 
-status_t
+static status_t
 cp_demangle (name, result)
      char *name;
      dyn_string_t result;
 cp_demangle (name, result)
      char *name;
      dyn_string_t result;