Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/ul Make all the global variables and functions static.
details: https://anonhg.NetBSD.org/src/rev/07613cc57878
branches: trunk
changeset: 346075:07613cc57878
user: abhinav <abhinav%NetBSD.org@localhost>
date: Thu Jun 23 03:58:13 2016 +0000
description:
Make all the global variables and functions static.
While there, remove unused variables and function prototypes.
Ok from christos
diffstat:
usr.bin/ul/ul.c | 61 ++++++++++++++++++++++++++------------------------------
1 files changed, 28 insertions(+), 33 deletions(-)
diffs (159 lines):
diff -r 7f6d15abdbe8 -r 07613cc57878 usr.bin/ul/ul.c
--- a/usr.bin/ul/ul.c Wed Jun 22 20:12:59 2016 +0000
+++ b/usr.bin/ul/ul.c Thu Jun 23 03:58:13 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ul.c,v 1.18 2016/06/13 14:58:57 abhinav Exp $ */
+/* $NetBSD: ul.c,v 1.19 2016/06/23 03:58:13 abhinav Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)ul.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: ul.c,v 1.18 2016/06/13 14:58:57 abhinav Exp $");
+__RCSID("$NetBSD: ul.c,v 1.19 2016/06/23 03:58:13 abhinav Exp $");
#endif /* not lint */
#include <err.h>
@@ -65,34 +65,29 @@
#define UNDERL 010 /* Ul */
#define BOLD 020 /* Bold */
-struct tinfo *info;
-int must_overstrike;
-const char *CURS_UP, *CURS_RIGHT, *CURS_LEFT,
- *ENTER_STANDOUT, *EXIT_STANDOUT, *ENTER_UNDERLINE, *EXIT_UNDERLINE,
- *ENTER_DIM, *ENTER_BOLD, *ENTER_REVERSE, *UNDER_CHAR, *EXIT_ATTRIBUTES;
+static int must_overstrike;
struct CHAR {
char c_mode;
char c_char;
} ;
-size_t col, maxcol;
-int mode;
-int halfpos;
-int upln;
-int iflag;
+static size_t col, maxcol;
+static int mode;
+static int halfpos;
+static int upln;
+static int iflag;
-void filter(FILE *);
-void flushln(struct CHAR *, size_t);
-void fwd(struct CHAR *, size_t);
-void iattr(struct CHAR *);
-void initbuf(struct CHAR *, size_t);
-void initcap(void);
-void outc(int);
-int outchar(int);
-void overstrike(struct CHAR *);
-void reverse(struct CHAR *, size_t);
-void setulmode(int);
+static void filter(FILE *);
+static void flushln(struct CHAR *, size_t);
+static void fwd(struct CHAR *, size_t);
+static void iattr(struct CHAR *);
+static void initbuf(struct CHAR *, size_t);
+static void outc(int);
+static int outchar(int);
+static void overstrike(struct CHAR *);
+static void reverse(struct CHAR *, size_t);
+static void setulmode(int);
static void alloc_buf(struct CHAR **, size_t *);
static void set_mode(void);
@@ -147,7 +142,7 @@
exit(0);
}
-void
+static void
filter(FILE *f)
{
int c;
@@ -270,7 +265,7 @@
free(obuf);
}
-void
+static void
flushln(struct CHAR *obuf, size_t obuf_size)
{
int lastmode;
@@ -312,7 +307,7 @@
* For terminals that can overstrike, overstrike underlines and bolds.
* We don't do anything with halfline ups and downs, or Greek.
*/
-void
+static void
overstrike(struct CHAR *obuf)
{
size_t i;
@@ -350,7 +345,7 @@
}
}
-void
+static void
iattr(struct CHAR *obuf)
{
size_t i;
@@ -374,7 +369,7 @@
putchar('\n');
}
-void
+static void
initbuf(struct CHAR *obuf, size_t obuf_size)
{
@@ -390,7 +385,7 @@
mode &= ALTSET;
}
-void
+static void
fwd(struct CHAR *obuf, size_t obuf_size)
{
int oldcol, oldmax;
@@ -402,7 +397,7 @@
maxcol = oldmax;
}
-void
+static void
reverse(struct CHAR *obuf, size_t obuf_size)
{
upln++;
@@ -412,7 +407,7 @@
upln++;
}
-int
+static int
outchar(int c)
{
return (putchar(c & 0177));
@@ -420,7 +415,7 @@
static int curmode = 0;
-void
+static void
outc(int c)
{
putchar(c);
@@ -433,7 +428,7 @@
}
}
-void
+static void
setulmode(int newmode)
{
if (!iflag) {
Home |
Main Index |
Thread Index |
Old Index