From d2e139396731d9982d64b7e59c4b03bf7f291d54 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 22 Nov 2006 04:36:35 +0000 Subject: [PATCH] Make sure constants are unsigned in string_hash. --- v7/src/microcode/intern.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)); } -- 2.25.1