summaryrefslogtreecommitdiff
path: root/usr.bin/patch
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2011-09-06 18:25:14 +0000
committerjoerg <joerg@NetBSD.org>2011-09-06 18:25:14 +0000
commit94d23bf2ae31dd7d6366c19593166f3274e0340f (patch)
tree27ea16e572cb3b982ce5d7c860f08ea38c5da241 /usr.bin/patch
parentcf331bc46323cccfc5af7e4d2aa4d25384c1cb4f (diff)
Consistently use __dead and __printflike.
Diffstat (limited to 'usr.bin/patch')
-rw-r--r--usr.bin/patch/patch.c6
-rw-r--r--usr.bin/patch/pch.c6
-rw-r--r--usr.bin/patch/util.h18
3 files changed, 13 insertions, 17 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index c3b89a3a814..9f49e7f96e1 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,7 +1,7 @@
/*
* $OpenBSD: patch.c,v 1.45 2007/04/18 21:52:24 sobrado Exp $
* $DragonFly: src/usr.bin/patch/patch.c,v 1.10 2008/08/10 23:39:56 joerg Exp $
- * $NetBSD: patch.c,v 1.28 2011/03/26 21:45:48 dholland Exp $
+ * $NetBSD: patch.c,v 1.29 2011/09/06 18:25:14 joerg Exp $
*/
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: patch.c,v 1.28 2011/03/26 21:45:48 dholland Exp $");
+__RCSID("$NetBSD: patch.c,v 1.29 2011/09/06 18:25:14 joerg Exp $");
#include <sys/types.h>
#include <sys/stat.h>
@@ -106,7 +106,7 @@ static bool spew_output(void);
static void dump_line(LINENUM, bool);
static bool patch_match(LINENUM, LINENUM, LINENUM);
static bool similar(const char *, const char *, int);
-static void usage(void);
+__dead static void usage(void);
/* true if -E was specified on command line. */
static bool remove_empty_files = false;
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
index 6dcf3aeeff5..bff3cc68dee 100644
--- a/usr.bin/patch/pch.c
+++ b/usr.bin/patch/pch.c
@@ -1,7 +1,7 @@
/*
* $OpenBSD: pch.c,v 1.37 2007/09/02 15:19:33 deraadt Exp $
* $DragonFly: src/usr.bin/patch/pch.c,v 1.6 2008/08/10 23:35:40 joerg Exp $
- * $NetBSD: pch.c,v 1.23 2008/09/19 18:33:34 joerg Exp $
+ * $NetBSD: pch.c,v 1.24 2011/09/06 18:25:14 joerg Exp $
*/
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pch.c,v 1.23 2008/09/19 18:33:34 joerg Exp $");
+__RCSID("$NetBSD: pch.c,v 1.24 2011/09/06 18:25:14 joerg Exp $");
#include <sys/types.h>
#include <sys/stat.h>
@@ -448,7 +448,7 @@ skip_to(LINENUM file_pos, LINENUM file_line)
}
/* Make this a function for better debugging. */
-static void
+__dead static void
malformed(void)
{
fatal("malformed patch at line %ld: %s", p_input_line, buf);
diff --git a/usr.bin/patch/util.h b/usr.bin/patch/util.h
index 222136c45d1..d5a7e16acc2 100644
--- a/usr.bin/patch/util.h
+++ b/usr.bin/patch/util.h
@@ -1,7 +1,7 @@
/*
* $OpenBSD: util.h,v 1.15 2005/06/20 07:14:06 otto Exp $
* $DragonFly: src/usr.bin/patch/util.h,v 1.2 2007/09/29 23:11:10 swildner Exp $
- * $NetBSD: util.h,v 1.11 2008/09/19 18:33:34 joerg Exp $
+ * $NetBSD: util.h,v 1.12 2011/09/06 18:25:14 joerg Exp $
*/
/*
@@ -35,20 +35,16 @@ char *checked_in(char *);
int backup_file(const char *);
int move_file(const char *, const char *);
int copy_file(const char *, const char *);
-void say(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
-void fatal(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
-void pfatal(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
-void ask(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
+void say(const char *, ...) __printflike(1, 2);
+void fatal(const char *, ...) __printflike(1, 2) __dead;
+void pfatal(const char *, ...) __printflike(1, 2) __dead;
+void ask(const char *, ...) __printflike(1, 2);
char *savestr(const char *);
void set_signals(int);
void ignore_signals(void);
void makedirs(const char *, bool);
-void version(void);
-void my_exit(int) __attribute__((noreturn));
+void version(void) __dead;
+void my_exit(int) __dead;
/* in mkpath.c */
extern int mkpath(char *);