cosmetic changes - make keylist[] static and remove extern definition

in fsort.h, move macro SALIGN() from sort.h to fsort.c
This commit is contained in:
jdolecek 2001-02-19 19:31:29 +00:00
parent ac52e9e4de
commit 7f547730fd
3 changed files with 7 additions and 8 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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.
*/