-/* $OpenBSD: rasops.c,v 1.68 2023/01/12 12:28:08 nicm Exp $ */
+/* $OpenBSD: rasops.c,v 1.69 2023/01/18 11:08:49 nicm Exp $ */
/* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */
/*-
if ((flg & WSATTR_HILIT) != 0 && fg < 8)
fg += 8;
- flg = ((flg & WSATTR_UNDERLINE) ? 1 : 0);
-
- *attr = (bg << 16) | (fg << 24) | flg;
+ *attr = (bg << 16) | (fg << 24) | (flg & WSATTR_UNDERLINE);
return (0);
}
bg = swap;
}
- *attr = (bg << 16) | (fg << 24) | ((flg & WSATTR_UNDERLINE) ? 7 : 6);
+ *attr = (bg << 16) | (fg << 24) | (flg & WSATTR_UNDERLINE);
return (0);
}
*fg = ((u_int)attr >> 24) & 0xf;
*bg = ((u_int)attr >> 16) & 0xf;
if (underline != NULL)
- *underline = (u_int)attr & 1;
+ *underline = (u_int)attr & WSATTR_UNDERLINE;
}
/*
col = ri->ri_cols - col - 1;
/* Do rotated char sans (side)underline */
- rc = ri->ri_real_ops.putchar(cookie, col, row, uc, attr & ~1);
+ rc = ri->ri_real_ops.putchar(cookie, col, row, uc,
+ attr & ~WSATTR_UNDERLINE);
if (rc != 0)
return rc;
height = ri->ri_font->fontheight;
/* XXX this assumes 16-bit color depth */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf];
while (height--) {
-/* $OpenBSD: rasops1.c,v 1.12 2021/01/09 18:20:47 fcambus Exp $ */
+/* $OpenBSD: rasops1.c,v 1.13 2023/01/18 11:08:49 nicm Exp $ */
/* $NetBSD: rasops1.c,v 1.11 2000/04/12 14:22:29 pk Exp $ */
/*-
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
*rp = (*rp & lmask) | (fg & rmask);
}
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = (rp[0] & lmask) | (fg & ~lmask);
rp[1] = (rp[1] & rmask) | (fg & ~rmask);
}
/* Do underline */
- if ((attr & 1) != 0)
+ if ((attr & WSATTR_UNDERLINE) != 0)
rp[-(ri->ri_stride << 1)] = fg;
return 0;
}
/* Do underline */
- if ((attr & 1) != 0)
+ if ((attr & WSATTR_UNDERLINE) != 0)
*(int16_t *)(rp - (ri->ri_stride << 1)) = fg;
return 0;
-/* $OpenBSD: rasops15.c,v 1.9 2020/05/25 09:55:49 jsg Exp $ */
+/* $OpenBSD: rasops15.c,v 1.10 2023/01/18 11:08:49 nicm Exp $ */
/* $NetBSD: rasops15.c,v 1.7 2000/04/12 14:22:29 pk Exp $ */
/*-
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int16_t c = (int16_t)clr[1];
rp -= ri->ri_stride << 1;
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(28);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
int32_t c = STAMP_READ(28);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
int32_t c = STAMP_READ(28);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
-/* $OpenBSD: rasops24.c,v 1.12 2020/05/25 09:55:49 jsg Exp $ */
+/* $OpenBSD: rasops24.c,v 1.13 2023/01/18 11:08:49 nicm Exp $ */
/* $NetBSD: rasops24.c,v 1.12 2000/04/12 14:22:29 pk Exp $ */
/*-
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp -= ri->ri_stride << 1;
while (width--) {
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(52);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(52);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
int32_t c = STAMP_READ(52);
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
-/* $OpenBSD: rasops32.c,v 1.12 2020/07/20 12:40:45 fcambus Exp $ */
+/* $OpenBSD: rasops32.c,v 1.13 2023/01/18 11:08:49 nicm Exp $ */
/* $NetBSD: rasops32.c,v 1.7 2000/04/12 14:22:29 pk Exp $ */
/*-
}
/* Do underline a pixel at a time */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp -= step;
for (cnt = 0; cnt < width; cnt++)
((int *)rp)[cnt] = f;
-/* $OpenBSD: rasops4.c,v 1.12 2020/05/25 09:55:49 jsg Exp $ */
+/* $OpenBSD: rasops4.c,v 1.13 2023/01/18 11:08:49 nicm Exp $ */
/* $NetBSD: rasops4.c,v 1.4 2001/11/15 09:48:15 lukem Exp $ */
/*-
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
*rp = (*rp & lmask) | (fg & rmask);
}
}
/* Do underline */
- if (attr & 1) {
+ if (attr & WSATTR_UNDERLINE) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = (rp[0] & lmask) | (fg & ~lmask);
rp[1] = (rp[1] & rmask) | (fg & ~rmask);
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp -= (rs << 1);
rp[0] = stamp[15];
rp[1] = stamp[15];
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp -= (rs << 1);
rp[0] = stamp[15];
rp[1] = stamp[15];
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
rp -= (rs << 1);
rp[0] = stamp[15];
rp[1] = stamp[15];
-/* $OpenBSD: rasops8.c,v 1.11 2020/05/25 09:55:49 jsg Exp $ */
+/* $OpenBSD: rasops8.c,v 1.12 2023/01/18 11:08:49 nicm Exp $ */
/* $NetBSD: rasops8.c,v 1.8 2000/04/12 14:22:29 pk Exp $ */
/*-
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
u_char c = clr[1];
rp -= (ri->ri_stride << 1);
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = rp[1] = stamp[15];
}
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = rp[1] = rp[2] = stamp[15];
}
}
/* Do underline */
- if ((attr & 1) != 0) {
+ if ((attr & WSATTR_UNDERLINE) != 0) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
rp[0] = rp[1] = rp[2] = rp[3] = stamp[15];
}