summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/src/pj/hash.c')
-rw-r--r--pjlib/src/pj/hash.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c
index 0495fadc..1f86317b 100644
--- a/pjlib/src/pj/hash.c
+++ b/pjlib/src/pj/hash.c
@@ -49,20 +49,21 @@ struct pj_hash_table_t
-PJ_DEF(pj_uint32_t) pj_hash_calc(pj_uint32_t hash, const void *key, unsigned keylen)
+PJ_DEF(pj_uint32_t) pj_hash_calc(pj_uint32_t hash, const void *key,
+ unsigned keylen)
{
PJ_CHECK_STACK();
if (keylen==PJ_HASH_KEY_STRING) {
const unsigned char *p = key;
for ( ; *p; ++p ) {
- hash = hash * PJ_HASH_MULTIPLIER + *p;
+ hash = (hash * PJ_HASH_MULTIPLIER) + *p;
}
} else {
const unsigned char *p = key,
*end = p + keylen;
for ( ; p!=end; ++p) {
- hash = hash * PJ_HASH_MULTIPLIER + *p;
+ hash = (hash * PJ_HASH_MULTIPLIER) + *p;
}
}
return hash;