Replace STRCMP with strcmp()
authorAndrew Cagney <cagney@redhat.com>
Fri, 19 Jan 2001 08:01:47 +0000 (08:01 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 19 Jan 2001 08:01:47 +0000 (08:01 +0000)
gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/defs.h
gdb/objfiles.c
gdb/remote-es.c
gdb/standalone.c
gdb/symfile.c
gdb/symtab.c

index 17d7a0f1675eec80ab36e8330040495452359889..0b2246627eaebfdacd75fdfb93e360aa26cad020 100644 (file)
@@ -1,3 +1,17 @@
+Thu Jan 18 12:48:04 2001  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * defs.h (STRCMP): Delete macro.
+
+       * objfiles.c (objfile_relocate): Replace STRCMP with call to
+       strcmp.
+       * symtab.c (lookup_partial_symbol, lookup_block_symbol): Ditto.
+       * symfile.c (compare_symbols):  Ditto.
+       * standalone.c (open):  Ditto.
+       * remote-es.c (verify_break):  Ditto.
+       * cli/cli-decode.c (add_cmd, add_show_from_set): Ditto.
+
+       * symfile.c (compare_psymbols): Delete comment refering to STRCMP.
+
 Thu Jan 18 12:25:06 2001  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * varobj.c (FREEIF): Delete macro.
index 42c126783ac1eddc09926f76e7d1c309c0ab5c9d..76e8447720e74c3299ca3922bcf77c253f202490 100644 (file)
@@ -67,7 +67,7 @@ add_cmd (char *name, enum command_class class, void (*fun) (char *, int),
 
   delete_cmd (name, list);
 
-  if (*list == NULL || STRCMP ((*list)->name, name) >= 0)
+  if (*list == NULL || strcmp ((*list)->name, name) >= 0)
     {
       c->next = *list;
       *list = c;
@@ -75,7 +75,7 @@ add_cmd (char *name, enum command_class class, void (*fun) (char *, int),
   else
     {
       p = *list;
-      while (p->next && STRCMP (p->next->name, name) <= 0)
+      while (p->next && strcmp (p->next->name, name) <= 0)
        {
          p = p->next;
        }
@@ -312,7 +312,7 @@ add_show_from_set (struct cmd_list_element *setcmd,
   else
     fprintf_unfiltered (gdb_stderr, "GDB internal error: Bad docstring for set command\n");
 
-  if (*list == NULL || STRCMP ((*list)->name, showcmd->name) >= 0)
+  if (*list == NULL || strcmp ((*list)->name, showcmd->name) >= 0)
     {
       showcmd->next = *list;
       *list = showcmd;
@@ -320,7 +320,7 @@ add_show_from_set (struct cmd_list_element *setcmd,
   else
     {
       p = *list;
-      while (p->next && STRCMP (p->next->name, showcmd->name) <= 0)
+      while (p->next && strcmp (p->next->name, showcmd->name) <= 0)
        {
          p = p->next;
        }
index 87e570f4b5a042f4ad590efb433f6c7d35e2f440..b5fe805d64db6cab2d392d336abbb16d799c5f8a 100644 (file)
@@ -148,7 +148,6 @@ typedef bfd_vma CORE_ADDR;
    issue is found that we spend the effort on algorithmic
    optimizations than micro-optimizing.'' J.T. */
 
-#define STRCMP(a,b) (*(a) == *(b) ? strcmp ((a), (b)) : (int)*(a) - (int)*(b))
 #define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
 #define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
 
index 3ad6d29771beb007c9cc3103891aafe3c7de16d7..d84770c0d522a0f8abee9931b568d05d640c82e0 100644 (file)
@@ -584,7 +584,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
 
              else if (SYMBOL_CLASS (sym) == LOC_CONST
                       && SYMBOL_NAMESPACE (sym) == LABEL_NAMESPACE
-                  && STRCMP (SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0)
+                      && strcmp (SYMBOL_NAME (sym), MIPS_EFI_SYMBOL_NAME) == 0)
                ecoff_relocate_efi (sym, ANOFFSET (delta,
                                                   s->block_line_section));
 #endif
index b2cabce5c45985b39e013e0f08fbb17baca9d736..92541a789f764e6c4179f31c67825794c9c3c9df 100644 (file)
@@ -1151,7 +1151,7 @@ verify_break (int vec)
        {
          memory_error (status, memaddress);
        }
-      return (STRCMP (instr, buf));
+      return (strcmp (instr, buf));
     }
   return (-1);
 }
index 1aa76d54f16623eb7f6dd89f0948532dbb830515..07e062d7d70d62786a600f5b5382b67b27a64140 100644 (file)
@@ -145,7 +145,7 @@ open (char *filename, int modes)
 
   for (next = files_start; *(int *) next; next += *(int *) next)
     {
-      if (!STRCMP (next + 4, filename))
+      if (!strcmp (next + 4, filename))
        {
          sourcebeg = next + 4 + strlen (next + 4) + 1;
          sourcebeg = (char *) (((int) sourcebeg + 3) & (-4));
index 983db2278163b18422e373da014b209d6dfd2c69..b0ae6e2a6acacba4dd6e8af0b0faafe930649d1a 100644 (file)
@@ -213,7 +213,7 @@ compare_symbols (const PTR s1p, const PTR s2p)
 
   s1 = (struct symbol **) s1p;
   s2 = (struct symbol **) s2p;
-  return (STRCMP (SYMBOL_SOURCE_NAME (*s1), SYMBOL_SOURCE_NAME (*s2)));
+  return (strcmp (SYMBOL_SOURCE_NAME (*s1), SYMBOL_SOURCE_NAME (*s2)));
 }
 
 /*
@@ -260,18 +260,6 @@ compare_psymbols (const PTR s1p, const PTR s2p)
     }
   else
     {
-      /* Note: I replaced the STRCMP line (commented out below)
-       * with a simpler "strcmp()" which compares the 2 strings
-       * from the beginning. (STRCMP is a macro which first compares
-       * the initial characters, then falls back on strcmp).
-       * The reason is that the STRCMP line was tickling a C compiler
-       * bug on HP-UX 10.30, which is avoided with the simpler
-       * code. The performance gain from the more complicated code
-       * is negligible, given that we have already checked the
-       * initial 2 characters above. I reported the compiler bug,
-       * and once it is fixed the original line can be put back. RT
-       */
-      /* return ( STRCMP (st1 + 2, st2 + 2)); */
       return (strcmp (st1, st2));
     }
 }
index 3b5e1a07ddf337f1b7f4bd96e801868f54efb7b2..832fb019a9016c97e5696cf5385b4ed92296dbd9 100644 (file)
@@ -1004,7 +1004,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
            {
              do_linear_search = 1;
            }
-         if (STRCMP (SYMBOL_SOURCE_NAME (*center), name) >= 0)
+         if (strcmp (SYMBOL_SOURCE_NAME (*center), name) >= 0)
            {
              top = center;
            }
@@ -1237,7 +1237,7 @@ lookup_block_symbol (register const struct block *block, const char *name,
            {
              top = inc;
            }
-         else if (STRCMP (SYMBOL_SOURCE_NAME (sym), name) < 0)
+         else if (strcmp (SYMBOL_SOURCE_NAME (sym), name) < 0)
            {
              bot = inc;
            }
This page took 0.030232 seconds and 4 git commands to generate.