cast pointers to longs, not ints. don't return ptr to local var.

This commit is contained in:
cgd 1995-04-24 13:27:39 +00:00
parent 06b20eca85
commit 39e0ed2fd0
4 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: addrtoname.c,v 1.3 1995/03/06 19:09:49 mycroft Exp $ */
/* $NetBSD: addrtoname.c,v 1.4 1995/04/24 13:27:39 cgd Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994
@ -170,7 +170,7 @@ getname(const u_char *ap)
/*
* Deal with alignment.
*/
switch ((int)ap & 3) {
switch ((long)ap & 3) {
case 0:
addr = *(u_int32 *)ap;
@ -355,7 +355,7 @@ etheraddr_string(register const u_char *ep)
char buf[128];
if (ether_ntohost(buf, (struct ether_addr *)ep) == 0) {
tp->e_name = savestr(buf);
return (buf);
return (tp->e_name);
}
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: print-ip.c,v 1.3 1995/03/06 19:11:14 mycroft Exp $ */
/* $NetBSD: print-ip.c,v 1.4 1995/04/24 13:27:43 cgd Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
@ -225,7 +225,7 @@ ip_print(register const u_char *bp, register int length)
* This will never happen with BPF. It does happen raw packet
* dumps from -r.
*/
if ((int)ip & (sizeof(long)-1)) {
if ((long)ip & (sizeof(long)-1)) {
static u_char *abuf;
if (abuf == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: print-nfs.c,v 1.3 1995/03/06 19:11:20 mycroft Exp $ */
/* $NetBSD: print-nfs.c,v 1.4 1995/04/24 13:27:45 cgd Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
@ -647,7 +647,7 @@ parseattrstat(const u_int32 *dp, int verbose)
if (dp == NULL)
return (0);
return ((int)parsefattr(dp, verbose));
return ((long)parsefattr(dp, verbose));
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcpdump.c,v 1.2 1995/03/06 19:11:47 mycroft Exp $ */
/* $NetBSD: tcpdump.c,v 1.3 1995/04/24 13:27:48 cgd Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
@ -380,7 +380,7 @@ default_print(register const u_char *bp, register int length)
register u_int i;
register int nshorts;
if ((int)bp & 1) {
if ((long)bp & 1) {
default_print_unaligned(bp, length);
return;
}