Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/rasops - New option (RASOPS_SMALL) for the tight-fis...



details:   https://anonhg.NetBSD.org/src/rev/185f4e9e75cf
branches:  trunk
changeset: 477600:185f4e9e75cf
user:      ad <ad%NetBSD.org@localhost>
date:      Sat Oct 23 23:14:13 1999 +0000

description:
- New option (RASOPS_SMALL) for the tight-fisted.
- Don't use int32_t/u_int32_t unless we must.
- Remove C++ single line comment delimeters that crept in.
- Remove defs pertaining to byte granularity 'ragged-edge' bitmasks.
- Move all declarations of per-depth initialization functions to rasops.h.
- Other minor cleanup.

diffstat:

 sys/dev/rasops/files.rasops    |    4 +-
 sys/dev/rasops/rasops.c        |   49 +++-----------
 sys/dev/rasops/rasops.h        |   10 ++-
 sys/dev/rasops/rasops1.c       |   32 +++++----
 sys/dev/rasops/rasops15.c      |   25 +++----
 sys/dev/rasops/rasops2.c       |   75 +++++++++++-----------
 sys/dev/rasops/rasops24.c      |  131 +++++++++++++++++++---------------------
 sys/dev/rasops/rasops32.c      |   13 +--
 sys/dev/rasops/rasops8.c       |   35 +++++-----
 sys/dev/rasops/rasops_bitops.h |   22 +++---
 sys/dev/rasops/rasops_masks.c  |   15 +----
 sys/dev/rasops/rasops_masks.h  |    6 +-
 12 files changed, 185 insertions(+), 232 deletions(-)

diffs (truncated from 1308 to 300 lines):

diff -r fe8b819d5124 -r 185f4e9e75cf sys/dev/rasops/files.rasops
--- a/sys/dev/rasops/files.rasops       Sat Oct 23 23:00:06 1999 +0000
+++ b/sys/dev/rasops/files.rasops       Sat Oct 23 23:14:13 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.rasops,v 1.4 1999/06/05 10:42:11 pk Exp $
+#      $NetBSD: files.rasops,v 1.5 1999/10/23 23:14:13 ad Exp $
 
 define rasops1
 define rasops2
@@ -23,4 +23,4 @@
 file dev/rasops/rasops24.c ((rasterconsole | wsdisplay) & rasops24)
 file dev/rasops/rasops32.c ((rasterconsole | wsdisplay) & rasops32)
 
-defopt opt_rasops.h    RASOPS_CLIPPING
+defopt opt_rasops.h    RASOPS_CLIPPING RASOPS_SMALL
diff -r fe8b819d5124 -r 185f4e9e75cf sys/dev/rasops/rasops.c
--- a/sys/dev/rasops/rasops.c   Sat Oct 23 23:00:06 1999 +0000
+++ b/sys/dev/rasops/rasops.c   Sat Oct 23 23:14:13 1999 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rasops.c,v 1.19 1999/10/04 22:52:13 ad Exp $ */
+/*      $NetBSD: rasops.c,v 1.20 1999/10/23 23:14:13 ad Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.19 1999/10/04 22:52:13 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.20 1999/10/23 23:14:13 ad Exp $");
 
 #include "opt_rasops.h"
 #include "rasops_glue.h"
@@ -97,14 +97,6 @@
 static void    rasops_do_cursor __P((struct rasops_info *));
 static void    rasops_init_devcmap __P((struct rasops_info *));
 
-/* Per-depth initalization functions */
-void   rasops1_init __P((struct rasops_info *));
-void   rasops2_init __P((struct rasops_info *));
-void   rasops8_init __P((struct rasops_info *));
-void   rasops15_init __P((struct rasops_info *));
-void   rasops24_init __P((struct rasops_info *));
-void   rasops32_init __P((struct rasops_info *));
-
 /*
  * Initalize a 'rasops_info' descriptor.
  */
@@ -113,6 +105,7 @@
        struct rasops_info *ri;
        int wantrows, wantcols;
 {
+
 #ifdef _KERNEL 
        /* Select a font if the caller doesn't care */
        if (ri->ri_font == NULL) {
@@ -164,7 +157,6 @@
        return (0);
 }
 
-
 /*
  * Reconfigure (because parameters have changed in some way).
  */
@@ -173,8 +165,7 @@
        struct rasops_info *ri;
        int wantrows, wantcols;
 {
-       int bpp;
-       int s;
+       int bpp, s;
        
        s = splhigh();
                
@@ -205,7 +196,7 @@
                ri->ri_emuheight = ri->ri_height;
        
        /* Reduce width until aligned on a 32-bit boundary */
-       while ((ri->ri_emuwidth*bpp & 31) != 0)
+       while ((ri->ri_emuwidth * bpp & 31) != 0)
                ri->ri_emuwidth--;
        
        ri->ri_cols = ri->ri_emuwidth / ri->ri_font->fontwidth;
@@ -265,38 +256,33 @@
        }
 
        switch (ri->ri_depth) {
-#if NRASOPS1
+#if NRASOPS1 > 0
        case 1:
                rasops1_init(ri);
                break;
 #endif
-
-#if NRASOPS2
+#if NRASOPS2 > 0
        case 2:
                rasops2_init(ri);
                break;
 #endif
-
-#if NRASOPS8
+#if NRASOPS8 > 0
        case 8:
                rasops8_init(ri);
                break;
 #endif
-
-#if NRASOPS15 || NRASOPS16
+#if NRASOPS15 > 0 || NRASOPS16 > 0
        case 15:
        case 16:
                rasops15_init(ri);
                break;
 #endif
-
-#if NRASOPS24
+#if NRASOPS24 > 0
        case 24:
                rasops24_init(ri);
                break;
 #endif
-
-#if NRASOPS32
+#if NRASOPS32 > 0
        case 32:
                rasops32_init(ri);
                break;
@@ -312,7 +298,6 @@
        return (0);
 }
 
-
 /*
  * Map a character.
  */
@@ -345,7 +330,6 @@
        return (5);
 }
 
