mdns: fix container_of pointer arith
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 20 Feb 2013 11:09:21 +0000 (12:09 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 20 Feb 2013 11:22:59 +0000 (12:22 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/mdns/src/container_of.h

index ca3150c..4fcaebd 100644 (file)
@@ -55,7 +55,7 @@
  * @param member name of node inside struct
  * @return pointer to surrounding struct
  */
-#define container_of(ptr, type, member) ((type *)( (char *)(ptr) - offsetof(type,member) ))
+#define container_of(ptr, type, member) ((type *) (((size_t) ptr) - offsetof(type, member) ))
 
 /**
  * Helper function for NULL safe container_of macro