aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2013-11-27 14:20:32 +0000
committerokan2013-11-27 14:20:32 +0000
commitfad4280d9453e32b642ed4aca146a524e6bb1458 (patch)
treeaf078037500c9e4187ea9eebf3fc085ad6d2d881
parent68b96b00340cd695b13813afd2e72425b831174c (diff)
downloadcwm-fad4280d9453e32b642ed4aca146a524e6bb1458.tar.gz
simplify/unfold
Diffstat (limited to '')
-rw-r--r--client.c10
-rw-r--r--mousefunc.c12
2 files changed, 9 insertions, 13 deletions
diff --git a/client.c b/client.c
index 50be63c..4e7dcaf 100644
--- a/client.c
+++ b/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.150 2013/11/27 00:01:23 okan Exp $
+ * $OpenBSD: client.c,v 1.151 2013/11/27 14:20:32 okan Exp $
*/
#include <sys/param.h>
@@ -781,12 +781,10 @@ client_applysizehints(struct client_ctx *cc)
}
/* adjust for aspect limits */
- if (cc->hint.mina > 0 && cc->hint.maxa > 0) {
- if (cc->hint.maxa <
- (float)cc->geom.w / cc->geom.h)
+ if (cc->hint.mina && cc->hint.maxa) {
+ if (cc->hint.maxa < (float)cc->geom.w / cc->geom.h)
cc->geom.w = cc->geom.h * cc->hint.maxa;
- else if (cc->hint.mina <
- (float)cc->geom.h / cc->geom.w)
+ else if (cc->hint.mina < (float)cc->geom.h / cc->geom.w)
cc->geom.h = cc->geom.w * cc->hint.mina;
}
diff --git a/mousefunc.c b/mousefunc.c
index b1fe7cf..1bec153 100644
--- a/mousefunc.c
+++ b/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.57 2013/10/19 18:59:22 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.58 2013/11/27 14:20:32 okan Exp $
*/
#include <sys/param.h>
@@ -50,21 +50,19 @@ static void
mousefunc_sweep_draw(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
- char asize[14]; /* fits " nnnn x nnnn \0" */
+ char s[14]; /* fits " nnnn x nnnn \0" */
- (void)snprintf(asize, sizeof(asize), " %4d x %-4d ",
+ (void)snprintf(s, sizeof(s), " %4d x %-4d ",
(cc->geom.w - cc->hint.basew) / cc->hint.incw,
(cc->geom.h - cc->hint.baseh) / cc->hint.inch);
XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0,
- xu_xft_width(sc->xftfont, asize, strlen(asize)),
- sc->xftfont->height);
+ xu_xft_width(sc->xftfont, s, strlen(s)), sc->xftfont->height);
XMapWindow(X_Dpy, sc->menuwin);
XClearWindow(X_Dpy, sc->menuwin);
- xu_xft_draw(sc, asize, CWM_COLOR_MENU_FONT,
- 0, sc->xftfont->ascent + 1);
+ xu_xft_draw(sc, s, CWM_COLOR_MENU_FONT, 0, sc->xftfont->ascent + 1);
}
void