Commit Diff


commit - af60b04af6a7bd8e5e18a7bc271f75af476ccccb
commit + 9f68765ee52324f2ec07f7866b5b66b572b72995
blob - 0273ba4bad194dae94c9512b7712a776539e222e
blob + 9c9e0f793a83d1e3dba565cc6a1747ba982d24c7
--- Makefile
+++ Makefile
@@ -4,7 +4,7 @@ SRC_DWM		= dwm/dwm.c dwm/drw.c dwm/util.c
 HDR_DWM		= dwm/drw.h dwm/util.h dwm/config.h master.h
 
 SRC_ST		= st/st.c st/x.c
-HDR_ST		= st/arg.h st/st.h st/win.h st/config.h
+HDR_ST		= st/arg.h st/st.h st/win.h st/config.h master.h
 
 SRC_DMENU	= dmenu/dmenu.c dmenu/drw.c dmenu/util.c
 HDR_DMENU	= dmenu/arg.h dmenu/config.h dmenu/drw.h dmenu/util.h master.h
blob - 25826dc79e8eb34a5a22011e5ff2bde25cc2d078
blob + aad4f75d1ce5b3e4f053f1725a921501054275b6
--- config.mk
+++ config.mk
@@ -5,5 +5,5 @@ SCRIPTDIR = ${PREFIX}/libexec/desktop
 VERSION = "benni-0.1"
 
 CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DPREFIX=\"${PREFIX}\" -DVERSION=\"${VERSION}\"
-CFLAGS = -std=c99 -pedantic -Wall -O2 ${CPPFLAGS}
+CFLAGS = -std=c99 -pedantic -Wall -Wunused-parameter -O2 ${CPPFLAGS}
 
blob - 52ca6e88297272880735ad3ce4c28429648e39eb
blob + 05a7fb103a0d60461df53e5f32d7575f4bef0c0f
--- dwm/dwm.c
+++ dwm/dwm.c
@@ -995,9 +995,8 @@ grabkeys(void)
 }
 
 /*void
-incnmaster(const Arg *arg)
+incnmaster(UNUSED const Arg *arg)
 {
-	(void)arg;
 	selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0);
 	arrange(selmon);
 }*/
@@ -1031,7 +1030,7 @@ keypress(XEvent *e)
 }
 
 void
-killclient(const Arg *arg)
+killclient(UNUSED const Arg *arg)
 {
 	if (!selmon->sel)
 		return;
@@ -1146,7 +1145,7 @@ monocle(Monitor *m)
 }
 
 void
-movemouse(const Arg *arg)
+movemouse(UNUSED const Arg *arg)
 {
 	int x, y, ocx, ocy, nx, ny;
 	Client *c;
@@ -1312,7 +1311,7 @@ resizeclient(Client *c, int x, int y, int w, int h)
 }
 
 void
-resizemouse(const Arg *arg)
+resizemouse(UNUSED const Arg *arg)
 {
 	int ocx, ocy, nw, nh;
 	Client *c;
@@ -1668,7 +1667,7 @@ showhide(Client *c)
 }
 
 void
-sigchld(int unused)
+sigchld(UNUSED int unused)
 {
 	if (signal(SIGCHLD, sigchld) == SIG_ERR)
 		die("can't install SIGCHLD handler:");
@@ -1676,14 +1675,14 @@ sigchld(int unused)
 }
 
 void
-sighup(int unused)
+sighup(UNUSED int unused)
 {
 	Arg a = {.i = 1};
 	quit(&a);
 }
 
 void
-sigterm(int unused)
+sigterm(UNUSED int unused)
 {
 	Arg a = {.i = 0};
 	quit(&a);
@@ -1755,7 +1754,7 @@ tile(Monitor *m)
 }
 
 void
-togglebar(const Arg *arg)
+togglebar(UNUSED const Arg *arg)
 {
 	selmon->showbar = !selmon->showbar;
 	updatebarpos(selmon);
@@ -1764,7 +1763,7 @@ togglebar(const Arg *arg)
 }
 
 void
-togglefloating(const Arg *arg)
+togglefloating(UNUSED const Arg *arg)
 {
 	if (!selmon->sel)
 		return;
@@ -2194,7 +2193,7 @@ xerror(Display *dpy, XErrorEvent *ee)
 }
 
 int
-xerrordummy(Display *dpy, XErrorEvent *ee)
+xerrordummy(UNUSED Display *dpy, UNUSED XErrorEvent *ee)
 {
 	return 0;
 }
@@ -2202,14 +2201,14 @@ xerrordummy(Display *dpy, XErrorEvent *ee)
 /* Startup Error handler to check if another window manager
  * is already running. */
 int
-xerrorstart(Display *dpy, XErrorEvent *ee)
+xerrorstart(UNUSED Display *dpy, UNUSED XErrorEvent *ee)
 {
 	die("dwm: another window manager is already running");
 	return -1;
 }
 
 void
