summaryrefslogtreecommitdiff
path: root/sys/dev/rasops/rasops2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/rasops/rasops2.c')
-rw-r--r--sys/dev/rasops/rasops2.c57
1 files changed, 31 insertions, 26 deletions
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 */