diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2008-07-11 14:21:29 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2008-07-11 14:21:29 +0000 |
commit | 7bd488e7c78e06de5f445f4f2669397298dbfb9c (patch) | |
tree | 0684416aa66987b30b47fcde37d467d0ae4a7422 /app/cwm/menu.c | |
parent | b8d1b4702426abb5c0ce0b5ea49d5874e1fd1e47 (diff) |
spacing, declaration lineup to be consistent throughout cwm,
readability, and a bit of knf.
ok oga@
Diffstat (limited to 'app/cwm/menu.c')
-rw-r--r-- | app/cwm/menu.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/cwm/menu.c b/app/cwm/menu.c index 6db9a535f..5b60b674a 100644 --- a/app/cwm/menu.c +++ b/app/cwm/menu.c @@ -67,7 +67,7 @@ menu_filter(struct menu_q *menuq, char *prompt, char *initial, int dummy, void (*match)(struct menu_q *, struct menu_q *, char *), void (*print)(struct menu *, int)) { - struct screen_ctx *sc = screen_current(); + struct screen_ctx *sc; struct menu_ctx mc; struct menu_q resultq; struct menu *mi = NULL; @@ -75,6 +75,8 @@ menu_filter(struct menu_q *menuq, char *prompt, char *initial, int dummy, Window focuswin; int Mask, focusrevert; + sc = screen_current(); + TAILQ_INIT(&resultq); bzero(&mc, sizeof(mc)); @@ -255,10 +257,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq) { struct menu *mi; - int n = 0; - int dy; - int xsave, ysave; - int warp; + int n, dy, xsave, ysave; if (mc->list) { if (TAILQ_EMPTY(resultq) && mc->list) { @@ -388,10 +387,12 @@ menu_handle_release(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc, static int menu_calc_entry(struct screen_ctx *sc, struct menu_ctx *mc, int x, int y) { - int entry = y / font_height(); + int entry; + + entry = y / font_height(); /* in bounds? */ - if (x < 0 || x > mc->width || y < 0 || y > font_height()*mc->num || + if (x < 0 || x > mc->width || y < 0 || y > font_height() * mc->num || entry < 0 || entry >= mc->num) entry = -1; |