Date: Thu, 27 Jun 2002 02:26:03 +0200 (CEST) From: Dan Lukes <dan@obluda.cz> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/39904: cleaning sbin/fsdb code from warnings Message-ID: <200206270026.g5R0Q3p6061265@obluda.cz>
next in thread | raw e-mail | index | archive | help
>Number: 39904
>Category: bin
>Synopsis: cleaning sbin/sysctl code from warnings
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jun 26 17:40:04 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206270026.g5R0Q3p6061265>
