diff options
-rw-r--r-- | contrib/binutils/opcodes/ppc-dis.c | 10 | ||||
-rw-r--r-- | sys/netinet/libalias/alias_util.c | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/contrib/binutils/opcodes/ppc-dis.c b/contrib/binutils/opcodes/ppc-dis.c index 4d48b9d..9dc586d 100644 --- a/contrib/binutils/opcodes/ppc-dis.c +++ b/contrib/binutils/opcodes/ppc-dis.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* ppc-dis.c -- Disassemble PowerPC instructions Copyright 1994, 1995, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. @@ -45,6 +46,7 @@ static int powerpc_dialect (struct disassemble_info *info) { int dialect = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC; + void *pd = &info->private_data; if (BFD_DEFAULT_TARGET_SIZE == 64) dialect |= PPC_OPCODE_64; @@ -91,7 +93,7 @@ powerpc_dialect (struct disassemble_info *info) dialect |= PPC_OPCODE_64; } - ((struct dis_private *) &info->private_data)->dialect = dialect; + ((struct dis_private *) pd)->dialect = dialect; return dialect; } @@ -100,7 +102,8 @@ powerpc_dialect (struct disassemble_info *info) int print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info) { - int dialect = ((struct dis_private *) &info->private_data)->dialect; + void *pd = &info->private_data; + int dialect = ((struct dis_private *) pd)->dialect; return print_insn_powerpc (memaddr, info, 1, dialect); } @@ -109,7 +112,8 @@ print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info) int print_insn_little_powerpc (bfd_vma memaddr, struct disassemble_info *info) { - int dialect = ((struct dis_private *) &info->private_data)->dialect; + void *pd = &info->private_data; + int dialect = ((struct dis_private *) pd)->dialect; return print_insn_powerpc (memaddr, info, 0, dialect); } diff --git a/sys/netinet/libalias/alias_util.c b/sys/netinet/libalias/alias_util.c index 805b51a..37068c2 100644 --- a/sys/netinet/libalias/alias_util.c +++ b/sys/netinet/libalias/alias_util.c @@ -110,6 +110,7 @@ TcpChecksum(struct ip *pip) struct tcphdr *tc; int nhdr, ntcp, nbytes; int sum, oddbyte; + void *v; nhdr = pip->ip_hl << 2; ntcp = ntohs(pip->ip_len) - nhdr; @@ -131,10 +132,12 @@ TcpChecksum(struct ip *pip) sum += oddbyte; } /* "Pseudo-header" data */ - ptr = (u_short *) & (pip->ip_dst); + v = &pip->ip_dst; + ptr = v; sum += *ptr++; sum += *ptr; - ptr = (u_short *) & (pip->ip_src); + v = &pip->ip_src; + ptr = v; sum += *ptr++; sum += *ptr; sum += htons((u_short) ntcp); |