about summary refs log tree commit homepage
path: root/ccan/list/list.h
diff options
context:
space:
mode:
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 */