Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/mopd ANSIfy + __printflike + __dead



details:   https://anonhg.NetBSD.org/src/rev/975b526fee7d
branches:  trunk
changeset: 769051:975b526fee7d
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Aug 30 19:49:10 2011 +0000

description:
ANSIfy + __printflike + __dead

diffstat:

 usr.sbin/mopd/common/cmp.h        |   6 +-
 usr.sbin/mopd/common/common.h     |  10 ++--
 usr.sbin/mopd/common/device.c     |   6 +-
 usr.sbin/mopd/common/device.h     |  20 +++++-----
 usr.sbin/mopd/common/dl.h         |   6 +-
 usr.sbin/mopd/common/file.c       |  68 ++++++++++++--------------------------
 usr.sbin/mopd/common/get.h        |  20 +++++-----
 usr.sbin/mopd/common/log.h        |  14 ++-----
 usr.sbin/mopd/common/loop-bsd.c   |  20 ++++------
 usr.sbin/mopd/common/mopdef.c     |   6 +-
 usr.sbin/mopd/common/nma.c        |  10 ++---
 usr.sbin/mopd/common/nma.h        |   8 ++--
 usr.sbin/mopd/common/pf.h         |  18 +++++-----
 usr.sbin/mopd/common/print.h      |  23 ++++++------
 usr.sbin/mopd/common/put.h        |  18 +++++-----
 usr.sbin/mopd/common/rc.h         |   6 +-
 usr.sbin/mopd/mopchk/mopchk.c     |  21 ++++-------
 usr.sbin/mopd/mopcopy/mopcopy.c   |   6 +-
 usr.sbin/mopd/mopd/mopd.c         |  21 ++++-------
 usr.sbin/mopd/mopd/process.h      |  12 +++---
 usr.sbin/mopd/mopprobe/mopprobe.c |  21 ++++-------
 usr.sbin/mopd/moptrace/moptrace.c |  21 ++++-------
 22 files changed, 153 insertions(+), 208 deletions(-)

diffs (truncated from 1049 to 300 lines):

diff -r fd29c2e1336a -r 975b526fee7d usr.sbin/mopd/common/cmp.h
--- a/usr.sbin/mopd/common/cmp.h        Tue Aug 30 19:27:37 2011 +0000
+++ b/usr.sbin/mopd/common/cmp.h        Tue Aug 30 19:49:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmp.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */
+/*     $NetBSD: cmp.h,v 1.7 2011/08/30 19:49:10 joerg Exp $    */
 
 /*
  * Copyright (c) 1993-95 Mats O Jansson.  All rights reserved.
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- *     $NetBSD: cmp.h,v 1.6 2009/11/17 18:58:07 drochner Exp $
+ *     $NetBSD: cmp.h,v 1.7 2011/08/30 19:49:10 joerg Exp $
  *
  */
 
@@ -31,7 +31,7 @@
 #define _CMP_H_
 
 __BEGIN_DECLS
-int    mopCmpEAddr __P((const u_char *, const u_char *));
+int    mopCmpEAddr(const u_char *, const u_char *);
 __END_DECLS
 
 #endif /* _CMP_H_ */
diff -r fd29c2e1336a -r 975b526fee7d usr.sbin/mopd/common/common.h
--- a/usr.sbin/mopd/common/common.h     Tue Aug 30 19:27:37 2011 +0000
+++ b/usr.sbin/mopd/common/common.h     Tue Aug 30 19:49:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.h,v 1.8 2009/11/17 18:58:07 drochner Exp $      */
+/*     $NetBSD: common.h,v 1.9 2011/08/30 19:49:10 joerg Exp $ */
 
 /*
  * Copyright (c) 1993-95 Mats O Jansson.  All rights reserved.
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- *     $NetBSD: common.h,v 1.8 2009/11/17 18:58:07 drochner Exp $
+ *     $NetBSD: common.h,v 1.9 2011/08/30 19:49:10 joerg Exp $
  *
  */
 
@@ -53,11 +53,11 @@
        int     trans;                  /* Transport type Ethernet/802.3   */
        u_char  eaddr[6];               /* Ethernet addr of this interface */
        char    if_name[IFNAME_SIZE];   /* Interface Name                  */
