This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Simplify STREQ and STRNEQ


Per, the STREQ thread, this patch simplifies STREQ and STRNEQ.

committed,
Andrew
2003-12-07  Andrew Cagney  <cagney@redhat.com>

	* defs.h (DEPRECATED_STREQN, DEPRECATED_STREQ): Simplify by
	directly calling strcmp equivalents.  Add disclaimer.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.134
diff -u -r1.134 defs.h
--- defs.h	23 Nov 2003 20:41:16 -0000	1.134
+++ defs.h	7 Dec 2003 17:17:05 -0000
@@ -160,8 +160,13 @@
    making untested changes, the remaining references were deprecated
    rather than replaced.  */
 
-#define DEPRECATED_STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
-#define DEPRECATED_STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
+/* DISCLAIMER: cagney/2003-11-23: Simplified definition of these
+   macros so that they just map directly onto strcmp equivalent.  I'm
+   not responsible for any breakage due to code that relied on the old
+   underlying implementation.  */
+
+#define DEPRECATED_STREQ(a,b) (strcmp ((a), (b)) == 0)
+#define DEPRECATED_STREQN(a,b,c) (strncmp ((a), (b), (c)) == 0)
 
 /* Check if a character is one of the commonly used C++ marker characters.  */
 extern int is_cplus_marker (int);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]