#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))
#define LENGTH(x) (sizeof x / sizeof x[0])
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))
#define LENGTH(x) (sizeof x / sizeof x[0])
font_extents = XExtentsOfFontSet(dc.font.set);
n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) {
font_extents = XExtentsOfFontSet(dc.font.set);
n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) {
- if(dc.font.ascent < (*xfonts)->ascent)
- dc.font.ascent = (*xfonts)->ascent;
- if(dc.font.descent < (*xfonts)->descent)
- dc.font.descent = (*xfonts)->descent;
+ dc.font.ascent = MAX(dc.font.ascent, (*xfonts)->ascent);
+ dc.font.descent = MAX(dc.font.descent,(*xfonts)->descent);
c->x = wx + ww - c->w - 2 * c->bw;
if(c->y + c->h + 2 * c->bw > wy + wh)
c->y = wy + wh - c->h - 2 * c->bw;
c->x = wx + ww - c->w - 2 * c->bw;
if(c->y + c->h + 2 * c->bw > wy + wh)
c->y = wy + wh - c->h - 2 * c->bw;
- if((nw = ev.xmotion.x - ocx - 2 * c->bw + 1) <= 0)
- nw = 1;
- if((nh = ev.xmotion.y - ocy - 2 * c->bw + 1) <= 0)
- nh = 1;
+ nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
+ nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
if(!c->isfloating && !lt->isfloating && (abs(nw - c->w) > SNAP || abs(nh - c->h) > SNAP))
togglefloating(NULL);
if((lt->isfloating) || c->isfloating)
if(!c->isfloating && !lt->isfloating && (abs(nw - c->w) > SNAP || abs(nh - c->h) > SNAP))
togglefloating(NULL);
if((lt->isfloating) || c->isfloating)