From cf8957924e41edd829919ecdbd7fa28fe3eb4f28 Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Sat, 1 Oct 2016 04:40:07 +0000 Subject: [PATCH] added STIX_FLIPBITS() --- stix/lib/stix-cmn.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stix/lib/stix-cmn.h b/stix/lib/stix-cmn.h index 4224bc2..6588c30 100644 --- a/stix/lib/stix-cmn.h +++ b/stix/lib/stix-cmn.h @@ -440,6 +440,9 @@ struct stix_ntime_t #define STIX_SETBITS(type,value,offset,length,bits) \ (value = (STIX_CLEARBITS(type,value,offset,length) | (((bits) & STIX_LBMASK(type,length)) << (offset)))) +#define STIX_FLIPBITS(type,value,offset,length) \ + (((type)(value)) ^ (STIX_LBMASK(type,length) << (offset))) + #define STIX_ORBITS(type,value,offset,length,bits) \ (value = (((type)(value)) | (((bits) & STIX_LBMASK(type,length)) << (offset))))