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 Cleanup, part 1:



details:   https://anonhg.NetBSD.org/src/rev/681e31c557b8
branches:  trunk
changeset: 533894:681e31c557b8
user:      wiz <wiz%NetBSD.org@localhost>
date:      Wed Jul 10 18:53:56 2002 +0000

description:
Cleanup, part 1:
Remove sysent.h, unneeded.
Remove __P().
unifdef __STDC__
Remove some #if 0 parts.
Start ANSIfication.

diffstat:

 usr.sbin/sup/source/Makefile        |    4 +-
 usr.sbin/sup/source/cvt.c           |    6 +-
 usr.sbin/sup/source/errmsg.c        |    4 +-
 usr.sbin/sup/source/expand.c        |   30 +--
 usr.sbin/sup/source/libc.h          |  137 +------------------
 usr.sbin/sup/source/log.c           |   69 +---------
 usr.sbin/sup/source/netcryptvoid.c  |    4 +-
 usr.sbin/sup/source/quit.c          |   18 +--
 usr.sbin/sup/source/run.c           |   44 +-----
 usr.sbin/sup/source/scan.c          |   42 ++--
 usr.sbin/sup/source/scm.c           |   26 +---
 usr.sbin/sup/source/scmio.c         |   12 +-
 usr.sbin/sup/source/stree.c         |   28 +-
 usr.sbin/sup/source/sup.h           |    8 +-
 usr.sbin/sup/source/supcdefs.h      |    4 +-
 usr.sbin/sup/source/supcmain.c      |   14 +-
 usr.sbin/sup/source/supcmeat.c      |   44 +-----
 usr.sbin/sup/source/supcmisc.c      |   21 +--
 usr.sbin/sup/source/supcparse.c     |    4 +-
 usr.sbin/sup/source/supextern.h     |  258 +++++++++++++++++------------------
 usr.sbin/sup/source/supfilesrv.c    |   79 ++++------
 usr.sbin/sup/source/supmsg.c        |   28 +--
 usr.sbin/sup/source/supscan.c       |   32 +---
 usr.sbin/sup/source/sys/viceioctl.h |    6 +-
 usr.sbin/sup/source/sysent.h        |  145 --------------------
 usr.sbin/sup/source/time.h          |   15 +-
 26 files changed, 272 insertions(+), 810 deletions(-)

diffs (truncated from 1817 to 300 lines):

diff -r a2f4e0029c01 -r 681e31c557b8 usr.sbin/sup/source/Makefile
--- a/usr.sbin/sup/source/Makefile      Wed Jul 10 17:43:13 2002 +0000
+++ b/usr.sbin/sup/source/Makefile      Wed Jul 10 18:53:56 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.17 2000/07/19 07:52:44 enami Exp $
+#      $NetBSD: Makefile,v 1.18 2002/07/10 18:53:56 wiz Exp $
 # Copyright (c) 1992,1991 Carnegie Mellon University
 # All Rights Reserved.
 # 
@@ -25,7 +25,7 @@
 # Makefile to build sup (the client side), supfilesrv (the repository
 # side, and supscan (used by the repository. If you only want to sup
 # files from CMU, just build sup.
-# The header files: c.h, libc.h and sysent.h are only
+# The header files: c.h and libc.h are only
 # necessary if you are compiling on a non-Mach system. Likewise the
 # files in libextra.a are normally found in libcs.a on a Mach system.
 # DOPRINT_VA is used by vprintf.c and should be defined if your version
