Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/rasops Add diagnostic measures to check for missing ...



details:   https://anonhg.NetBSD.org/src/rev/09bc27f4159c
branches:  trunk
changeset: 472980:09bc27f4159c
user:      ad <ad%NetBSD.org@localhost>
date:      Sat May 15 12:56:46 1999 +0000

description:
Add diagnostic measures to check for missing font.

diffstat:

 sys/dev/rasops/rasops.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r b581a2e0b5f7 -r 09bc27f4159c sys/dev/rasops/rasops.c
--- a/sys/dev/rasops/rasops.c   Sat May 15 12:54:53 1999 +0000
+++ b/sys/dev/rasops/rasops.c   Sat May 15 12:56:46 1999 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rasops.c,v 1.7 1999/05/15 12:54:53 ad Exp $ */
+/*      $NetBSD: rasops.c,v 1.8 1999/05/15 12:56:46 ad Exp $ */
 
 /*
  * Copyright (c) 1999 Andy Doran <ad%NetBSD.org@localhost>
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.7 1999/05/15 12:54:53 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.8 1999/05/15 12:56:46 ad Exp $");
 
 #include "rasops_glue.h"
 
@@ -116,11 +116,15 @@
                }
                
                if (wsfont_lock(cookie, &ri->ri_font, 
-                   WSFONT_L2R, WSFONT_L2R) < 0) {
+                   WSFONT_L2R, WSFONT_L2R) <= 0) {
                        printf("rasops_init: couldn't lock font\n");
                        return (-1);
                }
-               
+
+#ifdef DIAGNOSTIC      
+               if (ri->ri_font == NULL)
+                       panic("rasops_init: locked font, but got no pointer\n");
+#endif         
                ri->ri_wsfcookie = cookie;
        }
 #endif
@@ -307,6 +311,11 @@
        struct rasops_info *ri;
        
        ri = (struct rasops_info *)cookie;
+
+#ifdef DIAGNOSTIC      
+       if (ri->ri_font == NULL)
+               panic("rasops_mapchar: no font selected\n");
+#endif         
        
        if (c < ri->ri_font->firstchar) {
                *cp = ' ';



Home | Main Index | Thread Index | Old Index