container_of: work with -Wcast-qual
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 26 May 2014 03:40:02 +0000 (13:10 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 27 May 2014 11:08:29 +0000 (20:38 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/container_of/container_of.h

index 2943b8f098d5e3eba3d7f71a439712dde01df04d..0449935056f51a84af2a84f5b2dd7fcbf48c7678 100644 (file)
        container_off(typeof(*var), member)
 #else
 #define container_off_var(var, member)                 \
-       ((char *)&(var)->member - (char *)(var))
+       ((const char *)&(var)->member - (const char *)(var))
 #endif
 
 #endif /* CCAN_CONTAINER_OF_H */