From 0782e2f825decb365f7ac94066dd5d7d1880586f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 18 Dec 2012 20:06:40 +0100 Subject: [PATCH] Use gcc void* arithmetic to avoid cast warning --- include/ucore/ucore_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ucore/ucore_utils.h b/include/ucore/ucore_utils.h index fc389cc..c76499b 100644 --- a/include/ucore/ucore_utils.h +++ b/include/ucore/ucore_utils.h @@ -47,7 +47,7 @@ //struct foo *f = CONTAINER_OF(p, struct foo, zap); #define CONTAINER_OF(ptr, type, member) ({ \ typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type, member) ); }) + (type *)( (void *)__mptr - offsetof(type, member) ); }) #define UC_ALIGN(val,align) (((val)+(align)-1UL)&~((align)-1UL))