From c520d6cae2ee1c6ce964538f6842d0d4d085ac1c Mon Sep 17 00:00:00 2001 From: aymeric Date: Sat, 26 Jan 2002 13:16:06 +0000 Subject: [PATCH] - ANSIfy - remove some trailing spaces/tabs - minor style nits --- sys/arch/amiga/stand/binpatch/binpatch.c | 22 +++++++++---------- .../amiga/stand/bootblock/aout2bb/aout2bb.c | 18 +++++++-------- .../amiga/stand/bootblock/aout2bb/aout2bb.h | 6 ++--- .../amiga/stand/bootblock/aout2bb/chksum.h | 4 ++-- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/arch/amiga/stand/binpatch/binpatch.c b/sys/arch/amiga/stand/binpatch/binpatch.c index b89cf4f61c6e..cbd870107a92 100644 --- a/sys/arch/amiga/stand/binpatch/binpatch.c +++ b/sys/arch/amiga/stand/binpatch/binpatch.c @@ -1,4 +1,4 @@ -/* $NetBSD: binpatch.c,v 1.7 1997/11/01 06:49:17 lukem Exp $ */ +/* $NetBSD: binpatch.c,v 1.8 2002/01/26 13:16:06 aymeric Exp $ */ /* Author: Markus Wild mw@eunet.ch ??? */ /* Modified: Rob Leland leland@mitre.org */ @@ -27,7 +27,7 @@ NAME \t%s - Allows the patching of BSD binaries SYNOPSIS \t%s [-HELP] -\t%s [-b|-w|-l] -s symbol[[[index]][=value]] binary +\t%s [-b|-w|-l] -s symbol[[[index]][=value]] binary \t%s [-b|-w|-l] [-o offset] -s symbol [-r value] binary \t%s [-b|-w|-l] [-o offset] -a address [-r value] binary "; @@ -52,7 +52,7 @@ EXAMPLES \t\tbinpatch -l -s _hz netbsd \tNow it gets more advanced, replace the value: \t\tbinpatch -l -s _sbic_debug -r 1 netbsd -\tNow patch a variable at a given 'index' not offset, +\tNow patch a variable at a given 'index' not offset, \tunder NetBSD you must use '', under AmigaDos CLI '' is optional.: \t\tbinpatch -w -s '_vieww[4]' -r 0 a.out \tsame as @@ -107,8 +107,8 @@ main(int argc, char *argv[]) u_long lval; u_short sval; u_char cval; - - + + while ((c = getopt (argc, argv, "H:a:bwlr:s:o:")) != -1) switch (c) { @@ -164,7 +164,7 @@ main(int argc, char *argv[]) offset = atoi (optarg); break; }/* while switch() */ - + if (argc > 1) { if (addr || symbol) @@ -224,7 +224,7 @@ main(int argc, char *argv[]) addr += offset; /* if replace-mode, have to reopen the file for writing. - Can't do that from the beginning, or nlist() will not + Can't do that from the beginning, or nlist() will not work (at least not under AmigaDOS) */ if (do_replace) { @@ -265,7 +265,7 @@ main(int argc, char *argv[]) break; }/* switch size */ - + if (symbol) printf ("%s(0x%x): %d (0x%x)\n", symbol, addr, lval, lval); else @@ -349,7 +349,7 @@ static void Usage(char *pgname) treated as a index if-and-only-if a '-b -w -l' option was given. Otherwise it is treated like an offset. See above documentation in for of help! -*/ +*/ static void FindOffset(char *symbol,u_long *index) { char *sb=strchr(symbol,'['); /* Start of '[', now line must @@ -383,7 +383,7 @@ static void FindOffset(char *symbol,u_long *index) else { fprintf(stderr,"Error: Garbage trailing ']'\n"); - } + } } else { @@ -413,7 +413,7 @@ static u_long FindAssign(char *symbol,u_long *rvalue) if (nscan != 1) error("Invalid value following '='"); dr = 1; - *ce = '\0';/* Now were left with just symbol */ + *ce = '\0';/* Now were left with just symbol */ }/* if (ce) */ return(dr); }/* FindAssign */ diff --git a/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.c b/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.c index 70f13e96fec9..7e0d22c8d6e8 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.5 2001/12/17 05:43:40 mhitch Exp $ */ +/* $NetBSD: aout2bb.c,v 1.6 2002/01/26 13:17:12 aymeric Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -53,7 +53,7 @@ #include "aout2bb.h" #include "chksum.h" -void usage __P((void)); +void usage(void); int intcmp(const void *, const void *); int main(int argc, char *argv[]); @@ -68,7 +68,7 @@ int main(int argc, char *argv[]); char *progname; int bbsize = BBSIZE; u_int8_t *buffer; -u_int32_t *relbuf; +u_int32_t *relbuf; /* can't have more relocs than that*/ extern char *optarg; @@ -81,7 +81,7 @@ intcmp(i, j) r = (*(u_int32_t *)i) < (*(u_int32_t *)j); - return 2*r-1; + return 2*r-1; } int @@ -164,7 +164,7 @@ main(argc, argv) drsz = ntohl(eh->a_drsize); entry = ntohl(eh->a_entry); - dprintf(("tsz = 0x%x, dsz = 0x%x, bsz = 0x%x, total 0x%x, entry=0x%x\n", + dprintf(("tsz = 0x%x, dsz = 0x%x, bsz = 0x%x, total 0x%x, entry=0x%x\n", tsz, dsz, bsz, tsz+dsz+bsz, entry)); if ((trsz+drsz)==0) @@ -185,7 +185,7 @@ main(argc, argv) memcpy(buffer, image + N_TXTOFF(*eh), tsz+dsz); /* - * Hm. This tool REALLY should understand more than one + * Hm. This tool REALLY should understand more than one * relocator version. For now, check that the relocator at * the image start does understand what we output. */ @@ -333,8 +333,8 @@ main(argc, argv) : rpo >= buffer + bbsize) errx(1, "Relocs don't fit."); - ((u_int32_t *)buffer)[1] = 0; - ((u_int32_t *)buffer)[1] = + ((u_int32_t *)buffer)[1] = 0; + ((u_int32_t *)buffer)[1] = (0xffffffff - chksum((u_int32_t *)buffer, sumsize * 512 / 4)); ofd = open(argv[1], O_CREAT|O_WRONLY, 0644); @@ -348,7 +348,7 @@ main(argc, argv) } void -usage() +usage(void) { fprintf(stderr, "Usage: %s [-F] [-S bbsize] bootprog bootprog.bin\n", progname); diff --git a/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.h b/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.h index 33e1cf0f7753..4d25aeb287c4 100644 --- a/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.h +++ b/sys/arch/amiga/stand/bootblock/aout2bb/aout2bb.h @@ -1,4 +1,4 @@ -/* $NetBSD: aout2bb.h,v 1.3 1999/02/16 23:34:10 is Exp $ */ +/* $NetBSD: aout2bb.h,v 1.4 2002/01/26 13:17:12 aymeric Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -40,12 +40,12 @@ * Relocator version definitions for aout to Amiga bootblock converter. */ -/* +/* * All the tables are at the end of the bootblock, with logical start at the * end. */ -/* +/* * The following formats are for a length of 8 kBytes only. */ diff --git a/sys/arch/amiga/stand/bootblock/aout2bb/chksum.h b/sys/arch/amiga/stand/bootblock/aout2bb/chksum.h index c48bbf167d18..0c76dadfc391 100644 --- a/sys/arch/amiga/stand/bootblock/aout2bb/chksum.h +++ b/sys/arch/amiga/stand/bootblock/aout2bb/chksum.h @@ -1,4 +1,4 @@ -/* $NetBSD: chksum.h,v 1.3 1999/02/16 23:34:11 is Exp $ */ +/* $NetBSD: chksum.h,v 1.4 2002/01/26 13:17:12 aymeric Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,5 +38,5 @@ #define CHKSUMOFFS 1 -u_int32_t chksum __P((u_int32_t *, int)); +u_int32_t chksum(u_int32_t *, int);