Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin static + __dead
details: https://anonhg.NetBSD.org/src/rev/f083ea7368ce
branches: trunk
changeset: 769075:f083ea7368ce
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Aug 30 21:33:28 2011 +0000
description:
static + __dead
diffstat:
usr.bin/col/col.c | 56 +++++++++++++++++++++++++-------------------------
usr.bin/colrm/colrm.c | 14 ++++++------
usr.bin/comm/comm.c | 22 ++++++++++----------
3 files changed, 46 insertions(+), 46 deletions(-)
diffs (261 lines):
diff -r bdfc636bdc78 -r f083ea7368ce usr.bin/col/col.c
--- a/usr.bin/col/col.c Tue Aug 30 21:28:27 2011 +0000
+++ b/usr.bin/col/col.c Tue Aug 30 21:33:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: col.c,v 1.15 2008/07/21 14:19:21 lukem Exp $ */
+/* $NetBSD: col.c,v 1.16 2011/08/30 21:33:28 joerg Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95";
#endif
-__RCSID("$NetBSD: col.c,v 1.15 2008/07/21 14:19:21 lukem Exp $");
+__RCSID("$NetBSD: col.c,v 1.16 2011/08/30 21:33:28 joerg Exp $");
#endif /* not lint */
#include <ctype.h>
@@ -89,24 +89,24 @@
int l_max_col; /* max column in the line */
};
-LINE *alloc_line(void);
-void dowarn(int);
-void flush_line(LINE *);
-void flush_lines(int);
-void flush_blanks(void);
-void free_line(LINE *);
-void usage(void);
-void wrerr(void);
-void *xmalloc(void *, size_t);
+static LINE *alloc_line(void);
+static void dowarn(int);
+static void flush_line(LINE *);
+static void flush_lines(int);
+static void flush_blanks(void);
+static void free_line(LINE *);
+__dead static void usage(void);
+__dead static void wrerr(void);
+static void *xmalloc(void *, size_t);
-CSET last_set; /* char_set of last char printed */
-LINE *lines;
-int compress_spaces; /* if doing space -> tab conversion */
-int fine; /* if `fine' resolution (half lines) */
-int max_bufd_lines; /* max # lines to keep in memory */
-int nblank_lines; /* # blanks after last flushed line */
-int no_backspaces; /* if not to output any backspaces */
-int pass_unknown_seqs; /* whether to pass unknown control sequences */
+static CSET last_set; /* char_set of last char printed */
+static LINE *lines;
+static int compress_spaces; /* if doing space -> tab conversion */
+static int fine; /* if `fine' resolution (half lines) */
+static int max_bufd_lines; /* max # lines to keep in memory */
+static int nblank_lines; /* # blanks after last flushed line */
+static int no_backspaces; /* if not to output any backspaces */
+static int pass_unknown_seqs; /* whether to pass unknown control sequences */
#define PUTC(ch) \
if (putchar(ch) == EOF) \
@@ -324,7 +324,7 @@
/* NOTREACHED */
}
-void
+static void
flush_lines(int nflush)
{
LINE *l;
@@ -350,7 +350,7 @@
* is the number of half line feeds, otherwise it is the number of whole line
* feeds.
*/
-void
+static void
flush_blanks(void)
{
int half, i, nb;
@@ -379,7 +379,7 @@
* Write a line to stdout taking care of space to tab conversion (-h flag)
* and character set shifts.
*/
-void
+static void
flush_line(LINE *l)
{
CHAR *c, *endc;
@@ -478,7 +478,7 @@
static LINE *line_freelist;
-LINE *
+static LINE *
alloc_line(void)
{
LINE *l;
@@ -498,7 +498,7 @@
return (l);
}
-void
+static void
free_line(LINE *l)
{
@@ -506,7 +506,7 @@
line_freelist = l;
}
-void *
+static void *
xmalloc(void *p, size_t size)
{
void *q;
@@ -517,7 +517,7 @@
return (p);
}
-void
+static void
usage(void)
{
@@ -525,7 +525,7 @@
exit(EXIT_FAILURE);
}
-void
+static void
wrerr(void)
{
@@ -533,7 +533,7 @@
exit(EXIT_FAILURE);
}
-void
+static void
dowarn(int line)
{
diff -r bdfc636bdc78 -r f083ea7368ce usr.bin/colrm/colrm.c
--- a/usr.bin/colrm/colrm.c Tue Aug 30 21:28:27 2011 +0000
+++ b/usr.bin/colrm/colrm.c Tue Aug 30 21:33:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: colrm.c,v 1.8 2008/07/21 14:19:21 lukem Exp $ */
+/* $NetBSD: colrm.c,v 1.9 2011/08/30 21:35:09 joerg Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
#endif
-__RCSID("$NetBSD: colrm.c,v 1.8 2008/07/21 14:19:21 lukem Exp $");
+__RCSID("$NetBSD: colrm.c,v 1.9 2011/08/30 21:35:09 joerg Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -54,8 +54,8 @@
#define TAB 8
-void check(FILE *);
-void usage(void);
+static void check(FILE *);
+__dead static void usage(void);
int
main(int argc, char *argv[])
@@ -120,7 +120,7 @@
}
}
-void
+static void
check(FILE *stream)
{
if (feof(stream))
@@ -129,8 +129,8 @@
err(1, "%s", stream == stdin ? "stdin" : "stdout");
}
-void
-usage()
+static void
+usage(void)
{
(void)fprintf(stderr, "usage: colrm [start [stop]]\n");
exit(1);
diff -r bdfc636bdc78 -r f083ea7368ce usr.bin/comm/comm.c
--- a/usr.bin/comm/comm.c Tue Aug 30 21:28:27 2011 +0000
+++ b/usr.bin/comm/comm.c Tue Aug 30 21:33:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: comm.c,v 1.18 2009/11/28 03:56:38 darcy Exp $ */
+/* $NetBSD: comm.c,v 1.19 2011/08/30 21:36:38 joerg Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)comm.c 8.4 (Berkeley) 5/4/95";
#endif
-__RCSID("$NetBSD: comm.c,v 1.18 2009/11/28 03:56:38 darcy Exp $");
+__RCSID("$NetBSD: comm.c,v 1.19 2011/08/30 21:36:38 joerg Exp $");
#endif /* not lint */
#include <err.h>
@@ -55,12 +55,12 @@
#define MAXLINELEN (LINE_MAX + 1)
-const char *tabs[] = { "", "\t", "\t\t" };
+static const char *tabs[] = { "", "\t", "\t\t" };
-FILE *file(const char *);
-void show(FILE *, const char *, char *);
-void usage(void);
-char *getnextln(char *buf, FILE *);
+static FILE *file(const char *);
+static void show(FILE *, const char *, char *);
+__dead static void usage(void);
+static char *getnextln(char *buf, FILE *);
int
main(int argc, char **argv)
@@ -164,14 +164,14 @@
exit(0);
}
-void
+static void
show(FILE *fp, const char *offset, char *buf)
{
while (printf("%s%s\n", offset, buf) >= 0 && getnextln(buf, fp))
;
}
-FILE *
+static FILE *
file(const char *name)
{
FILE *fp;
@@ -183,7 +183,7 @@
return (fp);
}
-void
+static void
usage(void)
{
@@ -191,7 +191,7 @@
exit(1);
}
-char *
+static char *
getnextln(char *buf, FILE *fp)
{
size_t i = 0;
Home |
Main Index |
Thread Index |
Old Index