aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Huemer <alexander.huemer@xx.vu>2014-08-20 12:05:12 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-08-20 21:52:33 +0200
commit83dea7fd7bb5f6e8a11a7ac8a734d8016d1ed0cb (patch)
tree1c9021b1cc2ff11898552e7d5e356dac473b29fe
parente5f6736ee0a0f29a14afec5494a5b3f204cedc1c (diff)
downloadst-83dea7fd7bb5f6e8a11a7ac8a734d8016d1ed0cb.tar.gz
Improve readability of enum members
The 'left shift from one' notation of power of two integers is more expressive than the result. Signed-off-by: Alexander Huemer <alexander.huemer@xx.vu> Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
-rw-r--r--st.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/st.c b/st.c
index f15e868..6165119 100644
--- a/st.c
+++ b/st.c
@@ -88,17 +88,17 @@ char *argv0;
enum glyph_attribute {
ATTR_NULL = 0,
- ATTR_BOLD = 1,
- ATTR_FAINT = 2,
- ATTR_ITALIC = 4,
- ATTR_UNDERLINE = 8,
- ATTR_BLINK = 16,
- ATTR_REVERSE = 32,
- ATTR_INVISIBLE = 64,
- ATTR_STRUCK = 128,
- ATTR_WRAP = 256,
- ATTR_WIDE = 512,
- ATTR_WDUMMY = 1024,
+ ATTR_BOLD = 1 << 0,
+ ATTR_FAINT = 1 << 1,
+ ATTR_ITALIC = 1 << 2,
+ ATTR_UNDERLINE = 1 << 3,
+ ATTR_BLINK = 1 << 4,
+ ATTR_REVERSE = 1 << 5,
+ ATTR_INVISIBLE = 1 << 6,
+ ATTR_STRUCK = 1 << 7,
+ ATTR_WRAP = 1 << 8,
+ ATTR_WIDE = 1 << 9,
+ ATTR_WDUMMY = 1 << 10,
};
enum cursor_movement {
@@ -113,27 +113,27 @@ enum cursor_state {
};
enum term_mode {
- MODE_WRAP = 1,
- MODE_INSERT = 2,
- MODE_APPKEYPAD = 4,
- MODE_ALTSCREEN = 8,
- MODE_CRLF = 16,
- MODE_MOUSEBTN = 32,
- MODE_MOUSEMOTION = 64,
- MODE_REVERSE = 128,
- MODE_KBDLOCK = 256,
- MODE_HIDE = 512,
- MODE_ECHO = 1024,
- MODE_APPCURSOR = 2048,
- MODE_MOUSESGR = 4096,
- MODE_8BIT = 8192,
- MODE_BLINK = 16384,
- MODE_FBLINK = 32768,
- MODE_FOCUS = 65536,
- MODE_MOUSEX10 = 131072,
- MODE_MOUSEMANY = 262144,
- MODE_BRCKTPASTE = 524288,
- MODE_PRINT = 1048576,
+ MODE_WRAP = 1 << 0,
+ MODE_INSERT = 1 << 1,
+ MODE_APPKEYPAD = 1 << 2,
+ MODE_ALTSCREEN = 1 << 3,
+ MODE_CRLF = 1 << 4,
+ MODE_MOUSEBTN = 1 << 5,
+ MODE_MOUSEMOTION = 1 << 6,
+ MODE_REVERSE = 1 << 7,
+ MODE_KBDLOCK = 1 << 8,
+ MODE_HIDE = 1 << 9,
+ MODE_ECHO = 1 << 10,
+ MODE_APPCURSOR = 1 << 11,
+ MODE_MOUSESGR = 1 << 12,
+ MODE_8BIT = 1 << 13,
+ MODE_BLINK = 1 << 14,
+ MODE_FBLINK = 1 << 15,
+ MODE_FOCUS = 1 << 16,
+ MODE_MOUSEX10 = 1 << 17,
+ MODE_MOUSEMANY = 1 << 18,
+ MODE_BRCKTPASTE = 1 << 19,
+ MODE_PRINT = 1 << 20,
MODE_MOUSE = MODE_MOUSEBTN|MODE_MOUSEMOTION|MODE_MOUSEX10\
|MODE_MOUSEMANY,
};
remember that computers suck.