Index: uspace/lib/c/include/adt/hash_table.h
===================================================================
--- uspace/lib/c/include/adt/hash_table.h	(revision bc56f30178279e1e59b8add425abe116ecae93b5)
+++ uspace/lib/c/include/adt/hash_table.h	(revision bfb055b5d8b4b517c36ae0332c76d2f90f85bd12)
@@ -41,4 +41,5 @@
 #include <stdbool.h>
 #include <macros.h>
+#include <member.h>
 
 /** Opaque hash table link type. */
Index: uspace/lib/c/include/adt/list.h
===================================================================
--- uspace/lib/c/include/adt/list.h	(revision bc56f30178279e1e59b8add425abe116ecae93b5)
+++ uspace/lib/c/include/adt/list.h	(revision bfb055b5d8b4b517c36ae0332c76d2f90f85bd12)
@@ -38,4 +38,5 @@
 
 #include <assert.h>
+#include <member.h>
 #include <stdbool.h>
 #include <stddef.h>
@@ -85,8 +86,8 @@
 
 #define list_get_instance(link, type, member) \
-	((type *) (((void *)(link)) - list_link_to_void(&(((type *) NULL)->member))))
+	member_to_inst(link, type, member)
 
 #define list_foreach(list, member, itype, iterator) \
-	for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
+	for (itype *iterator = NULL; iterator == NULL; iterator = &((itype *) NULL)[1]) \
 		for (link_t *_link = (list).head.next; \
 		    iterator = list_get_instance(_link, itype, member), \
@@ -94,5 +95,5 @@
 
 #define list_foreach_rev(list, member, itype, iterator) \
-	for (itype *iterator = NULL; iterator == NULL; iterator = (itype *) 1) \
+	for (itype *iterator = NULL; iterator == NULL; iterator = &((itype *) NULL)[1]) \
 		for (link_t *_link = (list).head.prev; \
 		    iterator = list_get_instance(_link, itype, member), \
@@ -154,5 +155,5 @@
 extern bool list_member(const link_t *, const list_t *);
 extern void list_splice(list_t *, link_t *);
-extern unsigned long list_count(const list_t *);
+extern size_t list_count(const list_t *);
 
 /** Returns true if the link is definitely part of a list. False if not sure. */
@@ -394,7 +395,7 @@
  *
  */
-static inline link_t *list_nth(const list_t *list, unsigned long n)
-{
-	unsigned long cnt = 0;
+static inline link_t *list_nth(const list_t *list, size_t n)
+{
+	size_t cnt = 0;
 
 	link_t *link = list_first(list);
