Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin static + __dead



details:   https://anonhg.NetBSD.org/src/rev/8b0a949f581c
branches:  trunk
changeset: 769068:8b0a949f581c
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Aug 30 21:03:31 2011 +0000

description:
static + __dead

diffstat:

 usr.sbin/wsmuxctl/wsmuxctl.c              |   9 ++---
 usr.sbin/ypserv/makedbm/makedbm.c         |  27 ++++++++--------
 usr.sbin/ypserv/mkalias/mkalias.c         |  21 ++++++------
 usr.sbin/ypserv/mknetid/mknetid.c         |  49 +++++++++++++++---------------
 usr.sbin/ypserv/revnetgroup/revnetgroup.c |   9 ++---
 usr.sbin/ypserv/stdethers/stdethers.c     |   9 ++---
 usr.sbin/ypserv/stdhosts/stdhosts.c       |   9 ++---
 usr.sbin/ypserv/yppush/yppush.c           |  11 +++---
 8 files changed, 68 insertions(+), 76 deletions(-)

diffs (truncated from 466 to 300 lines):

diff -r 91ba6ef4cec1 -r 8b0a949f581c usr.sbin/wsmuxctl/wsmuxctl.c
--- a/usr.sbin/wsmuxctl/wsmuxctl.c      Tue Aug 30 20:54:18 2011 +0000
+++ b/usr.sbin/wsmuxctl/wsmuxctl.c      Tue Aug 30 21:03:31 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmuxctl.c,v 1.10 2008/04/28 20:24:17 martin Exp $ */
+/* $NetBSD: wsmuxctl.c,v 1.11 2011/08/30 21:03:31 joerg Exp $ */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -41,12 +41,11 @@
 
 #include <dev/wscons/wsconsio.h>
 
-static void usage(void);
-int main(int, char**);
+__dead static void usage(void);
 
-const char *ctlpath = "/dev/wsmuxctl";
+static const char *ctlpath = "/dev/wsmuxctl";
 
-const char *devnames[] = { "?", "wsmouse", "wskbd", "wsmux" };
+static const char *devnames[] = { "?", "wsmouse", "wskbd", "wsmux" };
 
 static void
 usage(void)
