[hackers] [st] move MODBIT to Macros section || noname_AT_inventati.org

From: <git_AT_suckless.org>
Date: Tue, 22 Apr 2014 07:37:02 +0200

commit 138887033193389854a2cb748b8940793a7bfb6f
Author: noname_AT_inventati.org <noname_AT_inventati.org>
Date: Sun Apr 20 13:08:09 2014 +0400

    move MODBIT to Macros section
    
    Patch moves MODBIT to macros section and uses it in tselcs.

diff --git a/st.c b/st.c
index 4ccef9c..7ffe59a 100644
--- a/st.c
+++ b/st.c
_AT_@ -75,6 +75,7 @@ char *argv0;
 #define IS_SET(flag) ((term.mode & (flag)) != 0)
 #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
 #define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x))
+#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
 
 #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
 #define IS_TRUECOL(x) (1 << 24 & (x))
_AT_@ -1784,8 +1785,6 @@ tsetscroll(int t, int b) {
         term.bot = b;
 }
 
-#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
-
 void
 tsetmode(bool priv, bool set, int *args, int narg) {
         int *lim, mode;
_AT_@ -2352,10 +2351,9 @@ tdeftran(char ascii) {
 
 void
 tselcs(void) {
- if (term.trantbl[term.charset] == CS_GRAPHIC0)
- term.c.attr.mode |= ATTR_GFX;
- else
- term.c.attr.mode &= ~ATTR_GFX;
+ MODBIT(term.c.attr.mode,
+ term.trantbl[term.charset] == CS_GRAPHIC0,
+ ATTR_GFX);
 }
 
 void
Received on Tue Apr 22 2014 - 07:37:02 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 22 2014 - 07:48:08 CEST