From 97eadfd5d78be64d183c3f608ac7c6e1e58d358c Mon Sep 17 00:00:00 2001 From: is Date: Thu, 27 Jan 2005 11:00:46 +0000 Subject: [PATCH] NTOHL() is not the same as ntohl()... --- sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.c b/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.c index dc162d249ed2..e482c4c0a4fe 100644 --- a/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.c +++ b/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.c @@ -1,4 +1,4 @@ -/* $NetBSD: aout2bb.c,v 1.10 2004/11/28 07:00:53 jmc Exp $ */ +/* $NetBSD: aout2bb.c,v 1.11 2005/01/27 11:00:46 is Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -52,6 +52,8 @@ #include /* of the machine we're running on */ #include /* of the machine we're running on */ +#define BE32TOH(x) do {(x) = be32toh(x);} while (0) + #include /* TARGET */ #include "aout2bb.h" @@ -219,8 +221,8 @@ main(argc, argv) for (rpi = (struct relocation_info_m68k *)(image+N_TRELOFF(*eh)); (caddr_t)rpi < image+N_TRELOFF(*eh)+trsz; rpi++) { - ntohl(((u_int32_t *)rpi)[0]); - ntohl(((u_int32_t *)rpi)[1]); + BE32TOH(((u_int32_t *)rpi)[0]); + BE32TOH(((u_int32_t *)rpi)[1]); dprintf(("0x%08x 0x%08x %c\n", *(u_int32_t *)rpi, ((u_int32_t *)rpi)[1], rpi->r_extern ? 'U' : ' ')); @@ -253,8 +255,8 @@ main(argc, argv) for (rpi = (struct relocation_info_m68k *)(image+N_DRELOFF(*eh)); (caddr_t)rpi < image+N_DRELOFF(*eh)+drsz; rpi++) { - ntohl(((u_int32_t *)rpi)[0]); - ntohl(((u_int32_t *)rpi)[1]); + BE32TOH(((u_int32_t *)rpi)[0]); + BE32TOH(((u_int32_t *)rpi)[1]); dprintf(("0x%08x 0x%08x %c\n", *(u_int32_t *)rpi, ((u_int32_t *)rpi)[1], rpi->r_extern ? 'U' : ' '));