Module Name: src
Committed By: joerg
Date: Sun Sep 4 20:27:52 UTC 2011
Modified Files:
src/usr.bin/join: join.c
Log Message:
static + __dead
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/join/join.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/join/join.c
diff -u src/usr.bin/join/join.c:1.30 src/usr.bin/join/join.c:1.31
--- src/usr.bin/join/join.c:1.30 Sun Apr 12 11:18:21 2009
+++ src/usr.bin/join/join.c Sun Sep 4 20:27:52 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: join.c,v 1.30 2009/04/12 11:18:21 lukem Exp $ */
+/* $NetBSD: join.c,v 1.31 2011/09/04 20:27:52 joerg Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -47,7 +47,7 @@
#if 0
static char sccsid[] = "from: @(#)join.c 5.1 (Berkeley) 11/18/91";
#else
-__RCSID("$NetBSD: join.c,v 1.30 2009/04/12 11:18:21 lukem Exp $");
+__RCSID("$NetBSD: join.c,v 1.31 2011/09/04 20:27:52 joerg Exp $");
#endif
#endif /* not lint */
@@ -74,8 +74,8 @@
u_long fieldalloc; /* line field(s) allocated count */
} LINE;
-char nolineline[1] = { '\0' };
-LINE noline = {nolineline, 0, 0, 0, 0}; /* arg for outfield if no line to output */
+static char nolineline[1] = { '\0' };
+static LINE noline = {nolineline, 0, 0, 0, 0}; /* arg for outfield if no line to output */
typedef struct {
FILE *fp; /* file descriptor */
@@ -88,34 +88,35 @@
u_long setcnt; /* set count */
u_long setalloc; /* set allocated count */
} INPUT;
-INPUT input1 = { NULL, 0, 0, 1, NULL, -1, 0, 0, },
+
+static INPUT input1 = { NULL, 0, 0, 1, NULL, -1, 0, 0, },
input2 = { NULL, 0, 0, 2, NULL, -1, 0, 0, };
typedef struct {
u_long fileno; /* file number */
u_long fieldno; /* field number */
} OLIST;
-OLIST *olist; /* output field list */
-u_long olistcnt; /* output field list count */
-u_long olistalloc; /* output field allocated count */
-
-int joinout = 1; /* show lines with matched join fields (-v) */
-int needsep; /* need separator character */
-int spans = 1; /* span multiple delimiters (-t) */
-char *empty; /* empty field replacement string (-e) */
-const char *tabchar = " \t"; /* delimiter characters (-t) */
-
-int cmp(LINE *, u_long, LINE *, u_long);
-void enomem(void);
-void fieldarg(char *);
-void joinlines(INPUT *, INPUT *);
-int main(int, char **);
-void obsolete(char **);
-void outfield(LINE *, u_long);
-void outoneline(INPUT *, LINE *);
-void outtwoline(INPUT *, LINE *, INPUT *, LINE *);
-void slurp(INPUT *);
-void usage(void);
+
+static OLIST *olist; /* output field list */
+static u_long olistcnt; /* output field list count */
+static u_long olistalloc; /* output field allocated count */
+
+static int joinout = 1; /* show lines with matched join fields (-v) */
+static int needsep; /* need separator character */
+static int spans = 1; /* span multiple delimiters (-t) */
+static char *empty; /* empty field replacement string (-e) */
+static const char *tabchar = " \t"; /* delimiter characters (-t) */
+
+static int cmp(LINE *, u_long, LINE *, u_long);
+__dead static void enomem(void);
+static void fieldarg(char *);
+static void joinlines(INPUT *, INPUT *);
+static void obsolete(char **);
+static void outfield(LINE *, u_long);
+static void outoneline(INPUT *, LINE *);
+static void outtwoline(INPUT *, LINE *, INPUT *, LINE *);
+static void slurp(INPUT *);
+__dead static void usage(void);
int
main(int argc, char *argv[])
@@ -295,7 +296,7 @@
return 0;
}
-void
+static void
slurp(INPUT *F)
{
LINE *lp;
@@ -401,7 +402,7 @@
}
}
-int
+static int
cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2)
{
@@ -412,7 +413,7 @@
return (strcmp(lp1->fields[fieldno1], lp2->fields[fieldno2]));
}
-void
+static void
joinlines(INPUT *F1, INPUT *F2)
{
u_long cnt1, cnt2;
@@ -432,7 +433,7 @@
outtwoline(F1, &F1->set[cnt1], F2, &F2->set[cnt2]);
}
-void
+static void
outoneline(INPUT *F, LINE *lp)
{
u_long cnt;
@@ -458,7 +459,7 @@
needsep = 0;
}
-void
+static void
outtwoline(INPUT *F1, LINE *lp1, INPUT *F2, LINE *lp2)
{
u_long cnt;
@@ -489,7 +490,7 @@
needsep = 0;
}
-void
+static void
outfield(LINE *lp, u_long fieldno)
{
if (needsep++)
@@ -512,7 +513,7 @@
* Convert an output list argument "2.1, 1.3, 2.4" into an array of output
* fields.
*/
-void
+static void
fieldarg(char *option)
{
u_long fieldno;
@@ -542,7 +543,7 @@
}
}
-void
+static void
obsolete(char **argv)
{
size_t len;
@@ -619,13 +620,13 @@
}
}
-void
+static void
enomem(void)
{
errx(1, "no memory");
}
-void
+static void
usage(void)
{
(void)fprintf(stderr,