Module Name:    src
Committed By:   joerg
Date:           Tue Sep  6 18:25:14 UTC 2011

Modified Files:
        src/usr.bin/patch: patch.c pch.c util.h

Log Message:
Consistently use __dead and __printflike.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/patch/patch.c
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/patch/pch.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/patch/util.h

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/patch/patch.c
diff -u src/usr.bin/patch/patch.c:1.28 src/usr.bin/patch/patch.c:1.29
--- src/usr.bin/patch/patch.c:1.28	Sat Mar 26 21:45:48 2011
+++ src/usr.bin/patch/patch.c	Tue Sep  6 18:25:14 2011
@@ -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;

Index: src/usr.bin/patch/pch.c
diff -u src/usr.bin/patch/pch.c:1.23 src/usr.bin/patch/pch.c:1.24
--- src/usr.bin/patch/pch.c:1.23	Fri Sep 19 18:33:34 2008
+++ src/usr.bin/patch/pch.c	Tue Sep  6 18:25:14 2011
@@ -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);

Index: src/usr.bin/patch/util.h
diff -u src/usr.bin/patch/util.h:1.11 src/usr.bin/patch/util.h:1.12
--- src/usr.bin/patch/util.h:1.11	Fri Sep 19 18:33:34 2008
+++ src/usr.bin/patch/util.h	Tue Sep  6 18:25:14 2011
@@ -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 *);

Reply via email to