-       int     (*iopen) __P((const char *, int, u_short, int));
+       int     (*iopen)(const char *, int, u_short, int);
                                        /* Interface Open Routine          */
-       int     (*write) __P((int, const u_char *, int, int));
+       int     (*write)(int, const u_char *, int, int);
                                        /* Interface Write Routine         */
-       void    (*read) __P((void));    /* Interface Read Routine          */
+       void    (*read)(void);  /* Interface Read Routine          */
        struct if_info *next;           /* Next Interface                  */
 };
 
diff -r fd29c2e1336a -r 975b526fee7d usr.sbin/mopd/common/device.c
--- a/usr.sbin/mopd/common/device.c     Tue Aug 30 19:27:37 2011 +0000
+++ b/usr.sbin/mopd/common/device.c     Tue Aug 30 19:49:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: device.c,v 1.11 2009/11/17 18:58:07 drochner Exp $     */
+/*     $NetBSD: device.c,v 1.12 2011/08/30 19:49:10 joerg Exp $        */
 
 /*
  * Copyright (c) 1993-95 Mats O Jansson.  All rights reserved.
@@ -26,7 +26,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: device.c,v 1.11 2009/11/17 18:58:07 drochner Exp $");
+__RCSID("$NetBSD: device.c,v 1.12 2011/08/30 19:49:10 joerg Exp $");
 #endif
 
 #include "os.h"
@@ -218,7 +218,7 @@
  * point to point.
  */
 void