-zoom(const Arg *arg)
+zoom(UNUSED const Arg *arg)
 {
 	Client *c = selmon->sel;
 
blob - 2123b7845881ea3347470bd153b92623e41eeeba
blob + 42274df1731f0174eb3ebd0a0b28cbb082e5267d
--- master.h
+++ master.h
@@ -1,2 +1,4 @@
 #define BUGREPORT "Benjamin Stürz <benni@stuerz.xyz>"
 #define TOPBAR_FONT "monospace:size=6"
+
+#define UNUSED __attribute__((unused))
blob - 70b33f4a3774c601efd28473fa4e00d9beee342a
blob + 55083d1e0610a1f2cd1dbc5031f87405c0ba4ce8
--- pinentry-dmenu/pinentry/password-cache.c
+++ pinentry-dmenu/pinentry/password-cache.c
@@ -17,6 +17,8 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "../../master.h"
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -64,7 +66,7 @@ keygrip_to_label (const char *keygrip)
 #endif
 
 void
-password_cache_save (const char *keygrip, const char *password)
+password_cache_save (UNUSED const char *keygrip, UNUSED const char *password)
 {
 #ifdef HAVE_LIBSECRET
   char *label;
@@ -96,7 +98,7 @@ password_cache_save (const char *keygrip, const char *
 }
 
 char *
-password_cache_lookup (const char *keygrip)
+password_cache_lookup (UNUSED const char *keygrip)
 {
 #ifdef HAVE_LIBSECRET
   GError *error = NULL;
@@ -140,7 +142,7 @@ password_cache_lookup (const char *keygrip)
    error, 0 if the key is not found and 1 if the password was
    removed.  */
 int
-password_cache_clear (const char *keygrip)
+password_cache_clear (UNUSED const char *keygrip)
 {
 #ifdef HAVE_LIBSECRET
   GError *error = NULL;
blob - 3d5b2cd357bca4b88fb147472773efeb66844528
blob + afe89eee03e79224e5e016f8f5ac59fdfb685c34
--- pinentry-dmenu/pinentry/secmem.c
+++ pinentry-dmenu/pinentry/secmem.c
@@ -18,6 +18,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
+
+#include "../../master.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -123,7 +125,7 @@ print_warn(void)
 
 
 static void
-lock_pool( void *p, size_t n )
+lock_pool( UNUSED void *p, UNUSED size_t n )
 {
 #if defined(USE_CAPABILITIES) && defined(HAVE_MLOCK)
     int err;
blob - 4b7de246c8f974888a0f6f54d24bf7a51e088ba5
blob + 8272aee3a914f1ea32402dce7cf79fe6135f63f3
--- st/st.c
+++ st/st.c
@@ -1,4 +1,5 @@
 /* See LICENSE for license details. */
+#include "../master.h"
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -726,7 +727,7 @@ execsh(char *cmd, char **args)
 }
 
 void
-sigchld(int a)
+sigchld(UNUSED int a)
 {
 	int stat;
 	pid_t p;
@@ -2138,7 +2139,7 @@ strreset(void)
 }
 
 void
-sendbreak(const Arg *arg)
+sendbreak(UNUSED const Arg *arg)
 {
 	if (tcsendbreak(cmdfd, 0))
 		perror("Error sending break");
@@ -2155,19 +2156,19 @@ tprinter(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();
 }
blob - ac2bc3c2e3921902680fa838a6b4d3c08de9cc48
blob + 0eb53fb1f68fa3a7d173dd38d53f1afd7a17a20b
--- st/x.c
+++ st/x.c
@@ -1,4 +1,5 @@
 /* See LICENSE for license details. */
+#include "../master.h"
 #include <errno.h>
 #include <math.h>
 #include <limits.h>
@@ -265,7 +266,7 @@ static char *opt_title = NULL;
 static uint buttons; /* bit field of pressed buttons */
 
 void
-clipcopy(const Arg *dummy)
+clipcopy(UNUSED const Arg *dummy)
 {
 	Atom clipboard;
 
@@ -280,7 +281,7 @@ clipcopy(const Arg *dummy)
 }
 
 void
-clippaste(const Arg *dummy)
+clippaste(UNUSED const Arg *dummy)
 {
 	Atom clipboard;
 
@@ -290,14 +291,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;
 }
@@ -322,7 +323,7 @@ zoomabs(const Arg *arg)
 }
 
 void
-zoomreset(const Arg *arg)
+zoomreset(UNUSED const Arg *arg)
 {
 	Arg larg;
 
@@ -1093,7 +1094,7 @@ xunloadfonts(void)
 }
 
 int
-ximopen(Display *dpy)
+ximopen(UNUSED Display *dpy)
 {
 	XIMCallback imdestroy = { .client_data = NULL, .callback = ximdestroy };
 	XICCallback icdestroy = { .client_data = NULL, .callback = xicdestroy };
@@ -1123,7 +1124,7 @@ ximopen(Display *dpy)
 }
 
 void
-ximinstantiate(Display *dpy, XPointer client, XPointer call)
+ximinstantiate(Display *dpy, UNUSED XPointer client, UNUSED XPointer call)
 {
 	if (ximopen(dpy))
 		XUnregisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL,
@@ -1131,7 +1132,7 @@ ximinstantiate(Display *dpy, XPointer client, XPointer
 }
 
 void
-ximdestroy(XIM xim, XPointer client, XPointer call)
+ximdestroy(UNUSED XIM xim, UNUSED XPointer client, UNUSED XPointer call)
 {
 	xw.ime.xim = NULL;
 	XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL,
@@ -1140,7 +1141,7 @@ ximdestroy(XIM xim, XPointer client, XPointer call)
 }
 
 int
-xicdestroy(XIC xim, XPointer client, XPointer call)
+xicdestroy(UNUSED XIC xim, UNUSED XPointer client, UNUSED XPointer call)
 {
 	xw.ime.xic = NULL;
 	return 1;
@@ -1757,7 +1758,7 @@ xximspot(int x, int y)
 }
 
 void
-expose(XEvent *ev)
+expose(UNUSED XEvent *ev)
 {
 	redraw();
 }
@@ -1771,7 +1772,7 @@ visibility(XEvent *ev)
 }
 
 void
-unmap(XEvent *ev)
+unmap(UNUSED XEvent *ev)
 {
 	win.mode &= ~MODE_VISIBLE;
 }