From: Ian Jackson Date: Sat, 23 Apr 2016 19:52:50 +0000 (+0100) Subject: common.h: bitmaps: Provide PRBITMASK X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=xf86-input-mtrack.git;a=commitdiff_plain;h=d3540aa6dbdda988cee8c40c3aadfede7a82b958 common.h: bitmaps: Provide PRBITMASK This is a printf format specifier, a la PRIx32 et al. This avoids us having to write %#x explicitly, which would be annoying if bitmask_t ever changed its type. No use sites introduced in this commit, so no functional change yet. Signed-off-by: Ian Jackson --- diff --git a/include/common.h b/include/common.h index 44537f8..b774ead 100644 --- a/include/common.h +++ b/include/common.h @@ -52,6 +52,7 @@ typedef unsigned int bitmask_t; #define SETBIT(m, x) (m |= BITMASK(x)) #define CLEARBIT(m, x) (m &= ~BITMASK(x)) #define MODBIT(m, x, b) ((b) ? SETBIT(m, x) : CLEARBIT(m, x)) +#define PRBITMASK "0x%x" #define ABSVAL(x) ((x) < 0 ? -1*(x) : (x)) #define MINVAL(x, y) ((x) < (y) ? (x) : (y))