From: Chris Hanson Date: Wed, 22 Nov 2006 04:36:35 +0000 (+0000) Subject: Make sure constants are unsigned in string_hash. X-Git-Tag: 20090517-FFI~840 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d2e139396731d9982d64b7e59c4b03bf7f291d54;p=mit-scheme.git Make sure constants are unsigned in string_hash. --- diff --git a/v7/src/microcode/intern.c b/v7/src/microcode/intern.c index c25c92869..d1d666582 100644 --- a/v7/src/microcode/intern.c +++ b/v7/src/microcode/intern.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: intern.c,v 9.62 2006/10/30 06:02:30 cph Exp $ +$Id: intern.c,v 9.63 2006/11/22 04:36:35 cph Exp $ Copyright 1987,1988,1989,1992,1994,1996 Massachusetts Institute of Technology Copyright 2000,2004,2005,2006 Massachusetts Institute of Technology @@ -45,11 +45,11 @@ DEFUN (string_hash, (length, string), unsigned long length AND CONST char * string) { - CONST char * scan = string; - CONST char * end = (scan + length); - unsigned int result = 2166136261; + CONST unsigned char * scan = string; + CONST unsigned char * end = (scan + length); + unsigned int result = 0x811c9dc5; while (scan < end) - result = ((result * 16777619) + (*scan++)); + result = ((result * 0x1000193) + (*scan++)); return (result & ((unsigned int) BIGGEST_FIXNUM)); }