-
 /*
  * Allocate a color attribute.
  */
@@ -385,7 +369,6 @@
        return (0);
 }
 
-
 /*
  * Allocate a mono attribute.
  */
@@ -413,7 +396,6 @@
        return (0);
 }
 
-
 /*
  * Copy rows.
  */
@@ -492,7 +474,6 @@
        }
 }
 
-
 /*
  * Copy columns. This is slow, and hard to optimize due to alignment,
  * and the fact that we have to copy both left->right and right->left.
@@ -552,7 +533,6 @@
        }
 }
 
-
 /*
  * Turn cursor off/on.
  */
@@ -594,7 +574,6 @@
                ri->ri_flg &= ~RI_CURSOR;
 }
 
-
 /*
  * Make the device colormap
  */
@@ -663,7 +642,6 @@
        }
 }
 
-
 /*
  * Unpack a rasops attribute
  */
@@ -678,7 +656,6 @@
        *underline = (u_int)attr & 1;
 }
 
-
 /*
  * Erase rows. This isn't static, since 24-bpp uses it in special cases.
  */
@@ -710,7 +687,7 @@
        clr = ri->ri_devcmap[(attr >> 16) & 15];
 
        /* 
-        * XXX the wsdisplay_emulops interface seems a little deficient in
+        * XXX The wsdisplay_emulops interface seems a little deficient in
         * that there is no way to clear the *entire* screen. We provide a 
         * workaround here: if the entire console area is being cleared, and 
         * the RI_FULLCLEAR flag is set, clear the entire display.
@@ -751,7 +728,6 @@
        }
 }
 
-
 /*
  * Actually turn the cursor on or off. This does the dirty work for
  * rasops_cursor().
@@ -817,7 +793,6 @@
        }
 }
 
-
 /*
  * Erase columns.
  */
diff -r fe8b819d5124 -r 185f4e9e75cf sys/dev/rasops/rasops.h
--- a/sys/dev/rasops/rasops.h   Sat Oct 23 23:00:06 1999 +0000
+++ b/sys/dev/rasops/rasops.h   Sat Oct 23 23:14:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rasops.h,v 1.7 1999/08/24 11:07:32 ad Exp $ */
+/*     $NetBSD: rasops.h,v 1.8 1999/10/23 23:14:13 ad Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -122,6 +122,14 @@
  * to -1 (or a new, valid cookie).
  */
 
+/* Per-depth initalization functions */
+void   rasops1_init __P((struct rasops_info *));
+void   rasops2_init __P((struct rasops_info *));
+void   rasops8_init __P((struct rasops_info *));
+void   rasops15_init __P((struct rasops_info *));
+void   rasops24_init __P((struct rasops_info *));
+void   rasops32_init __P((struct rasops_info *));
+
 /* rasops.c */
 int    rasops_init __P((struct rasops_info *, int, int));
 int    rasops_reconfig __P((struct rasops_info *, int, int));
diff -r fe8b819d5124 -r 185f4e9e75cf sys/dev/rasops/rasops1.c
--- a/sys/dev/rasops/rasops1.c  Sat Oct 23 23:00:06 1999 +0000
+++ b/sys/dev/rasops/rasops1.c  Sat Oct 23 23:14:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rasops1.c,v 1.9 1999/08/31 10:11:52 ad Exp $ */
+/*     $NetBSD: rasops1.c,v 1.10 1999/10/23 23:14:13 ad Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include "opt_rasops.h"
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops1.c,v 1.9 1999/08/31 10:11:52 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops1.c,v 1.10 1999/10/23 23:14:13 ad Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -51,14 +51,14 @@
 #include <dev/rasops/rasops.h>
 #include <dev/rasops/rasops_masks.h>
 
-static void    rasops1_putchar __P((void *, int, int col, u_int, long));
-static void    rasops1_putchar8 __P((void *, int, int col, u_int, long));
-static void    rasops1_putchar16 __P((void *, int, int col, u_int, long));
 static void    rasops1_copycols __P((void *, int, int, int, int));
 static void    rasops1_erasecols __P((void *, int, int, int, long));
 static void    rasops1_do_cursor __P((struct rasops_info *));
-
-void   rasops1_init __P((struct rasops_info *ri));
+static void    rasops1_putchar __P((void *, int, int col, u_int, long));
+#ifndef RASOPS_SMALL
+static void    rasops1_putchar8 __P((void *, int, int col, u_int, long));
+static void    rasops1_putchar16 __P((void *, int, int col, u_int, long));
+#endif
 
 /*
  * Initalize rasops_info struct for this colordepth.
@@ -69,12 +69,14 @@
 {
 
        switch (ri->ri_font->fontwidth) {
+#ifndef RASOPS_SMALL
        case 8:
                ri->ri_ops.putchar = rasops1_putchar8;
                break;
        case 16:
                ri->ri_ops.putchar = rasops1_putchar16;
                break;
+#endif
        default:



Home | Main Index | Thread Index | Old Index