Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/m4 Move usage and onintr to make them static. Add __...
details: https://anonhg.NetBSD.org/src/rev/f1e937281290
branches: trunk
changeset: 769316:f1e937281290
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Sep 06 18:16:01 2011 +0000
description:
Move usage and onintr to make them static. Add __dead as needed.
diffstat:
usr.bin/m4/extern.h | 4 +---
usr.bin/m4/gnum4.c | 6 +++---
usr.bin/m4/main.c | 21 ++++++++++++++++++---
usr.bin/m4/misc.c | 23 +++--------------------
4 files changed, 25 insertions(+), 29 deletions(-)
diffs (152 lines):
diff -r 914a8316c6ed -r f1e937281290 usr.bin/m4/extern.h
--- a/usr.bin/m4/extern.h Tue Sep 06 16:41:55 2011 +0000
+++ b/usr.bin/m4/extern.h Tue Sep 06 18:16:01 2011 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: extern.h,v 1.49 2009/10/14 17:19:47 sthen Exp $ */
-/* $NetBSD: extern.h,v 1.14 2009/10/26 21:12:47 christos Exp $ */
+/* $NetBSD: extern.h,v 1.15 2011/09/06 18:16:01 joerg Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -96,7 +96,6 @@
extern ptrdiff_t indx(const char *, const char *);
extern void initspaces(void);
extern void killdiv(void);
-extern void onintr(int);
extern void pbnum(int);
extern void pbnumbase(int, int, int);
extern void pbunsigned(unsigned long);
@@ -105,7 +104,6 @@
extern void *xalloc(size_t, const char *fmt, ...);
extern void *xrealloc(void *, size_t, const char *fmt, ...);
extern char *xstrdup(const char *);
-extern void usage(void);
extern void resizedivs(int);
extern size_t buffer_mark(void);
extern void dump_buffer(FILE *, size_t);
diff -r 914a8316c6ed -r f1e937281290 usr.bin/m4/gnum4.c
--- a/usr.bin/m4/gnum4.c Tue Sep 06 16:41:55 2011 +0000
+++ b/usr.bin/m4/gnum4.c Tue Sep 06 18:16:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gnum4.c,v 1.7 2009/10/26 21:16:49 christos Exp $ */
+/* $NetBSD: gnum4.c,v 1.8 2011/09/06 18:16:01 joerg Exp $ */
/* $OpenBSD: gnum4.c,v 1.39 2008/08/21 21:01:04 espie Exp $ */
/*
@@ -33,7 +33,7 @@
#include "nbtool_config.h"
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: gnum4.c,v 1.7 2009/10/26 21:16:49 christos Exp $");
+__RCSID("$NetBSD: gnum4.c,v 1.8 2011/09/06 18:16:01 joerg Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -203,7 +203,7 @@
static void addchar(int);
static char *twiddle(const char *);
static char *getstring(void);
-static void exit_regerror(int, regex_t *);
+static void exit_regerror(int, regex_t *) __dead;
static void do_subst(const char *, regex_t *, const char *, regmatch_t *);
static void do_regexpindex(const char *, regex_t *, regmatch_t *);
static void do_regexp(const char *, regex_t *, const char *, regmatch_t *);
diff -r 914a8316c6ed -r f1e937281290 usr.bin/m4/main.c
--- a/usr.bin/m4/main.c Tue Sep 06 16:41:55 2011 +0000
+++ b/usr.bin/m4/main.c Tue Sep 06 18:16:01 2011 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: main.c,v 1.77 2009/10/14 17:19:47 sthen Exp $ */
-/* $NetBSD: main.c,v 1.40 2011/08/14 12:59:25 christos Exp $ */
+/* $NetBSD: main.c,v 1.41 2011/09/06 18:16:01 joerg Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
#include "nbtool_config.h"
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: main.c,v 1.40 2011/08/14 12:59:25 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.41 2011/09/06 18:16:01 joerg Exp $");
#include <assert.h>
#include <signal.h>
#include <err.h>
@@ -167,7 +167,22 @@
static void enlarge_stack(void);
-int main(int, char *[]);
+__dead static void
+usage(void)
+{
+ fprintf(stderr, "usage: %s [-gPs] [-Dname[=value]] [-d flags] "
+ "[-I dirname] [-o filename]\n"
+ "\t[-t macro] [-Uname] [file ...]\n", getprogname());
+ exit(1);
+}
+
+__dead static void
+onintr(int signo)
+{
+ char intrmessage[] = "m4: interrupted.\n";
+ write(STDERR_FILENO, intrmessage, sizeof(intrmessage)-1);
+ _exit(1);
+}
int
main(int argc, char *argv[])
diff -r 914a8316c6ed -r f1e937281290 usr.bin/m4/misc.c
--- a/usr.bin/m4/misc.c Tue Sep 06 16:41:55 2011 +0000
+++ b/usr.bin/m4/misc.c Tue Sep 06 18:16:01 2011 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: misc.c,v 1.41 2009/10/14 17:19:47 sthen Exp $ */
-/* $NetBSD: misc.c,v 1.21 2011/03/05 16:37:50 christos Exp $ */
+/* $NetBSD: misc.c,v 1.22 2011/09/06 18:16:01 joerg Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -36,7 +36,7 @@
#include "nbtool_config.h"
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: misc.c,v 1.21 2011/03/05 16:37:50 christos Exp $");
+__RCSID("$NetBSD: misc.c,v 1.22 2011/09/06 18:16:01 joerg Exp $");
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
@@ -240,19 +240,11 @@
outfile[n] = NULL;
}
-void
-onintr(int signo)
-{
-#define intrmessage "m4: interrupted.\n"
- write(STDERR_FILENO, intrmessage, sizeof(intrmessage)-1);
- _exit(1);
-}
-
/*
* killdiv - get rid of the diversion files
*/
void
-killdiv()
+killdiv(void)
{
int n;
@@ -340,15 +332,6 @@
return p;
}
-void
-usage(void)
-{
- fprintf(stderr, "usage: %s [-gPs] [-Dname[=value]] [-d flags] "
- "[-I dirname] [-o filename]\n"
- "\t[-t macro] [-Uname] [file ...]\n", getprogname());
- exit(1);
-}
-
int
obtain_char(struct input_file *f)
{
Home |
Main Index |
Thread Index |
Old Index