diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-14 06:22:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-14 06:22:36 +0000 |
commit | b89bbbe579d3fc7a669fa8f7716d1c3b7468db61 (patch) | |
tree | 748a2d0818c5ab2c6cf58c009da67b865979c594 /sys/dev/rcons/raster_text.c | |
parent | e02b3f5aa9c6fa8276491de78f1f08032d57fbbc (diff) |
from netbsd:
Make it work on little-endian monochrome buffers; per Ted.
Must change `u_long' to `u_int32_t' as Jason pointed out.
since 'long's in this code are meant to be exactly 32-bits wide, use
'int32_t's instead, so that this code is usable on the alpha.
Diffstat (limited to 'sys/dev/rcons/raster_text.c')
-rw-r--r-- | sys/dev/rcons/raster_text.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/rcons/raster_text.c b/sys/dev/rcons/raster_text.c index d77b1f69a1a..ec0e140728d 100644 --- a/sys/dev/rcons/raster_text.c +++ b/sys/dev/rcons/raster_text.c @@ -1,4 +1,4 @@ -/* $NetBSD: raster_text.c,v 1.2 1995/10/04 23:57:22 pk Exp $ */ +/* $NetBSD: raster_text.c,v 1.3 1995/11/24 23:50:56 cgd Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -45,6 +45,7 @@ #ifdef _KERNEL #include <sys/param.h> +#include <sys/systm.h> #include <dev/rcons/raster.h> #ifdef COLORFONT_CACHE #include <sys/malloc.h> @@ -52,14 +53,14 @@ #endif #else #include <sys/types.h> -#include <dev/rcons/raster.h> +#include <string.h> +#include "raster.h" #ifdef COLORFONT_CACHE #include <malloc.h> #define NEW(size) malloc(size) #endif #endif - /* Draws text. Returns 0 on success, -1 on failure. */ int raster_text( r, x, y, rop, rf, text ) @@ -234,7 +235,7 @@ raster_alloc( width, height, depth ) return (struct raster*) 0; linelongs = ( ( width * depth + 31 ) >> 5 ); r = (struct raster*) - NEW( sizeof(struct raster) + height * linelongs * sizeof(u_long)); + NEW( sizeof(struct raster) + height * linelongs * sizeof(u_int32_t)); if ( r == (struct raster*) 0 ) return (struct raster*) 0; @@ -242,7 +243,7 @@ raster_alloc( width, height, depth ) r->height = height; r->depth = depth; r->linelongs = linelongs; - r->pixels = (u_long*) (r + 1); + r->pixels = (u_int32_t*) (r + 1); r->data = (caddr_t) 0; return r; } |