From keramida@ceid.upatras.gr  Wed Jun  5 14:48:46 2002
Return-Path: <keramida@ceid.upatras.gr>
Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5])
	by hub.freebsd.org (Postfix) with ESMTP id 088C037B409
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Jun 2002 14:48:43 -0700 (PDT)
Received: from hades.hell.gr (patr530-b140.otenet.gr [212.205.244.148])
	by mailsrv.otenet.gr (8.12.3/8.12.3) with ESMTP id g55Lmb7Y000169
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 6 Jun 2002 00:48:38 +0300 (EEST)
Received: from hades.hell.gr (hades [127.0.0.1])
	by hades.hell.gr (8.12.3/8.12.3) with ESMTP id g55Lmaas022348
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 6 Jun 2002 00:48:36 +0300 (EEST)
	(envelope-from charon@hades.hell.gr)
Received: (from charon@localhost)
	by hades.hell.gr (8.12.3/8.12.3/Submit) id g55JIsuF013719;
	Wed, 5 Jun 2002 22:18:54 +0300 (EEST)
	(envelope-from charon)
Message-Id: <200206051918.g55JIsuF013719@hades.hell.gr>
Date: Wed, 5 Jun 2002 22:18:54 +0300 (EEST)
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
Reply-To: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: WARNS=3 fixes for src/usr.bin/makewhatis
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         38929
>Category:       bin
>Synopsis:       WARNS=3 fixes for src/usr.bin/makewhatis
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    keramida
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 05 14:50:01 PDT 2002
>Closed-Date:    Fri Jun 07 12:02:34 PDT 2002
>Last-Modified:  Fri Jun 07 12:02:34 PDT 2002
>Originator:     Giorgos Keramidas
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:

	System: FreeBSD hades.hell.gr 5.0-CURRENT FreeBSD 5.0-CURRENT #0:
	Wed Jun 5 05:24:39 EEST 2002
	root@hades.hell.gr:/usr/obj/usr/src/sys/HECATE i386

>Description:

	The attached patch corrects the few warnings that makewhatis.c
	causes when compiled with WARNS=3.

>How-To-Repeat:

	% cd src/usr.bin/makewhatis/
	% make WARNS=3 clean all

>Fix:

--- foo begins here ---
Index: makewhatis.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/makewhatis/makewhatis.c,v
retrieving revision 1.5
diff -u -r1.5 makewhatis.c
--- makewhatis.c	22 May 2002 11:08:41 -0000	1.5
+++ makewhatis.c	5 Jun 2002 19:16:18 -0000
@@ -293,7 +293,7 @@
 no_page_exists(char *dir, StringList *names, char *suffix)
 {
 	char path[MAXPATHLEN];
-	int i;
+	unsigned int i;
 
 	for (i = 0; i < names->sl_cur; i++) {
 		snprintf(path, sizeof path, "%s/%s.%s.gz", dir, names->sl_str[i], suffix);
@@ -363,7 +363,7 @@
 static void
 finish_output(FILE *output, char *name)
 {
-	int i;
+	unsigned int i;
 	char *prev = NULL;
 
 	qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), linesort);
@@ -693,7 +693,7 @@
 	StringList *names;
 	char *descr;
 	int state = STATE_UNKNOWN;
-	int i;
+	unsigned int i;
 
 	sbuf_clear(whatis_proto);
 	if ((in = gzopen(page->filename, "r")) == NULL) {
@@ -824,7 +824,7 @@
 	struct page_info **pages;
 	int npages = 0;
 	int i;
-	int prev_inode = 0;
+	unsigned int prev_inode = 0;
 
 	if (verbose)
 		fprintf(stderr, "  %s\n", section_dir);
--- foo ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: keramida 
State-Changed-When: Fri Jun 7 12:01:35 PDT 2002 
State-Changed-Why:  
Bruce Evans helped me shape this a bit, and now it's in CURRENT. 
No MFC plans since WARNS=3 means totally different things in STABLE, 
and I'll have to get myself a 4.x-STABLE machine first. 


Responsible-Changed-From-To: freebsd-bugs->keramida 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Fri Jun 7 12:01:35 PDT 2002 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=38929 
>Unformatted:
