Module Name:    src
Committed By:   joerg
Date:           Wed Mar 14 23:47:20 UTC 2012

Modified Files:
        src/libexec/httpd: bozohttpd.h ssl-bozo.c

Log Message:
Add BOZO_PRINTFLIKE for functions that pass an argument and va_arg to
a vprintf-like function.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.14 -r1.15 src/libexec/httpd/ssl-bozo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.21 src/libexec/httpd/bozohttpd.h:1.22
--- src/libexec/httpd/bozohttpd.h:1.21	Mon Feb 20 09:26:56 2012
+++ src/libexec/httpd/bozohttpd.h	Wed Mar 14 23:47:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.21 2012/02/20 09:26:56 elric Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.22 2012/03/14 23:47:19 joerg Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -164,19 +164,18 @@ typedef struct bozoprefs_t {
 
 #define	strornull(x)	((x) ? (x) : "<null>")
 
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define BOZO_PRINTFLIKE(x,y) __attribute__((__format__(__printf__, x,y)))
+#define BOZO_DEAD __attribute__((__noreturn__))
+#endif
+
 #ifndef NO_DEBUG
-void	debug__(bozohttpd_t *, int, const char *, ...)
-			__attribute__((__format__(__printf__, 3, 4)));
+void	debug__(bozohttpd_t *, int, const char *, ...) BOZO_PRINTFLIKE(3, 4);
 #define debug(x)	debug__ x
 #else
 #define	debug(x)	
 #endif /* NO_DEBUG */
 
-#if defined(__GNUC__) && __GNUC__ >= 3
-#define BOZO_PRINTFLIKE(x,y) __attribute__((__format__(__printf__, x,y)))
-#define BOZO_DEAD __attribute__((__noreturn__))
-#endif
-
 void	bozo_warn(bozohttpd_t *, const char *, ...)
 		BOZO_PRINTFLIKE(2, 3);
 void	bozo_err(bozohttpd_t *, int, const char *, ...)
@@ -278,7 +277,7 @@ void	bozo_add_content_map_mime(bozohttpd
 #endif
 
 /* I/O */
-int bozo_printf(bozohttpd_t *, const char *, ...);
+int bozo_printf(bozohttpd_t *, const char *, ...) BOZO_PRINTFLIKE(2, 3);;
 ssize_t bozo_read(bozohttpd_t *, int, void *, size_t);
 ssize_t bozo_write(bozohttpd_t *, int, const void *, size_t);
 int bozo_flush(bozohttpd_t *, FILE *);

Index: src/libexec/httpd/ssl-bozo.c
diff -u src/libexec/httpd/ssl-bozo.c:1.14 src/libexec/httpd/ssl-bozo.c:1.15
--- src/libexec/httpd/ssl-bozo.c:1.14	Mon Feb 20 08:40:46 2012
+++ src/libexec/httpd/ssl-bozo.c	Wed Mar 14 23:47:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssl-bozo.c,v 1.14 2012/02/20 08:40:46 elric Exp $	*/
+/*	$NetBSD: ssl-bozo.c,v 1.15 2012/03/14 23:47:19 joerg Exp $	*/
 
 /*	$eterna: ssl-bozo.c,v 1.15 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -64,7 +64,7 @@ typedef struct sslinfo_t {
  * the error provided by the caller at the point of error it pops and
  * prints all errors from the SSL error queue.
  */
-BOZO_DEAD static void
+BOZO_PRINTFLIKE(3, 4) BOZO_DEAD static void
 bozo_ssl_err(bozohttpd_t *httpd, int code, const char *fmt, ...)
 {
         va_list ap;
@@ -96,7 +96,7 @@ bozo_ssl_err(bozohttpd_t *httpd, int cod
 	exit(code);
 }
 
-static int
+static BOZO_PRINTFLIKE(2, 0) int
 bozo_ssl_printf(bozohttpd_t *httpd, const char * fmt, va_list ap)
 {
 	sslinfo_t	*sslinfo;

Reply via email to