* [patch] STREQ fallout
@ 2003-11-25 1:46 David Carlton
0 siblings, 0 replies; only message in thread
From: David Carlton @ 2003-11-25 1:46 UTC (permalink / raw)
To: insight
Here's a patch dealing with fallout from Andrew's latest deprecation;
it gets rid of uses of STREQ{,N} and, as a bonus, gets rid of a couple
of DEPRECATED_SYMBOL_NAMEs that I happened to notice where it's
obvious that the linkage name is what is intended.
David Carlton
carlton@kealia.com
2003-11-24 David Carlton <carlton@kealia.com>
* generic/gdbtk.c (target_is_native): Replace STREQ by strcmp.
* generic/gdbtk-cmds.c (gdb_stop): Replace STREQ by strcmp.
(gdb_search): Replace STREQN by strncmp and DEPRECATED_SYMBOL_NAME
by SYMBOL_LINKAGE_NAME.
* generic/gdbtk-varobj.c (variable_format): Replace STREQN by
strncmp.
Index: gdbtk/generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.77
diff -u -p -r1.77 gdbtk-cmds.c
--- gdbtk/generic/gdbtk-cmds.c 8 Sep 2003 19:27:48 -0000 1.77
+++ gdbtk/generic/gdbtk-cmds.c 25 Nov 2003 01:39:31 -0000
@@ -547,7 +547,7 @@ gdb_stop (ClientData clientData, Tcl_Int
if (objc > 1)
{
s = Tcl_GetStringFromObj (objv[1], NULL);
- if (STREQ (s, "detach"))
+ if (strcmp (s, "detach") == 0)
force = 1;
}
@@ -1365,8 +1365,9 @@ gdb_search (ClientData clientData, Tcl_I
/* Strip off some C++ special symbols, like RTTI and global
constructors/destructors. */
- if ((p->symbol != NULL && !STREQN (DEPRECATED_SYMBOL_NAME (p->symbol), "__tf", 4)
- && !STREQN (DEPRECATED_SYMBOL_NAME (p->symbol), "_GLOBAL_", 8))
+ if ((p->symbol != NULL
+ && strncmp (SYMBOL_LINKAGE_NAME (p->symbol), "__tf", 4) != 0
+ && strncmp (SYMBOL_LINKAGE_NAME (p->symbol), "_GLOBAL_", 8) != 0)
|| p->msymbol != NULL)
{
elem = Tcl_NewListObj (0, NULL);
Index: gdbtk/generic/gdbtk-varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-varobj.c,v
retrieving revision 1.16
diff -u -p -r1.16 gdbtk-varobj.c
--- gdbtk/generic/gdbtk-varobj.c 11 Feb 2003 16:08:38 -0000 1.16
+++ gdbtk/generic/gdbtk-varobj.c 25 Nov 2003 01:39:31 -0000
@@ -474,15 +474,15 @@ variable_format (Tcl_Interp *interp, int
/* Set the format of VAR to given format */
int len;
char *fmt = Tcl_GetStringFromObj (objv[2], &len);
- if (STREQN (fmt, "natural", len))
+ if (strncmp (fmt, "natural", len) == 0)
varobj_set_display_format (var, FORMAT_NATURAL);
- else if (STREQN (fmt, "binary", len))
+ else if (strncmp (fmt, "binary", len) == 0)
varobj_set_display_format (var, FORMAT_BINARY);
- else if (STREQN (fmt, "decimal", len))
+ else if (strncmp (fmt, "decimal", len) == 0)
varobj_set_display_format (var, FORMAT_DECIMAL);
- else if (STREQN (fmt, "hexadecimal", len))
+ else if (strncmp (fmt, "hexadecimal", len) == 0)
varobj_set_display_format (var, FORMAT_HEXADECIMAL);
- else if (STREQN (fmt, "octal", len))
+ else if (strncmp (fmt, "octal", len) == 0)
varobj_set_display_format (var, FORMAT_OCTAL);
else
{
Index: gdbtk/generic/gdbtk.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk.c,v
retrieving revision 1.37
diff -u -p -r1.37 gdbtk.c
--- gdbtk/generic/gdbtk.c 4 Aug 2003 17:08:23 -0000 1.37
+++ gdbtk/generic/gdbtk.c 25 Nov 2003 01:39:31 -0000
@@ -321,10 +321,11 @@ target_is_native (struct target_ops *t)
{
char *name = t->to_shortname;
- if (STREQ (name, "exec") || STREQ (name, "hpux-threads")
- || STREQ (name, "child") || STREQ (name, "procfs")
- || STREQ (name, "solaris-threads") || STREQ (name, "linuxthreads")
- || STREQ (name, "multi-thread"))
+ if (strcmp (name, "exec") == 0 || strcmp (name, "hpux-threads") == 0
+ || strcmp (name, "child") == 0 || strcmp (name, "procfs") == 0
+ || strcmp (name, "solaris-threads") == 0
+ || strcmp (name, "linuxthreads") == 0
+ || strcmp (name, "multi-thread") == 0)
return 1;
return 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-11-25 1:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-25 1:46 [patch] STREQ fallout David Carlton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).