diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-05 14:09:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-05 14:09:36 +0000 |
commit | fe97057f16fd1cffc35ca63c0ad5df12f2a7b2df (patch) | |
tree | 6bcedac194b240651540f3015081e5826a73f2dd /sys/dev/rasops | |
parent | cdcddd879b0146dd3a452f32dc53867fce692d9b (diff) |
Change the wsdisplay_emulops return types from void to int; emulops will now
return zero on success and nonzero on failure.
This commit only performs mechanical changes for the existing emulops to
always return zero.
Diffstat (limited to 'sys/dev/rasops')
-rw-r--r-- | sys/dev/rasops/rasops.c | 135 | ||||
-rw-r--r-- | sys/dev/rasops/rasops.h | 8 | ||||
-rw-r--r-- | sys/dev/rasops/rasops1.c | 38 | ||||
-rw-r--r-- | sys/dev/rasops/rasops15.c | 51 | ||||
-rw-r--r-- | sys/dev/rasops/rasops2.c | 57 | ||||
-rw-r--r-- | sys/dev/rasops/rasops24.c | 81 | ||||
-rw-r--r-- | sys/dev/rasops/rasops32.c | 12 | ||||
-rw-r--r-- | sys/dev/rasops/rasops4.c | 60 | ||||
-rw-r--r-- | sys/dev/rasops/rasops8.c | 51 | ||||
-rw-r--r-- | sys/dev/rasops/rasops_bitops.h | 26 |
10 files changed, 300 insertions, 219 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 719aa91142f..3e12b2f5fb5 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.19 2008/08/20 18:49:12 miod Exp $ */ +/* $OpenBSD: rasops.c,v 1.20 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -131,13 +131,13 @@ const u_char rasops_isgray[16] = { }; /* Generic functions */ -void rasops_copycols(void *, int, int, int, int); -void rasops_copyrows(void *, int, int, int); +int rasops_copycols(void *, int, int, int, int); +int rasops_copyrows(void *, int, int, int); int rasops_mapchar(void *, int, u_int *); -void rasops_cursor(void *, int, int, int); +int rasops_cursor(void *, int, int, int); int rasops_alloc_cattr(void *, int, int, int, long *); int rasops_alloc_mattr(void *, int, int, int, long *); -void rasops_do_cursor(struct rasops_info *); +int rasops_do_cursor(struct rasops_info *); void rasops_init_devcmap(struct rasops_info *); void rasops_unpack_attr(void *, long, int *, int *, int *); #if NRASOPS_BSWAP > 0 @@ -145,11 +145,11 @@ static void slow_ovbcopy(void *, void *, size_t); #endif #if NRASOPS_ROTATION > 0 void rasops_copychar(void *, int, int, int, int); -void rasops_copycols_rotated(void *, int, int, int, int); -void rasops_copyrows_rotated(void *, int, int, int); -void rasops_erasecols_rotated(void *, int, int, int, long); -void rasops_eraserows_rotated(void *, int, int, long); -void rasops_putchar_rotated(void *, int, int, u_int, long); +int rasops_copycols_rotated(void *, int, int, int, int); +int rasops_copyrows_rotated(void *, int, int, int); +int rasops_erasecols_rotated(void *, int, int, int, long); +int rasops_eraserows_rotated(void *, int, int, long); +int rasops_putchar_rotated(void *, int, int, u_int, long); void rasops_rotate_font(int *); /* @@ -531,7 +531,7 @@ rasops_alloc_mattr(cookie, fg, bg, flg, attr) /* * Copy rows. */ -void +int rasops_copyrows(cookie, src, dst, num) void *cookie; int src, dst, num; @@ -544,7 +544,7 @@ rasops_copyrows(cookie, src, dst, num) #ifdef RASOPS_CLIPPING if (dst == src) - return; + return 0; if (src < 0) { num += src; @@ -563,7 +563,7 @@ rasops_copyrows(cookie, src, dst, num) num = ri->ri_rows - dst; if (num <= 0) - return; + return 0; #endif num *= ri->ri_font->fontheight; @@ -604,6 +604,8 @@ rasops_copyrows(cookie, src, dst, num) for (cnt = n1; cnt; cnt--) *dp++ = *sp++; } + + return 0; } /* @@ -612,7 +614,7 @@ rasops_copyrows(cookie, src, dst, num) * We simply cop-out here and use ovbcopy(), since it handles all of * these cases anyway. */ -void +int rasops_copycols(cookie, row, src, dst, num) void *cookie; int row, src, dst, num; @@ -625,11 +627,11 @@ rasops_copycols(cookie, row, src, dst, num) #ifdef RASOPS_CLIPPING if (dst == src) - return; + return 0; /* Catches < 0 case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (src < 0) { num += src; @@ -648,7 +650,7 @@ rasops_copycols(cookie, row, src, dst, num) num = ri->ri_cols - dst; if (num <= 0) - return; + return 0; #endif num *= ri->ri_xscale; @@ -674,26 +676,32 @@ rasops_copycols(cookie, row, src, dst, num) sp += ri->ri_stride; } } + + return 0; } /* * Turn cursor off/on. */ -void +int rasops_cursor(cookie, on, row, col) void *cookie; int on, row, col; { struct rasops_info *ri; + int rc; ri = (struct rasops_info *)cookie; /* Turn old cursor off */ - if ((ri->ri_flg & RI_CURSOR) != 0) + if ((ri->ri_flg & RI_CURSOR) != 0) { #ifdef RASOPS_CLIPPING if ((ri->ri_flg & RI_CURSORCLIP) == 0) #endif - ri->ri_do_cursor(ri); + if ((rc = ri->ri_do_cursor(ri)) != 0) + return rc; + ri->ri_flg &= ~RI_CURSOR; + } /* Select new cursor */ #ifdef RASOPS_CLIPPING @@ -711,13 +719,15 @@ rasops_cursor(cookie, on, row, col) ri->ri_updatecursor(ri); if (on) { - ri->ri_flg |= RI_CURSOR; #ifdef RASOPS_CLIPPING if ((ri->ri_flg & RI_CURSORCLIP) == 0) #endif - ri->ri_do_cursor(ri); - } else - ri->ri_flg &= ~RI_CURSOR; + if ((rc = ri->ri_do_cursor(ri)) != 0) + return rc; + ri->ri_flg |= RI_CURSOR; + } + + return 0; } /* @@ -834,7 +844,7 @@ rasops_unpack_attr(cookie, attr, fg, bg, underline) /* * Erase rows */ -void +int rasops_eraserows(cookie, row, num, attr) void *cookie; int row, num; @@ -856,7 +866,7 @@ rasops_eraserows(cookie, row, num, attr) num = ri->ri_rows - row; if (num <= 0) - return; + return 0; #endif clr = ri->ri_devcmap[(attr >> 16) & 0xf]; @@ -901,13 +911,15 @@ rasops_eraserows(cookie, row, num, attr) DELTA(dp, delta, int32_t *); } + + return 0; } /* * Actually turn the cursor on or off. This does the dirty work for * rasops_cursor(). */ -void +int rasops_do_cursor(ri) struct rasops_info *ri; { @@ -973,12 +985,14 @@ rasops_do_cursor(ri) *(int16_t *)dp ^= ~0; } } + + return 0; } /* * Erase columns. */ -void +int rasops_erasecols(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -992,7 +1006,7 @@ rasops_erasecols(cookie, row, col, num, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (col < 0) { num += col; @@ -1003,7 +1017,7 @@ rasops_erasecols(cookie, row, col, num, attr) num = ri->ri_cols - col; if (num <= 0) - return; + return 0; #endif num = num * ri->ri_xscale; @@ -1052,7 +1066,7 @@ rasops_erasecols(cookie, row, col, num, attr) } } - return; + return 0; } slop1 = (4 - ((long)rp & 3)) & 3; @@ -1102,6 +1116,8 @@ rasops_erasecols(cookie, row, col, num, attr) if (slop2 & 2) *(int16_t *)dp = clr; } + + return 0; } #if NRASOPS_ROTATION > 0 @@ -1186,7 +1202,7 @@ rasops_copychar(cookie, srcrow, dstrow, srccol, dstcol) } } -void +int rasops_putchar_rotated(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -1196,12 +1212,15 @@ rasops_putchar_rotated(cookie, row, col, uc, attr) struct rasops_info *ri; u_char *rp; int height; + int rc; ri = (struct rasops_info *)cookie; /* Do rotated char sans (side)underline */ - ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc, + rc = ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc, attr & ~1); + if (rc != 0) + return rc; /* Do rotated underline */ rp = ri->ri_bits + col * ri->ri_yscale + (ri->ri_rows - row - 1) * @@ -1217,9 +1236,11 @@ rasops_putchar_rotated(cookie, row, col, uc, attr) rp += ri->ri_stride; } } + + return 0; } -void +int rasops_erasecols_rotated(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -1227,15 +1248,21 @@ rasops_erasecols_rotated(cookie, row, col, num, attr) { struct rasops_info *ri; int i; + int rc; ri = (struct rasops_info *)cookie; - for (i = col; i < col + num; i++) - ri->ri_ops.putchar(cookie, row, i, ' ', attr); + for (i = col; i < col + num; i++) { + rc = ri->ri_ops.putchar(cookie, row, i, ' ', attr); + if (rc != 0) + return rc; + } + + return 0; } /* XXX: these could likely be optimised somewhat. */ -void +int rasops_copyrows_rotated(cookie, src, dst, num) void *cookie; int src, dst, num; @@ -1243,34 +1270,42 @@ rasops_copyrows_rotated(cookie, src, dst, num) struct rasops_info *ri = (struct rasops_info *)cookie; int col, roff; - if (src > dst) + if (src > dst) { for (roff = 0; roff < num; roff++) for (col = 0; col < ri->ri_cols; col++) rasops_copychar(cookie, src + roff, dst + roff, col, col); - else + } else { for (roff = num - 1; roff >= 0; roff--) for (col = 0; col < ri->ri_cols; col++) rasops_copychar(cookie, src + roff, dst + roff, col, col); + } + + return 0; } -void +int rasops_copycols_rotated(cookie, row, src, dst, num) void *cookie; int row, src, dst, num; { int coff; - if (src > dst) + if (src > dst) { for (coff = 0; coff < num; coff++) - rasops_copychar(cookie, row, row, src + coff, dst + coff); - else + rasops_copychar(cookie, row, row, src + coff, + dst + coff); + } else { for (coff = num - 1; coff >= 0; coff--) - rasops_copychar(cookie, row, row, src + coff, dst + coff); + rasops_copychar(cookie, row, row, src + coff, + dst + coff); + } + + return 0; } -void +int rasops_eraserows_rotated(cookie, row, num, attr) void *cookie; int row, num; @@ -1278,12 +1313,18 @@ rasops_eraserows_rotated(cookie, row, num, attr) { struct rasops_info *ri; int col, rn; + int rc; ri = (struct rasops_info *)cookie; for (rn = row; rn < row + num; rn++) - for (col = 0; col < ri->ri_cols; col++) - ri->ri_ops.putchar(cookie, rn, col, ' ', attr); + for (col = 0; col < ri->ri_cols; col++) { + rc = ri->ri_ops.putchar(cookie, rn, col, ' ', attr); + if (rc != 0) + return rc; + } + + return 0; } #endif /* NRASOPS_ROTATION */ diff --git a/sys/dev/rasops/rasops.h b/sys/dev/rasops/rasops.h index e6b58866a28..3848ab6f2da 100644 --- a/sys/dev/rasops/rasops.h +++ b/sys/dev/rasops/rasops.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.h,v 1.9 2008/06/26 05:42:17 ray Exp $ */ +/* $OpenBSD: rasops.h,v 1.10 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops.h,v 1.13 2000/06/13 13:36:54 ad Exp $ */ /*- @@ -105,7 +105,7 @@ struct rasops_info { int ri_caps; /* Callbacks so we can share some code */ - void (*ri_do_cursor)(struct rasops_info *); + int (*ri_do_cursor)(struct rasops_info *); void (*ri_updatecursor)(struct rasops_info *); #if NRASOPS_ROTATION > 0 @@ -145,8 +145,8 @@ void rasops32_init(struct rasops_info *); /* rasops.c */ int rasops_init(struct rasops_info *, int, int); int rasops_reconfig(struct rasops_info *, int, int); -void rasops_eraserows(void *, int, int, long); -void rasops_erasecols(void *, int, int, int, long); +int rasops_eraserows(void *, int, int, long); +int rasops_erasecols(void *, int, int, int, long); extern const u_char rasops_isgray[16]; extern const u_char rasops_cmap[256*3]; diff --git a/sys/dev/rasops/rasops1.c b/sys/dev/rasops/rasops1.c index 35c43b0c56a..bbca6a6369c 100644 --- a/sys/dev/rasops/rasops1.c +++ b/sys/dev/rasops/rasops1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops1.c,v 1.6 2008/06/26 05:42:17 ray Exp $ */ +/* $OpenBSD: rasops1.c,v 1.7 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops1.c,v 1.11 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -40,13 +40,13 @@ #include <dev/rasops/rasops.h> #include <dev/rasops/rasops_masks.h> -void rasops1_copycols(void *, int, int, int, int); -void rasops1_erasecols(void *, int, int, int, long); -void rasops1_do_cursor(struct rasops_info *); -void rasops1_putchar(void *, int, int col, u_int, long); +int rasops1_copycols(void *, int, int, int, int); +int rasops1_erasecols(void *, int, int, int, long); +int rasops1_do_cursor(struct rasops_info *); +int rasops1_putchar(void *, int, int col, u_int, long); #ifndef RASOPS_SMALL -void rasops1_putchar8(void *, int, int col, u_int, long); -void rasops1_putchar16(void *, int, int col, u_int, long); +int rasops1_putchar8(void *, int, int col, u_int, long); +int rasops1_putchar16(void *, int, int col, u_int, long); #endif /* @@ -82,7 +82,7 @@ rasops1_init(ri) /* * Paint a single character. This is the generic version, this is ugly. */ -void +int rasops1_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -100,10 +100,10 @@ rasops1_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif col *= ri->ri_font->fontwidth; @@ -224,13 +224,15 @@ rasops1_putchar(cookie, row, col, uc, attr) rp[1] = (rp[1] & rmask) | (fg & ~rmask); } } + + return 0; } #ifndef RASOPS_SMALL /* * Paint a single character. This is for 8-pixel wide fonts. */ -void +int rasops1_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -246,10 +248,10 @@ rasops1_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -290,12 +292,14 @@ rasops1_putchar8(cookie, row, col, uc, attr) /* Do underline */ if ((attr & 1) != 0) rp[-(ri->ri_stride << 1)] = fg; + + return 0; } /* * Paint a single character. This is for 16-pixel wide fonts. */ -void +int rasops1_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -311,10 +315,10 @@ rasops1_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -356,6 +360,8 @@ rasops1_putchar16(cookie, row, col, uc, attr) /* Do underline */ if ((attr & 1) != 0) *(int16_t *)(rp - (ri->ri_stride << 1)) = fg; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops15.c b/sys/dev/rasops/rasops15.c index a344769ef0b..66a2dc95ea4 100644 --- a/sys/dev/rasops/rasops15.c +++ b/sys/dev/rasops/rasops15.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops15.c,v 1.6 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops15.c,v 1.7 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops15.c,v 1.7 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -38,11 +38,11 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops15_putchar(void *, int, int, u_int, long attr); +int rasops15_putchar(void *, int, int, u_int, long attr); #ifndef RASOPS_SMALL -void rasops15_putchar8(void *, int, int, u_int, long attr); -void rasops15_putchar12(void *, int, int, u_int, long attr); -void rasops15_putchar16(void *, int, int, u_int, long attr); +int rasops15_putchar8(void *, int, int, u_int, long attr); +int rasops15_putchar12(void *, int, int, u_int, long attr); +int rasops15_putchar16(void *, int, int, u_int, long attr); void rasops15_makestamp(struct rasops_info *, long); /* @@ -105,7 +105,7 @@ rasops15_init(ri) /* * Paint a single character. */ -void +int rasops15_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -121,10 +121,10 @@ rasops15_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -173,6 +173,8 @@ rasops15_putchar(cookie, row, col, uc, attr) rp += 2; } } + + return 0; } #ifndef RASOPS_SMALL @@ -209,7 +211,7 @@ rasops15_makestamp(ri, attr) /* * Paint a single character. This is for 8-pixel wide fonts. */ -void +int rasops15_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -224,8 +226,7 @@ rasops15_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops15_putchar(cookie, row, col, uc, attr); - return; + return rasops15_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -233,12 +234,12 @@ rasops15_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -283,12 +284,14 @@ rasops15_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Paint a single character. This is for 12-pixel wide fonts. */ -void +int rasops15_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -303,8 +306,7 @@ rasops15_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops15_putchar(cookie, row, col, uc, attr); - return; + return rasops15_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -312,12 +314,12 @@ rasops15_putchar12(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -366,12 +368,14 @@ rasops15_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Paint a single character. This is for 16-pixel wide fonts. */ -void +int rasops15_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -386,8 +390,7 @@ rasops15_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops15_putchar(cookie, row, col, uc, attr); - return; + return rasops15_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -395,12 +398,12 @@ rasops15_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -455,5 +458,7 @@ rasops15_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops2.c b/sys/dev/rasops/rasops2.c index 29d50162a8f..1b2546aedf9 100644 --- a/sys/dev/rasops/rasops2.c +++ b/sys/dev/rasops/rasops2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops2.c,v 1.8 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops2.c,v 1.9 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops2.c,v 1.5 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -40,15 +40,15 @@ #include <dev/rasops/rasops.h> #include <dev/rasops/rasops_masks.h> -void rasops2_copycols(void *, int, int, int, int); -void rasops2_erasecols(void *, int, int, int, long); -void rasops2_do_cursor(struct rasops_info *); -void rasops2_putchar(void *, int, int col, u_int, long); +int rasops2_copycols(void *, int, int, int, int); +int rasops2_erasecols(void *, int, int, int, long); +int rasops2_do_cursor(struct rasops_info *); +int rasops2_putchar(void *, int, int col, u_int, long); u_int rasops2_mergebits(u_char *, int, int); #ifndef RASOPS_SMALL -void rasops2_putchar8(void *, int, int col, u_int, long); -void rasops2_putchar12(void *, int, int col, u_int, long); -void rasops2_putchar16(void *, int, int col, u_int, long); +int rasops2_putchar8(void *, int, int col, u_int, long); +int rasops2_putchar12(void *, int, int col, u_int, long); +int rasops2_putchar16(void *, int, int col, u_int, long); void rasops2_makestamp(struct rasops_info *, long); /* @@ -116,7 +116,7 @@ rasops2_mergebits(u_char *fr, int fg, int bg) /* * Paint a single character. This is the generic version, this is ugly. */ -void +int rasops2_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -134,10 +134,10 @@ rasops2_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif width = ri->ri_font->fontwidth << 1; @@ -225,6 +225,8 @@ rasops2_putchar(cookie, row, col, uc, attr) rp[1] = (rp[1] & rmask) | (fg & ~rmask); } } + + return 0; } #ifndef RASOPS_SMALL @@ -253,7 +255,7 @@ rasops2_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops2_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -267,8 +269,7 @@ rasops2_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops2_putchar(cookie, row, col, uc, attr); - return; + return rasops2_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -277,12 +278,12 @@ rasops2_putchar8(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -318,12 +319,14 @@ rasops2_putchar8(cookie, row, col, uc, attr) *(int16_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops2_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -337,8 +340,7 @@ rasops2_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops2_putchar(cookie, row, col, uc, attr); - return; + return rasops2_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -347,12 +349,12 @@ rasops2_putchar12(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -391,12 +393,14 @@ rasops2_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops2_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -410,8 +414,7 @@ rasops2_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops2_putchar(cookie, row, col, uc, attr); - return; + return rasops2_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -420,12 +423,12 @@ rasops2_putchar16(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -463,6 +466,8 @@ rasops2_putchar16(cookie, row, col, uc, attr) *(int32_t *)(rp - (ri->ri_stride << 1)) = stamp[15]; stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops24.c b/sys/dev/rasops/rasops24.c index 63b3ea84174..0847f7295fb 100644 --- a/sys/dev/rasops/rasops24.c +++ b/sys/dev/rasops/rasops24.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops24.c,v 1.7 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops24.c,v 1.8 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops24.c,v 1.12 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -40,13 +40,13 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops24_erasecols(void *, int, int, int, long); -void rasops24_eraserows(void *, int, int, long); -void rasops24_putchar(void *, int, int, u_int, long attr); +int rasops24_erasecols(void *, int, int, int, long); +int rasops24_eraserows(void *, int, int, long); +int rasops24_putchar(void *, int, int, u_int, long attr); #ifndef RASOPS_SMALL -void rasops24_putchar8(void *, int, int, u_int, long attr); -void rasops24_putchar12(void *, int, int, u_int, long attr); -void rasops24_putchar16(void *, int, int, u_int, long attr); +int rasops24_putchar8(void *, int, int, u_int, long attr); +int rasops24_putchar12(void *, int, int, u_int, long attr); +int rasops24_putchar16(void *, int, int, u_int, long attr); void rasops24_makestamp(struct rasops_info *, long); /* @@ -112,7 +112,7 @@ rasops24_init(ri) * Put a single character. This is the generic version. * XXX this bites - we should use masks. */ -void +int rasops24_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -128,10 +128,10 @@ rasops24_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -187,6 +187,8 @@ rasops24_putchar(cookie, row, col, uc, attr) *rp++ = clr[1]; } } + + return 0; } #ifndef RASOPS_SMALL @@ -236,7 +238,7 @@ rasops24_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops24_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -251,8 +253,7 @@ rasops24_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops24_putchar(cookie, row, col, uc, attr); - return; + return rasops24_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -260,12 +261,12 @@ rasops24_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -312,12 +313,14 @@ rasops24_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops24_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -332,8 +335,7 @@ rasops24_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops24_putchar(cookie, row, col, uc, attr); - return; + return rasops24_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -341,12 +343,12 @@ rasops24_putchar12(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -400,12 +402,14 @@ rasops24_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops24_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -420,8 +424,7 @@ rasops24_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops24_putchar(cookie, row, col, uc, attr); - return; + return rasops24_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -429,12 +432,12 @@ rasops24_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -495,13 +498,15 @@ rasops24_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ /* * Erase rows. This is nice and easy due to alignment. */ -void +int rasops24_eraserows(cookie, row, num, attr) void *cookie; int row, num; @@ -515,10 +520,8 @@ rasops24_eraserows(cookie, row, num, attr) * If the color is gray, we can cheat and use the generic routines * (which are faster, hopefully) since the r,g,b values are the same. */ - if ((attr & 4) != 0) { - rasops_eraserows(cookie, row, num, attr); - return; - } + if ((attr & 4) != 0) + return rasops_eraserows(cookie, row, num, attr); ri = (struct rasops_info *)cookie; @@ -532,7 +535,7 @@ rasops24_eraserows(cookie, row, num, attr) num = ri->ri_rows - row; if (num <= 0) - return; + return 0; #endif clr = ri->ri_devcmap[(attr >> 16) & 0xf] & 0xffffff; @@ -600,12 +603,14 @@ rasops24_eraserows(cookie, row, num, attr) DELTA(dp, delta, int32_t *); } + + return 0; } /* * Erase columns. */ -void +int rasops24_erasecols(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -620,17 +625,15 @@ rasops24_erasecols(cookie, row, col, num, attr) * If the color is gray, we can cheat and use the generic routines * (which are faster, hopefully) since the r,g,b values are the same. */ - if ((attr & 4) != 0) { - rasops_erasecols(cookie, row, col, num, attr); - return; - } + if ((attr & 4) != 0) + return rasops_erasecols(cookie, row, col, num, attr); ri = (struct rasops_info *)cookie; #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (col < 0) { num += col; @@ -641,7 +644,7 @@ rasops24_erasecols(cookie, row, col, num, attr) num = ri->ri_cols - col; if (num <= 0) - return; + return 0; #endif rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); @@ -721,4 +724,6 @@ rasops24_erasecols(cookie, row, col, num, attr) *dbp++ = clr; } } + + return 0; } diff --git a/sys/dev/rasops/rasops32.c b/sys/dev/rasops/rasops32.c index fb299b446b4..7884b9dd094 100644 --- a/sys/dev/rasops/rasops32.c +++ b/sys/dev/rasops/rasops32.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops32.c,v 1.5 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops32.c,v 1.6 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops32.c,v 1.7 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -38,7 +38,7 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops32_putchar(void *, int, int, u_int, long); +int rasops32_putchar(void *, int, int, u_int, long); /* * Initialize a 'rasops_info' descriptor for this depth. @@ -63,7 +63,7 @@ rasops32_init(ri) /* * Paint a single character. */ -void +int rasops32_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -80,10 +80,10 @@ rasops32_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); @@ -128,4 +128,6 @@ rasops32_putchar(cookie, row, col, uc, attr) while (width--) *rp++ = clr[1]; } + + return 0; } diff --git a/sys/dev/rasops/rasops4.c b/sys/dev/rasops/rasops4.c index cbd773b7202..856bb20117b 100644 --- a/sys/dev/rasops/rasops4.c +++ b/sys/dev/rasops/rasops4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops4.c,v 1.8 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops4.c,v 1.9 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops4.c,v 1.4 2001/11/15 09:48:15 lukem Exp $ */ /*- @@ -40,14 +40,14 @@ #include <dev/rasops/rasops.h> #include <dev/rasops/rasops_masks.h> -void rasops4_copycols(void *, int, int, int, int); -void rasops4_erasecols(void *, int, int, int, long); -void rasops4_do_cursor(struct rasops_info *); -void rasops4_putchar(void *, int, int col, u_int, long); +int rasops4_copycols(void *, int, int, int, int); +int rasops4_erasecols(void *, int, int, int, long); +int rasops4_do_cursor(struct rasops_info *); +int rasops4_putchar(void *, int, int col, u_int, long); #ifndef RASOPS_SMALL -void rasops4_putchar8(void *, int, int col, u_int, long); -void rasops4_putchar12(void *, int, int col, u_int, long); -void rasops4_putchar16(void *, int, int col, u_int, long); +int rasops4_putchar8(void *, int, int col, u_int, long); +int rasops4_putchar12(void *, int, int col, u_int, long); +int rasops4_putchar16(void *, int, int col, u_int, long); void rasops4_makestamp(struct rasops_info *, long); /* @@ -96,7 +96,7 @@ rasops4_init(ri) /* * Paint a single character. This is the generic version, this is ugly. */ -void +int rasops4_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -113,10 +113,10 @@ rasops4_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif width = ri->ri_font->fontwidth << 1; @@ -205,13 +205,15 @@ rasops4_putchar(cookie, row, col, uc, attr) rp[1] = (rp[1] & rmask) | (fg & ~rmask); } } + + return 0; } #endif /* * Put a single character. This is the generic version. */ -void +int rasops4_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -220,6 +222,7 @@ rasops4_putchar(cookie, row, col, uc, attr) { /* XXX punt */ + return (EAGAIN); } #ifndef RASOPS_SMALL @@ -255,7 +258,7 @@ rasops4_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops4_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -270,8 +273,7 @@ rasops4_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops4_putchar(cookie, row, col, uc, attr); - return; + return rasops4_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -280,12 +282,12 @@ rasops4_putchar8(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -325,12 +327,14 @@ rasops4_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops4_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -345,8 +349,7 @@ rasops4_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops4_putchar(cookie, row, col, uc, attr); - return; + return rasops4_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -355,12 +358,12 @@ rasops4_putchar12(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -403,12 +406,14 @@ rasops4_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops4_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -423,8 +428,7 @@ rasops4_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops4_putchar(cookie, row, col, uc, attr); - return; + return rasops4_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -433,12 +437,12 @@ rasops4_putchar16(cookie, row, col, uc, attr) /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -484,6 +488,8 @@ rasops4_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops8.c b/sys/dev/rasops/rasops8.c index 87e580f3fbb..4a728c2a7c9 100644 --- a/sys/dev/rasops/rasops8.c +++ b/sys/dev/rasops/rasops8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops8.c,v 1.8 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops8.c,v 1.9 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops8.c,v 1.8 2000/04/12 14:22:29 pk Exp $ */ /*- @@ -38,11 +38,11 @@ #include <dev/wscons/wsconsio.h> #include <dev/rasops/rasops.h> -void rasops8_putchar(void *, int, int, u_int, long attr); +int rasops8_putchar(void *, int, int, u_int, long attr); #ifndef RASOPS_SMALL -void rasops8_putchar8(void *, int, int, u_int, long attr); -void rasops8_putchar12(void *, int, int, u_int, long attr); -void rasops8_putchar16(void *, int, int, u_int, long attr); +int rasops8_putchar8(void *, int, int, u_int, long attr); +int rasops8_putchar12(void *, int, int, u_int, long attr); +int rasops8_putchar16(void *, int, int, u_int, long attr); void rasops8_makestamp(struct rasops_info *ri, long); /* @@ -93,7 +93,7 @@ rasops8_init(ri) /* * Put a single character. */ -void +int rasops8_putchar(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -109,10 +109,10 @@ rasops8_putchar(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING /* Catches 'row < 0' case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if ((unsigned)col >= (unsigned)ri->ri_cols) - return; + return 0; #endif rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale; @@ -158,6 +158,8 @@ rasops8_putchar(cookie, row, col, uc, attr) while (width--) *rp++ = c; } + + return 0; } #ifndef RASOPS_SMALL @@ -198,7 +200,7 @@ rasops8_makestamp(ri, attr) /* * Put a single character. This is for 8-pixel wide fonts. */ -void +int rasops8_putchar8(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -213,8 +215,7 @@ rasops8_putchar8(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops8_putchar(cookie, row, col, uc, attr); - return; + return rasops8_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -222,12 +223,12 @@ rasops8_putchar8(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -264,12 +265,14 @@ rasops8_putchar8(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 12-pixel wide fonts. */ -void +int rasops8_putchar12(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -284,8 +287,7 @@ rasops8_putchar12(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops8_putchar(cookie, row, col, uc, attr); - return; + return rasops8_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -293,12 +295,12 @@ rasops8_putchar12(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -338,12 +340,14 @@ rasops8_putchar12(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } /* * Put a single character. This is for 16-pixel wide fonts. */ -void +int rasops8_putchar16(cookie, row, col, uc, attr) void *cookie; int row, col; @@ -358,8 +362,7 @@ rasops8_putchar16(cookie, row, col, uc, attr) /* Can't risk remaking the stamp if it's already in use */ if (stamp_mutex++) { stamp_mutex--; - rasops8_putchar(cookie, row, col, uc, attr); - return; + return rasops8_putchar(cookie, row, col, uc, attr); } ri = (struct rasops_info *)cookie; @@ -367,12 +370,12 @@ rasops8_putchar16(cookie, row, col, uc, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) { stamp_mutex--; - return; + return 0; } if ((unsigned)col >= (unsigned)ri->ri_cols) { stamp_mutex--; - return; + return 0; } #endif @@ -409,5 +412,7 @@ rasops8_putchar16(cookie, row, col, uc, attr) } stamp_mutex--; + + return 0; } #endif /* !RASOPS_SMALL */ diff --git a/sys/dev/rasops/rasops_bitops.h b/sys/dev/rasops/rasops_bitops.h index 0c209104ce2..77206aae4ab 100644 --- a/sys/dev/rasops/rasops_bitops.h +++ b/sys/dev/rasops/rasops_bitops.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops_bitops.h,v 1.4 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: rasops_bitops.h,v 1.5 2009/09/05 14:09:35 miod Exp $ */ /* $NetBSD: rasops_bitops.h,v 1.6 2000/04/12 14:22:30 pk Exp $ */ /*- @@ -36,7 +36,7 @@ /* * Erase columns. */ -void +int NAME(erasecols)(cookie, row, col, num, attr) void *cookie; int row, col, num; @@ -51,7 +51,7 @@ NAME(erasecols)(cookie, row, col, num, attr) #ifdef RASOPS_CLIPPING if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (col < 0) { num += col; @@ -62,7 +62,7 @@ NAME(erasecols)(cookie, row, col, num, attr) num = ri->ri_cols - col; if (num <= 0) - return; + return 0; #endif col *= ri->ri_font->fontwidth << PIXEL_SHIFT; num *= ri->ri_font->fontwidth << PIXEL_SHIFT; @@ -108,12 +108,14 @@ NAME(erasecols)(cookie, row, col, num, attr) *dp = (*dp & rmask) | rclr; } } + + return 0; } /* * Actually paint the cursor. */ -void +int NAME(do_cursor)(ri) struct rasops_info *ri; { @@ -149,12 +151,14 @@ NAME(do_cursor)(ri) *dp ^= rmask; } } + + return 0; } /* * Copy columns. Ick! */ -void +int NAME(copycols)(cookie, row, src, dst, num) void *cookie; int row, src, dst, num; @@ -167,11 +171,11 @@ NAME(copycols)(cookie, row, src, dst, num) #ifdef RASOPS_CLIPPING if (dst == src) - return; + return 0; /* Catches < 0 case too */ if ((unsigned)row >= (unsigned)ri->ri_rows) - return; + return 0; if (src < 0) { num += src; @@ -190,7 +194,7 @@ NAME(copycols)(cookie, row, src, dst, num) num = ri->ri_cols - dst; if (num <= 0) - return; + return 0; #endif cnt = ri->ri_font->fontwidth << PIXEL_SHIFT; @@ -214,7 +218,7 @@ NAME(copycols)(cookie, row, src, dst, num) DELTA(drp, ri->ri_stride, int32_t *); } - return; + return 0; } lmask = rasops_rmask[db]; @@ -308,6 +312,8 @@ NAME(copycols)(cookie, row, src, dst, num) } } } + + return 0; } #endif /* _RASOPS_BITOPS_H_ */ |