KNF (mostly whitespace)

This commit is contained in:
itojun 2003-10-18 03:03:20 +00:00
parent cdcb0412a1
commit ba02466ff9
4 changed files with 31 additions and 31 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fields.c,v 1.14 2003/08/07 11:32:34 jdolecek Exp $ */
/* $NetBSD: fields.c,v 1.15 2003/10/18 03:03:20 itojun Exp $ */
/*-
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
#include "sort.h"
#ifndef lint
__RCSID("$NetBSD: fields.c,v 1.14 2003/08/07 11:32:34 jdolecek Exp $");
__RCSID("$NetBSD: fields.c,v 1.15 2003/10/18 03:03:20 itojun Exp $");
__SCCSID("@(#)fields.c 8.1 (Berkeley) 6/6/93");
#endif /* not lint */
@ -323,8 +323,8 @@ number(pos, bufend, line, lineend, Rflag)
} else
lastvalue = *line;
parity ^= 1;
} else if(*line == DECIMAL) {
if(!expincr) /* a decimal already occurred once */
} else if (*line == DECIMAL) {
if (!expincr) /* a decimal already occurred once */
break;
expincr = 0;
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: files.c,v 1.21 2003/10/16 07:01:51 itojun Exp $ */
/* $NetBSD: files.c,v 1.22 2003/10/18 03:03:20 itojun Exp $ */
/*-
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
#include "fsort.h"
#ifndef lint
__RCSID("$NetBSD: files.c,v 1.21 2003/10/16 07:01:51 itojun Exp $");
__RCSID("$NetBSD: files.c,v 1.22 2003/10/18 03:03:20 itojun Exp $");
__SCCSID("@(#)files.c 8.1 (Berkeley) 6/6/93");
#endif /* not lint */
@ -229,7 +229,7 @@ makeline(flno, top, filelist, nfiles, recbuf, bufend, dummy2)
warnx("makeline: line too long: ignoring '%.100s...'", recbuf->data);
/* Consume the rest of line from input */
while((c = getc(fp)) != REC_D && c != EOF)
while ((c = getc(fp)) != REC_D && c != EOF)
;
recbuf->offset = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fsort.c,v 1.28 2003/10/17 22:59:35 enami Exp $ */
/* $NetBSD: fsort.c,v 1.29 2003/10/18 03:03:20 itojun Exp $ */
/*-
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
#include "fsort.h"
#ifndef lint
__RCSID("$NetBSD: fsort.c,v 1.28 2003/10/17 22:59:35 enami Exp $");
__RCSID("$NetBSD: fsort.c,v 1.29 2003/10/18 03:03:20 itojun Exp $");
__SCCSID("@(#)fsort.c 8.1 (Berkeley) 6/6/93");
#endif /* not lint */
@ -114,11 +114,11 @@ fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
u_char *weights;
int ntfiles, mfct = 0, total, i, maxb, lastb, panic = 0;
int c, nelem, base;
long sizes [NBINS+1];
long sizes [NBINS + 1];
get_func_t get;
struct recheader *crec;
struct field tfield[2];
FILE *prevfp, *tailfp[FSORTMAX+1];
FILE *prevfp, *tailfp[FSORTMAX + 1];
u_char *nbuffer;
memset(tailfp, 0, sizeof(tailfp));
@ -170,15 +170,15 @@ fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
crec = (RECHEADER *) buffer;
do_read:
while((c = get(binno, top, filelist, nfiles, crec,
while ((c = get(binno, top, filelist, nfiles, crec,
bufend, ftbl)) == 0) {
*keypos++ = crec->data + depth;
if (++nelem == MAXNUM) {
c = BUFFEND;
break;
}
crec =(RECHEADER *) ((char *) crec +
SALIGN(crec->length) + sizeof(TRECHEADER));
crec =(RECHEADER *)((char *) crec +
SALIGN(crec->length) + sizeof(TRECHEADER));
}
if (c == BUFFEND && nelem < MAXNUM
@ -198,7 +198,7 @@ fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
bufend = buffer + bufsize;
/* patch up keylist[] */
for(keyp = &keypos[-1]; keyp >= keylist; keyp--)
for (keyp = &keypos[-1]; keyp >= keylist; keyp--)
*keyp = buffer + (*keyp - oldb);
crec = (RECHEADER *) (buffer + ((u_char *)crec - oldb));
@ -301,7 +301,7 @@ fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
if (!sizes[i]) /* bin empty; step ahead file offset */
getnext(i, base, NULL,ntfiles, crec, bufend, 0);
else
fsort(i, depth+1, base, filelist, ntfiles,
fsort(i, depth + 1, base, filelist, ntfiles,
outfp, ftbl);
}
@ -311,12 +311,12 @@ fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
if (prevfp != outfp)
tailfp[panic] = prevfp;
prevfp = ftmp();
for (i = maxb+1; i <= lastb; i++)
for (i = maxb + 1; i <= lastb; i++)
if (!sizes[i])
getnext(i, base, NULL, ntfiles, crec,
bufend,0);
else
fsort(i, depth+1, base, filelist,
fsort(i, depth + 1, base, filelist,
ntfiles, prevfp, ftbl);
}
@ -356,7 +356,7 @@ onepass(a, depth, n, sizes, tr, fp)
u_char *tr;
FILE *fp;
{
size_t tsizes[NBINS+1];
size_t tsizes[NBINS + 1];
const u_char **bin[257], ***bp, ***bpmax, **top[256], ***tp;
static int histo[256];
int *hp;
@ -376,17 +376,17 @@ onepass(a, depth, n, sizes, tr, fp)
bpmax = bin + 256;
tp = top, hp = histo;
for (bp = bin; bp < bpmax; bp++) {
*tp++ = *(bp+1) = *bp + (c = *hp);
*tp++ = *(bp + 1) = *bp + (c = *hp);
*hp++ = 0;
if (c <= 1)
continue;
}
for (aj = a; aj < an; *aj = r, aj = bin[c+1])
for (aj = a; aj < an; *aj = r, aj = bin[c + 1])
for (r = *aj; aj < (ak = --top[c = tr[r[depth]]]) ;)
swap(*ak, r, t);
for (ak = a, c = 0; c < 256; c++) {
an = bin[c+1];
an = bin[c + 1];
n = an - ak;
tsizes[c] += n * sizeof(TRECHEADER);
/* tell getnext how many elements in this bin, this segment. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: msort.c,v 1.15 2003/10/16 07:01:51 itojun Exp $ */
/* $NetBSD: msort.c,v 1.16 2003/10/18 03:03:20 itojun Exp $ */
/*-
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
#include "fsort.h"
#ifndef lint
__RCSID("$NetBSD: msort.c,v 1.15 2003/10/16 07:01:51 itojun Exp $");
__RCSID("$NetBSD: msort.c,v 1.16 2003/10/18 03:03:20 itojun Exp $");
__SCCSID("@(#)msort.c 8.1 (Berkeley) 6/6/93");
#endif /* not lint */
@ -177,8 +177,8 @@ merge(infl0, nfiles, get, outfp, put, ftbl)
int c, i, j, nf = nfiles;
struct mfile *flistb[MERGE_FNUM], **flist = flistb, *cfile;
size_t availsz = bufsize;
static void *bufs[MERGE_FNUM+1];
static size_t bufs_sz[MERGE_FNUM+1];
static void *bufs[MERGE_FNUM + 1];
static size_t bufs_sz[MERGE_FNUM + 1];
/*
* We need nfiles + 1 buffers. One is 'buffer', the
@ -186,7 +186,7 @@ merge(infl0, nfiles, get, outfp, put, ftbl)
*/
bufs[0] = buffer;
bufs_sz[0] = bufsize;
for(i=1; i < nfiles+1; i++) {
for (i = 1; i < nfiles + 1; i++) {
if (bufs[i])
continue;
@ -250,7 +250,7 @@ merge(infl0, nfiles, get, outfp, put, ftbl)
if (!cfile)
err(2, "merge: realloc");
for(i=0; i < nf+1; i++) {
for (i = 0; i < nf + 1; i++) {
if (bufs[i] == oldbuf) {
bufs[i] = (char *)cfile;
bufs_sz[i] = availsz;
@ -286,7 +286,7 @@ insert(flist, rec, ttop, delete)
struct mfile *tmprec = *rec;
int mid, top = ttop, bot = 0, cmpv = 1;
for (mid = top/2; bot +1 != top; mid = (bot+top)/2) {
for (mid = top / 2; bot + 1 != top; mid = (bot + top) / 2) {
cmpv = cmp(tmprec->rec, flist[mid]->rec);
if (cmpv < 0)
top = mid;
@ -327,7 +327,7 @@ insert(flist, rec, ttop, delete)
}
tmprec = flist[0];
if (bot)
memmove(flist, flist+1, bot * sizeof(MFILE **));
memmove(flist, flist + 1, bot * sizeof(MFILE **));
flist[bot] = *rec;
*rec = tmprec;
(*rec)->flno = flist[0]->flno;
@ -341,7 +341,7 @@ insert(flist, rec, ttop, delete)
if (UNIQUE && !cmpv)
return (1);
bot++;
memmove(flist + bot+1, flist + bot,
memmove(flist + bot + 1, flist + bot,
(ttop - bot) * sizeof(MFILE **));
flist[bot] = *rec;
return (0);