From dan@obluda.cz  Wed Jun 26 17:39:43 2002
Return-Path: <dan@obluda.cz>
Received: from xkulesh.vol.cz (xkulesh.vol.cz [195.250.154.106])
	by hub.freebsd.org (Postfix) with ESMTP id CC4E637D0D6
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 26 Jun 2002 17:37:33 -0700 (PDT)
Received: from obluda.cz (localhost [127.0.0.1])
	by xkulesh.vol.cz (8.12.3/8.12.3) with ESMTP id g5R0bVTt061818
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 27 Jun 2002 02:37:31 +0200 (CEST)
	(envelope-from dan@obluda.cz)
Received: (from root@localhost)
	by obluda.cz (8.12.4/8.12.4/Submit) id g5R0Q3p6061265;
	Thu, 27 Jun 2002 02:26:03 +0200 (CEST)
Message-Id: <200206270026.g5R0Q3p6061265@obluda.cz>
Date: Thu, 27 Jun 2002 02:26:03 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: cleaning sbin/fsdb code from warnings
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         39904
>Category:       bin
>Synopsis:       cleaning sbin/sysctl code from warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    johan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 26 17:40:04 PDT 2002
>Closed-Date:    Sun Apr 13 13:42:56 PDT 2003
>Last-Modified:  Sun Apr 13 13:42:56 PDT 2003
>Originator:     Dan Lukes
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD xkulesh.vol.cz 4.6-STABLE FreeBSD
src/sbin/sysctl/sysctl.c,v 1.25.2.8 2002/03/16 15:49:08

>Description:
sbin/sysctl/sysctl.c:387: warning: missing braces around initializer
sbin/sysctl/sysctl.c:387: warning: (near initialization for `maj2name[0]')
sbin/sysctl/sysctl.c: In function `machdep_bootdev':
401: warning: suggest parentheses around comparison in operand of &
402: warning: unsigned int format, u_long arg (arg 2)


>How-To-Repeat:
        N/A
>Fix:
--- sysctl.c.ORIG       Tue Mar 19 02:56:07 2002
+++ sysctl.c    Thu Jun 27 02:22:49 2002
@@ -384,12 +384,12 @@
        int majdev;
        char *name;
 } maj2name[] = {
-       30,     "ad",
-       0,      "wd",
-       1,      "wfd",
-       2,      "fd",
-       4,      "da",
-       -1,     NULL    /* terminator */
+       { 30,   "ad" },
+       { 0,    "wd" },
+       { 1,    "wfd" },
+       { 2,    "fd" },
+       { 4,    "da" },
+       { -1,   NULL }  /* terminator */
 };
 static int
@@ -398,8 +398,8 @@
        int majdev, unit, slice, part;
        struct _foo *p;
-       if (value & B_MAGICMASK != B_DEVMAGIC) {
-               printf("invalid (0x%08x)", value);
+       if ( (value & B_MAGICMASK) != B_DEVMAGIC) {
+               printf("invalid (0x%08lx)", value);
                return 0;
        }
        majdev = B_TYPE(value);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->johan 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sun Apr 13 09:24:45 PDT 2003 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39904 
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Sun Apr 13 13:42:31 PDT 2003 
State-Changed-Why:  
Does not apply to current. 

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