summaryrefslogtreecommitdiff
path: root/usr.sbin/mopd/common
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-12-01 00:56:52 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-12-01 00:56:52 +0000
commitffc6971951319dd718d51aab423355f68f17dc1d (patch)
tree13c33f610a6732d7f3d81db5d0cc5cafb300f7fa /usr.sbin/mopd/common
parent5becfd833db00e5c5ad38926beab55c9e93c9a1e (diff)
-Wall cleanup: trim unused vars, right format strings, constify rcsids,
braces where needed, add missing prototypes. tested and ok maja@
Diffstat (limited to 'usr.sbin/mopd/common')
-rw-r--r--usr.sbin/mopd/common/cmp.c4
-rw-r--r--usr.sbin/mopd/common/device.c9
-rw-r--r--usr.sbin/mopd/common/dl.c18
-rw-r--r--usr.sbin/mopd/common/file.c36
-rw-r--r--usr.sbin/mopd/common/file.h5
-rw-r--r--usr.sbin/mopd/common/get.c4
-rw-r--r--usr.sbin/mopd/common/loop-bsd.c4
-rw-r--r--usr.sbin/mopd/common/mopdef.c4
-rw-r--r--usr.sbin/mopd/common/nma.c4
-rw-r--r--usr.sbin/mopd/common/pf.c4
-rw-r--r--usr.sbin/mopd/common/print.c4
-rw-r--r--usr.sbin/mopd/common/put.c4
-rw-r--r--usr.sbin/mopd/common/rc.c26
13 files changed, 61 insertions, 65 deletions
diff --git a/usr.sbin/mopd/common/cmp.c b/usr.sbin/mopd/common/cmp.c
index dab8acf63a5..e603fd56ca9 100644
--- a/usr.sbin/mopd/common/cmp.c
+++ b/usr.sbin/mopd/common/cmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmp.c,v 1.5 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: cmp.c,v 1.6 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: cmp.c,v 1.5 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: cmp.c,v 1.6 2003/12/01 00:56:51 avsm Exp $";
#endif
#include "os.h"
diff --git a/usr.sbin/mopd/common/device.c b/usr.sbin/mopd/common/device.c
index 60893fd8598..3e5b6bfd431 100644
--- a/usr.sbin/mopd/common/device.c
+++ b/usr.sbin/mopd/common/device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: device.c,v 1.10 2003/11/07 10:16:46 jmc Exp $ */
+/* $OpenBSD: device.c,v 1.11 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: device.c,v 1.10 2003/11/07 10:16:46 jmc Exp $";
+static const char rcsid[] = "$OpenBSD: device.c,v 1.11 2003/12/01 00:56:51 avsm Exp $";
#endif
#include "os.h"
@@ -52,12 +52,7 @@ deviceEthAddr(ifname, eaddr)
char *ifname;
u_char *eaddr;
{
- char inbuf[8192];
- struct ifconf ifc;
- struct ifreq *ifr;
struct sockaddr_dl *sdl;
- int fd;
- int i, len;
struct ifaddrs *ifap, *ifa;
if (getifaddrs(&ifap) != 0) {
diff --git a/usr.sbin/mopd/common/dl.c b/usr.sbin/mopd/common/dl.c
index ce7a469ba87..01e33f8ceac 100644
--- a/usr.sbin/mopd/common/dl.c
+++ b/usr.sbin/mopd/common/dl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dl.c,v 1.3 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: dl.c,v 1.4 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: dl.c,v 1.3 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: dl.c,v 1.4 2003/12/01 00:56:51 avsm Exp $";
#endif
#include "os.h"
@@ -65,7 +65,7 @@ mopDumpDL(fd, pkt, trans)
if (moplen > 6) {
tmpl = mopGetLong(pkt,&index);/* Load Address */
- (void)fprintf(fd,"Load Address : %08x\n",tmpl);
+ (void)fprintf(fd,"Load Address : %08lx\n",tmpl);
}
if (moplen > 10) {
@@ -96,7 +96,7 @@ mopDumpDL(fd, pkt, trans)
}
tmpl = mopGetLong(pkt,&index); /* Load Address */
- (void)fprintf(fd,"Xfer Address : %08x\n",tmpl);
+ (void)fprintf(fd,"Xfer Address : %08lx\n",tmpl);
break;
case MOP_K_CODE_DCM:
@@ -110,7 +110,7 @@ mopDumpDL(fd, pkt, trans)
(void)fprintf(fd,"Load Number : %02x\n",tmpc);
tmpl = mopGetLong(pkt,&index); /* Load Address */
- (void)fprintf(fd,"Load Address : %08x\n",tmpl);
+ (void)fprintf(fd,"Load Address : %08lx\n",tmpl);
if (moplen > 6) {
#ifndef SHORT_PRINT
@@ -147,7 +147,7 @@ mopDumpDL(fd, pkt, trans)
case MOP_K_CODE_RMD:
tmpl = mopGetLong(pkt,&index); /* Memory Address */
- (void)fprintf(fd,"Mem Address : %08x\n",tmpl);
+ (void)fprintf(fd,"Mem Address : %08lx\n",tmpl);
tmps = mopGetShort(pkt,&index); /* Count */
(void)fprintf(fd,"Count : %04x (%d)\n",tmps,tmps);
@@ -206,7 +206,7 @@ mopDumpDL(fd, pkt, trans)
(void)fprintf(fd,"Format : %02x\n",tmpc);
tmpl = mopGetLong(pkt,&index); /* Memory Size */
- (void)fprintf(fd,"Memory Size : %08x\n",tmpl);
+ (void)fprintf(fd,"Memory Size : %08lx\n",tmpl);
tmpc = mopGetChar(pkt,&index); /* Bits */
(void)fprintf(fd,"Bits : %02x\n",tmpc);
@@ -217,7 +217,7 @@ mopDumpDL(fd, pkt, trans)
case MOP_K_CODE_MDD:
tmpl = mopGetLong(pkt,&index); /* Memory Address */
- (void)fprintf(fd,"Mem Address : %08x\n",tmpl);
+ (void)fprintf(fd,"Mem Address : %08lx\n",tmpl);
if (moplen > 5) {
#ifndef SHORT_PRINT
@@ -301,7 +301,7 @@ mopDumpDL(fd, pkt, trans)
}
tmpl = mopGetLong(pkt,&index); /* Transfer Address */
- (void)fprintf(fd,"Transfer Addr: %08x\n",tmpl);
+ (void)fprintf(fd,"Transfer Addr: %08lx\n",tmpl);
break;
default:
diff --git a/usr.sbin/mopd/common/file.c b/usr.sbin/mopd/common/file.c
index e160e2e1fcb..cf6583edc2a 100644
--- a/usr.sbin/mopd/common/file.c
+++ b/usr.sbin/mopd/common/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.6 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: file.c,v 1.7 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1995-96 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: file.c,v 1.6 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: file.c,v 1.7 2003/12/01 00:56:51 avsm Exp $";
#endif
#include "os.h"
@@ -189,10 +189,10 @@ GetMopFileInfo(fd, load, xfr)
header[iha+IHA_L_TFRADR1]) & 0x7fffffff;
#ifdef INFO
printf("Native Image (VAX)\n");
- printf("Header Block Count: %d\n",hbcnt);
- printf("Image Size: %08x\n",isize);
- printf("Load Address: %08x\n",load_addr);
- printf("Transfer Address: %08x\n",xfr_addr);
+ printf("Header Block Count: %lu\n",hbcnt);
+ printf("Image Size: %08lx\n",isize);
+ printf("Load Address: %08lx\n",load_addr);
+ printf("Transfer Address: %08lx\n",xfr_addr);
#endif
break;
case IHD_C_RSX: /* RSX image produced by TKB */
@@ -202,10 +202,10 @@ GetMopFileInfo(fd, load, xfr)
xfr_addr = header[L_BXFR+1]*256 + header[L_BXFR];
#ifdef INFO
printf("RSX Image\n");
- printf("Header Block Count: %d\n",hbcnt);
- printf("Image Size: %08x\n",isize);
- printf("Load Address: %08x\n",load_addr);
- printf("Transfer Address: %08x\n",xfr_addr);
+ printf("Header Block Count: %lu\n",hbcnt);
+ printf("Image Size: %08lx\n",isize);
+ printf("Load Address: %08lx\n",load_addr);
+ printf("Transfer Address: %08lx\n",xfr_addr);
#endif
break;
case IHD_C_BPA: /* BASIC plus analog */
@@ -242,10 +242,10 @@ GetMopFileInfo(fd, load, xfr)
header[iha+IHA_L_TFRADR1]);
#ifdef INFO
printf("PMAX Image \n");
- printf("Header Block Count: %d\n",hbcnt);
- printf("Image Size: %08x\n",isize);
- printf("Load Address: %08x\n",load_addr);
- printf("Transfer Address: %08x\n",xfr_addr);
+ printf("Header Block Count: %lu\n",hbcnt);
+ printf("Image Size: %08lx\n",isize);
+ printf("Load Address: %08lx\n",load_addr);
+ printf("Transfer Address: %08lx\n",xfr_addr);
#endif
break;
case IHD_C_ALPHA: /* ALPHA system image */
@@ -265,10 +265,10 @@ GetMopFileInfo(fd, load, xfr)
xfr_addr = 0;
#ifdef INFO
printf("Alpha Image \n");
- printf("Header Block Count: %d\n",hbcnt);
- printf("Image Size: %08x\n",isize);
- printf("Load Address: %08x\n",load_addr);
- printf("Transfer Address: %08x\n",xfr_addr);
+ printf("Header Block Count: %lu\n",hbcnt);
+ printf("Image Size: %08lx\n",isize);
+ printf("Load Address: %08lx\n",load_addr);
+ printf("Transfer Address: %08lx\n",xfr_addr);
#endif
break;
default:
diff --git a/usr.sbin/mopd/common/file.h b/usr.sbin/mopd/common/file.h
index c25dd044bf7..158b79bd073 100644
--- a/usr.sbin/mopd/common/file.h
+++ b/usr.sbin/mopd/common/file.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.h,v 1.7 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: file.h,v 1.8 2003/12/01 00:56:51 avsm 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.
*
- * $OpenBSD: file.h,v 1.7 2003/06/02 21:38:39 maja Exp $
+ * $OpenBSD: file.h,v 1.8 2003/12/01 00:56:51 avsm Exp $
*
*/
@@ -42,5 +42,6 @@ int GetAOutFileInfo(int, u_long *, u_long *, u_long *, u_long *,
u_long *, u_long *, u_long *, u_long *, int *);
int GetFileInfo(int, u_long *, u_long *, int *, u_long *, u_long *,
u_long *, u_long *, u_long *, u_long *);
+ssize_t mopFileRead(struct dllist *, u_char *);
#endif /* _FILE_H_ */
diff --git a/usr.sbin/mopd/common/get.c b/usr.sbin/mopd/common/get.c
index d203d5c7bf6..ab3e7762d7e 100644
--- a/usr.sbin/mopd/common/get.c
+++ b/usr.sbin/mopd/common/get.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: get.c,v 1.4 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: get.c,v 1.5 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: get.c,v 1.4 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: get.c,v 1.5 2003/12/01 00:56:51 avsm Exp $";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/mopd/common/loop-bsd.c b/usr.sbin/mopd/common/loop-bsd.c
index 750a0660693..21132bbf2e9 100644
--- a/usr.sbin/mopd/common/loop-bsd.c
+++ b/usr.sbin/mopd/common/loop-bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loop-bsd.c,v 1.7 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: loop-bsd.c,v 1.8 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: loop-bsd.c,v 1.7 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: loop-bsd.c,v 1.8 2003/12/01 00:56:51 avsm Exp $";
#endif
#include <stdlib.h>
diff --git a/usr.sbin/mopd/common/mopdef.c b/usr.sbin/mopd/common/mopdef.c
index 708d5365670..f60da40ab8b 100644
--- a/usr.sbin/mopd/common/mopdef.c
+++ b/usr.sbin/mopd/common/mopdef.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mopdef.c,v 1.4 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: mopdef.c,v 1.5 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1995 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: mopdef.c,v 1.4 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: mopdef.c,v 1.5 2003/12/01 00:56:51 avsm Exp $";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/mopd/common/nma.c b/usr.sbin/mopd/common/nma.c
index 280fe18858c..85bdd303020 100644
--- a/usr.sbin/mopd/common/nma.c
+++ b/usr.sbin/mopd/common/nma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nma.c,v 1.3 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: nma.c,v 1.4 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1995 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: nma.c,v 1.3 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: nma.c,v 1.4 2003/12/01 00:56:51 avsm Exp $";
#endif
#include <stddef.h>
diff --git a/usr.sbin/mopd/common/pf.c b/usr.sbin/mopd/common/pf.c
index fdc8c3b0e50..86089636ac3 100644
--- a/usr.sbin/mopd/common/pf.c
+++ b/usr.sbin/mopd/common/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.7 2003/06/04 04:43:56 deraadt Exp $ */
+/* $OpenBSD: pf.c,v 1.8 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -29,7 +29,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: pf.c,v 1.7 2003/06/04 04:43:56 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: pf.c,v 1.8 2003/12/01 00:56:51 avsm Exp $";
#endif
#include <stdio.h>
diff --git a/usr.sbin/mopd/common/print.c b/usr.sbin/mopd/common/print.c
index 7c9dae8dbc4..49d578c4f82 100644
--- a/usr.sbin/mopd/common/print.c
+++ b/usr.sbin/mopd/common/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.5 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: print.c,v 1.6 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-96 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: print.c,v 1.5 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: print.c,v 1.6 2003/12/01 00:56:51 avsm Exp $";
#endif
#include <sys/types.h>
diff --git a/usr.sbin/mopd/common/put.c b/usr.sbin/mopd/common/put.c
index 4afef270829..7fb73507e5a 100644
--- a/usr.sbin/mopd/common/put.c
+++ b/usr.sbin/mopd/common/put.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: put.c,v 1.4 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: put.c,v 1.5 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: put.c,v 1.4 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: put.c,v 1.5 2003/12/01 00:56:51 avsm Exp $";
#endif
#include <stddef.h>
diff --git a/usr.sbin/mopd/common/rc.c b/usr.sbin/mopd/common/rc.c
index 27cc3f83c21..9a67411c0bd 100644
--- a/usr.sbin/mopd/common/rc.c
+++ b/usr.sbin/mopd/common/rc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rc.c,v 1.3 2003/06/02 21:38:39 maja Exp $ */
+/* $OpenBSD: rc.c,v 1.4 2003/12/01 00:56:51 avsm Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: rc.c,v 1.3 2003/06/02 21:38:39 maja Exp $";
+static const char rcsid[] = "$OpenBSD: rc.c,v 1.4 2003/12/01 00:56:51 avsm Exp $";
#endif
#include "os.h"
@@ -75,7 +75,7 @@ mopDumpRC(fd, pkt, trans)
} else {
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Verification : %08x\n",tmpl);
+ (void)fprintf(fd,"Verification : %08lx\n",tmpl);
tmpc = mopGetChar(pkt,&index); /* Processor */
(void)fprintf(fd,"Processor : %02x ",tmpc);
@@ -161,31 +161,31 @@ mopDumpRC(fd, pkt, trans)
(void)fprintf(fd,"Last Zeroed : %04x %d\n",tmps,tmps);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Bytes rec : %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Bytes rec : %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Bytes snd : %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Bytes snd : %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Frames rec : %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Frames rec : %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Frames snd : %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Frames snd : %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Mcst Bytes re: %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Mcst Bytes re: %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Mcst Frame re: %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Mcst Frame re: %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Frame snd,def: %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Frame snd,def: %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Frame snd,col: %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Frame snd,col: %08lx %ld\n",tmpl,tmpl);
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Frame snd,mcl: %08x %d\n",tmpl,tmpl);
+ (void)fprintf(fd,"Frame snd,mcl: %08lx %ld\n",tmpl,tmpl);
tmps = mopGetShort(pkt,&index);
(void)fprintf(fd,"Snd failure : %04x %d\n",tmps,tmps);
@@ -226,7 +226,7 @@ mopDumpRC(fd, pkt, trans)
case MOP_K_CODE_RVC:
tmpl = mopGetLong(pkt,&index);
- (void)fprintf(fd,"Verification : %08x\n",tmpl);
+ (void)fprintf(fd,"Verification : %08lx\n",tmpl);
break;
case MOP_K_CODE_RLC: