From 141b9946e039e25cb9e79c581639caa00f442ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 6 Jan 2010 22:36:54 +0100 Subject: maintenance --- cas.c | 3 +++ container_of.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cas.c b/cas.c index 910a56d..1f83ca5 100644 --- a/cas.c +++ b/cas.c @@ -67,16 +67,19 @@ static inline unsigned int cas( volatile split_t *mem, int test_compare_and_swap () { pointer_t mem, old, new; + new.concat = old.concat = 0; return compare_and_swap(&mem.concat, old.concat, new.concat); } int test_cas () { pointer_t mem, old, new; + new.concat = old.concat = 0; return cas(&mem.split, old.split, new.split); } void check_assign_a() { pointer_t a, b; + b.concat = 0; a.concat = b.concat; } diff --git a/container_of.c b/container_of.c index f67b644..d3f9e25 100644 --- a/container_of.c +++ b/container_of.c @@ -29,7 +29,7 @@ #include "stdlib.h" #include "stddef.h" -#define container_of(ptr, type, member) ({ \ +#define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) -- cgit v1.1-2-g2b99