diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2015-07-01 14:36:43 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2015-07-01 14:36:43 +0000 |
commit | 289bb94330651efd0df46a917b9951520d855f68 (patch) | |
tree | e5d2d72529d1fce266ff4b9e8ee378e2ffa02076 | |
parent | 8f41e3af5849319e087f9458e38ee69c6c05aa04 (diff) |
style
-rw-r--r-- | app/cwm/client.c | 10 | ||||
-rw-r--r-- | app/cwm/conf.c | 6 | ||||
-rw-r--r-- | app/cwm/menu.c | 11 | ||||
-rw-r--r-- | app/cwm/mousefunc.c | 8 | ||||
-rw-r--r-- | app/cwm/search.c | 8 | ||||
-rw-r--r-- | app/cwm/xevents.c | 4 |
6 files changed, 23 insertions, 24 deletions
diff --git a/app/cwm/client.c b/app/cwm/client.c index 3d1c085b8..45f65b2ae 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.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. * - * $OpenBSD: client.c,v 1.197 2015/06/30 14:01:43 okan Exp $ + * $OpenBSD: client.c,v 1.198 2015/07/01 14:36:42 okan Exp $ */ #include <sys/types.h> @@ -655,7 +655,7 @@ client_cycle(struct screen_ctx *sc, int flags) oldcc = client_current(); if (oldcc == NULL) - oldcc = (flags & CWM_RCYCLE ? + oldcc = ((flags & CWM_RCYCLE) ? TAILQ_LAST(&sc->clientq, client_ctx_q) : TAILQ_FIRST(&sc->clientq)); @@ -663,7 +663,7 @@ client_cycle(struct screen_ctx *sc, int flags) while (again) { again = 0; - newcc = (flags & CWM_RCYCLE ? client_prev(newcc) : + newcc = ((flags & CWM_RCYCLE) ? client_prev(newcc) : client_next(newcc)); /* Only cycle visible and non-ignored windows. */ @@ -707,7 +707,7 @@ client_next(struct client_ctx *cc) struct screen_ctx *sc = cc->sc; struct client_ctx *ccc; - return((ccc = TAILQ_NEXT(cc, entry)) != NULL ? + return(((ccc = TAILQ_NEXT(cc, entry)) != NULL) ? ccc : TAILQ_FIRST(&sc->clientq)); } @@ -717,7 +717,7 @@ client_prev(struct client_ctx *cc) struct screen_ctx *sc = cc->sc; struct client_ctx *ccc; - return((ccc = TAILQ_PREV(cc, client_ctx_q, entry)) != NULL ? + return(((ccc = TAILQ_PREV(cc, client_ctx_q, entry)) != NULL) ? ccc : TAILQ_LAST(&sc->clientq, client_ctx_q)); } diff --git a/app/cwm/conf.c b/app/cwm/conf.c index 6648acd9b..bd30dbc6b 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.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. * - * $OpenBSD: conf.c,v 1.189 2015/06/30 18:44:29 okan Exp $ + * $OpenBSD: conf.c,v 1.190 2015/07/01 14:36:42 okan Exp $ */ #include <sys/types.h> @@ -346,8 +346,8 @@ conf_client(struct client_ctx *cc) } } - cc->bwidth = ignore ? 0 : Conf.bwidth; - cc->flags |= ignore ? CLIENT_IGNORE : 0; + cc->bwidth = (ignore) ? 0 : Conf.bwidth; + cc->flags |= (ignore) ? CLIENT_IGNORE : 0; } static const struct { diff --git a/app/cwm/menu.c b/app/cwm/menu.c index c9106e84d..dd050ca2b 100644 --- a/app/cwm/menu.c +++ b/app/cwm/menu.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: menu.c,v 1.85 2015/06/30 18:42:50 okan Exp $ + * $OpenBSD: menu.c,v 1.86 2015/07/01 14:36:42 okan Exp $ */ #include <sys/types.h> @@ -411,8 +411,7 @@ menu_draw(struct menu_ctx *mc, struct menu_q *menuq, struct menu_q *resultq) n = 0; TAILQ_FOREACH(mi, resultq, resultentry) { - char *text = mi->print[0] != '\0' ? - mi->print : mi->text; + char *text = (mi->print[0] != '\0') ? mi->print : mi->text; int y = n * (sc->xftfont->height + 1) + sc->xftfont->ascent + 1; /* Stop drawing when menu doesn't fit inside the screen. */ @@ -444,12 +443,12 @@ menu_draw_entry(struct menu_ctx *mc, struct menu_q *resultq, if (mi == NULL) return; - color = active ? CWM_COLOR_MENU_FG : CWM_COLOR_MENU_BG; - text = mi->print[0] != '\0' ? mi->print : mi->text; + color = (active) ? CWM_COLOR_MENU_FG : CWM_COLOR_MENU_BG; + text = (mi->print[0] != '\0') ? mi->print : mi->text; XftDrawRect(sc->xftdraw, &sc->xftcolor[color], 0, (sc->xftfont->height + 1) * entry, mc->geom.w, (sc->xftfont->height + 1) + sc->xftfont->descent); - color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT; + color = (active) ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT; xu_xft_draw(sc, text, color, 0, (sc->xftfont->height + 1) * entry + sc->xftfont->ascent + 1); } diff --git a/app/cwm/mousefunc.c b/app/cwm/mousefunc.c index 20a022f61..34c347f45 100644 --- a/app/cwm/mousefunc.c +++ b/app/cwm/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.94 2015/06/30 19:02:24 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.95 2015/07/01 14:36:42 okan Exp $ */ #include <sys/types.h> @@ -43,8 +43,8 @@ mousefunc_sweep_calc(struct client_ctx *cc, int x, int y, int mx, int my) client_applysizehints(cc); - cc->geom.x = x <= mx ? x : x - cc->geom.w; - cc->geom.y = y <= my ? y : y - cc->geom.h; + cc->geom.x = (x <= mx) ? x : x - cc->geom.w; + cc->geom.y = (y <= my) ? y : y - cc->geom.h; } static void @@ -183,7 +183,7 @@ mousefunc_menu_group(struct client_ctx *cc, union arg *arg) if (group_holds_only_sticky(gc)) continue; menuq_add(&menuq, gc, - group_holds_only_hidden(gc) ? "%d: [%s]" : "%d: %s", + (group_holds_only_hidden(gc)) ? "%d: [%s]" : "%d: %s", gc->num, gc->name); } diff --git a/app/cwm/search.c b/app/cwm/search.c index ccb6c889f..44311fd96 100644 --- a/app/cwm/search.c +++ b/app/cwm/search.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. * - * $OpenBSD: search.c,v 1.47 2015/07/01 14:29:36 okan Exp $ + * $OpenBSD: search.c,v 1.48 2015/07/01 14:36:42 okan Exp $ */ #include <sys/types.h> @@ -134,7 +134,7 @@ search_print_cmd(struct menu *mi, int i) special = 1; (void)snprintf(mi->print, sizeof(mi->print), - (special) ? "[%s]" : "%s", cmd->name); + (special) ? "[%s]" : "%s", cmd->name); } void @@ -152,8 +152,8 @@ search_print_client(struct menu *mi, int list) cc->matchname = cc->name; (void)snprintf(mi->print, sizeof(mi->print), "(%d) %c[%s] %s", - cc->group ? cc->group->num : 0, flag, - cc->label ? cc->label : "", cc->matchname); + (cc->group) ? cc->group->num : 0, flag, + (cc->label) ? cc->label : "", cc->matchname); } static void diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index 2b762ece0..f270ace47 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. * - * $OpenBSD: xevents.c,v 1.117 2015/06/30 14:01:43 okan Exp $ + * $OpenBSD: xevents.c,v 1.118 2015/07/01 14:36:42 okan Exp $ */ /* @@ -279,7 +279,7 @@ xev_handle_keypress(XEvent *ee) if ((kb->modmask | modshift) != e->state) continue; - if (kb->press.keysym == (modshift == 0 ? keysym : skeysym)) + if (kb->press.keysym == ((modshift == 0) ? keysym : skeysym)) break; } |