From ef3e6e6424e685a5e5e459bf69e3236a1b3e2c6e Mon Sep 17 00:00:00 2001 From: joerg Date: Tue, 30 Aug 2011 19:49:10 +0000 Subject: [PATCH] ANSIfy + __printflike + __dead --- common/cmp.h | 6 ++-- common/common.h | 10 +++---- common/device.c | 6 ++-- common/device.h | 20 ++++++------- common/dl.h | 6 ++-- common/file.c | 68 +++++++++++++++------------------------------ common/get.h | 20 ++++++------- common/log.h | 14 ++++------ common/loop-bsd.c | 20 ++++++------- common/mopdef.c | 6 ++-- common/nma.c | 10 +++---- common/nma.h | 8 +++--- common/pf.h | 18 ++++++------ common/print.h | 23 ++++++++------- common/put.h | 18 ++++++------ common/rc.h | 6 ++-- mopchk/mopchk.c | 21 ++++++-------- mopcopy/mopcopy.c | 6 ++-- mopd/mopd.c | 21 ++++++-------- mopd/process.h | 12 ++++---- mopprobe/mopprobe.c | 21 ++++++-------- moptrace/moptrace.c | 21 ++++++-------- 22 files changed, 153 insertions(+), 208 deletions(-) diff --git a/common/cmp.h b/common/cmp.h index 3ca3571..7d2fddb 100644 --- a/common/cmp.h +++ b/common/cmp.h @@ -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 --git a/common/common.h b/common/common.h index 9d9c3a8..2c25d77 100644 --- a/common/common.h +++ b/common/common.h @@ -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 @@ struct if_info { 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 --git a/common/device.c b/common/device.c index dd3f759..dc8d867 100644 --- a/common/device.c +++ b/common/device.c @@ -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 #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 @@ deviceInitOne(const char *ifname) * point to point. */ void -deviceInitAll() +deviceInitAll(void) { #ifdef DEV_NEW_CONF struct sockaddr_dl *sdl; diff --git a/common/device.h b/common/device.h index e4241c7..076936d 100644 --- a/common/device.h +++ b/common/device.h @@ -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 --git a/common/dl.h b/common/dl.h index 451a2d3..f3aa342 100644 --- a/common/dl.h +++ b/common/dl.h @@ -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 --git a/common/file.c b/common/file.c index ff2a2cf..9044904 100644 --- a/common/file.c +++ b/common/file.c @@ -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 #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 @@ __RCSID("$NetBSD: file.c,v 1.13 2011/08/16 16:45:20 christos Exp $"); # 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 @@ FileTypeName(type) } 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 @@ mopFilePutLX(buf, idx, value, cnt) } 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 @@ mopFilePutBX(buf, idx, value, cnt) } 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 @@ mopFileGetLX(buf, idx, cnt) } 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 @@ mopFileGetBX(buf, idx, cnt) } 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 @@ mopFileSwapX(buf, idx, cnt) } int -CheckMopFile(fd) - int fd; +CheckMopFile(int fd) { u_char header[512]; short image_type; @@ -190,8 +176,7 @@ CheckMopFile(fd) } int -GetMopFileInfo(dl) - struct dllist *dl; +GetMopFileInfo(struct dllist *dl) { u_char header[512]; short image_type; @@ -302,9 +287,8 @@ GetMopFileInfo(dl) } #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 @@ getMID(old_mid,new_mid) return(mid); } -int -getCLBYTES(mid) - int mid; +static int +getCLBYTES(int mid) { int clbytes; @@ -421,8 +404,7 @@ getCLBYTES(mid) #endif int -CheckElfFile(fd) - int fd; +CheckElfFile(int fd) { #ifdef NOELF return(-1); @@ -449,8 +431,7 @@ CheckElfFile(fd) } int -GetElfFileInfo(dl) - struct dllist *dl; +GetElfFileInfo(struct dllist *dl) { #ifdef NOELF return(-1); @@ -633,8 +614,7 @@ GetElfFileInfo(dl) } int -CheckAOutFile(fd) - int fd; +CheckAOutFile(int fd) { #ifdef NOAOUT return(-1); @@ -667,8 +647,7 @@ CheckAOutFile(fd) } int -GetAOutFileInfo(dl) - struct dllist *dl; +GetAOutFileInfo(struct dllist *dl) { #ifdef NOAOUT return(-1); @@ -869,8 +848,7 @@ GetAOutFileInfo(dl) } int -GetFileInfo(dl) - struct dllist *dl; +GetFileInfo(struct dllist *dl) { int error; @@ -906,9 +884,7 @@ GetFileInfo(dl) } ssize_t -mopFileRead(dlslot, buf) - struct dllist *dlslot; - u_char *buf; +mopFileRead(struct dllist *dlslot, u_char *buf) { ssize_t len, outlen; int bsz, sec; diff --git a/common/get.h b/common/get.h index 84b2567..1778dbf 100644 --- a/common/get.h +++ b/common/get.h @@ -1,4 +1,4 @@ -/* $NetBSD: get.h,v 1.5 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: get.h,v 1.6 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: get.h,v 1.5 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: get.h,v 1.6 2011/08/30 19:49:10 joerg Exp $ * */ @@ -31,14 +31,14 @@ #define _GET_H_ __BEGIN_DECLS -u_char mopGetChar __P((const u_char *, int *)); -u_short mopGetShort __P((const u_char *, int *)); -u_int32_t mopGetLong __P((const u_char *, int *)); -void mopGetMulti __P((const u_char *, int *, u_char *, int)); -int mopGetTrans __P((const u_char *, int)); -void mopGetHeader __P((const u_char *, int *, const u_char **, const u_char **, - u_short *, int *, int)); -u_short mopGetLength __P((const u_char *, int)); +u_char mopGetChar(const u_char *, int *); +u_short mopGetShort(const u_char *, int *); +u_int32_t mopGetLong(const u_char *, int *); +void mopGetMulti(const u_char *, int *, u_char *, int); +int mopGetTrans(const u_char *, int); +void mopGetHeader(const u_char *, int *, const u_char **, const u_char **, + u_short *, int *, int); +u_short mopGetLength(const u_char *, int); __END_DECLS #endif /* _GET_H_ */ diff --git a/common/log.h b/common/log.h index af373ac..09dc4ea 100644 --- a/common/log.h +++ b/common/log.h @@ -1,4 +1,4 @@ -/* $NetBSD: log.h,v 1.2 2008/04/28 20:24:17 martin Exp $ */ +/* $NetBSD: log.h,v 1.3 2011/08/30 19:49:10 joerg Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -34,14 +34,10 @@ __BEGIN_DECLS extern int mopInteractive; -void mopLogErr __P((const char *, ...)) - __attribute__((__format__(__printf__, 1, 2))); -void mopLogErrX __P((const char *, ...)) - __attribute__((__format__(__printf__, 1, 2))); -void mopLogWarn __P((const char *, ...)) - __attribute__((__format__(__printf__, 1, 2))); -void mopLogWarnX __P((const char *, ...)) - __attribute__((__format__(__printf__, 1, 2))); +void mopLogErr(const char *, ...) __dead __printflike(1, 2); +void mopLogErrX(const char *, ...) __dead __printflike(1, 2); +void mopLogWarn(const char *, ...) __printflike(1, 2); +void mopLogWarnX(const char *, ...) __printflike(1, 2); __END_DECLS #endif /* _LOG_H_ */ diff --git a/common/loop-bsd.c b/common/loop-bsd.c index baf2b83..6c48d53 100644 --- a/common/loop-bsd.c +++ b/common/loop-bsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: loop-bsd.c,v 1.10 2009/10/20 00:51:13 snj Exp $ */ +/* $NetBSD: loop-bsd.c,v 1.11 2011/08/30 19:49:10 joerg Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: loop-bsd.c,v 1.10 2009/10/20 00:51:13 snj Exp $"); +__RCSID("$NetBSD: loop-bsd.c,v 1.11 2011/08/30 19:49:10 joerg Exp $"); #endif #include @@ -48,9 +48,7 @@ __RCSID("$NetBSD: loop-bsd.c,v 1.10 2009/10/20 00:51:13 snj Exp $"); #include "log.h" int -mopOpenRC(p, trans) - struct if_info *p; - int trans; +mopOpenRC(struct if_info *p, int trans) { #ifndef NORC return (*(p->iopen))(p->if_name, @@ -63,9 +61,7 @@ mopOpenRC(p, trans) } int -mopOpenDL(p, trans) - struct if_info *p; - int trans; +mopOpenDL(struct if_info *p, int trans) { #ifndef NODL return (*(p->iopen))(p->if_name, @@ -78,12 +74,12 @@ mopOpenDL(p, trans) } void -mopReadRC() +mopReadRC(void) { } void -mopReadDL() +mopReadDL(void) { } @@ -93,14 +89,14 @@ mopReadDL() */ struct if_info *iflist; -void mopProcess __P((struct if_info *, u_char *)); +void mopProcess(struct if_info *, u_char *); /* * Loop indefinitely listening for MOP requests on the * interfaces in 'iflist'. */ void -Loop() +Loop(void) { u_char *buf, *bp, *ep; int cc, n, m; diff --git a/common/mopdef.c b/common/mopdef.c index 8ebd881..6bd1461 100644 --- a/common/mopdef.c +++ b/common/mopdef.c @@ -1,4 +1,4 @@ -/* $NetBSD: mopdef.c,v 1.4 2009/10/20 00:51:13 snj Exp $ */ +/* $NetBSD: mopdef.c,v 1.5 2011/08/30 19:49:10 joerg Exp $ */ /* * Copyright (c) 1995 Mats O Jansson. All rights reserved. @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mopdef.c,v 1.4 2009/10/20 00:51:13 snj Exp $"); +__RCSID("$NetBSD: mopdef.c,v 1.5 2011/08/30 19:49:10 joerg Exp $"); #endif #define MOPDEF_SURPESS_EXTERN @@ -40,7 +40,7 @@ char lp_802_proto[5] = MOP_K_PROTO_802_LP; /* Loopback 802.2 */ #if 0 int -mopdef_dummy() +mopdef_dummy(void) { /* Just to keep them as variables */ return(dl_mcst[0]-rc_mcst[0]- diff --git a/common/nma.c b/common/nma.c index 6fb3062..fbd8bd9 100644 --- a/common/nma.c +++ b/common/nma.c @@ -1,4 +1,4 @@ -/* $NetBSD: nma.c,v 1.5 2009/10/20 00:51:13 snj Exp $ */ +/* $NetBSD: nma.c,v 1.6 2011/08/30 19:49:11 joerg Exp $ */ /* * Copyright (c) 1995 Mats O Jansson. All rights reserved. @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: nma.c,v 1.5 2009/10/20 00:51:13 snj Exp $"); +__RCSID("$NetBSD: nma.c,v 1.6 2011/08/30 19:49:11 joerg Exp $"); #endif #include "os.h" @@ -188,8 +188,7 @@ struct commDev nmaCommDev[] = { }; const char * -nmaGetShort(devno) - int devno; +nmaGetShort(int devno) { struct commDev *current; @@ -205,8 +204,7 @@ nmaGetShort(devno) } const char * -nmaGetDevice(devno) - int devno; +nmaGetDevice(int devno) { struct commDev *current; diff --git a/common/nma.h b/common/nma.h index 16b013b..b05aeb5 100644 --- a/common/nma.h +++ b/common/nma.h @@ -1,4 +1,4 @@ -/* $NetBSD: nma.h,v 1.6 2009/10/20 00:51:13 snj Exp $ */ +/* $NetBSD: nma.h,v 1.7 2011/08/30 19:49:11 joerg Exp $ */ /* * Copyright (c) 1995 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: nma.h,v 1.6 2009/10/20 00:51:13 snj Exp $ + * $NetBSD: nma.h,v 1.7 2011/08/30 19:49:11 joerg Exp $ * */ @@ -31,8 +31,8 @@ #define _NMA_H_ __BEGIN_DECLS -const char *nmaGetShort __P((int)); -const char *nmaGetDevice __P((int)); +const char *nmaGetShort(int); +const char *nmaGetDevice(int); __END_DECLS #endif /* _NMA_H_ */ diff --git a/common/pf.h b/common/pf.h index ee898b8..2c926be 100644 --- a/common/pf.h +++ b/common/pf.h @@ -1,4 +1,4 @@ -/* $NetBSD: pf.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: pf.h,v 1.7 2011/08/30 19:49:11 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: pf.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: pf.h,v 1.7 2011/08/30 19:49:11 joerg Exp $ * */ @@ -31,13 +31,13 @@ #define _PF_H_ __BEGIN_DECLS -int pfTrans __P((const char *)); -int pfInit __P((const char *, int, u_short, int)); -int pfEthAddr __P((int, u_char *)); -int pfAddMulti __P((int, const char *, const char *)); -int pfDelMulti __P((int, const char *, const char *)); -int pfRead __P((int, u_char *, int)); -int pfWrite __P((int, const u_char *, int, int)); +int pfTrans(const char *); +int pfInit(const char *, int, u_short, int); +int pfEthAddr(int, u_char *); +int pfAddMulti(int, const char *, const char *); +int pfDelMulti(int, const char *, const char *); +int pfRead(int, u_char *, int); +int pfWrite(int, const u_char *, int, int); __END_DECLS #endif /* _PF_H_ */ diff --git a/common/print.h b/common/print.h index a50998e..f7d90ff 100644 --- a/common/print.h +++ b/common/print.h @@ -1,4 +1,4 @@ -/* $NetBSD: print.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: print.h,v 1.7 2011/08/30 19:49:11 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: print.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: print.h,v 1.7 2011/08/30 19:49:11 joerg Exp $ * */ @@ -31,16 +31,15 @@ #define _PRINT_H_ __BEGIN_DECLS -void mopPrintHWA __P((FILE *, const u_char *)); -void mopPrintBPTY __P((FILE *, u_char)); -void mopPrintPGTY __P((FILE *, u_char)); -void mopPrintOneline __P((FILE *, const u_char *, int)); -void mopPrintHeader __P((FILE *, const u_char *, int)); -void mopPrintMopHeader __P((FILE *, const u_char *, int)); -void mopPrintDevice __P((FILE *, u_char)); -void mopPrintTime __P((FILE *, const u_char *)); -void mopPrintInfo __P((FILE *, const u_char *, int *, u_short, - u_char, int)); +void mopPrintHWA(FILE *, const u_char *); +void mopPrintBPTY(FILE *, u_char); +void mopPrintPGTY(FILE *, u_char); +void mopPrintOneline(FILE *, const u_char *, int); +void mopPrintHeader(FILE *, const u_char *, int); +void mopPrintMopHeader(FILE *, const u_char *, int); +void mopPrintDevice(FILE *, u_char); +void mopPrintTime(FILE *, const u_char *); +void mopPrintInfo(FILE *, const u_char *, int *, u_short, u_char, int); __END_DECLS #endif /* _PRINT_H_ */ diff --git a/common/put.h b/common/put.h index 54c68d2..413b790 100644 --- a/common/put.h +++ b/common/put.h @@ -1,4 +1,4 @@ -/* $NetBSD: put.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: put.h,v 1.7 2011/08/30 19:49:11 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: put.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: put.h,v 1.7 2011/08/30 19:49:11 joerg Exp $ * */ @@ -31,13 +31,13 @@ #define _PUT_H_ __BEGIN_DECLS -void mopPutChar __P((u_char *, int *, u_char)); -void mopPutShort __P((u_char *, int *, u_short)); -void mopPutLong __P((u_char *, int *, u_int32_t)); -void mopPutMulti __P((u_char *, int *, const u_char *, int)); -void mopPutTime __P((u_char *, int *, time_t)); -void mopPutHeader __P((u_char *, int *, const u_char *, const u_char *, u_short, int)); -void mopPutLength __P((u_char *, int, u_short)); +void mopPutChar(u_char *, int *, u_char); +void mopPutShort(u_char *, int *, u_short); +void mopPutLong(u_char *, int *, u_int32_t); +void mopPutMulti(u_char *, int *, const u_char *, int); +void mopPutTime(u_char *, int *, time_t); +void mopPutHeader(u_char *, int *, const u_char *, const u_char *, u_short, int); +void mopPutLength(u_char *, int, u_short); __END_DECLS #endif /* _PUT_H_ */ diff --git a/common/rc.h b/common/rc.h index 16f88fc..1ae879b 100644 --- a/common/rc.h +++ b/common/rc.h @@ -1,4 +1,4 @@ -/* $NetBSD: rc.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: rc.h,v 1.7 2011/08/30 19:49:11 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: rc.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: rc.h,v 1.7 2011/08/30 19:49:11 joerg Exp $ * */ @@ -31,7 +31,7 @@ #define _RC_H_ __BEGIN_DECLS -void mopDumpRC __P((FILE *, const u_char *, int)); +void mopDumpRC(FILE *, const u_char *, int); __END_DECLS #endif /* _RC_H_ */ diff --git a/mopchk/mopchk.c b/mopchk/mopchk.c index 1686c8c..514e3aa 100644 --- a/mopchk/mopchk.c +++ b/mopchk/mopchk.c @@ -1,4 +1,4 @@ -/* $NetBSD: mopchk.c,v 1.12 2009/10/20 00:51:13 snj Exp $ */ +/* $NetBSD: mopchk.c,v 1.13 2011/08/30 19:49:11 joerg Exp $ */ /* * Copyright (c) 1995-96 Mats O Jansson. All rights reserved. @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mopchk.c,v 1.12 2009/10/20 00:51:13 snj Exp $"); +__RCSID("$NetBSD: mopchk.c,v 1.13 2011/08/30 19:49:11 joerg Exp $"); #endif /* @@ -49,9 +49,8 @@ __RCSID("$NetBSD: mopchk.c,v 1.12 2009/10/20 00:51:13 snj Exp $"); */ struct if_info *iflist; -void Usage __P((void)); -int main __P((int, char **)); -void mopProcess __P((struct if_info *, u_char *)); +__dead static void Usage(void); +void mopProcess(struct if_info *, u_char *); int AllFlag = 0; /* listen on "all" interfaces */ int VersionFlag = 0; /* Show version */ @@ -60,9 +59,7 @@ int promisc = 0; /* promisc mode not needed */ extern char version[]; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { struct dllist dl; int op, i; @@ -143,8 +140,8 @@ main(argc, argv) return (0); } -void -Usage() +static void +Usage(void) { (void) fprintf(stderr, "usage: %s [-a] [-v] [filename...]\n", getprogname()); @@ -156,8 +153,6 @@ Usage() * Doesn't actually do anything for mopchk(1) */ void -mopProcess(ii, pkt) - struct if_info *ii; - u_char *pkt; +mopProcess(struct if_info *ii, u_char *pkt) { } diff --git a/mopcopy/mopcopy.c b/mopcopy/mopcopy.c index f79216f..bfec3e3 100644 --- a/mopcopy/mopcopy.c +++ b/mopcopy/mopcopy.c @@ -1,4 +1,4 @@ -/* $NetBSD: mopcopy.c,v 1.4 2009/08/20 22:26:19 he Exp $ */ +/* $NetBSD: mopcopy.c,v 1.5 2011/08/30 19:49:11 joerg Exp $ */ /* mopcopy - Convert a Unix format kernel into something that * can be transfered via MOP. @@ -49,7 +49,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mopcopy.c,v 1.4 2009/08/20 22:26:19 he Exp $"); +__RCSID("$NetBSD: mopcopy.c,v 1.5 2011/08/30 19:49:11 joerg Exp $"); #endif #include "os.h" @@ -89,7 +89,7 @@ struct exec ex, ex_swap; #endif int -main (int argc, char **argv) +main(int argc, char **argv) { FILE *out; /* A FILE because that is easier. */ int i, j; diff --git a/mopd/mopd.c b/mopd/mopd.c index 8d90ddf..4c0d1f3 100644 --- a/mopd/mopd.c +++ b/mopd/mopd.c @@ -1,4 +1,4 @@ -/* $NetBSD: mopd.c,v 1.13 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: mopd.c,v 1.14 2011/08/30 19:49:11 joerg Exp $ */ /* * Copyright (c) 1993-96 Mats O Jansson. All rights reserved. @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mopd.c,v 1.13 2009/11/17 18:58:07 drochner Exp $"); +__RCSID("$NetBSD: mopd.c,v 1.14 2011/08/30 19:49:11 joerg Exp $"); #endif /* @@ -56,9 +56,8 @@ __RCSID("$NetBSD: mopd.c,v 1.13 2009/11/17 18:58:07 drochner Exp $"); */ struct if_info *iflist; -void Usage __P((void)); -int main __P((int, char **)); -void mopProcess __P((struct if_info *, u_char *)); +__dead static void Usage(void); +void mopProcess(struct if_info *, u_char *); int AllFlag = 0; /* listen on "all" interfaces */ int DebugFlag = 0; /* print debugging messages */ @@ -70,9 +69,7 @@ int promisc = 1; /* Need promisc mode */ const char *MopdDir = MOP_FILE_PATH; /* Path to mop directory */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c, pid; @@ -155,8 +152,8 @@ main(argc, argv) return (0); } -void -Usage() +static void +Usage(void) { (void) fprintf(stderr, "usage: %s -a [ -d -f -v ] [ -3 | -4 ]\n", getprogname()); @@ -170,9 +167,7 @@ Usage() * Process incomming packages. */ void -mopProcess(ii, pkt) - struct if_info *ii; - u_char *pkt; +mopProcess(struct if_info *ii, u_char *pkt) { const u_char *dst, *src; u_short ptype; diff --git a/mopd/process.h b/mopd/process.h index a936e98..ba3a2fe 100644 --- a/mopd/process.h +++ b/mopd/process.h @@ -1,4 +1,4 @@ -/* $NetBSD: process.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ */ +/* $NetBSD: process.h,v 1.7 2011/08/30 19:49:11 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: process.h,v 1.6 2009/11/17 18:58:07 drochner Exp $ + * $NetBSD: process.h,v 1.7 2011/08/30 19:49:11 joerg Exp $ * */ @@ -31,10 +31,10 @@ #define _PROCESS_H_ __BEGIN_DECLS -void mopProcessDL __P((FILE *, struct if_info *, u_char *, int *, - const u_char *, const u_char *, int, u_short)); -void mopProcessRC __P((FILE *, struct if_info *, u_char *, int *, - const u_char *, const u_char *, int, u_short)); +void mopProcessDL(FILE *, struct if_info *, u_char *, int *, + const u_char *, const u_char *, int, u_short); +void mopProcessRC(FILE *, struct if_info *, u_char *, int *, + const u_char *, const u_char *, int, u_short); __END_DECLS #endif /* _PROCESS_H_ */ diff --git a/mopprobe/mopprobe.c b/mopprobe/mopprobe.c index 3a29e78..09eaf90 100644 --- a/mopprobe/mopprobe.c +++ b/mopprobe/mopprobe.c @@ -1,4 +1,4 @@ -/* $NetBSD: mopprobe.c,v 1.10 2009/10/20 00:51:13 snj Exp $ */ +/* $NetBSD: mopprobe.c,v 1.11 2011/08/30 19:49:11 joerg Exp $ */ /* * Copyright (c) 1993-96 Mats O Jansson. All rights reserved. @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mopprobe.c,v 1.10 2009/10/20 00:51:13 snj Exp $"); +__RCSID("$NetBSD: mopprobe.c,v 1.11 2011/08/30 19:49:11 joerg Exp $"); #endif /* @@ -53,9 +53,8 @@ __RCSID("$NetBSD: mopprobe.c,v 1.10 2009/10/20 00:51:13 snj Exp $"); */ struct if_info *iflist; -void Usage __P((void)); -int main __P((int, char **)); -void mopProcess __P((struct if_info *, u_char *)); +__dead static void Usage(void); +void mopProcess(struct if_info *, u_char *); int AllFlag = 0; /* listen on "all" interfaces */ int DebugFlag = 0; /* print debugging messages */ @@ -65,9 +64,7 @@ int oflag = 0; /* print only once */ int promisc = 1; /* Need promisc mode */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int op; char *interface; @@ -115,8 +112,8 @@ main(argc, argv) return (0); } -void -Usage() +static void +Usage(void) { (void) fprintf(stderr, "usage: %s -a [ -3 | -4 ]\n", getprogname()); (void) fprintf(stderr, " %s [ -3 | -4 ] interface\n", @@ -128,9 +125,7 @@ Usage() * Process incomming packages. */ void -mopProcess(ii, pkt) - struct if_info *ii; - u_char *pkt; +mopProcess(struct if_info *ii, u_char *pkt) { u_char *dst, *src, *p, mopcode, tmpc, ilen; u_short *ptype, moplen, tmps, itype, len; diff --git a/moptrace/moptrace.c b/moptrace/moptrace.c index b788ba7..a069221 100644 --- a/moptrace/moptrace.c +++ b/moptrace/moptrace.c @@ -1,4 +1,4 @@ -/* $NetBSD: moptrace.c,v 1.10 2009/10/20 00:51:14 snj Exp $ */ +/* $NetBSD: moptrace.c,v 1.11 2011/08/30 19:49:11 joerg Exp $ */ /* * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: moptrace.c,v 1.10 2009/10/20 00:51:14 snj Exp $"); +__RCSID("$NetBSD: moptrace.c,v 1.11 2011/08/30 19:49:11 joerg Exp $"); #endif /* @@ -53,9 +53,8 @@ __RCSID("$NetBSD: moptrace.c,v 1.10 2009/10/20 00:51:14 snj Exp $"); */ struct if_info *iflist; -void Usage __P((void)); -int main __P((int, char **)); -void mopProcess __P((struct if_info *, u_char *)); +__dead static void Usage(void); +void mopProcess(struct if_info *, u_char *); int AllFlag = 0; /* listen on "all" interfaces */ int DebugFlag = 0; /* print debugging messages */ @@ -64,9 +63,7 @@ int Not4Flag = 0; /* Ignore MOP V4 messages */ int promisc = 1; /* Need promisc mode */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int op; char *interface; @@ -110,8 +107,8 @@ main(argc, argv) return (0); } -void -Usage() +static void +Usage(void) { (void) fprintf(stderr, "usage: %s -a [ -d ] [ -3 | -4 ]\n", getprogname()); @@ -124,9 +121,7 @@ Usage() * Process incoming packages. */ void -mopProcess(ii, pkt) - struct if_info *ii; - u_char *pkt; +mopProcess(struct if_info *ii, u_char *pkt) { int trans;