-deviceInitAll()
+deviceInitAll(void)
 {
 #ifdef DEV_NEW_CONF
        struct sockaddr_dl *sdl;
diff -r fd29c2e1336a -r 975b526fee7d usr.sbin/mopd/common/device.h
--- a/usr.sbin/mopd/common/device.h     Tue Aug 30 19:27:37 2011 +0000
+++ b/usr.sbin/mopd/common/device.h     Tue Aug 30 19:49:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: device.h,v 1.6 2009/11/17 18:58:07 drochner Exp $      */
+/*     $NetBSD: device.h,v 1.7 2011/08/30 19:49:10 joerg Exp $ */
 
 /*
  * Copyright (c) 1993-95 Mats O Jansson.  All rights reserved.
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- *     $NetBSD: device.h,v 1.6 2009/11/17 18:58:07 drochner Exp $
+ *     $NetBSD: device.h,v 1.7 2011/08/30 19:49:10 joerg Exp $
  *
  */
 
@@ -32,17 +32,17 @@
 
 __BEGIN_DECLS
 #ifdef DEV_NEW_CONF
-void   deviceEthAddr __P((const char *, u_char *));
+void   deviceEthAddr(const char *, u_char *);
 #endif
-void   deviceInitOne __P((const char *));
-void   deviceInitAll __P((void));
+void   deviceInitOne(const char *);
+void   deviceInitAll(void);
 
 /* from loop-bsd.c */
-void   Loop __P((void));
-int    mopOpenDL __P((struct if_info *, int));
-int    mopOpenRC __P((struct if_info *, int));
-void   mopReadDL __P((void));
-void   mopReadRC __P((void));
+__dead void    Loop(void);
+int    mopOpenDL(struct if_info *, int);
+int    mopOpenRC(struct if_info *, int);
+void   mopReadDL(void);
+void   mopReadRC(void);
 __END_DECLS
 
 #endif /* _DEVICE_H_ */
diff -r fd29c2e1336a -r 975b526fee7d usr.sbin/mopd/common/dl.h
--- a/usr.sbin/mopd/common/dl.h Tue Aug 30 19:27:37 2011 +0000
+++ b/usr.sbin/mopd/common/dl.h Tue Aug 30 19:49:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dl.h,v 1.6 2009/11/17 18:58:07 drochner Exp $  */
+/*     $NetBSD: dl.h,v 1.7 2011/08/30 19:49:10 joerg Exp $     */
 
 /*
  * Copyright (c) 1993-95 Mats O Jansson.  All rights reserved.
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- *     $NetBSD: dl.h,v 1.6 2009/11/17 18:58:07 drochner Exp $
+ *     $NetBSD: dl.h,v 1.7 2011/08/30 19:49:10 joerg Exp $
  *
  */
 
@@ -31,7 +31,7 @@
 #define _DL_H_
 
 __BEGIN_DECLS
-void   mopDumpDL       __P((FILE *, const u_char *, int));
+void   mopDumpDL(FILE *, const u_char *, int);
 __END_DECLS
 
 #endif /* _DL_H_ */
diff -r fd29c2e1336a -r 975b526fee7d usr.sbin/mopd/common/file.c
--- a/usr.sbin/mopd/common/file.c       Tue Aug 30 19:27:37 2011 +0000
+++ b/usr.sbin/mopd/common/file.c       Tue Aug 30 19:49:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file.c,v 1.13 2011/08/16 16:45:20 christos Exp $       */
+/*     $NetBSD: file.c,v 1.14 2011/08/30 19:49:10 joerg Exp $  */
 
 /*
  * Copyright (c) 1995-96 Mats O Jansson.  All rights reserved.
@@ -26,7 +26,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: file.c,v 1.13 2011/08/16 16:45:20 christos Exp $");
+__RCSID("$NetBSD: file.c,v 1.14 2011/08/30 19:49:10 joerg Exp $");
 #endif
 
 #include "os.h"
@@ -58,12 +58,11 @@
 # endif
 #endif /* NOELF */
 
-int    getCLBYTES __P((int));
-int    getMID __P((int, int));
+static int     getCLBYTES(int);
+static int     getMID(int, int);
 
 const char *
-FileTypeName(type)
-       mopd_imagetype type;
+FileTypeName(mopd_imagetype type)
 {
 
        switch (type) {
@@ -81,10 +80,7 @@
 }
 
 void
-mopFilePutLX(buf, idx, value, cnt)
-       u_char         *buf;
-       int             idx, cnt;
-       u_int32_t       value;
+mopFilePutLX(u_char *buf, int idx, u_int32_t value, int cnt)
 {
        int i;
        for (i = 0; i < cnt; i++) {
@@ -94,10 +90,7 @@
 }
 
 void
-mopFilePutBX(buf, idx, value, cnt)
-       u_char         *buf;
-       int             idx, cnt;
-       u_int32_t       value;
+mopFilePutBX(u_char *buf, int idx, u_int32_t value, int cnt)
 {
        int i;
        for (i = 0; i < cnt; i++) {
@@ -107,9 +100,7 @@
 }
 
 u_int32_t
-mopFileGetLX(buf, idx, cnt)
-       u_char  *buf;
-       int     idx, cnt;
+mopFileGetLX(u_char *buf, int idx, int cnt)
 {
        u_int32_t ret = 0;
        int i;
@@ -125,9 +116,7 @@
 }
 
 u_int32_t
-mopFileGetBX(buf, idx, cnt)
-       u_char  *buf;
-       int     idx, cnt;
+mopFileGetBX(u_char *buf, int idx, int cnt)
 {
        u_int32_t ret = 0;
        int i;
@@ -143,9 +132,7 @@
 }
 
 void
-mopFileSwapX(buf, idx, cnt)
-       u_char  *buf;
-       int     idx, cnt;
+mopFileSwapX(u_char *buf, int idx, int cnt)
 {
        int i;
        u_char c;
@@ -159,8 +146,7 @@
 }
 
 int
-CheckMopFile(fd)
-       int     fd;
+CheckMopFile(int fd)
 {
        u_char  header[512];
        short   image_type;
@@ -190,8 +176,7 @@
 }
 
 int
-GetMopFileInfo(dl)
-       struct          dllist *dl;
+GetMopFileInfo(struct dllist *dl)
 {
        u_char          header[512];
        short           image_type;
@@ -302,9 +287,8 @@
 }
 
 #ifndef NOAOUT
-int
-getMID(old_mid,new_mid)
-       int     old_mid, new_mid;
+static int
+getMID(int old_mid, int new_mid)
 {
        int     mid;
 
@@ -364,9 +348,8 @@
        return(mid);
 }
 
-int
-getCLBYTES(mid)
-       int     mid;
+static int
+getCLBYTES(int mid)
 {
        int     clbytes;
 
@@ -421,8 +404,7 @@
 #endif
 
 int
-CheckElfFile(fd)
-       int     fd;
+CheckElfFile(int fd)



Home | Main Index | Thread Index | Old Index