summaryrefslogtreecommitdiff
path: root/usr.sbin/mdsetimage/exec_coff.c
diff options
context:
space:
mode:
authortsutsui <tsutsui@NetBSD.org>2009-07-30 15:16:37 +0000
committertsutsui <tsutsui@NetBSD.org>2009-07-30 15:16:37 +0000
commitfcb0df9205fedbd883630a852f70ddd725f6b2ea (patch)
treeb258b7a4e763f1657455a5003f3a9576ac9e07dc /usr.sbin/mdsetimage/exec_coff.c
parent7d100c1859499606a9a0b8e4042e76e027e2d14c (diff)
WARNS'fy sources which are left for reference.
src/usr.sbin/mdsetimage has been superseded by src/gnu/usr.sbin/mdsetimage for toolchain to handle cross build binaries, but these old sources for local executable binaries still can be used for tools to patch binaries, like binpatch utility in sys/arch/amiga/stand and sys/arch/atari/stand.
Diffstat (limited to 'usr.sbin/mdsetimage/exec_coff.c')
-rw-r--r--usr.sbin/mdsetimage/exec_coff.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/mdsetimage/exec_coff.c b/usr.sbin/mdsetimage/exec_coff.c
index 77175a981f3..2367eb00e00 100644
--- a/usr.sbin/mdsetimage/exec_coff.c
+++ b/usr.sbin/mdsetimage/exec_coff.c
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_coff.c,v 1.5 2001/10/01 23:32:34 cgd Exp $ */
+/* $NetBSD: exec_coff.c,v 1.6 2009/07/30 15:16:37 tsutsui Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: exec_coff.c,v 1.5 2001/10/01 23:32:34 cgd Exp $");
+__RCSID("$NetBSD: exec_coff.c,v 1.6 2009/07/30 15:16:37 tsutsui Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -53,14 +53,14 @@ check_coff(mappedfile, mappedsize)
const char *mappedfile;
size_t mappedsize;
{
- struct coff_exechdr *exechdrp;
+ const struct coff_exechdr *exechdrp;
int rv;
rv = 0;
if (check(0, sizeof *exechdrp))
BAD;
- exechdrp = (struct coff_exechdr *)&mappedfile[0];
+ exechdrp = (const struct coff_exechdr *)&mappedfile[0];
if (COFF_BADMAG(&(exechdrp->f)))
BAD;
@@ -75,11 +75,11 @@ findoff_coff(mappedfile, mappedsize, vmaddr, fileoffp)
size_t mappedsize, *fileoffp;
u_long vmaddr;
{
- struct coff_exechdr *exechdrp;
+ const struct coff_exechdr *exechdrp;
int rv;
rv = 0;
- exechdrp = (struct coff_exechdr *)&mappedfile[0];
+ exechdrp = (const struct coff_exechdr *)&mappedfile[0];
#define COFF_TXTOFF_XXX(fp, ap) \
(COFF_ROUND(COFF_HDR_SIZE + (fp)->f_nscns * \
@@ -89,12 +89,12 @@ findoff_coff(mappedfile, mappedsize, vmaddr, fileoffp)
#define COFF_DATOFF_XXX(fp, ap) \
(COFF_TXTOFF_XXX(fp, ap) + (ap)->a_tsize)
- if (exechdrp->a.a_tstart <= vmaddr &&
- vmaddr < (exechdrp->a.a_tstart + exechdrp->a.a_tsize))
+ if ((u_long)exechdrp->a.a_tstart <= vmaddr &&
+ vmaddr < (u_long)(exechdrp->a.a_tstart + exechdrp->a.a_tsize))
*fileoffp = vmaddr - exechdrp->a.a_tstart +
COFF_TXTOFF(&exechdrp->f, &(exechdrp->a));
- else if (exechdrp->a.a_dstart <= vmaddr &&
- vmaddr < (exechdrp->a.a_dstart + exechdrp->a.a_dsize))
+ else if ((u_long)exechdrp->a.a_dstart <= vmaddr &&
+ vmaddr < (u_long)(exechdrp->a.a_dstart + exechdrp->a.a_dsize))
*fileoffp = vmaddr - exechdrp->a.a_dstart +
COFF_DATOFF_XXX(&exechdrp->f, &(exechdrp->a));
else