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/8bff379a3824
branches: trunk
changeset: 769243:8bff379a3824
user: joerg <joerg%NetBSD.org@localhost>
date: Sun Sep 04 20:27:05 2011 +0000
description:
static + __dead
diffstat:
usr.bin/gencat/gencat.c | 41 +++++++++++++--------------
usr.bin/hexdump/hexdump.h | 6 +---
usr.bin/hexdump/parse.c | 17 +++++++----
usr.bin/join/join.c | 69 +++++++++++++++++++++++-----------------------
4 files changed, 67 insertions(+), 66 deletions(-)
diffs (truncated from 382 to 300 lines):
diff -r 51056544e3b6 -r 8bff379a3824 usr.bin/gencat/gencat.c
--- a/usr.bin/gencat/gencat.c Sun Sep 04 20:26:17 2011 +0000
+++ b/usr.bin/gencat/gencat.c Sun Sep 04 20:27:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gencat.c,v 1.30 2009/07/13 19:05:41 roy Exp $ */
+/* $NetBSD: gencat.c,v 1.31 2011/09/04 20:27:05 joerg Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: gencat.c,v 1.30 2009/07/13 19:05:41 roy Exp $");
+__RCSID("$NetBSD: gencat.c,v 1.31 2011/09/04 20:27:05 joerg Exp $");
#endif
/***********************************************************
@@ -108,7 +108,7 @@
LIST_ENTRY(_setT) entries;
};
-LIST_HEAD(sethead, _setT) sethead;
+static LIST_HEAD(sethead, _setT) sethead;
static struct _setT *curSet;
static const char *curfile;
@@ -116,7 +116,7 @@
static long lineno = 0;
static char *cskip(char *);
-static void error(const char *);
+__dead static void error(const char *);
static char *get_line(int);
static char *getmsg(int, char *, char);
static void warning(const char *, const char *);
@@ -125,20 +125,19 @@
static void *xmalloc(size_t);
static void *xrealloc(void *, size_t);
-void MCParse(int fd);
-void MCReadCat(int fd);
-void MCWriteCat(int fd);
-void MCDelMsg(int msgId);
-void MCAddMsg(int msgId, const char *msg);
-void MCAddSet(int setId);
-void MCDelSet(int setId);
-int main(int, char **);
-void usage(void);
+static void MCParse(int fd);
+static void MCReadCat(int fd);
+static void MCWriteCat(int fd);
+static void MCDelMsg(int msgId);
+static void MCAddMsg(int msgId, const char *msg);
+static void MCAddSet(int setId);
+static void MCDelSet(int setId);
+__dead static void usage(void);
#define CORRUPT "corrupt message catalog"
#define NOMEMORY "out of memory"
-void
+static void
usage(void)
{
fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname());
@@ -442,7 +441,7 @@
return (msg);
}
-void
+static void
MCParse(int fd)
{
char *cptr, *str;
@@ -533,7 +532,7 @@
}
}
-void
+static void
MCReadCat(int fd)
{
void *msgcat; /* message catalog data */
@@ -631,7 +630,7 @@
* avoids additional housekeeping variables and/or a lot of seeks
* that would otherwise be required.
*/
-void
+static void
MCWriteCat(int fd)
{
int nsets; /* number of sets */
@@ -736,7 +735,7 @@
write(fd, msgcat, msgcat_size);
}
-void
+static void
MCAddSet(int setId)
{
struct _setT *p, *q;
@@ -773,7 +772,7 @@
curSet = p;
}
-void
+static void
MCAddMsg(int msgId, const char *str)
{
struct _msgT *p, *q;
@@ -811,7 +810,7 @@
p->str = xstrdup(str);
}
-void
+static void
MCDelSet(int setId)
{
struct _setT *set;
@@ -842,7 +841,7 @@
warning(NULL, "specified set doesn't exist");
}
-void
+static void
MCDelMsg(int msgId)
{
struct _msgT *msg;
diff -r 51056544e3b6 -r 8bff379a3824 usr.bin/hexdump/hexdump.h
--- a/usr.bin/hexdump/hexdump.h Sun Sep 04 20:26:17 2011 +0000
+++ b/usr.bin/hexdump/hexdump.h Sun Sep 04 20:27:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hexdump.h,v 1.12 2010/11/27 20:46:38 christos Exp $ */
+/* $NetBSD: hexdump.h,v 1.13 2011/09/04 20:27:27 joerg Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -81,10 +81,6 @@
void add(const char *);
void addfile(char *);
-void badcnt(char *);
-void badconv(char *);
-void badfmt(const char *);
-void badsfmt(void);
void bpad(PR *);
void conv_c(PR *, u_char *);
void conv_u(PR *, u_char *);
diff -r 51056544e3b6 -r 8bff379a3824 usr.bin/hexdump/parse.c
--- a/usr.bin/hexdump/parse.c Sun Sep 04 20:26:17 2011 +0000
+++ b/usr.bin/hexdump/parse.c Sun Sep 04 20:27:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.26 2009/01/18 21:34:32 apb Exp $ */
+/* $NetBSD: parse.c,v 1.27 2011/09/04 20:27:27 joerg Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: parse.c,v 1.26 2009/01/18 21:34:32 apb Exp $");
+__RCSID("$NetBSD: parse.c,v 1.27 2011/09/04 20:27:27 joerg Exp $");
#endif
#endif /* not lint */
@@ -57,6 +57,11 @@
#include "hexdump.h"
+__dead static void badcnt(char *);
+__dead static void badconv(char *);
+__dead static void badfmt(const char *);
+__dead static void badsfmt(void);
+
FU *endfu; /* format at end-of-data */
void
@@ -518,25 +523,25 @@
}
}
-void
+static void
badcnt(char *s)
{
errx(1, "%s: bad byte count", s);
}
-void
+static void
badsfmt(void)
{
errx(1, "%%s: requires a precision or a byte count");
}
-void
+static void
badfmt(const char *fmt)
{
errx(1, "\"%s\": bad format", fmt);
}
-void
+static void
badconv(char *ch)
{
errx(1, "%%%s: bad conversion character", ch);
diff -r 51056544e3b6 -r 8bff379a3824 usr.bin/join/join.c
--- a/usr.bin/join/join.c Sun Sep 04 20:26:17 2011 +0000
+++ b/usr.bin/join/join.c Sun Sep 04 20:27:05 2011 +0000
@@ -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 */
+
+static OLIST *olist; /* output field list */
+static u_long olistcnt; /* output field list count */
+static 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) */
+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) */
-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 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
Home |
Main Index |
Thread Index |
Old Index