aboutsummaryrefslogtreecommitdiff
path: root/binutils/prdbg.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-09-16 18:12:17 +0000
committerNick Clifton <nickc@redhat.com>2006-09-16 18:12:17 +0000
commit0112cd268b205d8176b8b4d00988a334822956cf (patch)
tree67d11340ff93c7dbc29c8917bc03d9d24555f43d /binutils/prdbg.c
parent4fa3602bd53183badf1d259128a5f951f32db8cb (diff)
downloadbinutils-0112cd268b205d8176b8b4d00988a334822956cf.zip
binutils-0112cd268b205d8176b8b4d00988a334822956cf.tar.gz
binutils-0112cd268b205d8176b8b4d00988a334822956cf.tar.bz2
* bfd-in.h (STRING_AND_COMMA): New macro. Takes one constant string as its
argument and emits the string followed by a comma and then the length of the string. (CONST_STRNEQ): New macro. Checks to see if a variable string has a constant string as its initial characters. (CONST_STRNCPY): New macro. Copies a constant string to the start of a variable string. * bfd-in2.h: Regenerate. * <remainign files>: Make use of the new macros.
Diffstat (limited to 'binutils/prdbg.c')
-rw-r--r--binutils/prdbg.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/binutils/prdbg.c b/binutils/prdbg.c
index 87a4934..5b89595 100644
--- a/binutils/prdbg.c
+++ b/binutils/prdbg.c
@@ -1,5 +1,5 @@
/* prdbg.c -- Print out generic debugging information.
- Copyright 1995, 1996, 1999, 2002, 2003, 2004
+ Copyright 1995, 1996, 1999, 2002, 2003, 2004, 2006
Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
Tags style generation written by Salvador E. Tropea <set@computer.org>.
@@ -910,11 +910,10 @@ pr_method_type (void *p, bfd_boolean domain, int argcount, bfd_boolean varargs)
domain_type = pop_type (info);
if (domain_type == NULL)
return FALSE;
- if (strncmp (domain_type, "class ", sizeof "class " - 1) == 0
+ if (CONST_STRNEQ (domain_type, "class ")
&& strchr (domain_type + sizeof "class " - 1, ' ') == NULL)
domain_type += sizeof "class " - 1;
- else if (strncmp (domain_type, "union class ",
- sizeof "union class ") == 0
+ else if (CONST_STRNEQ (domain_type, "union class ")
&& (strchr (domain_type + sizeof "union class " - 1, ' ')
== NULL))
domain_type += sizeof "union class " - 1;
@@ -1317,7 +1316,7 @@ pr_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean virtual,
if (t == NULL)
return FALSE;
- if (strncmp (t, "class ", sizeof "class " - 1) == 0)
+ if (CONST_STRNEQ (t, "class "))
t += sizeof "class " - 1;
/* Push it back on to take advantage of the prepend_type and
@@ -2158,7 +2157,7 @@ tg_class_static_member (void *p, const char *name,
if (! full_name)
return FALSE;
memcpy (full_name, info->stack->next->type, len_class);
- memcpy (full_name + len_class, "::", 2);
+ memcpy (full_name + len_class, STRING_COMMA_LEN ("::"));
memcpy (full_name + len_class + 2, name, len_var + 1);
if (! substitute_type (info, full_name))
@@ -2199,7 +2198,7 @@ tg_class_baseclass (void *p, bfd_vma bitpos ATTRIBUTE_UNUSED,
if (t == NULL)
return FALSE;
- if (strncmp (t, "class ", sizeof "class " - 1) == 0)
+ if (CONST_STRNEQ (t, "class "))
t += sizeof "class " - 1;
/* Push it back on to take advantage of the prepend_type and