diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-03-22 14:09:03 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-03-22 14:09:03 +0000 |
commit | ac8230daa81eaa522b8d4c0c7c644293fb750ddb (patch) | |
tree | b10c0d355479af12e0ce4f30faea82404993146a | |
parent | 7bcffddc6bf853c8e6c20a6077bf1ed70f9e4dcc (diff) |
Remove a bunch of unused variables and incorrect comments.
"ok with me" okan@.
-rw-r--r-- | app/cwm/calmwm.c | 11 | ||||
-rw-r--r-- | app/cwm/calmwm.h | 28 | ||||
-rw-r--r-- | app/cwm/kbfunc.c | 12 | ||||
-rw-r--r-- | app/cwm/search.c | 18 | ||||
-rw-r--r-- | app/cwm/xevents.c | 4 |
5 files changed, 15 insertions, 58 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c index 4a075fdad..a155924a0 100644 --- a/app/cwm/calmwm.c +++ b/app/cwm/calmwm.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.c,v 1.10 2008/02/13 21:48:03 oga Exp $ + * $Id: calmwm.c,v 1.11 2008/03/22 14:09:02 oga Exp $ */ #include "headers.h" @@ -149,7 +149,7 @@ void x_setupscreen(struct screen_ctx *sc, u_int which) { XColor tmp; - XGCValues gv, gv1/* , gv2 */; + XGCValues gv; Window *wins, w0, w1; u_int nwins, i = 0; XWindowAttributes winattr; @@ -209,13 +209,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which) GCForeground|GCBackground|GCFunction| GCLineWidth|GCSubwindowMode, &gv); - gv1.function = GXinvert; - gv1.subwindow_mode = IncludeInferiors; - gv1.line_width = 1; - - sc->invgc = XCreateGC(X_Dpy, sc->rootwin, - GCFunction|GCSubwindowMode|GCLineWidth, &gv1); - font_init(sc); DefaultFont = font_getx(sc, DefaultFontName); diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 81ce99155..b9f4c76ee 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.h,v 1.22 2008/02/20 13:00:18 oga Exp $ + * $Id: calmwm.h,v 1.23 2008/03/22 14:09:02 oga Exp $ */ #ifndef _CALMWM_H_ @@ -31,7 +31,7 @@ #define MAX(x, y) ((x) > (y) ? (x) : (y)) enum conftype { - CONF_BWIDTH, CONF_IGNORE, CONF_NOTIFIER, + CONF_BWIDTH, CONF_IGNORE, }; #define ChildMask (SubstructureRedirectMask|SubstructureNotifyMask) @@ -68,12 +68,11 @@ struct screen_ctx { Window groupwin; Window infowin; Colormap colormap; - GC invcg; XColor bgcolor, fgcolor, fccolor, redcolor, cyancolor, whitecolor, blackcolor; char *display; unsigned long blackpixl, whitepixl, redpixl, bluepixl, cyanpixl; - GC gc, invgc, hlgc; + GC gc, hlgc; Pixmap gray, blue, red; @@ -83,8 +82,6 @@ struct screen_ctx { int xmax; int ymax; - FILE *notifier; - struct cycle_entry_q mruq; struct client_ctx* cycle_client; @@ -203,22 +200,6 @@ struct xevent { TAILQ_HEAD(xevent_q, xevent); -/* Keybindings */ -enum kbtype { - KB_DELETE, KB_NEWTERM0, KB_NEWTERM1, KB_HIDE, - KB_LOWER, KB_RAISE, KB_SEARCH, KB_CYCLE, KB_LABEL, - KB_GROUPSELECT, KB_VERTMAXIMIZE, KB_MAXIMIZE, - - /* Group numbers need to be in order. */ - KB_GROUP_1, KB_GROUP_2, KB_GROUP_3, KB_GROUP_4, KB_GROUP_5, - KB_GROUP_6, KB_GROUP_7, KB_GROUP_8, KB_GROUP_9, KB_NOGROUP, - KB_NEXTGROUP, KB_PREVGROUP, - - KB_MOVE_WEST, KB_MOVE_EAST, KB_MOVE_NORTH, KB_MOVE_SOUTH, - - KB__LAST -}; - #define CWM_BIGMOVE 0x1000 enum directions { CWM_UP=0, CWM_DOWN, CWM_LEFT, CWM_RIGHT, @@ -229,7 +210,6 @@ enum directions { #define CWM_EXEC_WM 0x2 #define KBFLAG_NEEDCLIENT 0x01 -#define KBFLAG_FINDCLIENT 0x02 #define KBTOGROUP(X) ((X) - 1) @@ -463,14 +443,12 @@ void kbfunc_lock(struct client_ctx *cc, void *arg); void search_init(struct screen_ctx *); struct menu *search_start(struct menu_q *menuq, void (*match)(struct menu_q *, struct menu_q *, char *), - void (*rank)(struct menu_q *, char *), void (*print)(struct menu *mi, int), char *, int); void search_match_client(struct menu_q *, struct menu_q *, char *); void search_print_client(struct menu *mi, int list); void search_match_text(struct menu_q *, struct menu_q *, char *); void search_match_exec(struct menu_q *, struct menu_q *, char *); -void search_rank_text(struct menu_q *, char *); void group_init(void); void group_select(int); diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 2eee457a6..cfb1f9332 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: kbfunc.c,v 1.13 2008/01/16 11:39:20 oga Exp $ + * $Id: kbfunc.c,v 1.14 2008/03/22 14:09:02 oga Exp $ */ #include <paths.h> @@ -178,8 +178,8 @@ kbfunc_client_search(struct client_ctx *scratch, void *arg) } if ((mi = search_start(&menuq, - search_match_client, NULL, - search_print_client, "window", 0)) != NULL) { + search_match_client, search_print_client, + "window", 0)) != NULL) { cc = (struct client_ctx *)mi->ctx; if (cc->flags & CLIENT_HIDDEN) client_unhide(cc); @@ -213,7 +213,7 @@ kbfunc_menu_search(struct client_ctx *scratch, void *arg) } if ((mi = search_start(&menuq, - search_match_text, NULL, NULL, "application", 0)) != NULL) + search_match_text, NULL, "application", 0)) != NULL) u_spawn(((struct cmd *)mi->ctx)->image); while ((mi = TAILQ_FIRST(&menuq)) != NULL) { @@ -344,7 +344,7 @@ kbfunc_exec(struct client_ctx *scratch, void *arg) } if ((mi = search_start(&menuq, - search_match_exec, NULL, NULL, label, 1)) != NULL) { + search_match_exec, NULL, label, 1)) != NULL) { switch (cmd) { case CWM_EXEC_PROGRAM: u_spawn(mi->text); @@ -419,7 +419,7 @@ kbfunc_ssh(struct client_ctx *scratch, void *arg) if ((mi = search_start(&menuq, - search_match_exec, NULL, NULL, "ssh", 1)) != NULL) { + search_match_exec, NULL, "ssh", 1)) != NULL) { conf_cmd_refresh(&Conf); l = snprintf(cmd, sizeof(cmd), "%s -e ssh %s", Conf.termpath, mi->text); diff --git a/app/cwm/search.c b/app/cwm/search.c index cc091ddee..3e1be1642 100644 --- a/app/cwm/search.c +++ b/app/cwm/search.c @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: search.c,v 1.6 2008/01/16 11:39:20 oga Exp $ + * $Id: search.c,v 1.7 2008/03/22 14:09:02 oga Exp $ */ #include "headers.h" @@ -32,11 +32,6 @@ search_init(struct screen_ctx *sc) } /* - * ranking. each rank type is assigned a weight. multiply this by - * the rank given. add them up. simple linear combination. - */ - -/* * Input: list of items, * Output: choose one * so, exactly like menus @@ -45,7 +40,6 @@ search_init(struct screen_ctx *sc) struct menu * search_start(struct menu_q *menuq, void (*match)(struct menu_q *, struct menu_q *, char *), - void (*rank)(struct menu_q *resultq, char *search), void (*print)(struct menu *mi, int print), char *prompt, int dummy) { @@ -109,10 +103,6 @@ search_start(struct menu_q *menuq, switch (e.type) { case KeyPress: - /* - * XXX - C-s & C-r for next and prev. - */ - if (input_keycodetrans(e.xkey.keycode, e.xkey.state, &ctl, &chr, 1) < 0) continue; @@ -180,8 +170,6 @@ search_start(struct menu_q *menuq, if (mutated && strlen(searchstr) > 0) { (*match)(menuq, &resultq, searchstr); beobnoxious = TAILQ_EMPTY(&resultq); - if (!beobnoxious && rank != NULL) - (*rank)(&resultq, searchstr); } else if (mutated) TAILQ_INIT(&resultq); @@ -194,12 +182,10 @@ search_start(struct menu_q *menuq, case Expose: if (list) { if (TAILQ_EMPTY(&resultq) && list) { - /* Copy them over and rank them. */ + /* Copy them all over. */ TAILQ_FOREACH(mi, menuq, entry) TAILQ_INSERT_TAIL(&resultq, mi, resultentry); - if (rank != NULL) - (*rank)(&resultq, searchstr); listing = 1; } else if (mutated) diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index 946795f9a..ee6fa5432 100644 --- a/app/cwm/xevents.c +++ b/app/cwm/xevents.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: xevents.c,v 1.5 2008/02/20 12:56:10 oga Exp $ + * $Id: xevents.c,v 1.6 2008/03/22 14:09:02 oga Exp $ */ /* @@ -400,7 +400,7 @@ xev_handle_keypress(struct xevent *xev, XEvent *ee) if (kb == NULL) goto out; - if ((kb->flags & (KBFLAG_NEEDCLIENT|KBFLAG_FINDCLIENT)) && + if ((kb->flags & (KBFLAG_NEEDCLIENT)) && (cc = client_find(e->window)) == NULL && (cc = client_current()) == NULL) if (kb->flags & KBFLAG_NEEDCLIENT) |