From 08859aeb29fd8fea978ce1e82e97e32d8c6672b6 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 8 Dec 2019 12:59:41 -0500 Subject: [PATCH] use CELL_STYLE_SHIFT rather than bare 16u --- include/notcurses.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/notcurses.h b/include/notcurses.h index 6d1054c54..08b441254 100644 --- a/include/notcurses.h +++ b/include/notcurses.h @@ -569,7 +569,6 @@ API void cell_release(struct ncplane* n, cell* c); #define CELL_STYLE_SHIFT 16u #define CELL_STYLE_MASK 0xffff0000ul -#define CELL_ALPHA_MASK 0x0000fffful // these are used for the style bitfield *after* it is shifted #define CELL_STYLE_STANDOUT 0x0001u #define CELL_STYLE_UNDERLINE 0x0002u @@ -586,26 +585,26 @@ API void cell_release(struct ncplane* n, cell* c); static inline void cell_styles_set(cell* c, unsigned stylebits){ c->attrword = (c->attrword & ~CELL_STYLE_MASK) | - ((stylebits & 0xffff) << 16u); + ((stylebits & 0xffff) << CELL_STYLE_SHIFT); } // Get the style bits, shifted over into the LSBs. static inline unsigned cell_styles(const cell* c){ - return (c->attrword & CELL_STYLE_MASK) >> 16u; + return (c->attrword & CELL_STYLE_MASK) >> CELL_STYLE_SHIFT; } // Add the specified styles (in the LSBs) to the cell's existing spec, whether // they're actively supported or not. static inline void cell_styles_on(cell* c, unsigned stylebits){ - c->attrword |= ((stylebits & 0xffff) << 16u); + c->attrword |= ((stylebits & 0xffff) << CELL_STYLE_SHIFT); } // Remove the specified styles (in the LSBs) from the cell's existing spec. static inline void cell_styles_off(cell* c, unsigned stylebits){ - c->attrword &= ~((stylebits & 0xffff) << 16u); + c->attrword &= ~((stylebits & 0xffff) << CELL_STYLE_SHIFT); } static inline unsigned