---
 st.c | 10 +++++-----
 st.h |  9 +++++++++
 x.c  | 18 +++++++++---------
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/st.c b/st.c
index 4cdab8a..9522f52 100644
--- a/st.c
+++ b/st.c
@@ -718,7 +718,7 @@ execsh(const char *cmd, char *const *args)
 }
 
 void
-sigchld(int a)
+sigchld(UNUSED int a)
 {
        int stat;
        pid_t p;
@@ -1952,7 +1952,7 @@ strreset(void)
 }
 
 void
-sendbreak(const Arg *arg)
+sendbreak(UNUSED const Arg *arg)
 {
        if (tcsendbreak(cmdfd, 0))
                perror("Error sending break");
@@ -1969,19 +1969,19 @@ tprinter(const char *s, size_t len)
 }
 
 void
-toggleprinter(const Arg *arg)
+toggleprinter(UNUSED const Arg *arg)
 {
        term.mode ^= MODE_PRINT;
 }
 
 void
-printscreen(const Arg *arg)
+printscreen(UNUSED const Arg *arg)
 {
        tdump();
 }
 
 void
-printsel(const Arg *arg)
+printsel(UNUSED const Arg *arg)
 {
        tdumpsel();
 }
diff --git a/st.h b/st.h
index bc1c717..59f1d6e 100644
--- a/st.h
+++ b/st.h
@@ -20,6 +20,15 @@
 #define TRUECOLOR(r,g,b)       (1 << 24 | (r) << 16 | (g) << 8 | (b))
 #define IS_TRUECOL(x)          (1 << 24 & (x))
 
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+#if __has_attribute(unused)
+ #define UNUSED __attribute__ ((unused))
+#else
+ #define UNUSED
+#endif
+
 enum glyph_attribute {
        ATTR_NULL       = 0,
        ATTR_BOLD       = 1 << 0,
diff --git a/x.c b/x.c
index af569e5..2a3f3e3 100644
--- a/x.c
+++ b/x.c
@@ -241,7 +241,7 @@ static const char *opt_title = NULL;
 static int oldbutton = 3; /* button event on startup: 3 = release */
 
 void
-clipcopy(const Arg *dummy)
+clipcopy(UNUSED const Arg *dummy)
 {
        Atom clipboard;
 
@@ -256,7 +256,7 @@ clipcopy(const Arg *dummy)
 }
 
 void
-clippaste(const Arg *dummy)
+clippaste(UNUSED const Arg *dummy)
 {
        Atom clipboard;
 
@@ -266,14 +266,14 @@ clippaste(const Arg *dummy)
 }
 
 void
-selpaste(const Arg *dummy)
+selpaste(UNUSED const Arg *dummy)
 {
        XConvertSelection(xw.dpy, XA_PRIMARY, xsel.xtarget, XA_PRIMARY,
                        xw.win, CurrentTime);
 }
 
 void
-numlock(const Arg *dummy)
+numlock(UNUSED const Arg *dummy)
 {
        win.mode ^= MODE_NUMLOCK;
 }
@@ -298,7 +298,7 @@ zoomabs(const Arg *arg)
 }
 
 void
-zoomreset(const Arg *arg)
+zoomreset(UNUSED const Arg *arg)
 {
        Arg larg;
 
@@ -551,8 +551,8 @@ xclipcopy(void)
        clipcopy(NULL);
 }
 
-void
-selclear_(XEvent *e)
+void UNUSED
+selclear_(UNUSED XEvent *e)
 {
        selclear();
 }
@@ -1555,7 +1555,7 @@ xfinishdraw(void)
 }
 
 void
-expose(XEvent *ev)
+expose(UNUSED XEvent *ev)
 {
        redraw();
 }
@@ -1569,7 +1569,7 @@ visibility(XEvent *ev)
 }
 
 void
-unmap(XEvent *ev)
+unmap(UNUSED XEvent *ev)
 {
        win.mode &= ~MODE_VISIBLE;
 }
-- 
2.20.1


Reply via email to