diff options
| author | rin <rin@NetBSD.org> | 2019-07-24 18:33:49 +0000 |
|---|---|---|
| committer | rin <rin@NetBSD.org> | 2019-07-24 18:33:49 +0000 |
| commit | 91c552bb679f143fa896efc200c309fed8f68101 (patch) | |
| tree | d44d87e1d2ba875ee3426bdc2c637bcec8b46a67 /sys/dev | |
| parent | 52466bfc90961d6dc133eba2122ac7f6c792ff3f (diff) | |
Use unsigned integers for binary data storage.
No functional changes intended.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/rasops/rasops.c | 128 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops.h | 5 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops1.c | 51 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops15.c | 106 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops2.c | 35 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops24.c | 70 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops32.c | 30 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops4.c | 19 | ||||
| -rw-r--r-- | sys/dev/rasops/rasops8.c | 62 |
9 files changed, 256 insertions, 250 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index ac91fae46e5..f12d919b6a1 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops.c,v 1.81 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops.c,v 1.82 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.81 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.82 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" #include "rasops_glue.h" @@ -613,7 +613,7 @@ rasops_allocattr_mono(void *cookie, int fg, int bg, int flg, static void rasops_copyrows(void *cookie, int src, int dst, int num) { - int32_t *sp, *dp, *hp, *srp, *drp, *hrp; + uint32_t *sp, *dp, *hp, *srp, *drp, *hrp; struct rasops_info *ri; int n8, n1, cnt, delta; @@ -649,19 +649,19 @@ rasops_copyrows(void *cookie, int src, int dst, int num) n1 = (ri->ri_emustride >> 2) & 7; if (dst < src) { - srp = (int32_t *)(ri->ri_bits + src * ri->ri_yscale); - drp = (int32_t *)(ri->ri_bits + dst * ri->ri_yscale); + srp = (uint32_t *)(ri->ri_bits + src * ri->ri_yscale); + drp = (uint32_t *)(ri->ri_bits + dst * ri->ri_yscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + dst * + hrp = (uint32_t *)(ri->ri_hwbits + dst * ri->ri_yscale); delta = ri->ri_stride; } else { src = ri->ri_font->fontheight * src + num - 1; dst = ri->ri_font->fontheight * dst + num - 1; - srp = (int32_t *)(ri->ri_bits + src * ri->ri_stride); - drp = (int32_t *)(ri->ri_bits + dst * ri->ri_stride); + srp = (uint32_t *)(ri->ri_bits + src * ri->ri_stride); + drp = (uint32_t *)(ri->ri_bits + dst * ri->ri_stride); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + dst * + hrp = (uint32_t *)(ri->ri_hwbits + dst * ri->ri_stride); delta = -ri->ri_stride; @@ -673,10 +673,10 @@ rasops_copyrows(void *cookie, int src, int dst, int num) if (ri->ri_hwbits) hp = hrp; - DELTA(drp, delta, int32_t *); - DELTA(srp, delta, int32_t *); + DELTA(drp, delta, uint32_t *); + DELTA(srp, delta, uint32_t *); if (ri->ri_hwbits) - DELTA(hrp, delta, int32_t *); + DELTA(hrp, delta, uint32_t *); for (cnt = n8; cnt; cnt--) { dp[0] = sp[0]; @@ -914,7 +914,7 @@ rasops_eraserows(void *cookie, int row, int num, long attr) { struct rasops_info *ri; int np, nw, cnt, delta; - int32_t *dp, *hp, clr; + uint32_t *dp, *hp, clr; int i; ri = (struct rasops_info *)cookie; @@ -945,17 +945,17 @@ rasops_eraserows(void *cookie, int row, int num, long attr) np = ri->ri_stride >> 5; nw = (ri->ri_stride >> 2) & 7; num = ri->ri_height; - dp = (int32_t *)ri->ri_origbits; + dp = (uint32_t *)ri->ri_origbits; if (ri->ri_hwbits) - hp = (int32_t *)ri->ri_hworigbits; + hp = (uint32_t *)ri->ri_hworigbits; delta = 0; } else { np = ri->ri_emustride >> 5; nw = (ri->ri_emustride >> 2) & 7; num *= ri->ri_font->fontheight; - dp = (int32_t *)(ri->ri_bits + row * ri->ri_yscale); + dp = (uint32_t *)(ri->ri_bits + row * ri->ri_yscale); if (ri->ri_hwbits) - hp = (int32_t *)(ri->ri_hwbits + row * + hp = (uint32_t *)(ri->ri_hwbits + row * ri->ri_yscale); delta = ri->ri_delta; } @@ -973,17 +973,17 @@ rasops_eraserows(void *cookie, int row, int num, long attr) } for (cnt = nw; cnt; cnt--) { - *(int32_t *)dp = clr; - DELTA(dp, 4, int32_t *); + *(uint32_t *)dp = clr; + DELTA(dp, 4, uint32_t *); if (ri->ri_hwbits) { - *(int32_t *)hp = clr; - DELTA(hp, 4, int32_t *); + *(uint32_t *)hp = clr; + DELTA(hp, 4, uint32_t *); } } - DELTA(dp, delta, int32_t *); + DELTA(dp, delta, uint32_t *); if (ri->ri_hwbits) - DELTA(hp, delta, int32_t *); + DELTA(hp, delta, uint32_t *); } } @@ -1069,11 +1069,11 @@ rasops_do_cursor(struct rasops_info *ri) } for (cnt = full1; cnt; cnt--) { - tmp32 = *(int32_t *)dp ^ ~0; - *(int32_t *)dp = tmp32; + tmp32 = *(uint32_t *)dp ^ ~0; + *(uint32_t *)dp = tmp32; dp += 4; if (ri->ri_hwbits) { - *(int32_t *)hp = tmp32; + *(uint32_t *)hp = tmp32; hp += 4; } } @@ -1093,30 +1093,30 @@ rasops_do_cursor(struct rasops_info *ri) } if (msk1 != 0) { - tmp32 = *(int32_t *)dp ^ msk1; + tmp32 = *(uint32_t *)dp ^ msk1; *(uint32_t *)dp = tmp32; dp += 4; if (ri->ri_hwbits) { - *(int32_t *)hp = tmp32; + *(uint32_t *)hp = tmp32; hp += 4; } } for (cnt = full1; cnt; cnt--) { - tmp32 = *(int32_t *)dp ^ ~0; + tmp32 = *(uint32_t *)dp ^ ~0; *(uint32_t *)dp = tmp32; dp += 4; if (ri->ri_hwbits) { - *(int32_t *)hp = tmp32; + *(uint32_t *)hp = tmp32; hp += 4; } } if (msk2 != 0) { - tmp32 = *(int32_t *)dp ^ msk2; + tmp32 = *(uint32_t *)dp ^ msk2; *(uint32_t *)dp = tmp32; if (ri->ri_hwbits) - *(int32_t *)hp = tmp32; + *(uint32_t *)hp = tmp32; } } } @@ -1130,7 +1130,7 @@ rasops_erasecols(void *cookie, int row, int col, int num, long attr) { int n8, height, cnt, slop1, slop2, clr; struct rasops_info *ri; - int32_t *rp, *dp, *hrp, *hp; + uint32_t *rp, *dp, *hrp, *hp; int i; ri = (struct rasops_info *)cookie; @@ -1153,9 +1153,9 @@ rasops_erasecols(void *cookie, int row, int col, int num, long attr) #endif num = num * ri->ri_xscale; - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = ri->ri_font->fontheight; clr = ri->ri_devcmap[(attr >> 16) & 0xf]; @@ -1168,10 +1168,10 @@ rasops_erasecols(void *cookie, int row, int col, int num, long attr) while (height--) { dp = rp; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hp = hrp; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } for (cnt = num; cnt; cnt--) { @@ -1189,36 +1189,36 @@ rasops_erasecols(void *cookie, int row, int col, int num, long attr) while (height--) { dp = rp; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hp = hrp; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } for (cnt = num; cnt; cnt--) { - *(int16_t *)dp = clr; - DELTA(dp, 2, int32_t *); + *(uint16_t *)dp = clr; + DELTA(dp, 2, uint32_t *); if (ri->ri_hwbits) { - *(int16_t *)hp = clr; - DELTA(hp, 2, int32_t *); + *(uint16_t *)hp = clr; + DELTA(hp, 2, uint32_t *); } } } } else { while (height--) { dp = rp; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hp = hrp; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } for (cnt = num; cnt; cnt--) { *(uint8_t *)dp = clr; - DELTA(dp, 1, int32_t *); + DELTA(dp, 1, uint32_t *); if (ri->ri_hwbits) { *(uint8_t *)hp = clr; - DELTA(hp, 1, int32_t *); + DELTA(hp, 1, uint32_t *); } } } @@ -1235,28 +1235,28 @@ rasops_erasecols(void *cookie, int row, int col, int num, long attr) while (height--) { dp = rp; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hp = hrp; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } /* Align span to 4 bytes */ if (slop1 & 1) { *(uint8_t *)dp = clr; - DELTA(dp, 1, int32_t *); + DELTA(dp, 1, uint32_t *); if (ri->ri_hwbits) { *(uint8_t *)hp = clr; - DELTA(hp, 1, int32_t *); + DELTA(hp, 1, uint32_t *); } } if (slop1 & 2) { - *(int16_t *)dp = clr; - DELTA(dp, 2, int32_t *); + *(uint16_t *)dp = clr; + DELTA(dp, 2, uint32_t *); if (ri->ri_hwbits) { - *(int16_t *)hp = clr; - DELTA(hp, 2, int32_t *); + *(uint16_t *)hp = clr; + DELTA(hp, 2, uint32_t *); } } @@ -1282,17 +1282,17 @@ rasops_erasecols(void *cookie, int row, int col, int num, long attr) /* Write unaligned trailing slop */ if (slop2 & 1) { *(uint8_t *)dp = clr; - DELTA(dp, 1, int32_t *); + DELTA(dp, 1, uint32_t *); if (ri->ri_hwbits) { *(uint8_t *)hp = clr; - DELTA(hp, 1, int32_t *); + DELTA(hp, 1, uint32_t *); } } if (slop2 & 2) { - *(int16_t *)dp = clr; + *(uint16_t *)dp = clr; if (ri->ri_hwbits) - *(int16_t *)hp = clr; + *(uint16_t *)hp = clr; } } } @@ -1399,10 +1399,11 @@ rasops_putchar_rotated_cw(void *cookie, int row, int col, u_int uc, long attr) /* XXX this assumes 16-bit color depth */ if ((attr & WSATTR_UNDERLINE) != 0) { - int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf]; + uint16_t c = + (uint16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf]; while (height--) { - *(int16_t *)rp = c; + *(uint16_t *)rp = c; rp += ri->ri_stride; } } @@ -1527,10 +1528,11 @@ rasops_putchar_rotated_ccw(void *cookie, int row, int col, u_int uc, long attr) /* XXX this assumes 16-bit color depth */ if ((attr & WSATTR_UNDERLINE) != 0) { - int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf]; + uint16_t c = + (uint16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf]; while (height--) { - *(int16_t *)rp = c; + *(uint16_t *)rp = c; rp += ri->ri_stride; } } diff --git a/sys/dev/rasops/rasops.h b/sys/dev/rasops/rasops.h index b0ac8c1e050..4a8cc1cc0f5 100644 --- a/sys/dev/rasops/rasops.h +++ b/sys/dev/rasops/rasops.h @@ -1,4 +1,4 @@ -/* $NetBSD: rasops.h,v 1.34 2019/07/24 18:24:42 rin Exp $ */ +/* $NetBSD: rasops.h,v 1.35 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -123,7 +123,8 @@ struct rasops_info { uint8_t *ri_hworigbits; /* where hw bits actually start */ int ri_xorigin; /* where ri_bits begins (x) */ int ri_yorigin; /* where ri_bits begins (y) */ - int32_t ri_devcmap[16]; /* color -> framebuffer data */ + uint32_t + ri_devcmap[16]; /* color -> framebuffer data */ /* The emulops you need to use, and the screen caps for wscons */ struct wsdisplay_emulops ri_ops; diff --git a/sys/dev/rasops/rasops1.c b/sys/dev/rasops/rasops1.c index 7e7875f9b16..f63460ebb77 100644 --- a/sys/dev/rasops/rasops1.c +++ b/sys/dev/rasops/rasops1.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops1.c,v 1.25 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops1.c,v 1.26 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops1.c,v 1.25 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops1.c,v 1.26 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" @@ -91,7 +91,7 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) uint32_t height, width; struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); - int32_t *rp, *hrp = NULL, tmp, tmp2; + uint32_t *rp, *hrp = NULL, tmp, tmp2; uint8_t *fr; #ifdef RASOPS_CLIPPING @@ -104,9 +104,10 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) #endif col *= ri->ri_font->fontwidth; - rp = (int32_t *)(ri->ri_bits + row * ri->ri_yscale + ((col >> 3) & ~3)); + rp = (uint32_t *)(ri->ri_bits + row * ri->ri_yscale + + ((col >> 3) & ~3)); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row * ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row * ri->ri_yscale + ((col >> 3) & ~3)); height = font->fontheight; width = font->fontwidth; @@ -138,10 +139,10 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) while (height--) { tmp = (*rp & lmask) | bg; *rp = tmp; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); if (ri->ri_hwbits) { *hrp = tmp; - DELTA(hrp, rs, int32_t *); + DELTA(hrp, rs, uint32_t *); } } } else { @@ -155,10 +156,10 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) *rp = tmp; fr += fs; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); if (ri->ri_hwbits) { *hrp = tmp; - DELTA(hrp, rs, int32_t *); + DELTA(hrp, rs, uint32_t *); } } } else { @@ -170,10 +171,10 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) *rp = tmp; fr += fs; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); if (ri->ri_hwbits) { *hrp = tmp; - DELTA(hrp, rs, int32_t *); + DELTA(hrp, rs, uint32_t *); } } } @@ -181,11 +182,11 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); tmp = (*rp & lmask) | (fg & rmask); *rp = tmp; if (ri->ri_hwbits) { - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); *hrp = tmp; } } @@ -202,11 +203,11 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) tmp2 = (rp[1] & rmask) | width; rp[0] = tmp; rp[1] = tmp2; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); if (ri->ri_hwbits) { hrp[0] = tmp; hrp[1] = tmp2; - DELTA(hrp, rs, int32_t *); + DELTA(hrp, rs, uint32_t *); } } } else { @@ -226,11 +227,11 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) rp[0] = tmp; rp[1] = tmp2; fr += fs; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); if (ri->ri_hwbits) { hrp[0] = tmp; hrp[1] = tmp2; - DELTA(hrp, rs, int32_t *); + DELTA(hrp, rs, uint32_t *); } } } else { @@ -246,11 +247,11 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) rp[0] = tmp; rp[1] = tmp2; fr += fs; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); if (ri->ri_hwbits) { hrp[0] = tmp; hrp[1] = tmp2; - DELTA(hrp, rs, int32_t *); + DELTA(hrp, rs, uint32_t *); } } } @@ -258,13 +259,13 @@ rasops1_putchar(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); tmp = (rp[0] & lmask) | (fg & ~lmask); tmp2 = (rp[1] & rmask) | (fg & ~rmask); rp[0] = tmp; rp[1] = tmp2; if (ri->ri_hwbits) { - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); hrp[0] = tmp; hrp[1] = tmp2; } @@ -385,10 +386,10 @@ rasops1_putchar16(void *cookie, int row, int col, u_int uc, long attr) if (fg == bg || uc == ' ') { while (height--) { /* XXX alignment?! */ - *(int16_t *)rp = bg; + *(uint16_t *)rp = bg; rp += rs; if (ri->ri_hwbits) { - *(int16_t *)hrp = bg; + *(uint16_t *)hrp = bg; hrp += rs; } } @@ -428,9 +429,9 @@ rasops1_putchar16(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { /* XXX alignment?! */ - *(int16_t *)(rp - (ri->ri_stride << 1)) = fg; + *(uint16_t *)(rp - (ri->ri_stride << 1)) = fg; if (ri->ri_hwbits) { - *(int16_t *)(hrp - (ri->ri_stride << 1)) = fg; + *(uint16_t *)(hrp - (ri->ri_stride << 1)) = fg; } } } diff --git a/sys/dev/rasops/rasops15.c b/sys/dev/rasops/rasops15.c index 8ffe92f0ca9..6ffeb20cba2 100644 --- a/sys/dev/rasops/rasops15.c +++ b/sys/dev/rasops/rasops15.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops15.c,v 1.24 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops15.c,v 1.25 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.24 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.25 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" @@ -55,7 +55,7 @@ static void rasops15_makestamp(struct rasops_info *, long); /* * (2x2)x1 stamp for optimized character blitting */ -static int32_t stamp[32]; +static uint32_t stamp[32]; static long stamp_attr; static int stamp_mutex; /* XXX see note in readme */ @@ -64,12 +64,12 @@ static int stamp_mutex; /* XXX see note in readme */ * that the shift count is negative. * * offset = STAMP_SHIFT(fontbits, nibble #) & STAMP_MASK - * destination int32_t[0] = STAMP_READ(offset) - * destination int32_t[1] = STAMP_READ(offset + 4) + * destination uint32_t[0] = STAMP_READ(offset) + * destination uint32_t[1] = STAMP_READ(offset + 4) */ #define STAMP_SHIFT(fb,n) ((n*4-3) >= 0 ? (fb)>>(n*4-3):(fb)<<-(n*4-3)) #define STAMP_MASK (15 << 3) -#define STAMP_READ(o) (*(int32_t *)((char *)stamp + (o))) +#define STAMP_READ(o) (*(uint32_t *)((char *)stamp + (o))) #endif /* @@ -145,7 +145,7 @@ rasops15_putchar(void *cookie, int row, int col, u_int uc, long attr) clr[0] = ri->ri_devcmap[((u_int)attr >> 16) & 0xf]; if (uc == ' ') { - int16_t c = (int16_t)clr[0]; + uint16_t c = (uint16_t)clr[0]; while (height--) { dp = rp; rp += ri->ri_stride; @@ -155,10 +155,10 @@ rasops15_putchar(void *cookie, int row, int col, u_int uc, long attr) } for (cnt = width; cnt; cnt--) { - *(int16_t *)dp = c; + *(uint16_t *)dp = c; dp += 2; if (ri->ri_hwbits) { - *(int16_t *)hp = c; + *(uint16_t *)hp = c; hp += 2; } } @@ -178,10 +178,10 @@ rasops15_putchar(void *cookie, int row, int col, u_int uc, long attr) } for (cnt = width; cnt; cnt--) { - *(int16_t *)dp = (int16_t)clr[(fb >> 31) & 1]; + *(uint16_t *)dp = (uint16_t)clr[(fb >> 31) & 1]; if (ri->ri_hwbits) - *(int16_t *)hp = - (int16_t)clr[(fb >> 31) & 1]; + *(uint16_t *)hp = + (uint16_t)clr[(fb >> 31) & 1]; fb <<= 1; dp += 2; if (ri->ri_hwbits) @@ -192,16 +192,16 @@ rasops15_putchar(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - int16_t c = (int16_t)clr[1]; + uint16_t c = (uint16_t)clr[1]; rp -= ri->ri_stride << 1; if (ri->ri_hwbits) hrp -= ri->ri_stride << 1; while (width--) { - *(int16_t *)rp = c; + *(uint16_t *)rp = c; rp += 2; if (ri->ri_hwbits) { - *(int16_t *)hrp = c; + *(uint16_t *)hrp = c; hrp += 2; } } @@ -214,7 +214,7 @@ rasops15_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) int width, height, cnt, clr[2]; struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); - int16_t *dp, *rp; + uint16_t *dp, *rp; uint8_t *rrp; uint8_t *fr; uint16_t buffer[64]; /* XXX */ @@ -236,7 +236,7 @@ rasops15_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) return; rrp = (ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); - rp = (int16_t *)rrp; + rp = (uint16_t *)rrp; height = font->fontheight; width = font->fontwidth; @@ -249,7 +249,7 @@ rasops15_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) buffer[cnt] = clr[0]; while (height--) { dp = rp; - DELTA(rp, ri->ri_stride, int16_t *); + DELTA(rp, ri->ri_stride, uint16_t *); memcpy(dp, buffer, width << 1); } } else { @@ -294,7 +294,7 @@ rasops15_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { rp = (uint16_t *)rrp; - DELTA(rp, (ri->ri_stride * (height - 2)), int16_t *); + DELTA(rp, (ri->ri_stride * (height - 2)), uint16_t *); while (width--) *rp++ = clr[1]; } @@ -307,7 +307,7 @@ rasops15_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) static void rasops15_makestamp(struct rasops_info *ri, long attr) { - int32_t fg, bg; + uint32_t fg, bg; int i; fg = ri->ri_devcmap[((u_int)attr >> 24) & 0xf] & 0xffff; @@ -338,7 +338,7 @@ rasops15_putchar8(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, so, fs; - int32_t *rp, *hrp; + uint32_t *rp, *hrp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -366,20 +366,20 @@ rasops15_putchar8(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops15_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == (u_int)-1) { - int32_t c = stamp[0]; + uint32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = c; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hrp[0] = hrp[1] = hrp[2] = hrp[3] = c; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } } else { @@ -405,20 +405,20 @@ rasops15_putchar8(void *cookie, int row, int col, u_int uc, long attr) } fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - int32_t c = STAMP_READ(28); + uint32_t c = STAMP_READ(28); - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = rp[3] = c; if (ri->ri_hwbits) { - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); hrp[0] = hrp[1] = hrp[2] = hrp[3] = c; } } @@ -435,7 +435,7 @@ rasops15_putchar12(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, so, fs; - int32_t *rp, *hrp; + uint32_t *rp, *hrp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -463,21 +463,21 @@ rasops15_putchar12(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops15_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == (u_int)-1) { - int32_t c = stamp[0]; + uint32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = c; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hrp[0] = hrp[1] = hrp[2] = hrp[3] = hrp[4] = hrp[5] = c; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } } else { @@ -511,20 +511,20 @@ rasops15_putchar12(void *cookie, int row, int col, u_int uc, long attr) } fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } /* Do underline */ if (attr & WSATTR_UNDERLINE) { - int32_t c = STAMP_READ(28); + uint32_t c = STAMP_READ(28); - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = c; if (ri->ri_hwbits) { - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); hrp[0] = hrp[1] = hrp[2] = hrp[3] = hrp[4] = hrp[5] = c; } } @@ -541,7 +541,7 @@ rasops15_putchar16(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, so, fs; - int32_t *rp, *hrp; + uint32_t *rp, *hrp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -569,22 +569,22 @@ rasops15_putchar16(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops15_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == (u_int)-1) { - int32_t c = stamp[0]; + uint32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = c; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hrp[0] = hrp[1] = hrp[2] = hrp[3] = hrp[4] = hrp[5] = hrp[6] = hrp[7] = c; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } } else { @@ -625,22 +625,22 @@ rasops15_putchar16(void *cookie, int row, int col, u_int uc, long attr) hrp[7] = STAMP_READ(so + 4); } - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); fr += fs; } } /* Do underline */ if (attr & WSATTR_UNDERLINE) { - int32_t c = STAMP_READ(28); + uint32_t c = STAMP_READ(28); - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = c; if (ri->ri_hwbits) { - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); hrp[0] = hrp[1] = hrp[2] = hrp[3] = hrp[4] = hrp[5] = hrp[6] = hrp[7] = c; } diff --git a/sys/dev/rasops/rasops2.c b/sys/dev/rasops/rasops2.c index 3c91ac792b8..a601d849819 100644 --- a/sys/dev/rasops/rasops2.c +++ b/sys/dev/rasops/rasops2.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops2.c,v 1.20 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops2.c,v 1.21 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.20 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops2.c,v 1.21 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" @@ -57,7 +57,7 @@ static void rasops2_makestamp(struct rasops_info *, long); /* * 4x1 stamp for optimized character blitting */ -static int8_t stamp[16]; +static uint8_t stamp[16]; static long stamp_attr; static int stamp_mutex; /* XXX see note in README */ #endif @@ -104,7 +104,7 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr) int height, width, fs, rs, fb, bg, fg, lmask, rmask; struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); - int32_t *rp; + uint32_t *rp; uint8_t *fr; #ifdef RASOPS_CLIPPING @@ -119,7 +119,8 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr) width = font->fontwidth << 1; height = font->fontheight; col *= width; - rp = (int32_t *)(ri->ri_bits + row * ri->ri_yscale + ((col >> 3) & ~3)); + rp = (uint32_t *)(ri->ri_bits + row * ri->ri_yscale + + ((col >> 3) & ~3)); col = col & 31; rs = ri->ri_stride; @@ -147,7 +148,7 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr) while (height--) { *rp = (*rp & lmask) | bg; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); } } else { while (height--) { @@ -160,7 +161,7 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if (attr & WSATTR_UNDERLINE) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); *rp = (*rp & lmask) | (fg & rmask); } } else { @@ -174,7 +175,7 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr) while (height--) { rp[0] = (rp[0] & lmask) | bg; rp[1] = (rp[1] & rmask) | width; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); } } else { width = 32 - col; @@ -191,13 +192,13 @@ rasops2_putchar(void *cookie, int row, int col, u_int uc, long attr) | (MBE((u_int)fb << width) & ~rmask); fr += fs; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); } } /* Do underline */ if (attr & WSATTR_UNDERLINE) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = (rp[0] & lmask) | (fg & ~lmask); rp[1] = (rp[1] & rmask) | (fg & ~rmask); } @@ -290,9 +291,9 @@ rasops2_putchar8(void *cookie, int row, int col, u_int uc, long attr) rasops2_makestamp(ri, attr); if (uc == ' ') { - int8_t c = stamp[0]; + uint8_t c = stamp[0]; while (height--) { - *(int16_t *)rp = c; + *(uint16_t *)rp = c; rp += rs; } } else { @@ -310,7 +311,7 @@ rasops2_putchar8(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) - *(int16_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; + *(uint16_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; stamp_mutex--; } @@ -355,7 +356,7 @@ rasops2_putchar12(void *cookie, int row, int col, u_int uc, long attr) rasops2_makestamp(ri, attr); if (uc == ' ') { - int8_t c = stamp[0]; + uint8_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = c; rp += rs; @@ -423,9 +424,9 @@ rasops2_putchar16(void *cookie, int row, int col, u_int uc, long attr) rasops2_makestamp(ri, attr); if (uc == ' ') { - int8_t c = stamp[0]; + uint8_t c = stamp[0]; while (height--) { - *(int32_t *)rp = c; + *(uint32_t *)rp = c; rp += rs; } } else { @@ -445,7 +446,7 @@ rasops2_putchar16(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) - *(int32_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; + *(uint32_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; stamp_mutex--; } diff --git a/sys/dev/rasops/rasops24.c b/sys/dev/rasops/rasops24.c index edd957c0eb7..c1cf7e871c0 100644 --- a/sys/dev/rasops/rasops24.c +++ b/sys/dev/rasops/rasops24.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops24.c,v 1.31 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops24.c,v 1.32 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.31 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.32 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" @@ -57,7 +57,7 @@ static void rasops24_makestamp(struct rasops_info *, long); /* * 4x1 stamp for optimized character blitting */ -static int32_t stamp[64]; +static uint32_t stamp[64]; static long stamp_attr; static int stamp_mutex; /* XXX see note in readme */ #endif @@ -67,13 +67,13 @@ static int stamp_mutex; /* XXX see note in readme */ * that the shift count is negative. * * offset = STAMP_SHIFT(fontbits, nibble #) & STAMP_MASK - * destination int32_t[0] = STAMP_READ(offset) - * destination int32_t[1] = STAMP_READ(offset + 4) - * destination int32_t[2] = STAMP_READ(offset + 8) + * destination uint32_t[0] = STAMP_READ(offset) + * destination uint32_t[1] = STAMP_READ(offset + 4) + * destination uint32_t[2] = STAMP_READ(offset + 8) */ #define STAMP_SHIFT(fb,n) ((n*4-4) >= 0 ? (fb)>>(n*4-4):(fb)<<-(n*4-4)) #define STAMP_MASK (0xf << 4) -#define STAMP_READ(o) (*(int32_t *)((char *)stamp + (o))) +#define STAMP_READ(o) (*(uint32_t *)((char *)stamp + (o))) /* * Initialize rasops_info struct for this colordepth. @@ -242,7 +242,7 @@ rasops24_putchar8(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, so, fs; - int32_t *rp; + uint32_t *rp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -268,14 +268,14 @@ rasops24_putchar8(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops24_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == (u_int)-1) { - int32_t c = stamp[0]; + uint32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = c; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); } } else { uc -= font->firstchar; @@ -294,15 +294,15 @@ rasops24_putchar8(void *cookie, int row, int col, u_int uc, long attr) rp[5] = STAMP_READ(so + 8); fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); } } /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - int32_t c = STAMP_READ(52); + uint32_t c = STAMP_READ(52); - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = c; } @@ -318,7 +318,7 @@ rasops24_putchar12(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, so, fs; - int32_t *rp; + uint32_t *rp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -344,15 +344,15 @@ rasops24_putchar12(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops24_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == (u_int)-1) { - int32_t c = stamp[0]; + uint32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = c; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); } } else { uc -= font->firstchar; @@ -376,15 +376,15 @@ rasops24_putchar12(void *cookie, int row, int col, u_int uc, long attr) rp[8] = STAMP_READ(so + 8); fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); } } /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - int32_t c = STAMP_READ(52); + uint32_t c = STAMP_READ(52); - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = c; } @@ -401,7 +401,7 @@ rasops24_putchar16(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, so, fs; - int32_t *rp; + uint32_t *rp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -427,16 +427,16 @@ rasops24_putchar16(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops24_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == (u_int)-1) { - int32_t c = stamp[0]; + uint32_t c = stamp[0]; while (height--) { rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = rp[9] = rp[10] = rp[11] = c; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); } } else { uc -= font->firstchar; @@ -464,16 +464,16 @@ rasops24_putchar16(void *cookie, int row, int col, u_int uc, long attr) rp[10] = STAMP_READ(so + 4); rp[11] = STAMP_READ(so + 8); - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); fr += fs; } } /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - int32_t c = STAMP_READ(52); + uint32_t c = STAMP_READ(52); - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = rp[3] = rp[4] = rp[5] = rp[6] = rp[7] = rp[8] = rp[9] = rp[10] = rp[11] = c; @@ -541,12 +541,12 @@ rasops24_eraserows(void *cookie, int row, int num, long attr) if (num == ri->ri_rows && (ri->ri_flg & RI_FULLCLEAR) != 0) { stride = ri->ri_stride; num = ri->ri_height; - dp = (int32_t *)ri->ri_origbits; + dp = (uint32_t *)ri->ri_origbits; delta = 0; } else { stride = ri->ri_emustride; num *= ri->ri_font->fontheight; - dp = (int32_t *)(ri->ri_bits + row * ri->ri_yscale); + dp = (uint32_t *)(ri->ri_bits + row * ri->ri_yscale); delta = ri->ri_delta; } @@ -580,7 +580,7 @@ rasops24_eraserows(void *cookie, int row, int num, long attr) for (cnt = 0; cnt < n1; cnt++) *dp++ = xstamp[cnt]; - DELTA(dp, delta, int32_t *); + DELTA(dp, delta, uint32_t *); } } @@ -592,7 +592,7 @@ rasops24_erasecols(void *cookie, int row, int col, int num, long attr) { int n12, n4, height, cnt, slop, clr, xstamp[3]; struct rasops_info *ri; - int32_t *dp, *rp; + uint32_t *dp, *rp; uint8_t *dbp; /* @@ -623,7 +623,7 @@ rasops24_erasecols(void *cookie, int row, int col, int num, long attr) return; #endif - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); num *= ri->ri_font->fontwidth; height = ri->ri_font->fontheight; @@ -657,7 +657,7 @@ rasops24_erasecols(void *cookie, int row, int col, int num, long attr) while (height--) { dbp = (uint8_t *)rp; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); /* Align to 4 bytes */ /* XXX handle with masks, bring under control of RI_BSWAP */ @@ -667,7 +667,7 @@ rasops24_erasecols(void *cookie, int row, int col, int num, long attr) *dbp++ = clr; } - dp = (int32_t *)dbp; + dp = (uint32_t *)dbp; /* 12 pels per loop */ for (cnt = n12; cnt; cnt--) { diff --git a/sys/dev/rasops/rasops32.c b/sys/dev/rasops/rasops32.c index 11232c100af..a90b5c26bbd 100644 --- a/sys/dev/rasops/rasops32.c +++ b/sys/dev/rasops/rasops32.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops32.c,v 1.33 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops32.c,v 1.34 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.33 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops32.c,v 1.34 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" @@ -77,7 +77,7 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr) int width, height, cnt, fs, fb, clr[2]; struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); - int32_t *dp, *rp, *hp, *hrp; + uint32_t *dp, *rp, *hp, *hrp; uint8_t *fr; hp = hrp = NULL; @@ -95,9 +95,9 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr) if (!CHAR_IN_FONT(uc, font)) return; - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; @@ -109,10 +109,10 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr) if (uc == ' ') { while (height--) { dp = rp; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hp = hrp; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } for (cnt = width; cnt; cnt--) { @@ -130,10 +130,10 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr) fb = fr[3] | (fr[2] << 8) | (fr[1] << 16) | (fr[0] << 24); fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hp = hrp; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } for (cnt = width; cnt; cnt--) { @@ -147,9 +147,9 @@ rasops32_putchar(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); if (ri->ri_hwbits) - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); while (width--) { *rp++ = clr[1]; @@ -165,7 +165,7 @@ rasops32_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) int width, height, cnt, clr[2]; struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); - int32_t *dp, *rp; + uint32_t *dp, *rp; uint8_t *rrp; uint8_t *fr; uint32_t buffer[64]; /* XXX */ @@ -186,7 +186,7 @@ rasops32_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) return; rrp = (ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); - rp = (int32_t *)rrp; + rp = (uint32_t *)rrp; height = font->fontheight; width = font->fontwidth; @@ -199,7 +199,7 @@ rasops32_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) buffer[cnt] = clr[0]; while (height--) { dp = rp; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); memcpy(dp, buffer, width << 2); } } else { @@ -238,7 +238,7 @@ rasops32_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) if ((attr & WSATTR_UNDERLINE) != 0) { rp = (uint32_t *)rrp; height = font->fontheight; - DELTA(rp, (ri->ri_stride * (height - 2)), int32_t *); + DELTA(rp, (ri->ri_stride * (height - 2)), uint32_t *); while (width--) *rp++ = clr[1]; } diff --git a/sys/dev/rasops/rasops4.c b/sys/dev/rasops/rasops4.c index 8dbf5bbe657..67023706218 100644 --- a/sys/dev/rasops/rasops4.c +++ b/sys/dev/rasops/rasops4.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops4.c,v 1.14 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops4.c,v 1.15 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops4.c,v 1.14 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops4.c,v 1.15 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" @@ -104,7 +104,7 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr) int height, width, fs, rs, fb, bg, fg, lmask, rmask; struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); - int32_t *rp; + uint32_t *rp; uint8_t *fr; #ifdef RASOPS_CLIPPING @@ -119,7 +119,8 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr) width = font->fontwidth << 1; height = font->fontheight; col *= width; - rp = (int32_t *)(ri->ri_bits + row * ri->ri_yscale + ((col >> 3) & ~3)); + rp = (uint32_t *)(ri->ri_bits + row * ri->ri_yscale + + ((col >> 3) & ~3)); col = col & 31; rs = ri->ri_stride; @@ -147,7 +148,7 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr) while (height--) { *rp = (*rp & lmask) | bg; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); } } else { while (height--) { @@ -160,7 +161,7 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr) /* Do underline */ if (attr & WSATTR_UNDERLINE) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); *rp = (*rp & lmask) | (fg & rmask); } } else { @@ -174,7 +175,7 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr) while (height--) { rp[0] = (rp[0] & lmask) | bg; rp[1] = (rp[1] & rmask) | width; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); } } else { width = 32 - col; @@ -191,13 +192,13 @@ rasops4_putchar(void *cookie, int row, int col, u_int uc, long attr) | (MBE((u_int)fb << width) & ~rmask); fr += fs; - DELTA(rp, rs, int32_t *); + DELTA(rp, rs, uint32_t *); } } /* Do underline */ if (attr & WSATTR_UNDERLINE) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = (rp[0] & lmask) | (fg & ~lmask); rp[1] = (rp[1] & rmask) | (fg & ~rmask); } diff --git a/sys/dev/rasops/rasops8.c b/sys/dev/rasops/rasops8.c index 1744c0ec77a..c2d56a91d16 100644 --- a/sys/dev/rasops/rasops8.c +++ b/sys/dev/rasops/rasops8.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops8.c,v 1.36 2019/07/24 18:03:30 rin Exp $ */ +/* $NetBSD: rasops8.c,v 1.37 2019/07/24 18:33:49 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.36 2019/07/24 18:03:30 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops8.c,v 1.37 2019/07/24 18:33:49 rin Exp $"); #include "opt_rasops.h" @@ -53,7 +53,7 @@ static void rasops8_makestamp(struct rasops_info *ri, long); /* * 4x1 stamp for optimized character blitting */ -static int32_t stamp[16]; +static uint32_t stamp[16]; static long stamp_attr; static int stamp_mutex; /* XXX see note in README */ #endif @@ -67,7 +67,7 @@ static int stamp_mutex; /* XXX see note in README */ */ #define STAMP_SHIFT(fb,n) ((n*4-2) >= 0 ? (fb)>>(n*4-2):(fb)<<-(n*4-2)) #define STAMP_MASK (0xf << 2) -#define STAMP_READ(o) (*(int32_t *)((char *)stamp + (o))) +#define STAMP_READ(o) (*(uint32_t *)((char *)stamp + (o))) /* * Initialize a 'rasops_info' descriptor for this depth. @@ -299,7 +299,7 @@ rasops8_putchar_aa(void *cookie, int row, int col, u_int uc, long attr) static void rasops8_makestamp(struct rasops_info *ri, long attr) { - int32_t fg, bg; + uint32_t fg, bg; int i; fg = ri->ri_devcmap[(attr >> 24) & 0xf] & 0xff; @@ -337,7 +337,7 @@ rasops8_putchar8(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, fs; - int32_t *rp, *hp; + uint32_t *rp, *hp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -368,20 +368,20 @@ rasops8_putchar8(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops8_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == ' ') { while (height--) { rp[0] = rp[1] = stamp[0]; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hp[0] = stamp[0]; hp[1] = stamp[0]; - DELTA(hp, ri->ri_stride, int32_t *); + DELTA(hp, ri->ri_stride, uint32_t *); } } } else { @@ -399,18 +399,18 @@ rasops8_putchar8(void *cookie, int row, int col, u_int uc, long attr) } fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) - DELTA(hp, ri->ri_stride, int32_t *); + DELTA(hp, ri->ri_stride, uint32_t *); } } /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = stamp[15]; if (ri->ri_hwbits) { - DELTA(hp, -(ri->ri_stride << 1), int32_t *); + DELTA(hp, -(ri->ri_stride << 1), uint32_t *); hp[0] = stamp[15]; hp[1] = stamp[15]; } @@ -428,7 +428,7 @@ rasops8_putchar12(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, fs; - int32_t *rp, *hrp; + uint32_t *rp, *hrp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -459,23 +459,23 @@ rasops8_putchar12(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops8_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; if (uc == ' ') { while (height--) { - int32_t c = stamp[0]; + uint32_t c = stamp[0]; rp[0] = rp[1] = rp[2] = c; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) { hrp[0] = c; hrp[1] = c; hrp[2] = c; - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } } else { @@ -493,18 +493,18 @@ rasops8_putchar12(void *cookie, int row, int col, u_int uc, long attr) } fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = stamp[15]; if (ri->ri_hwbits) { - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); hrp[0] = stamp[15]; hrp[1] = stamp[15]; hrp[2] = stamp[15]; @@ -523,7 +523,7 @@ rasops8_putchar16(void *cookie, int row, int col, u_int uc, long attr) struct rasops_info *ri = (struct rasops_info *)cookie; struct wsdisplay_font *font = PICK_FONT(ri, uc); int height, fs; - int32_t *rp, *hrp; + uint32_t *rp, *hrp; uint8_t *fr; /* Can't risk remaking the stamp if it's already in use */ @@ -554,9 +554,9 @@ rasops8_putchar16(void *cookie, int row, int col, u_int uc, long attr) if (attr != stamp_attr) rasops8_makestamp(ri, attr); - rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); + rp = (uint32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); if (ri->ri_hwbits) - hrp = (int32_t *)(ri->ri_hwbits + row*ri->ri_yscale + + hrp = (uint32_t *)(ri->ri_hwbits + row*ri->ri_yscale + col*ri->ri_xscale); height = font->fontheight; @@ -588,18 +588,18 @@ rasops8_putchar16(void *cookie, int row, int col, u_int uc, long attr) } fr += fs; - DELTA(rp, ri->ri_stride, int32_t *); + DELTA(rp, ri->ri_stride, uint32_t *); if (ri->ri_hwbits) - DELTA(hrp, ri->ri_stride, int32_t *); + DELTA(hrp, ri->ri_stride, uint32_t *); } } /* Do underline */ if ((attr & WSATTR_UNDERLINE) != 0) { - DELTA(rp, -(ri->ri_stride << 1), int32_t *); + DELTA(rp, -(ri->ri_stride << 1), uint32_t *); rp[0] = rp[1] = rp[2] = rp[3] = stamp[15]; if (ri->ri_hwbits) { - DELTA(hrp, -(ri->ri_stride << 1), int32_t *); + DELTA(hrp, -(ri->ri_stride << 1), uint32_t *); hrp[0] = stamp[15]; hrp[1] = stamp[15]; hrp[2] = stamp[15]; |
