Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sup/source De-lint a bit.



details:   https://anonhg.NetBSD.org/src/rev/f84c5069e7f4
branches:  trunk
changeset: 533910:f84c5069e7f4
user:      wiz <wiz%NetBSD.org@localhost>
date:      Wed Jul 10 21:28:13 2002 +0000

description:
De-lint a bit.

diffstat:

 usr.sbin/sup/source/scan.c       |  12 ++++++------
 usr.sbin/sup/source/supcmain.c   |  13 +++++++------
 usr.sbin/sup/source/supcmeat.c   |   8 ++++----
 usr.sbin/sup/source/supcmisc.c   |  12 ++++++------
 usr.sbin/sup/source/supextern.h  |   4 ++--
 usr.sbin/sup/source/supfilesrv.c |  11 +++++------
 usr.sbin/sup/source/supscan.c    |   8 ++++----
 7 files changed, 34 insertions(+), 34 deletions(-)

diffs (278 lines):

diff -r 79f3f701b1d9 -r f84c5069e7f4 usr.sbin/sup/source/scan.c
--- a/usr.sbin/sup/source/scan.c        Wed Jul 10 21:13:35 2002 +0000
+++ b/usr.sbin/sup/source/scan.c        Wed Jul 10 21:28:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scan.c,v 1.14 2002/07/10 20:19:42 wiz Exp $    */
+/*     $NetBSD: scan.c,v 1.15 2002/07/10 21:28:13 wiz Exp $    */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -358,7 +358,7 @@
                                (void) chdir(basedir);
                        }
                        makescan(tl->TLlist, tl->TLscan);
-                       free((char *) tl);
+                       free(tl);
                        count++;
                }
                (void) fclose(f);
@@ -536,7 +536,7 @@
                                } while (_argbreak != ')');
                                continue;
                        }
-                       /* fall through */
+                       /* FALLTHROUGH */
                default:
                        goaway("Error in handling list file keyword %d", ltn);
                }
@@ -581,7 +581,7 @@
 listentry(char *name, char *fullname, char *updir, int always)
 {
        struct stat statbuf;
-       int link = 0;
+       int linkcount = 0;
 
        if (Tlookup(refuseT, fullname))
                return;
@@ -603,7 +603,7 @@
                        return;
                }
                if (updir)
-                       link++;
+                       linkcount++;
                if (stat(name, &statbuf) < 0)
                        return;
        }
@@ -618,7 +618,7 @@
                        (void) fflush(stdout);
                }
                listdir(fullname, always);
-               if (updir == 0 || link) {
+               if (updir == 0 || linkcount) {
                        (void) chdir(basedir);
                        if (prefix)
                                (void) chdir(prefix);
diff -r 79f3f701b1d9 -r f84c5069e7f4 usr.sbin/sup/source/supcmain.c
--- a/usr.sbin/sup/source/supcmain.c    Wed Jul 10 21:13:35 2002 +0000
+++ b/usr.sbin/sup/source/supcmain.c    Wed Jul 10 21:28:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supcmain.c,v 1.17 2002/07/10 20:19:44 wiz Exp $        */
+/*     $NetBSD: supcmain.c,v 1.18 2002/07/10 21:28:13 wiz Exp $        */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -359,7 +359,8 @@
 main(int argc, char **argv)
 {
        char *progname, *supfname;
-       int restart, sfdev = 0, sfino = 0, sfmtime = 0;
+       int restart, sfdev = 0, sfino = 0;
+       time_t sfmtime = 0;
        struct stat sbuf;
        struct sigaction ign;
 
@@ -438,7 +439,7 @@
                        free(thisC->Cpswd);
                if (thisC->Ccrypt)
                        free(thisC->Ccrypt);
-               free((char *) thisC);
+               free(thisC);
        }
        exit(0);
 }
@@ -665,10 +666,10 @@
                        continue;
                }
                if (cwant) {
-                       TREE *t;
-                       if ((t = Tsearch(collT, arg)) == NULL)
+                       TREE *mytree;
+                       if ((mytree = Tsearch(collT, arg)) == NULL)
                                continue;
-                       t->Tcount++;
+                       mytree->Tcount++;
                }
                c = (COLLECTION *) malloc(sizeof(COLLECTION));
                if (firstC == NULL)
diff -r 79f3f701b1d9 -r f84c5069e7f4 usr.sbin/sup/source/supcmeat.c
--- a/usr.sbin/sup/source/supcmeat.c    Wed Jul 10 21:13:35 2002 +0000
+++ b/usr.sbin/sup/source/supcmeat.c    Wed Jul 10 21:28:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supcmeat.c,v 1.24 2002/07/10 20:19:44 wiz Exp $        */
+/*     $NetBSD: supcmeat.c,v 1.25 2002/07/10 21:28:13 wiz Exp $        */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -1102,14 +1102,14 @@
        return (SCMOK);
 }
 
+/* from will be 0 if reading from network */
 int 
 copyfile(char *to, char *from)
- /* 0 if reading from network */
 {
        int fromf, tof, istemp, x;
        char dpart[STRINGLENGTH], fpart[STRINGLENGTH];
        char tname[STRINGLENGTH];
-       static int true = 1;
+       static int returntrue = 1;
 
        static int thispid = 0; /* process id # */
 
@@ -1185,7 +1185,7 @@
                        if (x != SCMOK)
                                goaway("Can't skip file transfer");
                }
