summaryrefslogtreecommitdiff
path: root/debian/patches/nodeihash0001-libihash-add-hurd_ihash_value_valid.patch
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-10-30 11:58:58 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-10-30 11:58:58 +0100
commit9c582abd66cdef750ae6ae0c306e9ce7b50a520a (patch)
treefb586a855df957536e4605c07d186d990847f733 /debian/patches/nodeihash0001-libihash-add-hurd_ihash_value_valid.patch
parentcec4cbacbfb65305f5d6a8633cbdb5c3f3b40530 (diff)
add patch series
Diffstat (limited to 'debian/patches/nodeihash0001-libihash-add-hurd_ihash_value_valid.patch')
-rw-r--r--debian/patches/nodeihash0001-libihash-add-hurd_ihash_value_valid.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/debian/patches/nodeihash0001-libihash-add-hurd_ihash_value_valid.patch b/debian/patches/nodeihash0001-libihash-add-hurd_ihash_value_valid.patch
new file mode 100644
index 00000000..18552150
--- /dev/null
+++ b/debian/patches/nodeihash0001-libihash-add-hurd_ihash_value_valid.patch
@@ -0,0 +1,47 @@
+From 12caea4ff224ba598199d2dc7752b442f09f3ee0 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Thu, 15 May 2014 17:55:45 +0200
+Subject: [PATCH hurd 1/3] libihash: add hurd_ihash_value_valid
+
+* libihash/ihash.h (hurd_ihash_value_valid): New function.
+* libihash/ihash.c (index_empty): Use hurd_ihash_value_valid.
+---
+ libihash/ihash.c | 3 +--
+ libihash/ihash.h | 7 +++++++
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/libihash/ihash.c b/libihash/ihash.c
+index fa29257..74e9edd 100644
+--- a/libihash/ihash.c
++++ b/libihash/ihash.c
+@@ -37,8 +37,7 @@
+ static inline int
+ index_empty (hurd_ihash_t ht, unsigned int idx)
+ {
+- return ht->items[idx].value == _HURD_IHASH_EMPTY
+- || ht->items[idx].value == _HURD_IHASH_DELETED;
++ return ! hurd_ihash_value_valid (ht->items[idx].value);
+ }
+
+
+diff --git a/libihash/ihash.h b/libihash/ihash.h
+index 849a55a..128027a 100644
+--- a/libihash/ihash.h
++++ b/libihash/ihash.h
+@@ -41,6 +41,13 @@ typedef void *hurd_ihash_value_t;
+ #define _HURD_IHASH_EMPTY ((hurd_ihash_value_t) 0)
+ #define _HURD_IHASH_DELETED ((hurd_ihash_value_t) -1)
+
++/* Test if VALUE is valid. */
++static inline int
++hurd_ihash_value_valid (hurd_ihash_value_t value)
++{
++ return value != _HURD_IHASH_EMPTY && value != _HURD_IHASH_DELETED;
++}
++
+ /* The type of integer we want to use for the keys. */
+ typedef uintptr_t hurd_ihash_key_t;
+
+--
+2.1.4
+