Changeset 2596 for vendor/gnumake/current/hash.h
- Timestamp:
- Jun 20, 2012, 12:44:52 AM (13 years ago)
- Location:
- vendor/gnumake/current
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current
- Property svn:ignore deleted
-
vendor/gnumake/current/hash.h
r1989 r2596 1 1 /* hash.h -- decls for hash table 2 Copyright (C) 1995, 1999, 2002 Free Software Foundation, Inc.2 Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc. 3 3 Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org> 4 4 … … 81 81 /* hash and comparison macros for case-sensitive string keys. */ 82 82 83 /* Due to the strcache, it's not uncommon for the string pointers to 84 be identical. Take advantage of that to short-circuit string compares. */ 85 83 86 #define STRING_HASH_1(KEY, RESULT) do { \ 84 87 unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \ … … 104 107 105 108 #define STRING_COMPARE(X, Y, RESULT) do { \ 106 RESULT =strcmp ((X), (Y)); \109 RESULT = (X) == (Y) ? 0 : strcmp ((X), (Y)); \ 107 110 } while (0) 108 111 #define return_STRING_COMPARE(X, Y) do { \ 109 return strcmp ((X), (Y)); \112 return (X) == (Y) ? 0 : strcmp ((X), (Y)); \ 110 113 } while (0) 111 114 … … 140 143 141 144 #define STRING_N_COMPARE(X, Y, N, RESULT) do { \ 142 RESULT = strncmp ((X), (Y), (N)); \145 RESULT = (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \ 143 146 } while (0) 144 147 #define return_STRING_N_COMPARE(X, Y, N) do { \ 145 return strncmp ((X), (Y), (N)); \148 return (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \ 146 149 } while (0) 147 150 … … 173 176 174 177 #define ISTRING_COMPARE(X, Y, RESULT) do { \ 175 RESULT = strcasecmp ((X), (Y)); \178 RESULT = (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \ 176 179 } while (0) 177 180 #define return_ISTRING_COMPARE(X, Y) do { \ 178 return strcasecmp ((X), (Y)); \181 return (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \ 179 182 } while (0) 180 183
Note:
See TracChangeset
for help on using the changeset viewer.