VirtualBox

Changeset 2591 in kBuild for trunk/src/kmk/hash.h


Ignore:
Timestamp:
Jun 17, 2012 8:45:31 PM (13 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

Location:
trunk/src/kmk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

    • Property svn:ignore
      •  

        old new  
        1313stamp-*
        1414makebook*
         15
        1516.*gdbinit
         17.gdb_history
         18
        1619*.dep
        1720*.dvi
         
        3134*.pg
        3235*.pgs
         36
        3337README
        3438README.DOS
        3539README.W32
         40README.OS2
        3641aclocal.m4
        3742autom4te.cache
         
        5257config.h.W32
        5358config.h-vms
         59
        5460loadavg
        5561loadavg.c
        5662make
         63
        5764.deps
        5865.dep_segment
         66ID
         67TAGS
         68
        5969_*
        6070sun4
         
        7282sol2
        7383i486-linux
         84
        7485customs
         86
        7587install-sh
        7688mkinstalldirs
         89
         90.directive.asc
  • trunk/src/kmk/hash.h

    r1993 r2591  
    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 <[email protected]> <[email protected]>
    44
     
    9898/* hash and comparison macros for case-sensitive string keys. */
    9999
     100/* Due to the strcache, it's not uncommon for the string pointers to
     101   be identical.  Take advantage of that to short-circuit string compares.  */
     102
    100103#define STRING_HASH_1(KEY, RESULT) do { \
    101104  unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
     
    121124
    122125#define STRING_COMPARE(X, Y, RESULT) do { \
    123   RESULT = strcmp ((X), (Y)); \
     126    RESULT = (X) == (Y) ? 0 : strcmp ((X), (Y)); \
    124127} while (0)
    125128#define return_STRING_COMPARE(X, Y) do { \
    126   return strcmp ((X), (Y)); \
     129  return (X) == (Y) ? 0 : strcmp ((X), (Y)); \
    127130} while (0)
    128131
     
    157160
    158161#define STRING_N_COMPARE(X, Y, N, RESULT) do { \
    159   RESULT = strncmp ((X), (Y), (N)); \
     162  RESULT = (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
    160163} while (0)
    161164#define return_STRING_N_COMPARE(X, Y, N) do { \
    162   return strncmp ((X), (Y), (N)); \
     165  return (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
    163166} while (0)
    164167
     
    190193
    191194#define ISTRING_COMPARE(X, Y, RESULT) do { \
    192   RESULT = strcasecmp ((X), (Y)); \
     195  RESULT = (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
    193196} while (0)
    194197#define return_ISTRING_COMPARE(X, Y) do { \
    195   return strcasecmp ((X), (Y)); \
     198  return (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
    196199} while (0)
    197200
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette