Module Name: src Committed By: rin Date: Wed Jul 24 18:33:49 UTC 2019
Modified Files: src/sys/dev/rasops: rasops.c rasops.h rasops1.c rasops15.c rasops2.c rasops24.c rasops32.c rasops4.c rasops8.c Log Message: Use unsigned integers for binary data storage. No functional changes intended. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/dev/rasops/rasops.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/rasops/rasops.h cvs rdiff -u -r1.25 -r1.26 src/sys/dev/rasops/rasops1.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/rasops/rasops15.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/rasops/rasops2.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/rasops/rasops24.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/rasops/rasops32.c cvs rdiff -u -r1.14 -r1.15 src/sys/dev/rasops/rasops4.c cvs rdiff -u -r1.36 -r1.37 src/sys/dev/rasops/rasops8.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/rasops/rasops.c diff -u src/sys/dev/rasops/rasops.c:1.81 src/sys/dev/rasops/rasops.c:1.82 --- src/sys/dev/rasops/rasops.c:1.81 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops.c Wed Jul 24 18:33:49 2019 @@ -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 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, i 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, i 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, { 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, 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, } 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 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, #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, 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, 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, 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, /* 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, /* 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, /* 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; } } Index: src/sys/dev/rasops/rasops.h diff -u src/sys/dev/rasops/rasops.h:1.34 src/sys/dev/rasops/rasops.h:1.35 --- src/sys/dev/rasops/rasops.h:1.34 Wed Jul 24 18:24:42 2019 +++ src/sys/dev/rasops/rasops.h Wed Jul 24 18:33:49 2019 @@ -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; Index: src/sys/dev/rasops/rasops1.c diff -u src/sys/dev/rasops/rasops1.c:1.25 src/sys/dev/rasops/rasops1.c:1.26 --- src/sys/dev/rasops/rasops1.c:1.25 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops1.c Wed Jul 24 18:33:49 2019 @@ -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, i 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, i #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, i 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, i *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, i *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, i /* 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, i 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, i 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, i 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, i /* 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, 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, /* 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; } } } Index: src/sys/dev/rasops/rasops15.c diff -u src/sys/dev/rasops/rasops15.c:1.24 src/sys/dev/rasops/rasops15.c:1.25 --- src/sys/dev/rasops/rasops15.c:1.24 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops15.c Wed Jul 24 18:33:49 2019 @@ -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 ra /* * (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 * 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, 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, } 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, } 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, /* 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 ro 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 ro 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 ro 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 ro /* 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 ro 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, 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, 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, } 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 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 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 } 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 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 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 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; } Index: src/sys/dev/rasops/rasops2.c diff -u src/sys/dev/rasops/rasops2.c:1.20 src/sys/dev/rasops/rasops2.c:1.21 --- src/sys/dev/rasops/rasops2.c:1.20 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops2.c Wed Jul 24 18:33:49 2019 @@ -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 ras /* * 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, i 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, i 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, i 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, i /* 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, i 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, i | (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, 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, /* 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, 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, 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, /* 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--; } Index: src/sys/dev/rasops/rasops24.c diff -u src/sys/dev/rasops/rasops24.c:1.31 src/sys/dev/rasops/rasops24.c:1.32 --- src/sys/dev/rasops/rasops24.c:1.31 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops24.c Wed Jul 24 18:33:49 2019 @@ -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 ra /* * 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 * 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, 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, 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, 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 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 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 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 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 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 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 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 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 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 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 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 *dbp++ = clr; } - dp = (int32_t *)dbp; + dp = (uint32_t *)dbp; /* 12 pels per loop */ for (cnt = n12; cnt; cnt--) { Index: src/sys/dev/rasops/rasops32.c diff -u src/sys/dev/rasops/rasops32.c:1.33 src/sys/dev/rasops/rasops32.c:1.34 --- src/sys/dev/rasops/rasops32.c:1.33 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops32.c Wed Jul 24 18:33:49 2019 @@ -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 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, 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, 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, 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, /* 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 ro 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 ro 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 ro 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 ro 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]; } Index: src/sys/dev/rasops/rasops4.c diff -u src/sys/dev/rasops/rasops4.c:1.14 src/sys/dev/rasops/rasops4.c:1.15 --- src/sys/dev/rasops/rasops4.c:1.14 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops4.c Wed Jul 24 18:33:49 2019 @@ -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, i 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, i 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, i 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, i /* 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, i 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, i | (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); } Index: src/sys/dev/rasops/rasops8.c diff -u src/sys/dev/rasops/rasops8.c:1.36 src/sys/dev/rasops/rasops8.c:1.37 --- src/sys/dev/rasops/rasops8.c:1.36 Wed Jul 24 18:03:30 2019 +++ src/sys/dev/rasops/rasops8.c Wed Jul 24 18:33:49 2019 @@ -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 ras /* * 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 */ #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 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, 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, 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, } 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, 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, 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, } 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, 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, 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, } 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];