2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Fix integer overflow that was causing traps on Cray.

[SVN r17150]
This commit is contained in:
Dave Abrahams
2003-02-01 17:21:54 +00:00
parent 8d0128af6f
commit a6aa672159
2 changed files with 6 additions and 10 deletions

View File

@@ -29,7 +29,7 @@ char *hashsccssid="@(#)hash.c 1.14 () 6/20/88";
struct hashhdr {
struct item *next;
int keyval; /* for quick comparisons */
unsigned int keyval; /* for quick comparisons */
} ;
/* This structure overlays the one handed to hashenter(). */
@@ -96,8 +96,8 @@ hashitem(
{
ITEM **base;
register ITEM *i;
char *b = (*data)->key;
int keyval;
unsigned char *b = (unsigned char*)(*data)->key;
unsigned int keyval;
if( enter && !hp->items.more )
hashrehash( hp );
@@ -110,8 +110,6 @@ hashitem(
while( *b )
keyval = keyval * 2147059363 + *b++;
keyval &= 0x7FFFFFFF;
base = hp->tab.base + ( keyval % hp->tab.nel );
for( i = *base; i; i = i->hdr.next )

View File

@@ -29,7 +29,7 @@ char *hashsccssid="@(#)hash.c 1.14 () 6/20/88";
struct hashhdr {
struct item *next;
int keyval; /* for quick comparisons */
unsigned int keyval; /* for quick comparisons */
} ;
/* This structure overlays the one handed to hashenter(). */
@@ -96,8 +96,8 @@ hashitem(
{
ITEM **base;
register ITEM *i;
char *b = (*data)->key;
int keyval;
unsigned char *b = (unsigned char*)(*data)->key;
unsigned int keyval;
if( enter && !hp->items.more )
hashrehash( hp );
@@ -110,8 +110,6 @@ hashitem(
while( *b )
keyval = keyval * 2147059363 + *b++;
keyval &= 0x7FFFFFFF;
base = hp->tab.base + ( keyval % hp->tab.nel );
for( i = *base; i; i = i->hdr.next )