-               if (true)
+               if (returntrue)
                        return (TRUE);
        }
        if (fromf >= 0) {       /* read file */
diff -r 79f3f701b1d9 -r f84c5069e7f4 usr.sbin/sup/source/supcmisc.c
--- a/usr.sbin/sup/source/supcmisc.c    Wed Jul 10 21:13:35 2002 +0000
+++ b/usr.sbin/sup/source/supcmisc.c    Wed Jul 10 21:28:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supcmisc.c,v 1.12 2002/07/10 20:19:45 wiz Exp $        */
+/*     $NetBSD: supcmisc.c,v 1.13 2002/07/10 21:28:13 wiz Exp $        */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -106,7 +106,7 @@
 }
 
 int 
-makedir(char *fname, int mode, struct stat * statp)
+makedir(char *fname, unsigned int mode, struct stat * statp)
 {
        if (lstat(fname, statp) != -1 && !S_ISDIR(statp->st_mode)) {
                if (unlink(fname) == -1) {
@@ -114,7 +114,7 @@
                        return -1;
                }
        }
-       (void) mkdir(fname, 0755);
+       (void) mkdir(fname, mode);
 
        return stat(fname, statp);
 }
@@ -200,8 +200,8 @@
        static int first = TRUE;
 
        if (first) {
-               bzero((char *) uidL, sizeof(uidL));
-               bzero((char *) gidL, sizeof(gidL));
+               bzero(uidL, sizeof(uidL));
+               bzero(gidL, sizeof(gidL));
                first = FALSE;
        }
        pw = NULL;
@@ -313,7 +313,7 @@
 fmttime(time_t time)
 {
        static char buf[STRINGLENGTH];
-       int len;
+       unsigned int len;
 
        (void) strcpy(buf, ctime(&time));
        len = strlen(buf + 4) - 6;
diff -r 79f3f701b1d9 -r f84c5069e7f4 usr.sbin/sup/source/supextern.h
--- a/usr.sbin/sup/source/supextern.h   Wed Jul 10 21:13:35 2002 +0000
+++ b/usr.sbin/sup/source/supextern.h   Wed Jul 10 21:28:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supextern.h,v 1.17 2002/07/10 18:55:34 wiz Exp $       */
+/*     $NetBSD: supextern.h,v 1.18 2002/07/10 21:28:13 wiz Exp $       */
 
 struct stat;
 
@@ -143,7 +143,7 @@
 /* supcmisc.c */
 void prtime(void);
 int establishdir(char *);
-int makedir(char *, int, struct stat *);
+int makedir(char *, unsigned int, struct stat *);
 int estabd(char *, char *);
 void ugconvert(char *, char *, int *, int *, int *);
 void notify(char *, ...)
diff -r 79f3f701b1d9 -r f84c5069e7f4 usr.sbin/sup/source/supfilesrv.c
--- a/usr.sbin/sup/source/supfilesrv.c  Wed Jul 10 21:13:35 2002 +0000
+++ b/usr.sbin/sup/source/supfilesrv.c  Wed Jul 10 21:28:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supfilesrv.c,v 1.23 2002/07/10 20:19:46 wiz Exp $      */
+/*     $NetBSD: supfilesrv.c,v 1.24 2002/07/10 21:28:13 wiz Exp $      */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -317,7 +317,6 @@
 int dorcs = FALSE;
 #endif
 
-char *clienthost;              /* host name of client */
 int nchildren;                 /* number of children that exist */
 char *prefix;                  /* collection pathname prefix */
 char *release;                 /* collection release name */
@@ -820,7 +819,7 @@
                        int hostok = FALSE;
                        /* get stat info before open */
                        if (stat(buf, &sbuf) == -1)
-                               (void) bzero((char *) &sbuf, sizeof(sbuf));
+                               (void) bzero(&sbuf, sizeof(sbuf));
 
                        if ((f = fopen(buf, "r")) != NULL) {
                                struct stat fsbuf;
@@ -1029,7 +1028,7 @@
                if (link_nofollow(1) != -1) {
                        /* get stat info before open */
                        if (stat(buf, &sbuf) == -1)
-                               (void) bzero((char *) &sbuf, sizeof(sbuf));
+                               (void) bzero(&sbuf, sizeof(sbuf));
 
                        if ((f = fopen(buf, "r")) != NULL) {
                                struct stat fsbuf;
@@ -1505,7 +1504,7 @@
                        table[i] = h->Hnext;
                        if (h->Hname)
                                free(h->Hname);
-                       free((char *) h);
+                       free(h);
                }
 }
 
@@ -1783,7 +1782,7 @@
 fmttime(time_t time)
 {
        static char buf[STRINGLENGTH];
-       int len;
+       unsigned int len;
 
        (void) strcpy(buf, ctime(&time));
        len = strlen(buf + 4) - 6;
diff -r 79f3f701b1d9 -r f84c5069e7f4 usr.sbin/sup/source/supscan.c
--- a/usr.sbin/sup/source/supscan.c     Wed Jul 10 21:13:35 2002 +0000
+++ b/usr.sbin/sup/source/supscan.c     Wed Jul 10 21:28:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: supscan.c,v 1.10 2002/07/10 20:19:47 wiz Exp $ */
+/*     $NetBSD: supscan.c,v 1.11 2002/07/10 21:28:13 wiz Exp $ */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -205,7 +205,7 @@
                free(c->Cbase);
                if (c->Cprefix)
                        free(c->Cprefix);
-               free((char *) c);
+               free(c);
        }
        exit(0);
 }
@@ -397,8 +397,8 @@
 localhost(char *host)
 {
        static char myhost[MAXHOSTNAMELEN + 1];
-       static int myhostlen;
-       int hostlen;
+       static unsigned int myhostlen;
+       unsigned int hostlen;
 
        if (*myhost == '\0') {
                /*



Home | Main Index | Thread Index | Old Index