diff options
author | Bruno Haible <bruno@clisp.org> | 2002-12-16 14:40:19 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2002-12-16 14:40:19 +0000 |
commit | 21cd7bfd2416e9afb5fc6ee8b0cd6b8b8990f773 (patch) | |
tree | e84b163131efa39e87e733775b4eb8cd0c1fd83c /lib | |
parent | ebc7fe61881637eaeccbe18bebedd0f089c78029 (diff) | |
download | gperf-21cd7bfd2416e9afb5fc6ee8b0cd6b8b8990f773.tar.gz |
Use 'unsigned char' instead of 'char' in many places, to reduce casts.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hash.cc | 8 | ||||
-rw-r--r-- | lib/hash.h | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/hash.cc b/lib/hash.cc index b5bb4ad..1795cee 100644 --- a/lib/hash.cc +++ b/lib/hash.cc @@ -1,6 +1,6 @@ /* -Copyright (C) 1990, 2000 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) +Copyright (C) 1990, 2000, 2002 Free Software Foundation + written by Doug Lea <dl@rocky.oswego.edu> */ #include <hash.h> @@ -12,14 +12,14 @@ Copyright (C) 1990, 2000 Free Software Foundation */ unsigned int -hashpjw (const char *x, unsigned int len) // From Dragon book, p436 +hashpjw (const unsigned char *x, unsigned int len) // From Dragon book, p436 { unsigned int h = 0; unsigned int g; for (; len > 0; len--) { - h = (h << 4) + (unsigned char) *x++; + h = (h << 4) + *x++; if ((g = h & 0xf0000000) != 0) h = (h ^ (g >> 24)) ^ g; } @@ -1,8 +1,8 @@ // This may look like C code, but it is really -*- C++ -*- /* -Copyright (C) 1988, 1992, 2000 Free Software Foundation - written by Doug Lea (dl@rocky.oswego.edu) +Copyright (C) 1988, 1992, 2000, 2002 Free Software Foundation + written by Doug Lea <dl@rocky.oswego.edu> */ #ifndef _hash_h @@ -10,6 +10,6 @@ Copyright (C) 1988, 1992, 2000 Free Software Foundation /* a hash function for char[] arrays using the method described in Aho, Sethi, & Ullman, p 436. */ -extern unsigned int hashpjw (const char *string, unsigned int len); +extern unsigned int hashpjw (const unsigned char *string, unsigned int len); #endif |