diff options
author | Jim Meyering <jim@meyering.net> | 2001-10-05 11:46:57 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-10-05 11:46:57 +0000 |
commit | 175e677c82a13e7251eedbae865ab8af4ddb8fd1 (patch) | |
tree | ddbe21883f824c84515cfef5bf32f227efa1bc5f /src/copy.c | |
parent | 8b856a31326eba702ae00a484434261132559446 (diff) | |
download | coreutils-175e677c82a13e7251eedbae865ab8af4ddb8fd1.tar.xz |
Include hash-pjw.h and remove definition of hash_pjw.
Diffstat (limited to 'src/copy.c')
-rw-r--r-- | src/copy.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/copy.c b/src/copy.c index 77ad6b8a7..5915c0e8b 100644 --- a/src/copy.c +++ b/src/copy.c @@ -33,6 +33,7 @@ #include "copy.h" #include "cp-hash.h" #include "hash.h" +#include "hash-pjw.h" #include "same.h" #include "dirname.h" #include "full-write.h" @@ -587,27 +588,6 @@ overwrite_prompt (char const *dst_path, struct stat const *dst_sb) } } -/* A hash function for null-terminated char* strings using - the method described in Aho, Sethi, & Ullman, p 436. */ -/* FIXME: this is copied from remove.c */ - -static unsigned int -hash_pjw (const void *x, unsigned int tablesize) -{ - const char *s = x; - unsigned int h = 0; - unsigned int g; - - while (*s != 0) - { - h = (h << 4) + *s++; - if ((g = h & (unsigned int) 0xf0000000) != 0) - h = (h ^ (g >> 24)) ^ g; - } - - return (h % tablesize); -} - /* Hash a dest_info entry. */ static unsigned int dest_info_hash (void const *x, unsigned int table_size) |