unsigned char cast in hash functions
This commit is contained in:
parent
e45e3caa84
commit
6458fdc5bd
|
|
@ -30,13 +30,13 @@ static unsigned int hi_hash(const char *tok)
|
||||||
|
|
||||||
if(xctx->sch_path_hash[xctx->currsch] == 0) {
|
if(xctx->sch_path_hash[xctx->currsch] == 0) {
|
||||||
str=xctx->sch_path[xctx->currsch];
|
str=xctx->sch_path[xctx->currsch];
|
||||||
while ( (c = *str++) )
|
while ( (c = (unsigned char)*str++) )
|
||||||
hash += (hash << 5) + c;
|
hash += (hash << 5) + c;
|
||||||
xctx->sch_path_hash[xctx->currsch] = hash;
|
xctx->sch_path_hash[xctx->currsch] = hash;
|
||||||
} else {
|
} else {
|
||||||
hash = xctx->sch_path_hash[xctx->currsch];
|
hash = xctx->sch_path_hash[xctx->currsch];
|
||||||
}
|
}
|
||||||
while ( (c = *tok++) )
|
while ( (c = (unsigned char)*tok++) )
|
||||||
hash += (hash << 5) + c;
|
hash += (hash << 5) + c;
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ unsigned int str_hash(const char *tok)
|
||||||
register unsigned int hash = 5381;
|
register unsigned int hash = 5381;
|
||||||
register unsigned int c;
|
register unsigned int c;
|
||||||
|
|
||||||
while ( (c = *tok++) )
|
while ( (c = (unsigned char)*tok++) )
|
||||||
hash += (hash << 5) + c;
|
hash += (hash << 5) + c;
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue