summaryrefslogtreecommitdiff
path: root/lib/hash.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-06-17 19:53:53 +0000
committerJim Meyering <jim@meyering.net>2003-06-17 19:53:53 +0000
commit8ccf7c033dc81b99ed1054dd94659afbdabfab35 (patch)
treeb198a8ee6d35bb66c80c3665c23e5e3a0713df60 /lib/hash.c
parentcd40ac8029f06c69c4fc3272f6e660c3335089b4 (diff)
downloadcoreutils-8ccf7c033dc81b99ed1054dd94659afbdabfab35.tar.xz
Merge in changes from gnulib.
Include <stdbool.h> unconditionally. Include <limits.h>. (CHAR_BIT): Don't define.
Diffstat (limited to 'lib/hash.c')
-rw-r--r--lib/hash.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/hash.c b/lib/hash.c
index df8f4bd61..0bbe09596 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -1,5 +1,8 @@
/* hash - hashing table processing.
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
+
Written by Jim Meyering, 1992.
This program is free software; you can redistribute it and/or modify
@@ -27,11 +30,9 @@
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
-#if HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-typedef enum {false = 0, true = 1} bool;
-#endif
+
+#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <assert.h>
@@ -403,9 +404,6 @@ hash_do_for_each (const Hash_table *table, Hash_processor processor,
unsigned
hash_string (const char *string, unsigned n_buckets)
{
-# ifndef CHAR_BIT
-# define CHAR_BIT 8
-# endif
# define ROTATE_LEFT(Value, Shift) \
((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift)))
# define HASH_ONE_CHAR(Value, Byte) \