From owner-svn-src-all@FreeBSD.ORG Sun Nov 6 08:15:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 846891065BC6; Sun, 6 Nov 2011 08:15:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2947E8FC16; Sun, 6 Nov 2011 08:15:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68FaoF008463; Sun, 6 Nov 2011 08:15:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Faov008461; Sun, 6 Nov 2011 08:15:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68Faov008461@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227167 - head/usr.bin/join X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:36 -0000 Author: ed Date: Sun Nov 6 08:15:35 2011 New Revision: 227167 URL: http://svn.freebsd.org/changeset/base/227167 Log: Add missing static keywords to join(1) Modified: head/usr.bin/join/join.c Modified: head/usr.bin/join/join.c ============================================================================== --- head/usr.bin/join/join.c Sun Nov 6 08:15:30 2011 (r227166) +++ head/usr.bin/join/join.c Sun Nov 6 08:15:35 2011 (r227167) @@ -83,36 +83,36 @@ typedef struct { u_long setcnt; /* set count */ u_long setalloc; /* set allocated count */ } INPUT; -INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 }, - input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 }; +static INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 }, + input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 }; typedef struct { u_long filenum; /* 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) */ +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 wchar_t default_tabchar[] = L" \t"; -wchar_t *tabchar = default_tabchar;/* delimiter characters (-t) */ +static wchar_t *tabchar = default_tabchar; /* delimiter characters (-t) */ -int cmp(LINE *, u_long, LINE *, u_long); -void fieldarg(char *); -void joinlines(INPUT *, INPUT *); -int mbscoll(const char *, const char *); -char *mbssep(char **, const wchar_t *); -void obsolete(char **); -void outfield(LINE *, u_long, int); -void outoneline(INPUT *, LINE *); -void outtwoline(INPUT *, LINE *, INPUT *, LINE *); -void slurp(INPUT *); -wchar_t *towcs(const char *); -void usage(void); +static int cmp(LINE *, u_long, LINE *, u_long); +static void fieldarg(char *); +static void joinlines(INPUT *, INPUT *); +static int mbscoll(const char *, const char *); +static char *mbssep(char **, const wchar_t *); +static void obsolete(char **); +static void outfield(LINE *, u_long, int); +static void outoneline(INPUT *, LINE *); +static void outtwoline(INPUT *, LINE *, INPUT *, LINE *); +static void slurp(INPUT *); +static wchar_t *towcs(const char *); +static void usage(void); int main(int argc, char *argv[]) @@ -270,7 +270,7 @@ main(int argc, char *argv[]) exit(0); } -void +static void slurp(INPUT *F) { LINE *lp, *lastlp, tmp; @@ -359,7 +359,7 @@ slurp(INPUT *F) } } -char * +static char * mbssep(char **stringp, const wchar_t *delim) { char *s, *tok; @@ -388,7 +388,7 @@ mbssep(char **stringp, const wchar_t *de } } -int +static int cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2) { if (lp1->fieldcnt <= fieldno1) @@ -398,7 +398,7 @@ cmp(LINE *lp1, u_long fieldno1, LINE *lp return (mbscoll(lp1->fields[fieldno1], lp2->fields[fieldno2])); } -int +static int mbscoll(const char *s1, const char *s2) { wchar_t *w1, *w2; @@ -414,7 +414,7 @@ mbscoll(const char *s1, const char *s2) return (ret); } -wchar_t * +static wchar_t * towcs(const char *s) { wchar_t *wcs; @@ -428,7 +428,7 @@ towcs(const char *s) return (wcs); } -void +static void joinlines(INPUT *F1, INPUT *F2) { u_long cnt1, cnt2; @@ -448,7 +448,7 @@ joinlines(INPUT *F1, INPUT *F2) outtwoline(F1, &F1->set[cnt1], F2, &F2->set[cnt2]); } -void +static void outoneline(INPUT *F, LINE *lp) { u_long cnt; @@ -476,7 +476,7 @@ outoneline(INPUT *F, LINE *lp) needsep = 0; } -void +static void outtwoline(INPUT *F1, LINE *lp1, INPUT *F2, LINE *lp2) { u_long cnt; @@ -512,7 +512,7 @@ outtwoline(INPUT *F1, LINE *lp1, INPUT * needsep = 0; } -void +static void outfield(LINE *lp, u_long fieldno, int out_empty) { if (needsep++) @@ -535,7 +535,7 @@ outfield(LINE *lp, u_long fieldno, int o * 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, filenum; @@ -569,7 +569,7 @@ fieldarg(char *option) } } -void +static void obsolete(char **argv) { size_t len; @@ -654,7 +654,7 @@ jbad: errx(1, "illegal option -- %s", } } -void +static void usage(void) { (void)fprintf(stderr, "%s %s\n%s\n",