diff options
author | steve <steve@FreeBSD.org> | 1997-06-29 19:50:26 +0000 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1997-06-29 19:50:26 +0000 |
commit | c08c53d77406e9025bae15bb0da72f757f38073b (patch) | |
tree | c3a91194a8e6990997d715644d67ac180cabc8fc /libexec | |
parent | 0d992ff3138ae20de7a6f94dd7a46d15618900ad (diff) | |
download | FreeBSD-src-c08c53d77406e9025bae15bb0da72f757f38073b.zip FreeBSD-src-c08c53d77406e9025bae15bb0da72f757f38073b.tar.gz |
Zap register keyword usage and convert: bcopy -> memmove, bzero -> memset,
index -> strchr, and rindex -> strrchr.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rbootd/bpf.c | 12 | ||||
-rw-r--r-- | libexec/rbootd/parseconf.c | 20 | ||||
-rw-r--r-- | libexec/rbootd/rbootd.c | 8 | ||||
-rw-r--r-- | libexec/rbootd/rmp_var.h | 2 | ||||
-rw-r--r-- | libexec/rbootd/rmpproto.c | 34 | ||||
-rw-r--r-- | libexec/rbootd/utils.c | 36 |
6 files changed, 56 insertions, 56 deletions
diff --git a/libexec/rbootd/bpf.c b/libexec/rbootd/bpf.c index 6633b48..ddeea4f 100644 --- a/libexec/rbootd/bpf.c +++ b/libexec/rbootd/bpf.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)bpf.c 8.1 (Berkeley) 6/4/93 - * $Id: bpf.c,v 1.6 1997/02/22 14:21:57 peter Exp $ + * $Id: bpf.c,v 1.7 1997/06/29 19:00:01 steve Exp $ * * From: Utah Hdr: bpf.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -146,7 +146,7 @@ BpfOpen() ifr.ifr_addr.sa_len = RMP_ADDRLEN + 2; #endif ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(&RmpMcastAddr[0], (char *)&ifr.ifr_addr.sa_data[0], RMP_ADDRLEN); + memmove((char *)&ifr.ifr_addr.sa_data[0], &RmpMcastAddr[0], RMP_ADDRLEN); if (ioctl(BpfFd, BIOCPROMISC, (caddr_t)0) < 0) { syslog(LOG_ERR, "bpf: can't set promiscuous mode: %m"); Exit(0); @@ -308,7 +308,7 @@ BpfRead(rconn, doread) RMPCONN *rconn; int doread; { - register int datlen, caplen, hdrlen; + int datlen, caplen, hdrlen; static u_int8_t *bp = NULL, *ep = NULL; int cc; @@ -345,9 +345,9 @@ BpfRead(rconn, doread) caplen); else { rconn->rmplen = caplen; - bcopy((char *)&bhp->bh_tstamp, (char *)&rconn->tstamp, + memmove((char *)&rconn->tstamp, (char *)&bhp->bh_tstamp, sizeof(struct timeval)); - bcopy((char *)bp + hdrlen, (char *)&rconn->rmp, caplen); + memmove((char *)&rconn->rmp, (char *)bp + hdrlen, caplen); } bp += BPF_WORDALIGN(caplen + hdrlen); return(1); @@ -410,7 +410,7 @@ BpfClose() ifr.ifr_addr.sa_len = RMP_ADDRLEN + 2; #endif ifr.ifr_addr.sa_family = AF_UNSPEC; - bcopy(&RmpMcastAddr[0], (char *)&ifr.ifr_addr.sa_data[0], RMP_ADDRLEN); + memmove((char *)&ifr.ifr_addr.sa_data[0], &RmpMcastAddr[0], RMP_ADDRLEN); if (ioctl(BpfFd, SIOCDELMULTI, (caddr_t)&ifr) < 0) (void) ioctl(BpfFd, BIOCPROMISC, (caddr_t)0); diff --git a/libexec/rbootd/parseconf.c b/libexec/rbootd/parseconf.c index 93c9411..4950e4f 100644 --- a/libexec/rbootd/parseconf.c +++ b/libexec/rbootd/parseconf.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)parseconf.c 8.1 (Berkeley) 6/4/93 - * $Id: parseconf.c,v 1.5 1997/02/22 14:21:57 peter Exp $ + * $Id: parseconf.c,v 1.6 1997/06/29 19:00:08 steve Exp $ * * From: Utah Hdr: parseconf.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -85,8 +85,8 @@ ParseConfig() CLIENT *client; u_int8_t *addr; char line[C_LINELEN]; - register char *cp, *bcp; - register int i, j; + char *cp, *bcp; + int i, j; int omask, linecnt = 0; if (BootAny) /* ignore config file */ @@ -128,7 +128,7 @@ ParseConfig() if (*line == '\0' || *line == '#') /* ignore comment */ continue; - if ((cp = index(line,'#')) != NULL) /* trash comments */ + if ((cp = strchr(line,'#')) != NULL) /* trash comments */ *cp = '\0'; cp = line; /* init `cp' */ @@ -248,11 +248,11 @@ ParseAddr(str) char *str; { static u_int8_t addr[RMP_ADDRLEN]; - register char *cp; - register unsigned i; - register int part, subpart; + char *cp; + unsigned i; + int part, subpart; - bzero((char *)&addr[0], RMP_ADDRLEN); /* zero static buffer */ + memset((char *)&addr[0], 0, RMP_ADDRLEN); /* zero static buffer */ part = subpart = 0; for (cp = str; *cp; cp++) { @@ -312,8 +312,8 @@ GetBootFiles() { DIR *dfd; struct stat statb; - register struct dirent *dp; - register int i; + struct dirent *dp; + int i; /* * Free the current list of boot files. diff --git a/libexec/rbootd/rbootd.c b/libexec/rbootd/rbootd.c index 3b98ccf..0129c6d 100644 --- a/libexec/rbootd/rbootd.c +++ b/libexec/rbootd/rbootd.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)rbootd.c 8.1 (Berkeley) 6/4/93 - * $Id: rbootd.c,v 1.6 1997/03/28 15:48:14 imp Exp $ + * $Id: rbootd.c,v 1.7 1997/06/29 19:00:15 steve Exp $ * * From: Utah Hdr: rbootd.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -297,7 +297,7 @@ main(argc, argv) void DoTimeout() { - register RMPCONN *rtmp; + RMPCONN *rtmp; struct timeval now; (void) gettimeofday(&now, (struct timezone *)0); @@ -333,9 +333,9 @@ DoTimeout() CLIENT * FindClient(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { - register CLIENT *ctmp; + CLIENT *ctmp; for (ctmp = Clients; ctmp != NULL; ctmp = ctmp->next) if (bcmp((char *)&rconn->rmp.hp_hdr.saddr[0], diff --git a/libexec/rbootd/rmp_var.h b/libexec/rbootd/rmp_var.h index 7da0fdd..3a9c7f4 100644 --- a/libexec/rbootd/rmp_var.h +++ b/libexec/rbootd/rmp_var.h @@ -127,7 +127,7 @@ typedef char restofpkt; * COPYWORD(w1,w2) Copy u_word `w1' to `w2'. * GETWORD(w,i) Copy u_word `w' into int `i'. * PUTWORD(i,w) Copy int `i' into u_word `w'. - * + * * N.B. Endianness is handled by use of ntohl/htonl */ #if defined(__vax__) || defined(__tahoe__) || defined(__m68k__) diff --git a/libexec/rbootd/rmpproto.c b/libexec/rbootd/rmpproto.c index 9120718..31102e8 100644 --- a/libexec/rbootd/rmpproto.c +++ b/libexec/rbootd/rmpproto.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)rmpproto.c 8.1 (Berkeley) 6/4/93 - * $Id$ + * $Id: rmpproto.c,v 1.2 1997/06/29 19:00:24 steve Exp $ * * From: Utah Hdr: rmpproto.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -176,9 +176,9 @@ int SendServerID(rconn) RMPCONN *rconn; { - register struct rmp_packet *rpl; - register char *src, *dst; - register u_int8_t *size; + struct rmp_packet *rpl; + char *src, *dst; + u_int8_t *size; rpl = &rconn->rmp; /* cache ptr to RMP packet */ @@ -230,10 +230,10 @@ SendFileNo(req, rconn, filelist) RMPCONN *rconn; char *filelist[]; { - register struct rmp_packet *rpl; - register char *src, *dst; - register u_int8_t *size; - register int i; + struct rmp_packet *rpl; + char *src, *dst; + u_int8_t *size; + int i; GETWORD(req->r_brpl.rmp_seqno, i); /* SeqNo is really FileNo */ rpl = &rconn->rmp; /* cache ptr to RMP packet */ @@ -296,9 +296,9 @@ SendBootRepl(req, rconn, filelist) int retval; char *filename, filepath[RMPBOOTDATA+1]; RMPCONN *oldconn; - register struct rmp_packet *rpl; - register char *src, *dst1, *dst2; - register u_int8_t i; + struct rmp_packet *rpl; + char *src, *dst1, *dst2; + u_int8_t i; /* * If another connection already exists, delete it since we @@ -339,7 +339,7 @@ SendBootRepl(req, rconn, filelist) * stripped file name and spoof the client into thinking that it * really got what it wanted. */ - filename = (filename = rindex(filepath,'/'))? ++filename: filepath; + filename = (filename = strrchr(filepath,'/'))? ++filename: filepath; /* * Check that this is a valid boot file name. @@ -402,8 +402,8 @@ SendReadRepl(rconn) { int retval = 0; RMPCONN *oldconn; - register struct rmp_packet *rpl, *req; - register int size = 0; + struct rmp_packet *rpl, *req; + int size = 0; int madeconn = 0; /* @@ -564,14 +564,14 @@ BootDone(rconn) */ int SendPacket(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { /* * Set Ethernet Destination address to Source (BPF and the enet * driver will take care of getting our source address set). */ - bcopy((char *)&rconn->rmp.hp_hdr.saddr[0], - (char *)&rconn->rmp.hp_hdr.daddr[0], RMP_ADDRLEN); + memmove((char *)&rconn->rmp.hp_hdr.daddr[0], + (char *)&rconn->rmp.hp_hdr.saddr[0], RMP_ADDRLEN); #ifdef __FreeBSD__ /* BPF (incorrectly) wants this in host order. */ rconn->rmp.hp_hdr.len = rconn->rmplen - sizeof(struct hp_hdr); diff --git a/libexec/rbootd/utils.c b/libexec/rbootd/utils.c index 8defac0..aadb5a9 100644 --- a/libexec/rbootd/utils.c +++ b/libexec/rbootd/utils.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)utils.c 8.1 (Berkeley) 6/4/93 - * $Id$ + * $Id: utils.c,v 1.2 1997/06/29 19:00:29 steve Exp $ * * From: Utah Hdr: utils.c 3.1 92/07/06 * Author: Jeff Forys, University of Utah CSS @@ -84,7 +84,7 @@ DispPkt(rconn, direct) static char ReadFmt[] = "\t\tRetCode:%u Offset:%lx SessID:%x\n"; struct tm *tmp; - register struct rmp_packet *rmp; + struct rmp_packet *rmp; int i, omask; u_int32_t t; @@ -210,8 +210,8 @@ GetEtherAddr(addr) { static char Hex[] = "0123456789abcdef"; static char etherstr[RMP_ADDRLEN*3]; - register int i; - register char *cp; + int i; + char *cp; /* * For each byte in `addr', convert it to "<hexchar><hexchar>:". @@ -247,10 +247,10 @@ GetEtherAddr(addr) */ void DspFlnm(size, flnm) - register u_int size; - register char *flnm; + u_int size; + char *flnm; { - register int i; + int i; (void) fprintf(DbgFp, "\n\t\tFile Name (%u): <", size); for (i = 0; i < size; i++) @@ -284,8 +284,8 @@ NewClient(addr) return(NULL); } - bzero(ctmp, sizeof(CLIENT)); - bcopy(addr, &ctmp->addr[0], RMP_ADDRLEN); + memset(ctmp, 0, sizeof(CLIENT)); + memmove(&ctmp->addr[0], addr, RMP_ADDRLEN); return(ctmp); } @@ -308,7 +308,7 @@ NewClient(addr) void FreeClients() { - register CLIENT *ctmp; + CLIENT *ctmp; while (Clients != NULL) { ctmp = Clients; @@ -386,7 +386,7 @@ NewConn(rconn) * Copy template into `rtmp', init file descriptor to `-1' and * set ptr to next elem NULL. */ - bcopy((char *)rconn, (char *)rtmp, sizeof(RMPCONN)); + memmove((char *)rtmp, (char *)rconn, sizeof(RMPCONN)); rtmp->bootfd = -1; rtmp->next = NULL; @@ -408,7 +408,7 @@ NewConn(rconn) */ void FreeConn(rtmp) - register RMPCONN *rtmp; + RMPCONN *rtmp; { /* * If the file descriptor is in use, close the file. @@ -444,7 +444,7 @@ FreeConn(rtmp) void FreeConns() { - register RMPCONN *rtmp; + RMPCONN *rtmp; while (RmpConns != NULL) { rtmp = RmpConns; @@ -475,7 +475,7 @@ FreeConns() */ void AddConn(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { if (RmpConns != NULL) rconn->next = RmpConns; @@ -503,9 +503,9 @@ AddConn(rconn) */ RMPCONN * FindConn(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { - register RMPCONN *rtmp; + RMPCONN *rtmp; for (rtmp = RmpConns; rtmp != NULL; rtmp = rtmp->next) if (bcmp((char *)&rconn->rmp.hp_hdr.saddr[0], @@ -533,9 +533,9 @@ FindConn(rconn) */ void RemoveConn(rconn) - register RMPCONN *rconn; + RMPCONN *rconn; { - register RMPCONN *thisrconn, *lastrconn; + RMPCONN *thisrconn, *lastrconn; if (RmpConns == rconn) { /* easy case */ RmpConns = RmpConns->next; |