Replace STRCMP with strcmp()

This commit is contained in:
Andrew Cagney 2001-01-19 08:01:47 +00:00
parent 8038e1e2b1
commit 494b7ec97e
8 changed files with 24 additions and 23 deletions

View 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.

View 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;
}

View 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)

View 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

View File

@ -1151,7 +1151,7 @@ verify_break (int vec)
{
memory_error (status, memaddress);
}
return (STRCMP (instr, buf));
return (strcmp (instr, buf));
}
return (-1);
}

View 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));

View 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));
}
}

View 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;
}