summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2002-12-16 14:40:19 +0000
committerBruno Haible <bruno@clisp.org>2002-12-16 14:40:19 +0000
commit21cd7bfd2416e9afb5fc6ee8b0cd6b8b8990f773 (patch)
treee84b163131efa39e87e733775b4eb8cd0c1fd83c /lib
parentebc7fe61881637eaeccbe18bebedd0f089c78029 (diff)
downloadgperf-21cd7bfd2416e9afb5fc6ee8b0cd6b8b8990f773.tar.gz
Use 'unsigned char' instead of 'char' in many places, to reduce casts.
Diffstat (limited to 'lib')
-rw-r--r--lib/hash.cc8
-rw-r--r--lib/hash.h6
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;
}
diff --git a/lib/hash.h b/lib/hash.h
index 5dbc92b..d202e72 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -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