JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
It's 2014 now.
[st.git] / st.c
diff --git a/st.c b/st.c
index e017940..019f53c 100644 (file)
--- a/st.c
+++ b/st.c
@@ -67,7 +67,7 @@ char *argv0;
 /* macros */
 #define MIN(a, b)  ((a) < (b) ? (a) : (b))
 #define MAX(a, b)  ((a) < (b) ? (b) : (a))
-#define LEN(a)     (sizeof(a) / sizeof(a[0]))
+#define LEN(a)     (sizeof(a) / sizeof(a)[0])
 #define DEFAULT(a, b)     (a) = (a) ? (a) : (b)
 #define BETWEEN(x, a, b)  ((a) <= (x) && (x) <= (b))
 #define LIMIT(x, a, b)    (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
@@ -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))
@@ -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;
@@ -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
@@ -3817,7 +3815,7 @@ run(void) {
 
 void
 usage(void) {
-       die("%s " VERSION " (c) 2010-2013 st engineers\n" \
+       die("%s " VERSION " (c) 2010-2014 st engineers\n" \
        "usage: st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]" \
        " [-t title] [-w windowid] [-e command ...]\n", argv0);
 }