diff options
author | okan | 2014-09-07 19:27:30 +0000 |
---|---|---|
committer | okan | 2014-09-07 19:27:30 +0000 |
commit | eab7846097604d0bfc81f122685219fe7a738415 (patch) | |
tree | 6630de258aa2ebc267a9f79e9eeb32ca8d7e7ca5 | |
parent | 6ad47ab7a1880d92f7b8b36722a424dd841025eb (diff) | |
download | cwm-eab7846097604d0bfc81f122685219fe7a738415.tar.gz |
more style nits
-rw-r--r-- | calmwm.c | 8 | ||||
-rw-r--r-- | client.c | 36 | ||||
-rw-r--r-- | conf.c | 22 | ||||
-rw-r--r-- | menu.c | 28 | ||||
-rw-r--r-- | screen.c | 12 | ||||
-rw-r--r-- | search.c | 14 | ||||
-rw-r--r-- | xmalloc.c | 10 | ||||
-rw-r--r-- | xutil.c | 20 |
8 files changed, 75 insertions, 75 deletions
@@ -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: calmwm.c,v 1.90 2014/09/06 16:24:32 okan Exp $ + * $OpenBSD: calmwm.c,v 1.91 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -120,7 +120,7 @@ main(int argc, char **argv) if (cwm_status == CWM_RESTART) x_restart(cwm_argv); - return (0); + return(0); } static void @@ -185,7 +185,7 @@ x_wmerrorhandler(Display *dpy, XErrorEvent *e) { errx(1, "root window unavailable - perhaps another wm is running?"); - return (0); + return(0); } static int @@ -201,7 +201,7 @@ x_errorhandler(Display *dpy, XErrorEvent *e) warnx("%s(0x%x): %s", req, (unsigned int)e->resourceid, msg); #endif - return (0); + return(0); } static void @@ -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.175 2014/09/07 17:38:38 okan Exp $ + * $OpenBSD: client.c,v 1.176 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -47,11 +47,11 @@ client_find(Window win) { struct client_ctx *cc; - TAILQ_FOREACH(cc, &Clientq, entry) + TAILQ_FOREACH(cc, &Clientq, entry) { if (cc->win == win) - return (cc); - - return (NULL); + return(cc); + } + return(NULL); } struct client_ctx * @@ -63,16 +63,16 @@ client_init(Window win, struct screen_ctx *sc) int mapped; if (win == None) - return (NULL); + return(NULL); if (!XGetWindowAttributes(X_Dpy, win, &wattr)) - return (NULL); + return(NULL); if (sc == NULL) { sc = screen_find(wattr.root); mapped = 1; } else { if (wattr.override_redirect || wattr.map_state != IsViewable) - return (NULL); + return(NULL); mapped = wattr.map_state != IsUnmapped; } @@ -138,7 +138,7 @@ client_init(Window win, struct screen_ctx *sc) XSync(X_Dpy, False); XUngrabServer(X_Dpy); - return (cc); + return(cc); } void @@ -226,7 +226,7 @@ client_none(struct screen_ctx *sc) struct client_ctx * client_current(void) { - return (curcc); + return(curcc); } void @@ -696,7 +696,7 @@ client_mrunext(struct client_ctx *cc) struct screen_ctx *sc = cc->sc; struct client_ctx *ccc; - return ((ccc = TAILQ_NEXT(cc, mru_entry)) != NULL ? + return((ccc = TAILQ_NEXT(cc, mru_entry)) != NULL ? ccc : TAILQ_FIRST(&sc->mruq)); } @@ -706,7 +706,7 @@ client_mruprev(struct client_ctx *cc) struct screen_ctx *sc = cc->sc; struct client_ctx *ccc; - return ((ccc = TAILQ_PREV(cc, cycle_entry_q, mru_entry)) != NULL ? + return((ccc = TAILQ_PREV(cc, cycle_entry_q, mru_entry)) != NULL ? ccc : TAILQ_LAST(&sc->mruq, cycle_entry_q)); } @@ -896,7 +896,7 @@ client_transient(struct client_ctx *cc) static int client_inbound(struct client_ctx *cc, int x, int y) { - return (x < cc->geom.w && x >= 0 && + return(x < cc->geom.w && x >= 0 && y < cc->geom.h && y >= 0); } @@ -916,15 +916,15 @@ client_snapcalc(int n0, int n1, int e0, int e1, int snapdist) /* possible to snap in both directions */ if (s0 != 0 && s1 != 0) if (abs(s0) < abs(s1)) - return (s0); + return(s0); else - return (s1); + return(s1); else if (s0 != 0) - return (s0); + return(s0); else if (s1 != 0) - return (s1); + return(s1); else - return (0); + return(0); } void @@ -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.178 2014/09/06 16:14:35 okan Exp $ + * $OpenBSD: conf.c,v 1.179 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -475,14 +475,14 @@ conf_bind_getmask(const char *name, unsigned int *mask) *mask = 0; if ((dash = strchr(name, '-')) == NULL) - return (name); + return(name); for (i = 0; i < nitems(bind_mods); i++) { if ((ch = strchr(name, bind_mods[i].ch)) != NULL && ch < dash) *mask |= bind_mods[i].mask; } /* Skip past modifiers. */ - return (dash + 1); + return(dash + 1); } int @@ -500,7 +500,7 @@ conf_bind_kbd(struct conf *c, const char *bind, const char *cmd) if (kb->press.keysym == NoSymbol) { warnx("unknown symbol: %s", key); free(kb); - return (0); + return(0); } /* We now have the correct binding, remove duplicates. */ @@ -508,7 +508,7 @@ conf_bind_kbd(struct conf *c, const char *bind, const char *cmd) if (strcmp("unmap", cmd) == 0) { free(kb); - return (1); + return(1); } for (i = 0; i < nitems(name_to_func); i++) { @@ -520,7 +520,7 @@ conf_bind_kbd(struct conf *c, const char *bind, const char *cmd) kb->argument = name_to_func[i].argument; kb->argtype |= ARG_INT; TAILQ_INSERT_TAIL(&c->keybindingq, kb, entry); - return (1); + return(1); } kb->callback = kbfunc_cmdexec; @@ -528,7 +528,7 @@ conf_bind_kbd(struct conf *c, const char *bind, const char *cmd) kb->argument.c = xstrdup(cmd); kb->argtype |= ARG_CHAR; TAILQ_INSERT_TAIL(&c->keybindingq, kb, entry); - return (1); + return(1); } static void @@ -564,7 +564,7 @@ conf_bind_mouse(struct conf *c, const char *bind, const char *cmd) if (errstr) { warnx("button number is %s: %s", errstr, button); free(mb); - return (0); + return(0); } /* We now have the correct binding, remove duplicates. */ @@ -572,7 +572,7 @@ conf_bind_mouse(struct conf *c, const char *bind, const char *cmd) if (strcmp("unmap", cmd) == 0) { free(mb); - return (1); + return(1); } for (i = 0; i < nitems(name_to_func); i++) { @@ -583,10 +583,10 @@ conf_bind_mouse(struct conf *c, const char *bind, const char *cmd) mb->flags = name_to_func[i].flags; mb->argument = name_to_func[i].argument; TAILQ_INSERT_TAIL(&c->mousebindingq, mb, entry); - return (1); + return(1); } - return (0); + return(0); } static void @@ -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.76 2014/09/06 16:18:08 okan Exp $ + * $OpenBSD: menu.c,v 1.77 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -126,7 +126,7 @@ menu_filter(struct screen_ctx *sc, struct menu_q *menuq, const char *prompt, if (xu_ptr_grab(sc->menuwin, MENUGRABMASK, Conf.cursor[CF_QUESTION]) < 0) { XUnmapWindow(X_Dpy, sc->menuwin); - return (NULL); + return(NULL); } XGetInputFocus(X_Dpy, &focuswin, &focusrevert); @@ -180,7 +180,7 @@ out: XUnmapWindow(X_Dpy, sc->menuwin); XUngrabKeyboard(X_Dpy, CurrentTime); - return (mi); + return(mi); } static struct menu * @@ -210,7 +210,7 @@ menu_complete_path(struct menu_ctx *mc) else if (!mr->abort) strlcpy(mr->text, mc->searchstr, sizeof(mr->text)); free(path); - return (mr); + return(mr); } static struct menu * @@ -225,7 +225,7 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq, wchar_t wc; if (menu_keycode(&e->xkey, &ctl, chr) < 0) - return (NULL); + return(NULL); switch (ctl) { case CTL_ERASEONE: @@ -266,7 +266,7 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq, mi->dummy = 1; } mi->abort = 0; - return (mi); + return(mi); case CTL_WIPE: mc->searchstr[0] = '\0'; mc->changed = 1; @@ -281,7 +281,7 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq, if ((mc->flags & CWM_MENU_FILE) && (strncmp(mc->searchstr, mi->text, strlen(mi->text))) == 0) - return (menu_complete_path(mc)); + return(menu_complete_path(mc)); /* * Put common prefix of the results into searchstr @@ -306,7 +306,7 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq, mi->text[0] = '\0'; mi->dummy = 1; mi->abort = 1; - return (mi); + return(mi); default: break; } @@ -329,7 +329,7 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq, mc->listing = 0; } - return (NULL); + return(NULL); } static void @@ -497,7 +497,7 @@ menu_handle_release(XEvent *e, struct menu_ctx *mc, struct menu_q *resultq) mi->text[0] = '\0'; mi->dummy = 1; } - return (mi); + return(mi); } static int @@ -517,7 +517,7 @@ menu_calc_entry(struct menu_ctx *mc, int x, int y) if (mc->hasprompt && entry == 0) entry = -1; - return (entry); + return(entry); } static int @@ -597,12 +597,12 @@ menu_keycode(XKeyEvent *ev, enum ctltype *ctl, char *chr) } if (*ctl != CTL_NONE) - return (0); + return(0); if (XLookupString(ev, chr, 32, &ks, NULL) < 0) - return (-1); + return(-1); - return (0); + return(0); } void @@ -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: screen.c,v 1.65 2014/09/07 17:38:38 okan Exp $ + * $OpenBSD: screen.c,v 1.66 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -83,12 +83,12 @@ screen_find(Window win) { struct screen_ctx *sc; - TAILQ_FOREACH(sc, &Screenq, entry) + TAILQ_FOREACH(sc, &Screenq, entry) { if (sc->rootwin == win) - return (sc); - + return(sc); + } /* XXX FAIL HERE */ - return (TAILQ_FIRST(&Screenq)); + return(TAILQ_FIRST(&Screenq)); } void @@ -133,7 +133,7 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y, int flags) geom.w -= (sc->gap.left + sc->gap.right); geom.h -= (sc->gap.top + sc->gap.bottom); } - return (geom); + return(geom); } void @@ -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.39 2014/08/22 19:04:00 okan Exp $ + * $OpenBSD: search.c,v 1.40 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -194,13 +194,13 @@ search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, in static void search_match_path_exec(struct menu_q *menuq, struct menu_q *resultq, char *search) { - return (search_match_path(menuq, resultq, search, PATH_EXEC)); + return(search_match_path(menuq, resultq, search, PATH_EXEC)); } void search_match_path_any(struct menu_q *menuq, struct menu_q *resultq, char *search) { - return (search_match_path(menuq, resultq, search, PATH_ANY)); + return(search_match_path(menuq, resultq, search, PATH_ANY)); } void @@ -254,13 +254,13 @@ strsubmatch(char *sub, char *str, int zeroidx) unsigned int n, flen; if (sub == NULL || str == NULL) - return (0); + return(0); len = strlen(str); sublen = strlen(sub); if (sublen > len) - return (0); + return(0); if (!zeroidx) flen = len - sublen; @@ -269,7 +269,7 @@ strsubmatch(char *sub, char *str, int zeroidx) for (n = 0; n <= flen; n++) if (strncasecmp(sub, str + n, sublen) == 0) - return (1); + return(1); - return (0); + return(0); } @@ -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: xmalloc.c,v 1.12 2013/12/17 16:12:18 okan Exp $ + * $OpenBSD: xmalloc.c,v 1.13 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -42,7 +42,7 @@ xmalloc(size_t siz) if ((p = malloc(siz)) == NULL) err(1, "malloc"); - return (p); + return(p); } void * @@ -57,7 +57,7 @@ xcalloc(size_t no, size_t siz) if ((p = calloc(no, siz)) == NULL) err(1, "calloc"); - return (p); + return(p); } char * @@ -68,7 +68,7 @@ xstrdup(const char *str) if ((p = strdup(str)) == NULL) err(1, "strdup"); - return (p); + return(p); } int @@ -84,5 +84,5 @@ xasprintf(char **ret, const char *fmt, ...) if (i < 0 || *ret == NULL) err(1, "asprintf"); - return (i); + return(i); } @@ -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: xutil.c,v 1.90 2014/09/06 16:08:58 okan Exp $ + * $OpenBSD: xutil.c,v 1.91 2014/09/07 19:27:30 okan Exp $ */ #include <sys/param.h> @@ -74,7 +74,7 @@ xu_key_ungrab(Window win) int xu_ptr_grab(Window win, unsigned int mask, Cursor curs) { - return (XGrabPointer(X_Dpy, win, False, mask, + return(XGrabPointer(X_Dpy, win, False, mask, GrabModeAsync, GrabModeAsync, None, curs, CurrentTime) == GrabSuccess ? 0 : -1); } @@ -82,7 +82,7 @@ xu_ptr_grab(Window win, unsigned int mask, Cursor curs) int xu_ptr_regrab(unsigned int mask, Cursor curs) { - return (XChangeActivePointerGrab(X_Dpy, mask, + return(XChangeActivePointerGrab(X_Dpy, mask, curs, CurrentTime) == GrabSuccess ? 0 : -1); } @@ -117,12 +117,12 @@ xu_getprop(Window win, Atom atm, Atom type, long len, unsigned char **p) if (XGetWindowProperty(X_Dpy, win, atm, 0L, len, False, type, &realtype, &format, &n, &extra, p) != Success || *p == NULL) - return (-1); + return(-1); if (n == 0) XFree(*p); - return (n); + return(n); } int @@ -135,7 +135,7 @@ xu_getstrprop(Window win, Atom atm, char **text) { XGetTextProperty(X_Dpy, win, &prop, atm); if (!prop.nitems) - return (0); + return(0); if (Xutf8TextPropertyToTextList(X_Dpy, &prop, &list, &nitems) == Success && nitems > 0 && *list) { @@ -154,7 +154,7 @@ xu_getstrprop(Window win, Atom atm, char **text) { XFree(prop.value); - return (nitems); + return(nitems); } /* Root Window Properties */ @@ -351,13 +351,13 @@ xu_ewmh_get_net_wm_state(struct client_ctx *cc, int *n) if ((*n = xu_getprop(cc->win, ewmh[_NET_WM_STATE], XA_ATOM, 64L, (unsigned char **)&p)) <= 0) - return (NULL); + return(NULL); state = xcalloc(*n, sizeof(Atom)); (void)memcpy(state, p, *n * sizeof(Atom)); XFree((char *)p); - return (state); + return(state); } void @@ -483,7 +483,7 @@ xu_xft_width(XftFont *xftfont, const char *text, int len) XftTextExtentsUtf8(X_Dpy, xftfont, (const FcChar8*)text, len, &extents); - return (extents.xOff); + return(extents.xOff); } void |