projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Assign more suitable types and fix narrowing conversion warns.
[tinc]
/
src
/
hash.c
diff --git
a/src/hash.c
b/src/hash.c
index
63b8f54
..
39e88c9
100644
(file)
--- a/
src/hash.c
+++ b/
src/hash.c
@@
-29,11
+29,11
@@
static uint32_t hash_function(const void *p, size_t len) {
uint32_t hash = 0;
while(true) {
uint32_t hash = 0;
while(true) {
- for(
in
t i = len > 4 ? 4 : len; --i;) {
+ for(
size_
t i = len > 4 ? 4 : len; --i;) {
hash += (uint32_t)q[len - i] << (8 * i);
}
hash += (uint32_t)q[len - i] << (8 * i);
}
- hash
*= 0x9e370001UL
; // Golden ratio prime.
+ hash
= (uint32_t)(hash * 0x9e370001UL)
; // Golden ratio prime.
if(len <= 4) {
break;
if(len <= 4) {
break;