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:
@@ -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 )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user