Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/patch Consistently use __dead and __printflike.
details: https://anonhg.NetBSD.org/src/rev/f9fce20780bf
branches: trunk
changeset: 769321:f9fce20780bf
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Sep 06 18:25:14 2011 +0000
description:
Consistently use __dead and __printflike.
diffstat:
usr.bin/patch/patch.c | 6 +++---
usr.bin/patch/pch.c | 6 +++---
usr.bin/patch/util.h | 18 +++++++-----------
3 files changed, 13 insertions(+), 17 deletions(-)
diffs (99 lines):
diff -r 80de92c6a56a -r f9fce20780bf usr.bin/patch/patch.c
--- a/usr.bin/patch/patch.c Tue Sep 06 18:24:43 2011 +0000
+++ b/usr.bin/patch/patch.c Tue Sep 06 18:25:14 2011 +0000
@@ -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 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 -r 80de92c6a56a -r f9fce20780bf usr.bin/patch/pch.c
--- a/usr.bin/patch/pch.c Tue Sep 06 18:24:43 2011 +0000
+++ b/usr.bin/patch/pch.c Tue Sep 06 18:25:14 2011 +0000
@@ -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 @@
}
/* 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 -r 80de92c6a56a -r f9fce20780bf usr.bin/patch/util.h
--- a/usr.bin/patch/util.h Tue Sep 06 18:24:43 2011 +0000
+++ b/usr.bin/patch/util.h Tue Sep 06 18:25:14 2011 +0000
@@ -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 @@
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 *);
Home |
Main Index |
Thread Index |
Old Index