diff -r 91ba6ef4cec1 -r 8b0a949f581c usr.sbin/ypserv/makedbm/makedbm.c
--- a/usr.sbin/ypserv/makedbm/makedbm.c Tue Aug 30 20:54:18 2011 +0000
+++ b/usr.sbin/ypserv/makedbm/makedbm.c Tue Aug 30 21:03:31 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: makedbm.c,v 1.24 2009/10/20 00:51:14 snj Exp $ */
+/*     $NetBSD: makedbm.c,v 1.25 2011/08/30 21:10:28 joerg Exp $       */
 
 /*
  * Copyright (c) 1994 Mats O Jansson <moj%stacken.kth.se@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: makedbm.c,v 1.24 2009/10/20 00:51:14 snj Exp $");
+__RCSID("$NetBSD: makedbm.c,v 1.25 2011/08/30 21:10:28 joerg Exp $");
 #endif
 
 #include <sys/param.h>
@@ -50,13 +50,12 @@
 #include "ypdb.h"
 #include "ypdef.h"
 
-int    main(int, char *[]);
-void   usage(void);
-int    add_record(DBM *, const char *, const char *, int);
-char   *file_date(char *);
-void   list_database(char *);
-void   create_database(char *, char *, char *, char *, char *, char *,
-                       int, int, int);
+__dead static void     usage(void);
+static int     add_record(DBM *, const char *, const char *, int);
+static char    *file_date(char *);
+static void    list_database(char *);
+static void    create_database(char *, char *, char *, char *, char *,
+                               char *, int, int, int);
 
 int
 main(int argc, char *argv[])
@@ -143,7 +142,7 @@
        exit(0);
 }
 
-int
+static int
 add_record(DBM *db, const char *str1, const char *str2, int check)
 {
        datum key, val;
@@ -169,7 +168,7 @@
        return 0;
 }
 
-char *
+static char *
 file_date(char *filename)
 {
        struct stat finfo;
@@ -190,7 +189,7 @@
        return datestr;
 }
 
-void
+static void
 list_database(char *database)
 {
        DBM *db;
@@ -220,7 +219,7 @@
        ypdb_close(db);
 }
 
-void
+static void
 create_database(char *infile, char *database, char *yp_input_file,
                char *yp_output_file, char *yp_master_name,
                char *yp_domain_name, int bflag, int lflag, int sflag)
@@ -346,7 +345,7 @@
        }
 }
 
-void
+static void
 usage(void)
 {
 
diff -r 91ba6ef4cec1 -r 8b0a949f581c usr.sbin/ypserv/mkalias/mkalias.c
--- a/usr.sbin/ypserv/mkalias/mkalias.c Tue Aug 30 20:54:18 2011 +0000
+++ b/usr.sbin/ypserv/mkalias/mkalias.c Tue Aug 30 21:03:31 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkalias.c,v 1.17 2009/10/20 00:51:14 snj Exp $ */
+/*     $NetBSD: mkalias.c,v 1.18 2011/08/30 21:10:28 joerg Exp $ */
 
 /*
  * Copyright (c) 1997 Mats O Jansson <moj%stacken.kth.se@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: mkalias.c,v 1.17 2009/10/20 00:51:14 snj Exp $");
+__RCSID("$NetBSD: mkalias.c,v 1.18 2011/08/30 21:10:28 joerg Exp $");
 #endif
 
 #include <sys/types.h>
@@ -52,13 +52,12 @@
 #include "ypdb.h"
 #include "ypdef.h"
 
-void   capitalize(char *, int);
-int    check_host(char *, char *, int, int, int);
-int    main(int, char *[]);
-void   split_address(char *, int, char *, char *);
-void   usage(void);
+static void    capitalize(char *, int);
+static int     check_host(char *, char *, int, int, int);
+static void    split_address(char *, int, char *, char *);
+__dead static void     usage(void);
 
-void
+static void
 split_address(char *address, int len, char *user, char *host)
 {
        char *c, *s, *r;
@@ -95,7 +94,7 @@
        }
 }
 
-int
+static int
 check_host(char *address, char *host, int dflag, int uflag, int Eflag)
 {
        u_char answer[PACKETSZ];
@@ -119,7 +118,7 @@
        return(status == -1);
 }
 
-void
+static void
 capitalize(char *name, int len)
 {
        char last = ' ';
@@ -331,7 +330,7 @@
        exit(0);
 }
 
-void
+static void
 usage(void)
 {
        fprintf(stderr,
diff -r 91ba6ef4cec1 -r 8b0a949f581c usr.sbin/ypserv/mknetid/mknetid.c
--- a/usr.sbin/ypserv/mknetid/mknetid.c Tue Aug 30 20:54:18 2011 +0000
+++ b/usr.sbin/ypserv/mknetid/mknetid.c Tue Aug 30 21:03:31 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mknetid.c,v 1.17 2009/10/20 00:51:14 snj Exp $ */
+/*     $NetBSD: mknetid.c,v 1.18 2011/08/30 21:10:28 joerg Exp $       */
 
 /*
  * Copyright (c) 1996 Mats O Jansson <moj%stacken.kth.se@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: mknetid.c,v 1.17 2009/10/20 00:51:14 snj Exp $");
+__RCSID("$NetBSD: mknetid.c,v 1.18 2011/08/30 21:10:28 joerg Exp $");
 #endif
 
 /*
@@ -65,21 +65,20 @@
 
 #define HASHMAX 55
 
-void   add_group(const char *, const char *);
-void   add_user(const char *, const char *, const char *);
-int    hashidx(char);
-int    isgsep(char);
-int    main(int, char *[]);
-void   print_hosts(const char *, const char *);
-void   print_netid(const char *);
-void   print_passwd_group(int, const char *);
-void   read_group(const char *);
-void   read_passwd(const char *);
-void   usage(void);
+static void    add_group(const char *, const char *);
+static void    add_user(const char *, const char *, const char *);
+static int     hashidx(char);
+static int     isgsep(char);
+static void    print_hosts(const char *, const char *);
+static void    print_netid(const char *);
+static void    print_passwd_group(int, const char *);
+static void    read_group(const char *);
+static void    read_passwd(const char *);
+__dead static void     usage(void);
 
 TAILQ_HEAD(user_list, user);
-struct user_list root;
-struct user_list hroot[HASHMAX];
+static struct user_list root;
+static struct user_list hroot[HASHMAX];
 
 int
 main(int argc, char *argv[])
@@ -146,7 +145,7 @@
        exit (0);
 }
 
-int
+static int
 hashidx(char key)
 {
        if (key < 'A')
@@ -164,7 +163,7 @@
        return(54);
 }
 
-void
+static void
 add_user(const char *username, const char *uid, const char *gid)
 {
        struct user *u;
@@ -189,7 +188,7 @@
        TAILQ_INSERT_TAIL((&hroot[idx]), u, hash);
 }
 
-void
+static void
 add_group(const char *username, const char *gid)
 {
        struct user *u;
@@ -211,7 +210,7 @@
        }
 }
 
-void
+static void
 read_passwd(const char *fname)
 {
        FILE    *pfile;
@@ -271,7 +270,7 @@
        (void)fclose(pfile);
 }
 
-int
+static int
 isgsep(char ch)
 {
 
@@ -286,7 +285,7 @@
        return (0);
 }
 
-void
+static void
 read_group(const char *fname)
 {
        FILE    *gfile;
@@ -354,7 +353,7 @@
        (void)fclose(gfile);
 }
 
-void
+static void
 print_passwd_group(int qflag, const char *domain)
 {
        struct user *u, *p;
@@ -380,7 +379,7 @@
        }
 }
 
-void
+static void
 print_hosts(const char *fname, const char *domain)
 {
        FILE    *hfile;
@@ -413,7 +412,7 @@
        (void) fclose(hfile);
 }
 



Home | Main Index | Thread Index | Old Index