Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sbin/disklabel Pullup 1.84-1.87 [christos]:



details:   https://anonhg.NetBSD.org/src/rev/cd506af1929b
branches:  netbsd-1-5
changeset: 489879:cd506af1929b
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Oct 18 02:52:44 2000 +0000

description:
Pullup 1.84-1.87 [christos]:
cleanup c syntax (sizeof parentheses)

diffstat:

 sbin/disklabel/disklabel.c |  24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diffs (92 lines):

diff -r 987ce7f42d78 -r cd506af1929b sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c        Wed Oct 18 02:52:14 2000 +0000
+++ b/sbin/disklabel/disklabel.c        Wed Oct 18 02:52:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.84.2.4 2000/10/18 02:27:44 tv Exp $    */
+/*     $NetBSD: disklabel.c,v 1.84.2.5 2000/10/18 02:52:44 tv Exp $    */
 
 /*
  * Copyright (c) 1987, 1993
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)disklabel.c        8.4 (Berkeley) 5/4/95";
 /* from static char sccsid[] = "@(#)disklabel.c        1.2 (Symmetric) 11/28/85"; */
 #else
-__RCSID("$NetBSD: disklabel.c,v 1.84.2.4 2000/10/18 02:27:44 tv Exp $");
+__RCSID("$NetBSD: disklabel.c,v 1.84.2.5 2000/10/18 02:52:44 tv Exp $");
 #endif
 #endif /* not lint */
 
@@ -904,7 +904,7 @@
        }
        lp = (struct disklabel *)
                (boot + (LABELSECTOR * dp->d_secsize) + LABELOFFSET);
-       (void) memset(lp, 0, sizeof *lp);
+       (void) memset(lp, 0, sizeof(*lp));
 #ifdef SAVEBOOTAREA
        /*
         * We must read the current bootarea so we don't clobber the
@@ -916,7 +916,7 @@
                if (lseek(f, sectoffset, SEEK_SET) < 0 ||
                    read(f, boot, BBSIZE) < BBSIZE)
                        err(4, "%s", specname);
-               (void) memset(lp, 0, sizeof *lp);
+               (void) memset(lp, 0, sizeof(*lp));
        }
 #endif
 #if NUMBOOT > 0
@@ -941,7 +941,7 @@
                        if (lseek(f, sectoffset, SEEK_SET) < 0 ||
                            read(f, boot, BBSIZE) < BBSIZE)
                                err(4, "%s", specname);
-                       (void) memset(lp, 0, sizeof *lp);
+                       (void) memset(lp, 0, sizeof(*lp));
                }
                return (lp);
        }
@@ -1287,7 +1287,7 @@
 
        if ((tmpdir = getenv("TMPDIR")) == NULL)
                tmpdir = _PATH_TMP;
-       (void)snprintf(tmpfil, sizeof (tmpfil), "%s/%s", tmpdir, TMPFILE);
+       (void)snprintf(tmpfil, sizeof(tmpfil), "%s/%s", tmpdir, TMPFILE);
        if ((fd = mkstemp(tmpfil)) == -1 || (fp = fdopen(fd, "w")) == NULL) {
                warn("%s", tmpfil);
                return (1);
@@ -1435,7 +1435,7 @@
                                tp = "unknown";
                        cpp = dktypenames;
                        for (; cpp < &dktypenames[DKMAXTYPES]; cpp++)
-                               if ((s = *cpp) && !strcmp(s, tp)) {
+                               if ((s = *cpp) && !strcasecmp(s, tp)) {
                                        lp->d_type = cpp - dktypenames;
                                        goto next;
                                }
@@ -1449,11 +1449,11 @@
                if (!strcmp(cp, "flags")) {
                        for (v = 0; (cp = tp) && *cp != '\0';) {
                                tp = word(cp);
-                               if (!strcmp(cp, "removable"))
+                               if (!strcasecmp(cp, "removable"))
                                        v |= D_REMOVABLE;
-                               else if (!strcmp(cp, "ecc"))
+                               else if (!strcasecmp(cp, "ecc"))
                                        v |= D_ECC;
-                               else if (!strcmp(cp, "badsect"))
+                               else if (!strcasecmp(cp, "badsect"))
                                        v |= D_BADSECT;
                                else {
                                        warnx("line %d: bad flag: %s",
@@ -1485,11 +1485,11 @@
                if (tp == NULL)
                        tp = "";
                if (!strcmp(cp, "disk")) {
-                       strncpy(lp->d_typename, tp, sizeof (lp->d_typename));
+                       strncpy(lp->d_typename, tp, sizeof(lp->d_typename));
                        continue;
                }
                if (!strcmp(cp, "label")) {
-                       strncpy(lp->d_packname, tp, sizeof (lp->d_packname));
+                       strncpy(lp->d_packname, tp, sizeof(lp->d_packname));
                        continue;
                }
                if (!strcmp(cp, "bytes/sector")) {



Home | Main Index | Thread Index | Old Index