knf, some from a diff from Tiago Cunha.

This commit is contained in:
okan 2012-05-13 15:15:54 +00:00
parent 63b59e44c1
commit fb4936d0f7
4 changed files with 14 additions and 10 deletions

View File

@ -159,6 +159,7 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
XSetWindowAttributes rootattr; XSetWindowAttributes rootattr;
int fake; int fake;
u_int nwins, i; u_int nwins, i;
sc->which = which; sc->which = which;
sc->rootwin = RootWindow(X_Dpy, sc->which); sc->rootwin = RootWindow(X_Dpy, sc->which);
@ -221,6 +222,7 @@ x_wmerrorhandler(Display *dpy, XErrorEvent *e)
return (0); return (0);
} }
static int static int
x_errorhandler(Display *dpy, XErrorEvent *e) x_errorhandler(Display *dpy, XErrorEvent *e)
{ {

View File

@ -613,7 +613,8 @@ client_cycle(struct screen_ctx *sc, int flags)
return; return;
if (oldcc == NULL) if (oldcc == NULL)
oldcc = (flags & CWM_RCYCLE ? TAILQ_LAST(&sc->mruq, cycle_entry_q) : oldcc = (flags & CWM_RCYCLE ?
TAILQ_LAST(&sc->mruq, cycle_entry_q) :
TAILQ_FIRST(&sc->mruq)); TAILQ_FIRST(&sc->mruq));
newcc = oldcc; newcc = oldcc;
@ -792,6 +793,7 @@ client_getsizehints(struct client_ctx *cc)
cc->size->max_aspect.y; cc->size->max_aspect.y;
} }
} }
void void
client_applysizehints(struct client_ctx *cc) client_applysizehints(struct client_ctx *cc)
{ {
@ -911,13 +913,13 @@ client_snapcalc(int n, int dn, int nmax, int bwidth, int snapdist)
/* possible to snap in both directions */ /* possible to snap in both directions */
if (s0 != 0 && s1 != 0) if (s0 != 0 && s1 != 0)
if (abs(s0) < abs(s1)) if (abs(s0) < abs(s1))
return s0; return (s0);
else else
return s1; return (s1);
else if (s0 != 0) else if (s0 != 0)
return s0; return (s0);
else if (s1 != 0) else if (s1 != 0)
return s1; return (s1);
else else
return 0; return (0);
} }

2
conf.c
View File

@ -642,7 +642,7 @@ conf_grab_mouse(struct client_ctx *cc)
TAILQ_FOREACH(mb, &Conf.mousebindingq, entry) { TAILQ_FOREACH(mb, &Conf.mousebindingq, entry) {
if (mb->context != MOUSEBIND_CTX_WIN) if (mb->context != MOUSEBIND_CTX_WIN)
continue; continue;
switch(mb->button) { switch(mb->button) {
case 1: case 1:

View File

@ -292,10 +292,10 @@ xu_getcolor(struct screen_ctx *sc, char *name)
if (!XAllocNamedColor(X_Dpy, DefaultColormap(X_Dpy, sc->which), if (!XAllocNamedColor(X_Dpy, DefaultColormap(X_Dpy, sc->which),
name, &color, &tmp)) { name, &color, &tmp)) {
warnx("XAllocNamedColor error: '%s'", name); warnx("XAllocNamedColor error: '%s'", name);
return 0; return (0);
} }
return color.pixel; return (color.pixel);
} }
void void