diff -r a2f4e0029c01 -r 681e31c557b8 usr.sbin/sup/source/cvt.c
--- a/usr.sbin/sup/source/cvt.c Wed Jul 10 17:43:13 2002 +0000
+++ b/usr.sbin/sup/source/cvt.c Wed Jul 10 18:53:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cvt.c,v 1.2 1997/06/17 18:56:10 christos Exp $ */
+/*     $NetBSD: cvt.c,v 1.3 2002/07/10 18:53:57 wiz Exp $      */
 
 /*
  * Quick hack to convert old binary sup when.collection files into 
@@ -10,9 +10,7 @@
 #include <fcntl.h>
 
 int
-main(argc, argv)
-       int argc;
-       char *argv[];
+main(int argc, char **argv)
 {
        long b;
        FILE *fp;
diff -r a2f4e0029c01 -r 681e31c557b8 usr.sbin/sup/source/errmsg.c
--- a/usr.sbin/sup/source/errmsg.c      Wed Jul 10 17:43:13 2002 +0000
+++ b/usr.sbin/sup/source/errmsg.c      Wed Jul 10 18:53:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: errmsg.c,v 1.5 1998/08/04 04:33:15 mikel Exp $ */
+/*     $NetBSD: errmsg.c,v 1.6 2002/07/10 18:53:57 wiz Exp $   */
 
 /*
  * Copyright (c) 1991 Carnegie Mellon University
@@ -37,7 +37,7 @@
 #include "supextern.h"
 
 #ifndef __NetBSD__
-static char *itoa __P((char *, unsigned));
+static char *itoa(char *, unsigned);
 
 static char *itoa(p,n)
 char *p;
diff -r a2f4e0029c01 -r 681e31c557b8 usr.sbin/sup/source/expand.c
--- a/usr.sbin/sup/source/expand.c      Wed Jul 10 17:43:13 2002 +0000
+++ b/usr.sbin/sup/source/expand.c      Wed Jul 10 18:53:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expand.c,v 1.12 1998/11/02 04:00:24 kim Exp $  */
+/*     $NetBSD: expand.c,v 1.13 2002/07/10 18:53:57 wiz Exp $  */
 
 /*
  * Copyright (c) 1991 Carnegie Mellon University
@@ -70,7 +70,7 @@
 #endif
 #include <pwd.h>
 #include <ctype.h>
-#include <libc.h>
+#include "libc.h"
 #include <setjmp.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -89,23 +89,15 @@
 
 #define fixit(a) (a[0] ? a : ".")
 
-#ifndef __P
-#ifdef __STDC__
-#define __P(a) a
-#else
-#define __P(a) ()
-#endif
-#endif
-
-int expand __P((char *, char **, int));
-static void glob __P((char *));
-static void matchdir __P((char *));
-static int execbrc __P((char *, char *));
-static int match __P((char *, char *));
-static int amatch __P((char *, char *));
-static void addone __P((char *, char *));
-static int addpath __P((int));
-static int gethdir __P((char *, int));
+int expand(char *, char **, int);
+static void glob(char *);
+static void matchdir(char *);
+static int execbrc(char *, char *);
+static int match(char *, char *);
+static int amatch(char *, char *);
+static void addone(char *, char *);
+static int addpath(int);
+static int gethdir(char *, int);
 
 int expand(spec, buffer, bufsize)
        register char *spec;
diff -r a2f4e0029c01 -r 681e31c557b8 usr.sbin/sup/source/libc.h
--- a/usr.sbin/sup/source/libc.h        Wed Jul 10 17:43:13 2002 +0000
+++ b/usr.sbin/sup/source/libc.h        Wed Jul 10 18:53:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: libc.h,v 1.5 1998/07/26 15:52:46 mycroft Exp $ */
+/*     $NetBSD: libc.h,v 1.6 2002/07/10 18:53:57 wiz Exp $     */
 
 /*
  * Copyright (c) 1991 Carnegie Mellon University
@@ -81,10 +81,6 @@
 #include <sys/types.h>
 #endif /* _TYPES_ */
 
-#ifndef        _SYSENT_H_
-#include <sysent.h>
-#endif /* _SYSENT_H_ */
-
 #ifndef        FILE
 #include <stdio.h>
 #endif /* FILE */
@@ -102,19 +98,12 @@
 #endif /* _TIME_H_ */
 
 /*  CMU stdio additions */
-#if defined(__STDC__)
 extern FILE *fopenp(const char*, const char*, char*, char*);
 extern FILE *fwantread(const char*, const char*, const char*, const char*);
 extern FILE *fwantwrite(const char*, const char*, const char*, const char*,
                        int);
-#else  /* __STDC__ */
-extern FILE *fopenp();
-extern FILE *fwantread();
-extern FILE *fwantwrite();
-#endif /* __STDC__ */
 
 /* CMU string routines */
-#if defined(__STDC__)
 extern char* foldup(char*, const char*);
 extern char* folddown(char*, const char*);
 extern char* sindex(const char*, const char*);
@@ -150,142 +139,18 @@
                           unsigned int, unsigned int, unsigned int);
 extern unsigned int atoh(const char*);
 extern char *concat(const char*, int, ...);
-#else  /* __STDC__ */
-extern char *foldup(), *folddown();
-extern char *sindex(), *skipto(), *skipover(), *nxtarg();
-extern char *getstr(), *strarg();
-extern long getlong(), longarg();
-extern short getshort(), shortarg();
-extern float getfloat(), floatarg();
-extern double getdouble(), doublearg();
-extern unsigned int getoct(), octarg(), gethex(), hexarg();
-extern unsigned int atoo(), atoh();
-extern char *salloc();
-extern char *concat();
-#endif /* __STDC__ */
 
 /* CMU library routines */
-#if defined(__STDC__)
 extern char *getname(int);
 extern char *pathof(char *);
 extern const char *errmsg(int);
