summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2012-11-07 20:34:39 +0000
committerokan <okan>2012-11-07 20:34:39 +0000
commit76b0874b4caa937b5313b3604208d050b4868b04 (patch)
tree779b7d995d058ccfe4eac44ea30757a964621b31
parentdfb6aed82aa9a75d895f75984013f07a474c4d7a (diff)
downloadcwm-76b0874b4caa937b5313b3604208d050b4868b04.tar.gz
cwm-76b0874b4caa937b5313b3604208d050b4868b04.tar.xz
cwm-76b0874b4caa937b5313b3604208d050b4868b04.zip
get rid of the xfree() wrapper around free(); from Tiago Cunha.
-rw-r--r--calmwm.h1
-rw-r--r--client.c10
-rw-r--r--conf.c25
-rw-r--r--group.c6
-rw-r--r--kbfunc.c21
-rw-r--r--menu.c6
-rw-r--r--mousefunc.c4
-rw-r--r--xmalloc.c6
-rw-r--r--xutil.c2
9 files changed, 36 insertions, 45 deletions
diff --git a/calmwm.h b/calmwm.h
index 9b2a4ca..4bc97f4 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -490,7 +490,6 @@ void			 u_exec(char *);
 void			 u_spawn(char *);
 
 void			*xcalloc(size_t, size_t);
-void			 xfree(void *);
 void			*xmalloc(size_t);
 char			*xstrdup(const char *);
 
diff --git a/client.c b/client.c
index 8cb119f..c2da98c 100644
--- a/client.c
+++ b/client.c
@@ -166,12 +166,12 @@ client_delete(struct client_ctx *cc)
 	while ((wn = TAILQ_FIRST(&cc->nameq)) != NULL) {
 		TAILQ_REMOVE(&cc->nameq, wn, entry);
 		if (wn->name != emptystring)
-			xfree(wn->name);
-		xfree(wn);
+			free(wn->name);
+		free(wn);
 	}
 
 	client_freehints(cc);
-	xfree(cc);
+	free(cc);
 }
 
 void
@@ -582,8 +582,8 @@ match:
 		assert(wn != NULL);
 		TAILQ_REMOVE(&cc->nameq, wn, entry);
 		if (wn->name != emptystring)
-			xfree(wn->name);
-		xfree(wn);
+			free(wn->name);
+		free(wn);
 		cc->nameqlen--;
 	}
 }
diff --git a/conf.c b/conf.c
index 57e45a2..9e40fa2 100644
--- a/conf.c
+++ b/conf.c
@@ -202,36 +202,35 @@ conf_clear(struct conf *c)
 
 	while ((cmd = TAILQ_FIRST(&c->cmdq)) != NULL) {
 		TAILQ_REMOVE(&c->cmdq, cmd, entry);
-		xfree(cmd);
+		free(cmd);
 	}
 
 	while ((kb = TAILQ_FIRST(&c->keybindingq)) != NULL) {
 		TAILQ_REMOVE(&c->keybindingq, kb, entry);
-		xfree(kb);
+		free(kb);
 	}
 
 	while ((ag = TAILQ_FIRST(&c->autogroupq)) != NULL) {
 		TAILQ_REMOVE(&c->autogroupq, ag, entry);
-		xfree(ag->class);
-		if (ag->name)
-			xfree(ag->name);
-		xfree(ag);
+		free(ag->class);
+		free(ag->name);
+		free(ag);
 	}
 
 	while ((wm = TAILQ_FIRST(&c->ignoreq)) != NULL) {
 		TAILQ_REMOVE(&c->ignoreq, wm, entry);
-		xfree(wm);
+		free(wm);
 	}
 
 	while ((mb = TAILQ_FIRST(&c->mousebindingq)) != NULL) {
 		TAILQ_REMOVE(&c->mousebindingq, mb, entry);
-		xfree(mb);
+		free(mb);
 	}
 
 	for (i = 0; i < CWM_COLOR_MAX; i++)
-		xfree(c->color[i].name);
+		free(c->color[i].name);
 
-	xfree(c->font);
+	free(c->font);
 }
 
 void
@@ -477,7 +476,7 @@ conf_bindname(struct conf *c, char *name, char *binding)
 
 	if (current_binding->keysym == NoSymbol &&
 	    current_binding->keycode == 0) {
-		xfree(current_binding);
+		free(current_binding);
 		return;
 	}
 
@@ -523,7 +522,7 @@ conf_unbind(struct conf *c, struct keybinding *unbind)
 		    key->keysym == unbind->keysym) {
 			conf_ungrab(c, key);
 			TAILQ_REMOVE(&c->keybindingq, key, entry);
-			xfree(key);
+			free(key);
 		}
 	}
 }
@@ -603,7 +602,7 @@ conf_mouseunbind(struct conf *c, struct mousebinding *unbind)
 
 		if (mb->button == unbind->button) {
 			TAILQ_REMOVE(&c->mousebindingq, mb, entry);
-			xfree(mb);
+			free(mb);
 		}
 	}
 }
diff --git a/group.c b/group.c
index 3370643..dd748ea 100644
--- a/group.c
+++ b/group.c
@@ -129,7 +129,7 @@ group_show(struct screen_ctx *sc, struct group_ctx *gc)
 	}
 
 	XRestackWindows(X_Dpy, winlist, gc->nhidden);
-	xfree(winlist);
+	free(winlist);
 
 	gc->hidden = 0;
 	group_setactive(sc, gc->shortcut - 1);
