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, sprinkle "const"
details: https://anonhg.NetBSD.org/src/rev/fbc5a507cf83
branches: trunk
changeset: 749094:fbc5a507cf83
user: drochner <drochner%NetBSD.org@localhost>
date: Tue Nov 17 18:58:07 2009 +0000
description:
ANSIfy, sprinkle "const"
diffstat:
usr.sbin/mopd/common/cmp.c | 9 ++--
usr.sbin/mopd/common/cmp.h | 6 +-
usr.sbin/mopd/common/common.h | 8 ++--
usr.sbin/mopd/common/device.c | 18 +++-------
usr.sbin/mopd/common/device.h | 8 ++--
usr.sbin/mopd/common/dl.c | 12 ++----
usr.sbin/mopd/common/dl.h | 6 +-
usr.sbin/mopd/common/get.c | 38 +++++++---------------
usr.sbin/mopd/common/get.h | 18 +++++-----
usr.sbin/mopd/common/pf.c | 36 +++++++--------------
usr.sbin/mopd/common/pf.h | 14 ++++----
usr.sbin/mopd/common/print.c | 56 ++++++++++----------------------
usr.sbin/mopd/common/print.h | 16 ++++----
usr.sbin/mopd/common/put.c | 42 +++++-------------------
usr.sbin/mopd/common/put.h | 6 +-
usr.sbin/mopd/common/rc.c | 9 +---
usr.sbin/mopd/common/rc.h | 6 +-
usr.sbin/mopd/mopd/mopd.c | 6 +-
usr.sbin/mopd/mopd/process.c | 72 ++++++++++++++----------------------------
usr.sbin/mopd/mopd/process.h | 8 ++--
20 files changed, 146 insertions(+), 248 deletions(-)
diffs (truncated from 1101 to 300 lines):
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/cmp.c
--- a/usr.sbin/mopd/common/cmp.c Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/cmp.c Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmp.c,v 1.4 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: cmp.c,v 1.5 2009/11/17 18:58:07 drochner Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -26,15 +26,14 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: cmp.c,v 1.4 2009/10/20 00:51:13 snj Exp $");
+__RCSID("$NetBSD: cmp.c,v 1.5 2009/11/17 18:58:07 drochner Exp $");
#endif
#include "os.h"
#include "cmp.h"
int
-mopCmpEAddr(addr1, addr2)
- u_char *addr1, *addr2;
+mopCmpEAddr(const u_char *addr1, const u_char *addr2)
{
- return(memcmp((char *)addr1, (char *)addr2, 6));
+ return(memcmp(addr1, addr2, 6));
}
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/cmp.h
--- a/usr.sbin/mopd/common/cmp.h Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/cmp.h Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmp.h,v 1.5 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: cmp.h,v 1.6 2009/11/17 18:58:07 drochner 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.5 2009/10/20 00:51:13 snj Exp $
+ * $NetBSD: cmp.h,v 1.6 2009/11/17 18:58:07 drochner Exp $
*
*/
@@ -31,7 +31,7 @@
#define _CMP_H_
__BEGIN_DECLS
-int mopCmpEAddr __P((u_char *, u_char *));
+int mopCmpEAddr __P((const u_char *, const u_char *));
__END_DECLS
#endif /* _CMP_H_ */
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/common.h
--- a/usr.sbin/mopd/common/common.h Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/common.h Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.7 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: common.h,v 1.8 2009/11/17 18:58:07 drochner 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.7 2009/10/20 00:51:13 snj Exp $
+ * $NetBSD: common.h,v 1.8 2009/11/17 18:58:07 drochner Exp $
*
*/
@@ -53,9 +53,9 @@
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((char *, int, u_short, int));
+ int (*iopen) __P((const char *, int, u_short, int));
/* Interface Open Routine */
- int (*write) __P((int, u_char *, int, int));
+ int (*write) __P((int, const u_char *, int, int));
/* Interface Write Routine */
void (*read) __P((void)); /* Interface Read Routine */
struct if_info *next; /* Next Interface */
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/device.c
--- a/usr.sbin/mopd/common/device.c Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/device.c Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device.c,v 1.10 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: device.c,v 1.11 2009/11/17 18:58:07 drochner 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.10 2009/10/20 00:51:13 snj Exp $");
+__RCSID("$NetBSD: device.c,v 1.11 2009/11/17 18:58:07 drochner Exp $");
#endif
#include "os.h"
@@ -38,7 +38,7 @@
struct if_info *iflist; /* Interface List */
-void deviceOpen __P((char *, u_short, int));
+void deviceOpen(const char *, u_short, int);
#ifdef DEV_NEW_CONF
/*
@@ -46,9 +46,7 @@
*/
void
-deviceEthAddr(ifname, eaddr)
- char *ifname;
- u_char *eaddr;
+deviceEthAddr(const char *ifname, u_char *eaddr)
{
struct sockaddr_dl *sdl;
struct ifaddrs *ifap, *ifa;
@@ -74,10 +72,7 @@
#endif /* DEV_NEW_CONF */
void
-deviceOpen(ifname, proto, trans)
- char *ifname;
- u_short proto;
- int trans;
+deviceOpen(const char *ifname, u_short proto, int trans)
{
struct if_info *p, tmp;
@@ -127,8 +122,7 @@
}
void
-deviceInitOne(ifname)
- char *ifname;
+deviceInitOne(const char *ifname)
{
char interface[IFNAME_SIZE];
struct if_info *p;
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/device.h
--- a/usr.sbin/mopd/common/device.h Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/device.h Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.5 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: device.h,v 1.6 2009/11/17 18:58:07 drochner 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.5 2009/10/20 00:51:13 snj Exp $
+ * $NetBSD: device.h,v 1.6 2009/11/17 18:58:07 drochner Exp $
*
*/
@@ -32,9 +32,9 @@
__BEGIN_DECLS
#ifdef DEV_NEW_CONF
-void deviceEthAddr __P((char *, u_char *));
+void deviceEthAddr __P((const char *, u_char *));
#endif
-void deviceInitOne __P((char *));
+void deviceInitOne __P((const char *));
void deviceInitAll __P((void));
/* from loop-bsd.c */
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/dl.c
--- a/usr.sbin/mopd/common/dl.c Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/dl.c Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dl.c,v 1.6 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: dl.c,v 1.7 2009/11/17 18:58:07 drochner Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -26,7 +26,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: dl.c,v 1.6 2009/10/20 00:51:13 snj Exp $");
+__RCSID("$NetBSD: dl.c,v 1.7 2009/11/17 18:58:07 drochner Exp $");
#endif
#include "os.h"
@@ -36,14 +36,12 @@
#include "print.h"
void
-mopDumpDL(fd, pkt, trans)
- FILE *fd;
- u_char *pkt;
- int trans;
+mopDumpDL(FILE *fd, const u_char *pkt, int trans)
{
int i,idx = 0;
u_int32_t tmpl;
- u_char tmpc,c,program[257],code,*ucp;
+ u_char tmpc,c,program[257],code;
+ const u_char *ucp;
u_short len,tmps,moplen;
len = mopGetLength(pkt, trans);
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/dl.h
--- a/usr.sbin/mopd/common/dl.h Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/dl.h Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dl.h,v 1.5 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: dl.h,v 1.6 2009/11/17 18:58:07 drochner 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.5 2009/10/20 00:51:13 snj Exp $
+ * $NetBSD: dl.h,v 1.6 2009/11/17 18:58:07 drochner Exp $
*
*/
@@ -31,7 +31,7 @@
#define _DL_H_
__BEGIN_DECLS
-void mopDumpDL __P((FILE *, u_char *, int));
+void mopDumpDL __P((FILE *, const u_char *, int));
__END_DECLS
#endif /* _DL_H_ */
diff -r c3151a70b623 -r fbc5a507cf83 usr.sbin/mopd/common/get.c
--- a/usr.sbin/mopd/common/get.c Tue Nov 17 18:54:26 2009 +0000
+++ b/usr.sbin/mopd/common/get.c Tue Nov 17 18:58:07 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: get.c,v 1.5 2009/10/20 00:51:13 snj Exp $ */
+/* $NetBSD: get.c,v 1.6 2009/11/17 18:58:07 drochner Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -26,7 +26,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: get.c,v 1.5 2009/10/20 00:51:13 snj Exp $");
+__RCSID("$NetBSD: get.c,v 1.6 2009/11/17 18:58:07 drochner Exp $");
#endif
#include "os.h"
@@ -34,9 +34,7 @@
#include "mopdef.h"
u_char
-mopGetChar(pkt, idx)
- u_char *pkt;
- int *idx;
+mopGetChar(const u_char *pkt, int *idx)
{
u_char ret;
@@ -46,9 +44,7 @@
}
u_short
-mopGetShort(pkt, idx)
- u_char *pkt;
- int *idx;
+mopGetShort(const u_char *pkt, int *idx)
{
u_short ret;
@@ -58,9 +54,7 @@
}
u_int32_t
-mopGetLong(pkt, idx)
- u_char *pkt;
- int *idx;
+mopGetLong(const u_char *pkt, int *idx)
{
u_int32_t ret;
@@ -73,9 +67,7 @@
}
void
-mopGetMulti(pkt, idx, dest, size)
- u_char *pkt,*dest;
- int *idx,size;
+mopGetMulti(const u_char *pkt, int *idx, u_char *dest, int size)
{
int i;
Home |
Main Index |
Thread Index |
Old Index