Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/httpd Add BOZO_PRINTFLIKE for functions that pass an...
details: https://anonhg.NetBSD.org/src/rev/a620fa6fa4bc
branches: trunk
changeset: 778056:a620fa6fa4bc
user: joerg <joerg%NetBSD.org@localhost>
date: Wed Mar 14 23:47:19 2012 +0000
description:
Add BOZO_PRINTFLIKE for functions that pass an argument and va_arg to
a vprintf-like function.
diffstat:
libexec/httpd/bozohttpd.h | 17 ++++++++---------
libexec/httpd/ssl-bozo.c | 6 +++---
2 files changed, 11 insertions(+), 12 deletions(-)
diffs (71 lines):
diff -r f61beaa00e22 -r a620fa6fa4bc libexec/httpd/bozohttpd.h
--- a/libexec/httpd/bozohttpd.h Wed Mar 14 17:03:10 2012 +0000
+++ b/libexec/httpd/bozohttpd.h Wed Mar 14 23:47:19 2012 +0000
@@ -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 @@
#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 @@
#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 *);
diff -r f61beaa00e22 -r a620fa6fa4bc libexec/httpd/ssl-bozo.c
--- a/libexec/httpd/ssl-bozo.c Wed Mar 14 17:03:10 2012 +0000
+++ b/libexec/httpd/ssl-bozo.c Wed Mar 14 23:47:19 2012 +0000
@@ -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 @@
* 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 @@
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;
Home |
Main Index |
Thread Index |
Old Index