1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
From 6eb2e6c55e2c3247285648be5f918e6220e81968 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Sat, 28 Feb 2015 07:49:38 +0100
Subject: [PATCH] Fix build with gcc 5
See http://www.gnu.org/software/gcc/gcc-5/porting_to.html
Simpler to drop "inline", especially as pointer to these functions are used.
---
lib/hash-algorithms.c | 10 +++++-----
lib/hash-algorithms.h | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/hash-algorithms.c b/lib/hash-algorithms.c
index 86c3abc..96ab313 100644
--- a/lib/hash-algorithms.c
+++ b/lib/hash-algorithms.c
@@ -29,7 +29,7 @@
* Returns:
* - the hash key
*/
-inline uint32_t qha_jenkins1(uint32_t key)
+uint32_t qha_jenkins1(uint32_t key)
{
key = (key ^ 61) ^ (key >> 16);
key = key + (key << 3);
@@ -50,7 +50,7 @@ inline uint32_t qha_jenkins1(uint32_t key)
* Returns:
* - the hash key
*/
-inline uint32_t qha_jenkins2(uint32_t key)
+uint32_t qha_jenkins2(uint32_t key)
{
key = (key+0x7ed55d16) + (key<<12);
key = (key^0xc761c23c) ^ (key>>19);
@@ -70,12 +70,12 @@ inline uint32_t qha_jenkins2(uint32_t key)
* Returns:
* - the hash key
*/
-inline uint32_t qha_no_hash(uint32_t key)
+uint32_t qha_no_hash(uint32_t key)
{
return key;
}
-inline uint32_t qha_djb2(char *key)
+uint32_t qha_djb2(char *key)
{
uint32_t hash = 5381;
int c;
@@ -87,7 +87,7 @@ inline uint32_t qha_djb2(char *key)
return hash;
}
-inline uint32_t qha_sdbm(char *key)
+uint32_t qha_sdbm(char *key)
{
uint32_t hash = 0;
int c;
diff --git a/lib/hash-algorithms.h b/lib/hash-algorithms.h
index 8de96cd..48da5fa 100644
--- a/lib/hash-algorithms.h
+++ b/lib/hash-algorithms.h
@@ -21,11 +21,11 @@
#ifndef QH_HASH_ALGORITHMS_H
#define QH_HASH_ALGORITHMS_H
-inline uint32_t qha_jenkins1(uint32_t key);
-inline uint32_t qha_jenkins2(uint32_t key);
-inline uint32_t qha_no_hash(uint32_t key);
+uint32_t qha_jenkins1(uint32_t key);
+uint32_t qha_jenkins2(uint32_t key);
+uint32_t qha_no_hash(uint32_t key);
-inline uint32_t qha_djb2(char *key);
-inline uint32_t qha_sdbm(char *key);
+uint32_t qha_djb2(char *key);
+uint32_t qha_sdbm(char *key);
#endif
|