Hello,

this patch does the following things (in order of appearance):
- remove blank line to match rest of the file
- add missing declaration of a function
- remove unnecessary cast
- don’t unnecessarily cast away constness (3 times)

Sincerely,
Mahdi


PS: I have no experience with mailing list or submitting patches, please let me 
know if I fucked up :)
From 6d22ad7aeaefed57efdd50d2a8b28bcf33f908e8 Mon Sep 17 00:00:00 2001
From: Mahdi Khanalizadeh <ma...@khanalizadeh.com>
Date: Mon, 29 Dec 2014 03:05:46 +0100
Subject: [PATCH] mostly casting changes

---
 drw.c | 1 -
 dwm.c | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drw.c b/drw.c
index b130405..4d58a10 100644
--- a/drw.c
+++ b/drw.c
@@ -179,7 +179,6 @@ drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) {
 	XSync(drw->dpy, False);
 }
 
-
 void
 drw_font_getexts(Fnt *font, const char *text, unsigned int len, Extnts *tex) {
 	XRectangle r;
diff --git a/dwm.c b/dwm.c
index f896170..424911c 100644
--- a/dwm.c
+++ b/dwm.c
@@ -169,6 +169,7 @@ static void focus(Client *c);
 static void focusin(XEvent *e);
 static void focusmon(const Arg *arg);
 static void focusstack(const Arg *arg);
+static Atom getatomprop(Client *c, Atom prop);
 static Bool getrootptr(int *x, int *y);
 static long getstate(Window w);
 static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
@@ -884,7 +885,7 @@ getstate(Window w) {
 	Atom real;
 
 	if(XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
-	                      &real, &format, &n, &extra, (unsigned char **)&p) != Success)
+	                      &real, &format, &n, &extra, &p) != Success)
 		return -1;
 	if(n != 0)
 		result = *p;
@@ -1474,7 +1475,7 @@ setlayout(const Arg *arg) {
 	if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
 		selmon->sellt ^= 1;
 	if(arg && arg->v)
-		selmon->lt[selmon->sellt] = (Layout *)arg->v;
+		selmon->lt[selmon->sellt] = (const Layout *)arg->v;
 	strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
 	if(selmon->sel)
 		arrange(selmon);
@@ -1585,8 +1586,8 @@ spawn(const Arg *arg) {
 		if(dpy)
 			close(ConnectionNumber(dpy));
 		setsid();
-		execvp(((char **)arg->v)[0], (char **)arg->v);
-		fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]);
+		execvp(((char *const *)arg->v)[0], (char *const *)arg->v);
+		fprintf(stderr, "dwm: execvp %s", ((char *const *)arg->v)[0]);
 		perror(" failed");
 		exit(EXIT_SUCCESS);
 	}
-- 
2.2.1

Attachment: pgpD7qJ6Wuw6W.pgp
Description: PGP signature

Reply via email to