summaryrefslogtreecommitdiff
path: root/src/journal/lookup3.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-02 22:51:50 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-02 22:52:09 -0400
commit44a6b1b68029833893f6e9cee35aa27a974038f6 (patch)
tree170b79abd66a206598ac095156a6c4012d0583f4 /src/journal/lookup3.h
parent2f79c10e9aef916efbcf29315eea8c25d0a50ac4 (diff)
Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function calls assert. It is assumed that the assert won't trigger, and even if it does, it can only trigger on the first call with a given set of parameters, and we don't care if the compiler moves the order of calls.
Diffstat (limited to 'src/journal/lookup3.h')
-rw-r--r--src/journal/lookup3.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/journal/lookup3.h b/src/journal/lookup3.h
index 502b42c209..3224473a6a 100644
--- a/src/journal/lookup3.h
+++ b/src/journal/lookup3.h
@@ -5,13 +5,15 @@
#include <inttypes.h>
#include <sys/types.h>
-uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initval);
+#include "macro.h"
+
+uint32_t jenkins_hashword(const uint32_t *k, size_t length, uint32_t initval) _pure_;
void jenkins_hashword2(const uint32_t *k, size_t length, uint32_t *pc, uint32_t *pb);
-uint32_t jenkins_hashlittle(const void *key, size_t length, uint32_t initval);
+uint32_t jenkins_hashlittle(const void *key, size_t length, uint32_t initval) _pure_;
void jenkins_hashlittle2(const void *key, size_t length, uint32_t *pc, uint32_t *pb);
-uint32_t jenkins_hashbig(const void *key, size_t length, uint32_t initval);
+uint32_t jenkins_hashbig(const void *key, size_t length, uint32_t initval) _pure_;
static inline uint64_t hash64(const void *data, size_t length) {
uint32_t a = 0, b = 0;