Ignore:
Timestamp:
Jun 20, 2012, 12:44:52 AM (13 years ago)
Author:
bird
Message:

gnumake/current -> 3.82-cvs.

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  
    11/* hash.h -- decls for hash table
    2 Copyright (C) 1995, 1999, 2002 Free Software Foundation, Inc.
     2Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
    33Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
    44
     
    8181/* hash and comparison macros for case-sensitive string keys. */
    8282
     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
    8386#define STRING_HASH_1(KEY, RESULT) do { \
    8487  unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
     
    104107
    105108#define STRING_COMPARE(X, Y, RESULT) do { \
    106   RESULT = strcmp ((X), (Y)); \
     109    RESULT = (X) == (Y) ? 0 : strcmp ((X), (Y)); \
    107110} while (0)
    108111#define return_STRING_COMPARE(X, Y) do { \
    109   return strcmp ((X), (Y)); \
     112  return (X) == (Y) ? 0 : strcmp ((X), (Y)); \
    110113} while (0)
    111114
     
    140143
    141144#define STRING_N_COMPARE(X, Y, N, RESULT) do { \
    142   RESULT = strncmp ((X), (Y), (N)); \
     145  RESULT = (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
    143146} while (0)
    144147#define return_STRING_N_COMPARE(X, Y, N) do { \
    145   return strncmp ((X), (Y), (N)); \
     148  return (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
    146149} while (0)
    147150
     
    173176
    174177#define ISTRING_COMPARE(X, Y, RESULT) do { \
    175   RESULT = strcasecmp ((X), (Y)); \
     178  RESULT = (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
    176179} while (0)
    177180#define return_ISTRING_COMPARE(X, Y) do { \
    178   return strcasecmp ((X), (Y)); \
     181  return (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
    179182} while (0)
    180183
Note: See TracChangeset for help on using the changeset viewer.