Skip to content

Commit

Permalink
common.h: bitmaps: Provide PRBITMASK
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ijackson committed Apr 23, 2016
1 parent 52802ab commit 8403908
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

1 comment on commit 8403908

@rynbrd
Copy link
Owner

@rynbrd rynbrd commented on 8403908 Apr 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're not using it why are you defining it?

Please sign in to comment.