Cosmetic updates from FreeBSD.

Eliminate bcopy in favor of memcpy.
This commit is contained in:
Ralf Corsepius
2006-11-16 16:37:49 +00:00
parent 9824dafe0e
commit 3a0d61e9c3
3 changed files with 22 additions and 28 deletions

View File

@@ -56,8 +56,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $";
static char rcsid[] = "$Id$";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/param.h>
@@ -158,9 +158,9 @@ gethostanswer(answer, anslen, qname, qtype)
const char *qname;
int qtype;
{
register const HEADER *hp;
register const u_char *cp;
register int n;
const HEADER *hp;
const u_char *cp;
int n;
const u_char *eom, *erdata;
char *bp, **ap, **hap;
int type, class, buflen, ancount, qdcount;
@@ -168,7 +168,7 @@ gethostanswer(answer, anslen, qname, qtype)
int toobig = 0;
char tbuf[MAXDNAME];
const char *tname;
int (*name_ok) __P((const char *));
int (*name_ok)(const char *);
tname = qname;
host.h_name = NULL;
@@ -404,7 +404,7 @@ gethostanswer(answer, anslen, qname, qtype)
cp += n;
continue;
}
bcopy(cp, *hap++ = bp, n);
memcpy(*hap++ = bp, cp, n);
bp += n;
buflen -= n;
cp += n;
@@ -454,11 +454,7 @@ gethostanswer(answer, anslen, qname, qtype)
}
struct hostent *
__dns_getanswer(answer, anslen, qname, qtype)
const char *answer;
int anslen;
const char *qname;
int qtype;
__dns_getanswer(const char *answer, int anslen, const char *qname, int qtype)
{
switch(qtype) {
case T_AAAA:
@@ -701,7 +697,7 @@ _gethostbydnsaddr(addr, len, af)
#endif /*SUNSECURITY*/
hp->h_addrtype = af;
hp->h_length = len;
bcopy(addr, host_addr, len);
memcpy(host_addr, addr, len);
h_addr_ptrs[0] = (char *)host_addr;
h_addr_ptrs[1] = NULL;
if (af == AF_INET && (_res.options & RES_USE_INET6)) {
@@ -757,9 +753,9 @@ addrsort(ap, num)
}
}
#endif
void
_sethostdnsent(stayopen)
int stayopen;
_sethostdnsent(int stayopen)
{
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
return;

View File

@@ -55,12 +55,12 @@ static char sccsid[] = "@(#)linkaddr.c 8.1 (Berkeley) 6/4/93";
void
link_addr(addr, sdl)
register const char *addr;
register struct sockaddr_dl *sdl;
const char *addr;
struct sockaddr_dl *sdl;
{
register char *cp = sdl->sdl_data;
char *cp = sdl->sdl_data;
char *cplim = sdl->sdl_len + (char *)sdl;
register int byte = 0, state = NAMING,
int byte = 0, state = NAMING,
new=0; /* new=0 to avoid warning */
bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1);
@@ -127,17 +127,17 @@ static char hexlist[] = "0123456789abcdef";
char *
link_ntoa(sdl)
register const struct sockaddr_dl *sdl;
const struct sockaddr_dl *sdl;
{
static char obuf[64];
register char *out = obuf;
register int i;
register u_char *in = (u_char *)LLADDR(sdl);
char *out = obuf;
int i;
u_char *in = (u_char *)LLADDR(sdl);
u_char *inlim = in + sdl->sdl_alen;
int firsttime = 1;
if (sdl->sdl_nlen) {
bcopy(sdl->sdl_data, obuf, sdl->sdl_nlen);
memcpy(obuf, sdl->sdl_data, sdl->sdl_nlen);
out += sdl->sdl_nlen;
if (sdl->sdl_alen)
*out++ = ':';

View File

@@ -79,23 +79,21 @@ typedef union {
} align;
void
_map_v4v6_address(src, dst)
const char *src;
char *dst;
_map_v4v6_address(const char *src, char *dst)
{
u_char *p = (u_char *)dst;
char tmp[INADDRSZ];
int i;
/* Stash a temporary copy so our caller can update in place. */
bcopy(src, tmp, INADDRSZ);
memcpy(tmp, src, INADDRSZ);
/* Mark this ipv6 addr as a mapped ipv4. */
for (i = 0; i < 10; i++)
*p++ = 0x00;
*p++ = 0xff;
*p++ = 0xff;
/* Retrieve the saved copy and we're done. */
bcopy(tmp, (void*)p, INADDRSZ);
memcpy((void*)p, tmp, INADDRSZ);
}
void