diff options
| author | jdolecek <jdolecek@NetBSD.org> | 2001-02-19 19:31:29 +0000 |
|---|---|---|
| committer | jdolecek <jdolecek@NetBSD.org> | 2001-02-19 19:31:29 +0000 |
| commit | 7f547730fdfc2e64fc23b7ba0da63e4744e9db41 (patch) | |
| tree | b8308fcf4ed4ceab213f27c38a42a26024c504a2 /usr.bin | |
| parent | ac52e9e4de70e4a4dd5f365951fd423a981820ad (diff) | |
cosmetic changes - make keylist[] static and remove extern definition
in fsort.h, move macro SALIGN() from sort.h to fsort.c
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/sort/fsort.c | 8 | ||||
| -rw-r--r-- | usr.bin/sort/fsort.h | 3 | ||||
| -rw-r--r-- | usr.bin/sort/sort.h | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/sort/fsort.c b/usr.bin/sort/fsort.c index 2380be3a5d7..e1eb87b3a8e 100644 --- a/usr.bin/sort/fsort.c +++ b/usr.bin/sort/fsort.c @@ -1,4 +1,4 @@ -/* $NetBSD: fsort.c,v 1.12 2001/02/05 14:25:34 itojun Exp $ */ +/* $NetBSD: fsort.c,v 1.13 2001/02/19 19:31:29 jdolecek Exp $ */ /*- * Copyright (c) 1993 @@ -47,14 +47,14 @@ #include "fsort.h" #ifndef lint -__RCSID("$NetBSD: fsort.c,v 1.12 2001/02/05 14:25:34 itojun Exp $"); +__RCSID("$NetBSD: fsort.c,v 1.13 2001/02/19 19:31:29 jdolecek Exp $"); __SCCSID("@(#)fsort.c 8.1 (Berkeley) 6/6/93"); #endif /* not lint */ #include <stdlib.h> #include <string.h> -const u_char **keylist = 0; +static const u_char **keylist = 0; u_char *buffer = 0, *linebuf = 0; size_t bufsize = DEFLLEN; size_t linebuf_size; @@ -64,6 +64,7 @@ extern char *toutpath; int PANIC = FSORTMAX; #define MSTART (MAXFCT - MERGE_FNUM) +#define SALIGN(n) ((n+sizeof(length_t)-1) & ~(sizeof(length_t)-1)) void fsort(binno, depth, top, filelist, nfiles, outfp, ftbl) @@ -142,6 +143,7 @@ fsort(binno, depth, top, filelist, nfiles, outfp, ftbl) crec =(RECHEADER *) ((char *) crec + SALIGN(crec->length) + sizeof(TRECHEADER)); } + if (c == BUFFEND && nelem < min(9, MAXNUM)) { const u_char **keyp; u_char *oldb = buffer; diff --git a/usr.bin/sort/fsort.h b/usr.bin/sort/fsort.h index 34b20b63db3..5475e935820 100644 --- a/usr.bin/sort/fsort.h +++ b/usr.bin/sort/fsort.h @@ -1,4 +1,4 @@ -/* $NetBSD: fsort.h,v 1.6 2001/01/19 10:12:35 jdolecek Exp $ */ +/* $NetBSD: fsort.h,v 1.7 2001/02/19 19:31:29 jdolecek Exp $ */ /*- * Copyright (c) 1993 @@ -51,7 +51,6 @@ */ #define MERGE_FNUM 16 -extern const u_char **keylist; extern u_char *buffer, *linebuf; extern size_t bufsize, linebuf_size; diff --git a/usr.bin/sort/sort.h b/usr.bin/sort/sort.h index 21d493be689..a8f2c4b1718 100644 --- a/usr.bin/sort/sort.h +++ b/usr.bin/sort/sort.h @@ -1,4 +1,4 @@ -/* $NetBSD: sort.h,v 1.11 2001/01/19 10:14:31 jdolecek Exp $ */ +/* $NetBSD: sort.h,v 1.12 2001/02/19 19:31:29 jdolecek Exp $ */ /*- * Copyright (c) 1993 @@ -84,8 +84,6 @@ /* length of record is currently limited to maximum string length (size_t) */ typedef size_t length_t; -#define SALIGN(n) ((n+sizeof(length_t)-1) & ~(sizeof(length_t)-1)) - /* a record is a key/line pair starting at rec.data. It has a total length * and an offset to the start of the line half of the pair. */ |
