]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Hash: mem_hash doesn't modify the memory, declared constant
authorJan Maria Matejka <mq@ucw.cz>
Tue, 27 Nov 2018 07:49:31 +0000 (08:49 +0100)
committerJan Maria Matejka <mq@ucw.cz>
Tue, 4 Dec 2018 13:00:53 +0000 (14:00 +0100)
lib/hash.h

index 8809aedc93b7c8da7adafff65bbed6f177a25629..ea4ca6dde2363be00b0605de2f55057f40d947ce 100644 (file)
@@ -202,7 +202,7 @@ mem_hash_init(u64 *h)
 }
 
 static inline void
-mem_hash_mix(u64 *h, void *p, uint s)
+mem_hash_mix(u64 *h, const void *p, uint s)
 {
   const u64 multiplier = 0xb38bc09a61202731ULL;
   const char *pp = p;
@@ -222,7 +222,7 @@ mem_hash_value(u64 *h)
 }
 
 static inline uint
-mem_hash(void *p, uint s)
+mem_hash(const void *p, uint s)
 {
   static u64 h;
   mem_hash_init(&h);