[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 08/75: libihash: add hurd_ihash_value_valid
From: |
Samuel Thibault |
Subject: |
[hurd] 08/75: libihash: add hurd_ihash_value_valid |
Date: |
Thu, 14 Jan 2016 01:04:01 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch dde
in repository hurd.
commit 6c948532d2799bcc172053cac504c4aa5f016bba
Author: Justus Winter <address@hidden>
Date: Thu May 15 17:55:45 2014 +0200
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;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch dde updated (c7fdc30 -> cb08549), Samuel Thibault, 2016/01/13
- [hurd] 04/75: random: fix odd formatting, Samuel Thibault, 2016/01/13
- [hurd] 06/75: random: use /servers/startup to register for shutdown notifications, Samuel Thibault, 2016/01/13
- [hurd] 07/75: random: satisfy arbitrarily-sized reads, Samuel Thibault, 2016/01/13
- [hurd] 08/75: libihash: add hurd_ihash_value_valid,
Samuel Thibault <=
- [hurd] 10/75: libihash: prefer performance degradation over failure, Samuel Thibault, 2016/01/13
- [hurd] 11/75: Make dde conditionally built under presence of libpciaccess, Samuel Thibault, 2016/01/13
- [hurd] 13/75: Clean debugging macro, Samuel Thibault, 2016/01/13
- [hurd] 09/75: libihash: optimize lookup-or-insert operations, Samuel Thibault, 2016/01/13
- [hurd] 03/75: Remove unused variables, Samuel Thibault, 2016/01/13
- [hurd] 17/75: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into dde, Samuel Thibault, 2016/01/13
- [hurd] 19/75: Add devnode documentation, Samuel Thibault, 2016/01/13
- [hurd] 23/75: Add missing menus, Samuel Thibault, 2016/01/13
- [hurd] 20/75: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into dde, Samuel Thibault, 2016/01/13
- [hurd] 12/75: Merge branch 'dde' of ssh://git.savannah.gnu.org/srv/git/hurd/incubator into dde, Samuel Thibault, 2016/01/13