]> git.ozlabs.org Git - ccan/blobdiff - ccan/htable/htable.h
bitmap: Avoid shadowing type name with parameter name
[ccan] / ccan / htable / htable.h
index 358b74280867c8694fd90ce11689091fd57055fd..faaf541bd8ce8c5ee5f5ea64eab3649e1462fade 100644 (file)
  * supply inline functions.
  */
 struct htable {
-       /* These are the bits which are the same in all pointers. */
-       uintptr_t common_bits, common_mask;
        size_t (*rehash)(const void *elem, void *priv);
        void *priv;
        unsigned int bits, perfect_bitnum;
        size_t elems, deleted;
+       /* These are the bits which are the same in all pointers. */
+       uintptr_t common_mask, common_bits;
        uintptr_t *table;
 };
 
@@ -49,7 +49,7 @@ struct htable {
  *     static struct htable ht = HTABLE_INITIALIZER(ht, rehash, NULL);
  */
 #define HTABLE_INITIALIZER(name, rehash, priv)                         \
-       { 0, -1, rehash, priv, 0, 0, 0, 0, &name.common_bits }
+       { rehash, priv, 0, 0, 0, 0, -1, 0, &name.common_bits }
 
 /**
  * htable_init - initialize an empty hash table.
@@ -132,7 +132,7 @@ bool htable_copy_(struct htable *dst, const struct htable *src);
  * htable_add - add a pointer into a hash table.
  * @ht: the htable
  * @hash: the hash value of the object
- * @p: the non-NULL pointer
+ * @p: the non-NULL pointer (also cannot be (void *)1).
  *
  * Also note that this can only fail due to allocation failure.  Otherwise, it
  * returns true.