X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Futil.h;h=0db41be926389f0d48e9cb4af868e774b853f3bd;hb=015ac88281952a1b43ad46e9e6300db1c6e3647b;hp=2159594cb79a415d2fa427db54acba0d2f729548;hpb=e93ab5531c808c63a7ac4a12739530982ba0eaeb;p=sliver-openvswitch.git diff --git a/lib/util.h b/lib/util.h index 2159594cb..0db41be92 100644 --- a/lib/util.h +++ b/lib/util.h @@ -189,9 +189,13 @@ is_pow2(uintmax_t x) * that that OBJECT points to, assigns the address of the outer object to * OBJECT, which must be an lvalue. * - * Evaluates to 1. */ + * Evaluates to (void) 0 as the result is not to be used. */ #define ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER) \ - ((OBJECT) = OBJECT_CONTAINING(POINTER, OBJECT, MEMBER), 1) + ((OBJECT) = OBJECT_CONTAINING(POINTER, OBJECT, MEMBER), (void) 0) + +/* Given ATTR, and TYPE, cast the ATTR to TYPE by first casting ATTR to + * (void *). This is to suppress the alignment warning issued by clang. */ +#define ALIGNED_CAST(TYPE, ATTR) ((TYPE) (void *) (ATTR)) #ifdef __cplusplus extern "C" {