Commit 9ba0565e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Rename __printflike to __v_printflike to make sure we have control

over it with vdef.h.

Confine __unused to include/vtree.h at the same time.
parent 282d8fbf
......@@ -848,7 +848,7 @@ void HTTP_Encode(const struct http *fm, uint8_t *, unsigned len, unsigned how);
int HTTP_Decode(struct http *to, const uint8_t *fm);
void http_ForceHeader(struct http *to, const char *hdr, const char *val);
void http_PrintfHeader(struct http *to, const char *fmt, ...)
__printflike(2, 3);
__v_printflike(2, 3);
void http_TimeHeader(struct http *to, const char *fmt, double now);
void http_SetHeader(struct http *to, const char *hdr);
void http_SetH(const struct http *to, unsigned n, const char *fm);
......@@ -1029,10 +1029,10 @@ void VSL_End(struct vsl_log *vsl);
void VSM_Free(void *ptr);
#ifdef VSL_ENDMARKER
void VSL(enum VSL_tag_e tag, uint32_t vxid, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
void VSLbv(struct vsl_log *, enum VSL_tag_e tag, const char *fmt, va_list va);
void VSLb(struct vsl_log *, enum VSL_tag_e tag, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
void VSLbt(struct vsl_log *, enum VSL_tag_e tag, txt t);
void VSLb_ts(struct vsl_log *, const char *event, double first, double *pprev,
double now);
......@@ -1120,7 +1120,7 @@ void *WS_Alloc(struct ws *ws, unsigned bytes);
void *WS_Copy(struct ws *ws, const void *str, int len);
char *WS_Snapshot(struct ws *ws);
int WS_Overflowed(const struct ws *ws);
void *WS_Printf(struct ws *ws, const char *fmt, ...) __printflike(2, 3);
void *WS_Printf(struct ws *ws, const char *fmt, ...) __v_printflike(2, 3);
/* cache_rfc2616.c */
void RFC2616_Ttl(struct busyobj *, double now);
......
......@@ -80,7 +80,7 @@ int VFP_Open(struct vfp_ctx *bo);
void VFP_Close(struct vfp_ctx *bo);
enum vfp_status VFP_Suck(struct vfp_ctx *, void *p, ssize_t *lp);
enum vfp_status VFP_Error(struct vfp_ctx *, const char *fmt, ...)
__printflike(2, 3);
__v_printflike(2, 3);
/* cache_fetch_proc.c */
enum vfp_status VFP_GetStorage(struct vfp_ctx *, ssize_t *sz, uint8_t **ptr);
......
......@@ -54,7 +54,7 @@ typedef void mgt_cli_close_f(void *priv);
void mgt_cli_setup(int fdi, int fdo, int verbose, const char *ident,
mgt_cli_close_f *close_func, void *priv);
int mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
void mgt_cli_start_child(int fdi, int fdo);
void mgt_cli_stop_child(void);
void mgt_cli_telnet(const char *T_arg);
......
......@@ -172,7 +172,7 @@ static pthread_mutex_t log_mutex = PTHREAD_MUTEX_INITIALIZER;
static void
thread_log(int lvl, int errcode, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
static void
thread_log(int lvl, int errcode, const char *fmt, ...)
......
......@@ -81,7 +81,7 @@ void vtc_loginit(char *buf, unsigned buflen);
struct vtclog *vtc_logopen(const char *id);
void vtc_logclose(struct vtclog *vl);
void vtc_log(struct vtclog *vl, int lvl, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
void vtc_dump(struct vtclog *vl, int lvl, const char *pfx,
const char *str, int len);
void vtc_hexdump(struct vtclog *vl, int lvl, const char *pfx,
......@@ -93,8 +93,8 @@ int exec_file(const char *fn, const char *script, const char *tmpdir,
void macro_undef(struct vtclog *vl, const char *instance, const char *name);
void macro_def(struct vtclog *vl, const char *instance, const char *name,
const char *fmt, ...)
__printflike(4, 5);
__v_printflike(4, 5);
struct vsb *macro_expand(struct vtclog *vl, const char *text);
void extmacro_def(const char *name, const char *fmt, ...)
__printflike(2, 3);
__v_printflike(2, 3);
......@@ -54,6 +54,6 @@ struct cli_proto {
/* The implementation must provide these functions */
int VCLI_Overflow(struct cli *cli);
void VCLI_Out(struct cli *cli, const char *fmt, ...)
__printflike(2, 3);
__v_printflike(2, 3);
void VCLI_Quote(struct cli *cli, const char *str);
void VCLI_SetResult(struct cli *cli, unsigned r);
......@@ -59,20 +59,12 @@
# endif
#endif
#ifndef __printflike
# if __GNUC_PREREQ(2, 95) || defined(__INTEL_COMPILER)
# define __printflike(f,a) __attribute__((format(printf, f, a)))
# else
# define __printflike(f,a)
# endif
#endif
#ifndef __unused
# if __GNUC_PREREQ(2, 95) || defined(__INTEL_COMPILER)
# define __unused __attribute__((__unused__))
# else
# define __unused
# endif
#ifdef __printflike
# define __v_printflike(f,a) __printflike(f,a)
#elif __GNUC_PREREQ(2, 95) || defined(__INTEL_COMPILER)
# define __v_printflike(f,a) __attribute__((format(printf, f, a)))
#else
# define __v_printflike(f,a)
#endif
/**********************************************************************
......
......@@ -63,10 +63,10 @@ void VSB_clear(struct vsb *);
int VSB_bcat(struct vsb *, const void *, size_t);
int VSB_cat(struct vsb *, const char *);
int VSB_printf(struct vsb *, const char *, ...)
__printflike(2, 3);
__v_printflike(2, 3);
#ifdef va_start
int VSB_vprintf(struct vsb *, const char *, va_list)
__printflike(2, 0);
__v_printflike(2, 0);
#endif
int VSB_putc(struct vsb *, int);
int VSB_error(const struct vsb *);
......
......@@ -30,6 +30,10 @@
#ifndef _VTREE_H_
#define _VTREE_H_
#ifndef __unused
define __unused __attribute__((__unused__))
#endif
/*
* This file defines data structures for different types of trees:
* splay trees and red-black trees.
......
......@@ -65,7 +65,7 @@ struct VUT {
extern struct VUT VUT;
void VUT_Error(int status, const char *fmt, ...)
__printflike(2, 3);
__v_printflike(2, 3);
int VUT_g_Arg(const char *arg);
......
......@@ -38,7 +38,7 @@
/*lint -esym(534, vsl_diag) */
int vsl_diag(struct VSL_data *vsl, const char *fmt, ...)
__printflike(2, 3);
__v_printflike(2, 3);
void vsl_vbm_bitset(int bit, void *priv);
void vsl_vbm_bitclr(int bit, void *priv);
......
......@@ -57,5 +57,5 @@ struct VSM_data {
};
int vsm_diag(struct VSM_data *vd, const char *fmt, ...)
__printflike(2, 3);
__v_printflike(2, 3);
void VSC_Delete(struct VSM_data *vd);
......@@ -256,11 +256,11 @@ struct inifin *New_IniFin(struct vcc *tl);
* F -> Finish function
*/
void Fh(const struct vcc *tl, int indent, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
void Fc(const struct vcc *tl, int indent, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
void Fb(const struct vcc *tl, int indent, const char *fmt, ...)
__printflike(3, 4);
__v_printflike(3, 4);
void EncToken(struct vsb *sb, const struct token *t);
int IsMethod(const struct token *t);
void *TlAlloc(struct vcc *tl, unsigned len);
......
......@@ -247,7 +247,7 @@ vcc_new_expr(void)
static struct expr *
vcc_mk_expr(enum var_type fmt, const char *str, ...)
__printflike(2, 3);
__v_printflike(2, 3);
static struct expr *
vcc_mk_expr(enum var_type fmt, const char *str, ...)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment