From gordont@proving-ground.sd.bluemt.net  Wed Nov  8 17:42:42 2000
Return-Path: <gordont@proving-ground.sd.bluemt.net>
Received: from proving-ground.sd.bluemt.net (dhcp76-36.sd.bmarts.com [209.247.76.36])
	by hub.freebsd.org (Postfix) with ESMTP id AF2ED37B479
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Nov 2000 17:42:40 -0800 (PST)
Received: (from gordont@localhost)
	by proving-ground.sd.bluemt.net (8.11.1/8.11.1) id eA91pxU22302;
	Wed, 8 Nov 2000 17:51:59 -0800 (PST)
	(envelope-from gordont)
Message-Id: <200011090151.eA91pxU22302@proving-ground.sd.bluemt.net>
Date: Wed, 8 Nov 2000 17:51:59 -0800 (PST)
From: gordont@bluemntn.net
Sender: gordont@proving-ground.sd.bluemt.net
Reply-To: gordont@bluemtn.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: daemon_saver.c fails compile with -Wall -Werror <Synopsis of the problem (one line)>
X-Send-Pr-Version: 3.2

>Number:         22709
>Category:       kern
>Synopsis:       daemon_saver.c fails compile with -Wall -Werror
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yokota
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 08 17:50:01 PST 2000
>Closed-Date:    Fri Jul 20 08:02:42 PDT 2001
>Last-Modified:  Fri Jul 20 08:04:09 PDT 2001
>Originator:     Gordon Tetlow
>Release:        FreeBSD 4.2-BETA i386
>Organization:
Blue Mountain 
>Environment:

	
	N/A

>Description:

	
	There are char's used as array indices causing the compiler
	to throw an warning (or error when compiled with -Werror).

>How-To-Repeat:

	
	(Assuming a Bourne Shell)
	cd /usr/src/sys/modules/syscons/daemon
	CC='cc -Wall -Werror' make

>Fix:

	
I know this is really trivial but I figured it doesn't hurt to fix the code.
I'm not an expert coder (nor do I know C that well) but I'm trying to give
back and maybe learn a thing or two.

-gordon

--- daemon_saver.c.orig	Wed Nov  8 17:33:53 2000
+++ daemon_saver.c	Wed Nov  8 17:35:34 2000
@@ -174,14 +174,14 @@
 				sc_vtb_putc(&sc->cur_scp->scr,
 					    (ypos + y)*sc->cur_scp->xsize
 						 + xpos + x,
-					    sc->scr_map[daemon_pic[y][px]],
+					    sc->scr_map[(int) daemon_pic[y][px]],
 					    attr);
 			} else {		/* Moving right */
 				sc_vtb_putc(&sc->cur_scp->scr,
 					    (ypos + y)*sc->cur_scp->xsize
 						+ xpos + DAEMON_MAX_WIDTH 
 						- px - 1,
-					    sc->scr_map[xflip_symbol(daemon_pic[y][px])], 
+					    sc->scr_map[(int) xflip_symbol(daemon_pic[y][px])], 
 					    attr);
 			}
 		}
@@ -211,7 +211,7 @@
 #else
 		sc_vtb_putc(&sc->cur_scp->scr,
 			    ypos*sc->cur_scp->xsize + xpos + x,
-			    sc->scr_map[s[x]], (FG_LIGHTGREEN | BG_BLACK) << 8);
+			    sc->scr_map[(int) s[x]], (FG_LIGHTGREEN | BG_BLACK) << 8);
 #endif
 	}
 }

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->yokota 
Responsible-Changed-By: dirk 
Responsible-Changed-When: Thu Nov 9 03:41:23 PST 2000 
Responsible-Changed-Why:  
Over to Mr. syscons... 

Kazutaka, can you please look at the patches and commit them 
if appropriate? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22709 
State-Changed-From-To: open->closed 
State-Changed-By: yokota 
State-Changed-When: Fri Jul 20 08:02:42 PDT 2001 
State-Changed-Why:  
Fixed by nyan in both 5.0-CURRENT and RELENG_4. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=22709 
>Unformatted:
