about summary refs log tree commit homepage
path: root/ccan/list/list.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2014-05-22 23:18:40 +0000
committerEric Wong <e@80x24.org>2014-05-22 23:46:53 +0000
commit506e082b551ea2d337d68d8a929bdacfb7e77f95 (patch)
tree9ea391a7fd739f2023095519b252e5a8ef24beb2 /ccan/list/list.h
parent489e29e887f58eca37a5fefa205ff91a1c772f3c (diff)
downloadcmogstored-506e082b551ea2d337d68d8a929bdacfb7e77f95.tar.gz
These warnings were encountered when adding ccan/list to cmogstored
(which uses -Wcast-qual).  This changes the public API for checking,
but I doubt anybody is affected.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'ccan/list/list.h')
-rw-r--r--ccan/list/list.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/ccan/list/list.h b/ccan/list/list.h
index 4d1d34e..99dfbd2 100644
--- a/ccan/list/list.h
+++ b/ccan/list/list.h
@@ -3,6 +3,7 @@
 #define CCAN_LIST_H
 //#define CCAN_LIST_DEBUG 1
 #include <stdbool.h>
+#include <stdint.h>
 #include <assert.h>
 #include <ccan/str/str.h>
 #include <ccan/container_of/container_of.h>
@@ -69,7 +70,8 @@ struct list_head
  *                        printf(" -> %s\n", c->name);
  *        }
  */
-struct list_head *list_check(const struct list_head *h, const char *abortstr);
+const struct list_head *list_check(const struct list_head *h,
+                                const char *abortstr);
 
 /**
  * list_check_node - check node of a list for consistency
@@ -87,8 +89,8 @@ struct list_head *list_check(const struct list_head *h, const char *abortstr);
  *                printf("%s\n", c->name);
  *        }
  */
-struct list_node *list_check_node(const struct list_node *n,
-                                  const char *abortstr);
+const struct list_node *list_check_node(const struct list_node *n,
+                                        const char *abortstr);
 
 #define LIST_LOC __FILE__  ":" stringify(__LINE__)
 #ifdef CCAN_LIST_DEBUG
@@ -651,6 +653,6 @@ static inline void *list_entry_or_null(const struct list_head *h,
 {
         if (n == &h->n)
                 return NULL;
-        return (char *)n - off;
+        return (void *)((uintptr_t)n - off);
 }
 #endif /* CCAN_LIST_H */