@@ -387,7 +387,7 @@ group_menu(XButtonEvent *e)
 cleanup:
 	while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 		TAILQ_REMOVE(&menuq, mi, entry);
-		xfree(mi);
+		free(mi);
 	}
 }
 
@@ -491,7 +491,7 @@ group_update_names(struct screen_ctx *sc)
 	if (prop_ret != NULL)
 		XFree(prop_ret);
 	if (sc->group_nonames != 0)
-		xfree(sc->group_names);
+		free(sc->group_names);
 
 	sc->group_names = strings;
 	sc->group_nonames = n;
diff --git a/kbfunc.c b/kbfunc.c
index b6c0a0d..c67222e 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -170,7 +170,7 @@ kbfunc_client_search(struct client_ctx *cc, union arg *arg)
 
 	while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 		TAILQ_REMOVE(&menuq, mi, entry);
-		xfree(mi);
+		free(mi);
 	}
 }
 
@@ -197,7 +197,7 @@ kbfunc_menu_search(struct client_ctx *cc, union arg *arg)
 
 	while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 		TAILQ_REMOVE(&menuq, mi, entry);
-		xfree(mi);
+		free(mi);
 	}
 }
 
@@ -297,7 +297,7 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
 		}
 		(void)closedir(dirp);
 	}
-	xfree(path);
+	free(path);
 
 	if ((mi = menu_filter(sc, &menuq, label, NULL,
 	    CWM_MENU_DUMMY | CWM_MENU_FILE,
@@ -319,10 +319,10 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
 	}
 out:
 	if (mi != NULL && mi->dummy)
-		xfree(mi);
+		free(mi);
 	while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 		TAILQ_REMOVE(&menuq, mi, entry);
-		xfree(mi);
+		free(mi);
 	}
 }
 
@@ -375,7 +375,7 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
 		(void)strlcpy(mi->text, hostbuf, sizeof(mi->text));
 		TAILQ_INSERT_TAIL(&menuq, mi, entry);
 	}
-	xfree(lbuf);
+	free(lbuf);
 	(void)fclose(fp);
 
 	if ((mi = menu_filter(sc, &menuq, "ssh", NULL, CWM_MENU_DUMMY,
@@ -389,10 +389,10 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
 	}
 out:
 	if (mi != NULL && mi->dummy)
-		xfree(mi);
+		free(mi);
 	while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 		TAILQ_REMOVE(&menuq, mi, entry);
-		xfree(mi);
+		free(mi);
 	}
 }
 
@@ -409,11 +409,10 @@ kbfunc_client_label(struct client_ctx *cc, union arg *arg)
 	    search_match_text, NULL);
 
 	if (!mi->abort) {
-		if (cc->label != NULL)
-			xfree(cc->label);
+		free(cc->label);
 		cc->label = xstrdup(mi->text);
 	}
-	xfree(mi);
+	free(mi);
 }
 
 void
diff --git a/menu.c b/menu.c
index e32994b..0fff91e 100644
--- a/menu.c
+++ b/menu.c
@@ -188,7 +188,7 @@ menu_filter(struct screen_ctx *sc, struct menu_q *menuq, char *prompt,
 out:
 	if ((mc.flags & CWM_MENU_DUMMY) == 0 && mi->dummy) {
 	       	/* no mouse based match */
-		xfree(mi);
+		free(mi);
 		mi = NULL;
 	}
 
@@ -225,7 +225,7 @@ menu_complete_path(struct menu_ctx *mc)
 	
 	while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 		TAILQ_REMOVE(&menuq, mi, entry);
-		xfree(mi);
+		free(mi);
 	}
 
 	if (path[0] != '\0') 
@@ -233,7 +233,7 @@ menu_complete_path(struct menu_ctx *mc)
 			mc->searchstr, path);
 	else if (!mr->abort)
 		strlcpy(mr->text,  mc->searchstr, sizeof(mr->text));
-	xfree(path);
+	free(path);
 	return (mr);
 }
 
diff --git a/mousefunc.c b/mousefunc.c
index c615052..3521d71 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -253,7 +253,7 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg)
 	} else {
 		while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 			TAILQ_REMOVE(&menuq, mi, entry);
-			xfree(mi);
+			free(mi);
 		}
 	}
 }
@@ -282,6 +282,6 @@ mousefunc_menu_cmd(struct client_ctx *cc, void *arg)
 	else
 		while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
 			TAILQ_REMOVE(&menuq, mi, entry);
-			xfree(mi);
+			free(mi);
 		}
 }
diff --git a/xmalloc.c b/xmalloc.c
index 7860b97..27114d1 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -52,12 +52,6 @@ xcalloc(size_t no, size_t siz)
 	return (p);
 }
 
-void
-xfree(void *p)
-{
-	free(p);
-}
-
 char *
 xstrdup(const char *str)
 {
diff --git a/xutil.c b/xutil.c
index 5dbc911..bcde1c5 100644
--- a/xutil.c
+++ b/xutil.c
@@ -339,7 +339,7 @@ xu_ewmh_net_client_list(struct screen_ctx *sc)
 		winlist[j++] = cc->win;
 	XChangeProperty(X_Dpy, sc->rootwin, ewmh[_NET_CLIENT_LIST].atom,
 	    XA_WINDOW, 32, PropModeReplace, (unsigned char *)winlist, i);
-	xfree(winlist);
+	free(winlist);
 }
 
 void