Module Name: src
Committed By: joerg
Date: Sun Sep 4 20:27:05 UTC 2011
Modified Files:
src/usr.bin/gencat: gencat.c
Log Message:
static + __dead
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/gencat/gencat.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/gencat/gencat.c
diff -u src/usr.bin/gencat/gencat.c:1.30 src/usr.bin/gencat/gencat.c:1.31
--- src/usr.bin/gencat/gencat.c:1.30 Mon Jul 13 19:05:41 2009
+++ src/usr.bin/gencat/gencat.c Sun Sep 4 20:27:05 2011
@@ -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;