diff options
| author | noname@inventati.org <noname@inventati.org> | 2014-04-20 13:08:09 +0400 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2014-04-20 21:13:37 +0200 |
| commit | 138887033193389854a2cb748b8940793a7bfb6f (patch) | |
| tree | 1e80ec7a1dafa7a7e2acc625334cfb35a2eec166 | |
| parent | 6b56cbf9cc597b529f244ee8fcb1cbbcc338c7b7 (diff) | |
| download | st-138887033193389854a2cb748b8940793a7bfb6f.tar.gz st-138887033193389854a2cb748b8940793a7bfb6f.zip | |
move MODBIT to Macros section
Patch moves MODBIT to macros section and uses it in tselcs.
| -rw-r--r-- | st.c | 10 |
1 files changed, 4 insertions, 6 deletions
| @@ -75,6 +75,7 @@ char *argv0; | |||
| 75 | #define IS_SET(flag) ((term.mode & (flag)) != 0) | 75 | #define IS_SET(flag) ((term.mode & (flag)) != 0) |
| 76 | #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000) | 76 | #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000) |
| 77 | #define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x)) | 77 | #define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x)) |
| 78 | #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) | ||
| 78 | 79 | ||
| 79 | #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) | 80 | #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) |
| 80 | #define IS_TRUECOL(x) (1 << 24 & (x)) | 81 | #define IS_TRUECOL(x) (1 << 24 & (x)) |
| @@ -1784,8 +1785,6 @@ tsetscroll(int t, int b) { | |||
| 1784 | term.bot = b; | 1785 | term.bot = b; |
| 1785 | } | 1786 | } |
| 1786 | 1787 | ||
| 1787 | #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) | ||
| 1788 | |||
| 1789 | void | 1788 | void |
| 1790 | tsetmode(bool priv, bool set, int *args, int narg) { | 1789 | tsetmode(bool priv, bool set, int *args, int narg) { |
| 1791 | int *lim, mode; | 1790 | int *lim, mode; |
| @@ -2352,10 +2351,9 @@ tdeftran(char ascii) { | |||
| 2352 | 2351 | ||
| 2353 | void | 2352 | void |
| 2354 | tselcs(void) { | 2353 | tselcs(void) { |
| 2355 | if (term.trantbl[term.charset] == CS_GRAPHIC0) | 2354 | MODBIT(term.c.attr.mode, |
| 2356 | term.c.attr.mode |= ATTR_GFX; | 2355 | term.trantbl[term.charset] == CS_GRAPHIC0, |
| 2357 | else | 2356 | ATTR_GFX); |
| 2358 | term.c.attr.mode &= ~ATTR_GFX; | ||
| 2359 | } | 2357 | } |
| 2360 | 2358 | ||
| 2361 | void | 2359 | void |
