diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-05-15 17:55:45 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-11-06 15:50:28 +0100 |
commit | 6c948532d2799bcc172053cac504c4aa5f016bba (patch) | |
tree | fb0f17d9b2bc0be22a05eec6605d953bf76d32f4 /libihash/ihash.h | |
parent | df778cd01505e3a8c11f5b13f5ee26a4be290f9a (diff) | |
download | hurd-6c948532d2799bcc172053cac504c4aa5f016bba.tar.gz hurd-6c948532d2799bcc172053cac504c4aa5f016bba.tar.bz2 hurd-6c948532d2799bcc172053cac504c4aa5f016bba.zip |
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.
Diffstat (limited to 'libihash/ihash.h')
-rw-r--r-- | libihash/ihash.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libihash/ihash.h b/libihash/ihash.h index 849a55a2..128027a0 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; |