--- gcc/objc/hash.h 2018/04/24 18:10:18 1.1.1.2 +++ gcc/objc/hash.h 2018/04/24 18:26:56 1.1.1.5 @@ -1,5 +1,5 @@ /* Hash tables for Objective C method dispatch. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -15,7 +15,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause @@ -27,11 +28,7 @@ the Free Software Foundation, 675 Mass A #ifndef __hash_INCLUDE_GNU #define __hash_INCLUDE_GNU -#ifdef IN_GCC -#include "gstddef.h" -#else -#include "stddef.h" -#endif +#include /* * This data structure is used to hold items @@ -66,7 +63,7 @@ typedef unsigned int (*hash_func_type)(v /* * This data type is the function that compares two hash keys and returns an * integer greater than, equal to, or less than 0, according as the first - * parameter is lexico-graphically greater than, equal to, or less than the + * parameter is lexicographically greater than, equal to, or less than the * second. */ @@ -117,7 +114,7 @@ cache_ptr hash_new (unsigned int size, void hash_delete (cache_ptr cache); /* Add the key/value pair to the hash table. If the - hash table reaches a level of fullnes then it will be resized. + hash table reaches a level of fullness then it will be resized. assert if the key is already in the hash. */ @@ -193,7 +190,12 @@ compare_ptrs (const void *k1, const void static inline int compare_strings (const void *k1, const void *k2) { - return !strcmp (k1, k2); + if (k1 == k2) + return 1; + else if (k1 == 0 || k2 == 0) + return 0; + else + return !strcmp (k1, k2); }