-#else  /* __STDC__ */
-extern char *getname();
-extern char *pathof();
-extern const char *errmsg();
-#endif /* __STDC__ */
 
 /*  CMU time additions */
-#if defined(__STDC__)
 extern long gtime(const struct tm*);
 extern long atot(const char*);
-#else  /* __STDC__ */
-extern long gtime();
-extern long atot();
-#endif /* __STDC__ */
 
 /* 4.3 BSD standard library routines; taken from man(3) */
-#if defined(__STDC__)
-#if 0
-typedef int (*PFI)();
-#endif
 #if defined(c_plusplus)
 typedef int (*PFI2)(...);
 #endif /* c_plusplus */
-#if 0
-extern void abort(void);
-extern int abs(int);
-extern double atof(const char *);
-extern int atoi(const char *);
-extern long atol(const char *);
-extern void bcopy(const void *, void *, int);
-extern int bcmp(const void *, const void *, int);
-extern void bzero(void *, int);
-extern int ffs(int);
-extern char *crypt(const char *, const char *);
-extern void setkey(char *);
-extern void encrypt(char *, int);
-extern char *ecvt(double, int, int *, int *);
-extern char *fcvt(double, int, int *, int *);
-extern char *gcvt(double, int, char *);
-extern int execl(const char *, ...);
-extern int execv(const char *, const char **);
-extern int execle(const char *, ...);
-extern int exect(const char *, const char **, const char **);
-extern void exit(int);
-extern char *getenv(const char *);
-extern char *getlogin(void);
-extern int getopt(int, const char **, const char *);
-extern char *getpass(const char *);
-extern char *getusershell(void);
-extern void setusershell(void);
-extern void endusershell(void);
-extern char *getwd(char *);
-extern int initgroups(const char *, gid_t);
-extern void *malloc(unsigned);
-extern void free(void *);
-extern void *realloc(void *, unsigned);
-extern void *calloc(unsigned, unsigned);
-extern void *alloca(int);
-extern char *mktemp(char *);
-extern int mkstemp(char *);
-extern void monitor(PFI, PFI, short *, int, int);
-extern void monstartup(PFI, PFI);
-extern void moncontrol(int);
-extern int pause(void);
-#if defined(c_plusplus)
-extern void qsort(void *, int, int, PFI2);
-#else /* c_plusplus */
-extern void qsort(void *, int, int, PFI);
-#endif /* c_plusplus */
-extern long random(void);
-extern int srandom(int);
-extern void *initstate(unsigned, void *, int);
-extern void *setstate(void *);
-extern int rcmd(char **, int, const char *, const char *, const char *, int);
-extern int rresvport(int *);
-extern int ruserok(char *, int, const char *, const char *);
-extern char *re_comp(char *);
-extern int re_exec(char *);
-extern int rexec(char **, int, const char *, const char *, const char *,
-                int *);
-extern int setuid(uid_t);
-extern int seteuid(uid_t);
-extern int setruid(uid_t);
-extern int setgid(gid_t);
-extern int setegid(gid_t);
-extern int setrgid(gid_t);
-extern void sleep(unsigned);
-extern void swab(void *, void *, int);
-extern int system(const char *);
-extern char *ttyname(int);
-extern int isatty(int);
-extern int ttyslot(void);
-extern unsigned ualarm(unsigned, unsigned);
-extern void usleep(unsigned);
-#endif
-#else  /* __STDC__ */
-extern double atof();
-extern long atol();
-extern char *crypt();
-extern char *ecvt();
-extern char *fcvt();
-extern char *gcvt();
-extern char *getenv();
-extern char *getlogin();
-extern char *getpass();
-extern char *getusershell();
-extern char *getwd();
-extern char *malloc();
-extern char *realloc();
-extern char *calloc();
-extern char *alloca();
-extern char *mktemp();
-extern long random();
-extern char *initstate();
-extern char *setstate();
-extern char *re_comp();
-extern char *ttyname();
-extern unsigned ualarm();
-#endif /* __STDC__ */
 #endif /* not _LIBC_H_ */
diff -r a2f4e0029c01 -r 681e31c557b8 usr.sbin/sup/source/log.c
--- a/usr.sbin/sup/source/log.c Wed Jul 10 17:43:13 2002 +0000
+++ b/usr.sbin/sup/source/log.c Wed Jul 10 18:53:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: log.c,v 1.6 2000/10/11 20:23:57 is Exp $       */
+/*     $NetBSD: log.c,v 1.7 2002/07/10 18:53:57 wiz Exp $      */
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -64,27 +64,12 @@



Home | Main Index | Thread Index | Old Index