Permalink
Browse files

Our various "make-C-readable" macros encroach on name-spaces reserved

by various standardsbodies.

Going forward these macros will all be named 'v_[a-z_]*_' and only
vdef.h gets to define them.

Renames:
	__match_proto__()		->	v_matchproto_()
	__v_printflike()		->	v_printflike_()
	__state_variable__()		->	v_statevariable_()
	__unused			->	v_unused_
	__attribute__((__noreturn__))	->	v_noreturn_

As a side-effect of the last one, the rule that "vdef.h" be the
first non-<...> include in .c files, possibly via a subsystem
.h (such as vct.h) needs to be enforced harder.

(autocraps "config.h" still needs to go before <...> includes)
  • Loading branch information...
bsdphk committed Nov 30, 2017
1 parent ae1c0ab commit 2061f887203ec454719fe760419f4562ca8876e6
Showing with 519 additions and 474 deletions.
  1. +3 −2 bin/varnishadm/varnishadm.c
  2. +4 −4 bin/varnishd/cache/cache.h
  3. +5 −5 bin/varnishd/cache/cache_acceptor.c
  4. +5 −5 bin/varnishd/cache/cache_backend.c
  5. +4 −4 bin/varnishd/cache/cache_backend_probe.c
  6. +2 −2 bin/varnishd/cache/cache_ban.c
  7. +1 −1 bin/varnishd/cache/cache_ban_lurker.c
  8. +1 −1 bin/varnishd/cache/cache_deliver_proc.c
  9. +4 −4 bin/varnishd/cache/cache_director.c
  10. +5 −5 bin/varnishd/cache/cache_esi_deliver.c
  11. +5 −5 bin/varnishd/cache/cache_esi_fetch.c
  12. +4 −4 bin/varnishd/cache/cache_esi_parse.c
  13. +3 −3 bin/varnishd/cache/cache_expire.c
  14. +1 −1 bin/varnishd/cache/cache_fetch.c
  15. +1 −1 bin/varnishd/cache/cache_fetch_proc.c
  16. +1 −1 bin/varnishd/cache/cache_filter.h
  17. +6 −6 bin/varnishd/cache/cache_gzip.c
  18. +4 −4 bin/varnishd/cache/cache_lck.c
  19. +3 −3 bin/varnishd/cache/cache_main.c
  20. +1 −1 bin/varnishd/cache/cache_mempool.c
  21. +1 −1 bin/varnishd/cache/cache_panic.c
  22. +2 −2 bin/varnishd/cache/cache_pool.c
  23. +1 −1 bin/varnishd/cache/cache_range.c
  24. +1 −1 bin/varnishd/cache/cache_req.c
  25. +1 −1 bin/varnishd/cache/cache_req_body.c
  26. +1 −1 bin/varnishd/cache/cache_session.c
  27. +1 −1 bin/varnishd/cache/cache_tcp_pool.c
  28. +7 −7 bin/varnishd/cache/cache_vcl.c
  29. +1 −1 bin/varnishd/cache/cache_vrt.c
  30. +1 −1 bin/varnishd/cache/cache_vrt_vmod.c
  31. +1 −1 bin/varnishd/cache/cache_wrk.c
  32. +4 −4 bin/varnishd/hash/hash_classic.c
  33. +5 −5 bin/varnishd/hash/hash_critbit.c
  34. +3 −3 bin/varnishd/hash/hash_simple_list.c
  35. +13 −13 bin/varnishd/hpack/vhp_decode.c
  36. +2 −2 bin/varnishd/http1/cache_http1_deliver.c
  37. +1 −1 bin/varnishd/http1/cache_http1_fetch.c
  38. +7 −7 bin/varnishd/http1/cache_http1_fsm.c
  39. +1 −1 bin/varnishd/http1/cache_http1_proto.c
  40. +3 −3 bin/varnishd/http1/cache_http1_vfp.c
  41. +3 −3 bin/varnishd/http2/cache_http2_deliver.c
  42. +16 −16 bin/varnishd/http2/cache_http2_proto.c
  43. +3 −3 bin/varnishd/http2/cache_http2_session.c
  44. +5 −4 bin/varnishd/mgt/mgt.h
  45. +1 −1 bin/varnishd/mgt/mgt_acceptor.c
  46. +8 −8 bin/varnishd/mgt/mgt_child.c
  47. +10 −10 bin/varnishd/mgt/mgt_cli.c
  48. +3 −3 bin/varnishd/mgt/mgt_jail.c
  49. +3 −3 bin/varnishd/mgt/mgt_jail_solaris.c
  50. +5 −5 bin/varnishd/mgt/mgt_jail_unix.c
  51. +4 −4 bin/varnishd/mgt/mgt_main.c
  52. +2 −2 bin/varnishd/mgt/mgt_param.c
  53. +3 −3 bin/varnishd/mgt/mgt_vcc.c
  54. +8 −8 bin/varnishd/mgt/mgt_vcl.c
  55. +2 −2 bin/varnishd/proxy/cache_proxy_proto.c
  56. +2 −2 bin/varnishd/storage/mgt_stevedore.c
  57. +1 −1 bin/varnishd/storage/stevedore.c
  58. +3 −3 bin/varnishd/storage/storage_file.c
  59. +1 −1 bin/varnishd/storage/storage_lru.c
  60. +5 −5 bin/varnishd/storage/storage_malloc.c
  61. +6 −6 bin/varnishd/storage/storage_persistent.c
  62. +3 −3 bin/varnishd/storage/storage_persistent_silo.c
  63. +10 −10 bin/varnishd/storage/storage_simple.c
  64. +8 −8 bin/varnishd/storage/storage_umem.c
  65. +2 −2 bin/varnishd/waiter/cache_waiter.c
  66. +3 −3 bin/varnishd/waiter/cache_waiter_epoll.c
  67. +3 −3 bin/varnishd/waiter/cache_waiter_kqueue.c
  68. +3 −3 bin/varnishd/waiter/cache_waiter_poll.c
  69. +2 −2 bin/varnishd/waiter/cache_waiter_ports.c
  70. +4 −4 bin/varnishhist/varnishhist.c
  71. +6 −5 bin/varnishlog/varnishlog.c
  72. +14 −13 bin/varnishncsa/varnishncsa.c
  73. +6 −6 bin/varnishstat/varnishstat.c
  74. +2 −2 bin/varnishstat/varnishstat_curses.c
  75. +6 −5 bin/varnishtest/vtc.h
  76. +1 −1 bin/varnishtest/vtc_client.c
  77. +4 −1 bin/varnishtest/vtc_h2_hpack.c
  78. +3 −1 bin/varnishtest/vtc_h2_tbl.c
  79. +2 −2 bin/varnishtest/vtc_log.c
  80. +1 −1 bin/varnishtest/vtc_logexp.c
  81. +2 −2 bin/varnishtest/vtc_main.c
  82. +5 −4 bin/varnishtop/varnishtop.c
  83. +6 −2 include/Makefile.am
  84. +2 −2 include/vas.h
  85. +1 −1 include/vcli_serve.h
  86. +15 −12 include/vdef.h
  87. +1 −1 include/vrt.h
  88. +2 −2 include/vsb.h
  89. +2 −2 include/vtree.h
  90. +1 −1 include/vut.h
  91. +3 −3 lib/libvarnish/binary_heap.c
  92. +4 −2 lib/libvarnish/vas.c
  93. +2 −0 lib/libvarnish/vav.c
  94. +2 −0 lib/libvarnish/vcli_proto.c
  95. +4 −4 lib/libvarnish/vcli_serve.c
  96. +2 −0 lib/libvarnish/vct.c
  97. +2 −2 lib/libvarnish/vev.c
  98. +2 −1 lib/libvarnish/vin.c
  99. +2 −0 lib/libvarnish/vlu.c
  100. +2 −0 lib/libvarnish/vnum.c
  101. +2 −0 lib/libvarnish/vpf.c
  102. +2 −0 lib/libvarnish/vre.c
  103. +2 −1 lib/libvarnish/vrnd.c
  104. +2 −0 lib/libvarnish/vsha256.c
  105. +2 −0 lib/libvarnish/vss.c
  106. +2 −1 lib/libvarnish/vsub.c
  107. +2 −2 lib/libvarnish/vtcp.c
  108. +2 −0 lib/libvarnish/vtim.c
  109. +2 −0 lib/libvarnishapi/vjsn.c
  110. +2 −2 lib/libvarnishapi/vsl.c
  111. +1 −1 lib/libvarnishapi/vsl_api.h
  112. +2 −2 lib/libvarnishapi/vsl_arg.c
  113. +2 −2 lib/libvarnishapi/vut.c
  114. +1 −1 lib/libvcc/vcc_acl.c
  115. +3 −3 lib/libvcc/vcc_compile.c
  116. +3 −3 lib/libvcc/vcc_compile.h
  117. +6 −6 lib/libvcc/vcc_expr.c
  118. +1 −1 lib/libvcc/vcc_parse.c
  119. +1 −1 lib/libvcc/vcc_utils.c
  120. +1 −1 lib/libvcc/vcc_var.c
  121. +1 −1 lib/libvcc/vcc_xref.c
  122. +11 −11 lib/libvmod_blob/vmod_blob.c
  123. +19 −19 lib/libvmod_debug/vmod_debug.c
  124. +1 −1 lib/libvmod_debug/vmod_debug_dyn.c
  125. +9 −9 lib/libvmod_debug/vmod_debug_obj.c
  126. +7 −7 lib/libvmod_directors/fall_back.c
  127. +5 −5 lib/libvmod_directors/hash.c
  128. +7 −7 lib/libvmod_directors/random.c
  129. +7 −7 lib/libvmod_directors/round_robin.c
  130. +4 −4 lib/libvmod_directors/shard_hash.c
  131. +11 −11 lib/libvmod_directors/vmod_shard.c
  132. +2 −2 lib/libvmod_purge/vmod_purge.c
  133. +16 −16 lib/libvmod_std/vmod_std.c
  134. +8 −8 lib/libvmod_std/vmod_std_conversions.c
  135. +1 −1 lib/libvmod_std/vmod_std_fileread.c
  136. +1 −1 lib/libvmod_std/vmod_std_querysort.c
  137. +9 −9 lib/libvmod_vtc/vmod_vtc.c
@@ -58,10 +58,11 @@
#include <string.h>
#include <unistd.h>
#include "vdef.h"
#include "vapi/vsm.h"
#include "vas.h"
#include "vcli.h"
#include "vdef.h"
#include "vnum.h"
#include "vtcp.h"
@@ -184,7 +185,7 @@ do_args(int sock, int argc, char * const *argv)
* to have a global variable.
*/
static int _line_sock;
static void __match_proto__()
static void v_matchproto_()
send_line(char *l)
{
if (l) {
@@ -672,7 +672,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, ...)
__v_printflike(2, 3);
v_printflike_(2, 3);
void http_TimeHeader(struct http *to, const char *fmt, double now);
void http_Proto(struct http *to);
void http_SetHeader(struct http *to, const char *hdr);
@@ -860,10 +860,10 @@ const char *SES_Get_String_Attr(const struct sess *sp, enum sess_attr a);
/* cache_shmlog.c */
void VSLv(enum VSL_tag_e tag, uint32_t vxid, const char *fmt, va_list va);
void VSL(enum VSL_tag_e tag, uint32_t vxid, const char *fmt, ...)
__v_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, ...)
__v_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);
@@ -927,7 +927,7 @@ void *WS_Alloc(struct ws *ws, unsigned bytes);
void *WS_Copy(struct ws *ws, const void *str, int len);
uintptr_t WS_Snapshot(struct ws *ws);
int WS_Overflowed(const struct ws *ws);
void *WS_Printf(struct ws *ws, const char *fmt, ...) __v_printflike(2, 3);
void *WS_Printf(struct ws *ws, const char *fmt, ...) v_printflike_(2, 3);
int WS_Inside(const struct ws *, const void *, const void *);
void WS_Assert_Allocated(const struct ws *ws, const void *ptr, ssize_t len);
@@ -289,7 +289,7 @@ vca_pace_good(void)
* Called from assigned worker thread
*/
static void __match_proto__(task_func_t)
static void v_matchproto_(task_func_t)
vca_make_session(struct worker *wrk, void *arg)
{
struct sess *sp;
@@ -391,7 +391,7 @@ vca_make_session(struct worker *wrk, void *arg)
* and handle the new connection ourselves.
*/
static void __match_proto__(task_func_t)
static void v_matchproto_(task_func_t)
vca_accept_task(struct worker *wrk, void *arg)
{
struct wrk_accept wa;
@@ -518,7 +518,7 @@ VCA_DestroyPool(struct pool *pp)
/*--------------------------------------------------------------------*/
static void * __match_proto__()
static void * v_matchproto_()
vca_acct(void *arg)
{
struct listen_sock *ls;
@@ -583,7 +583,7 @@ vca_acct(void *arg)
/*--------------------------------------------------------------------*/
static void __match_proto__(cli_func_t)
static void v_matchproto_(cli_func_t)
ccf_start(struct cli *cli, const char * const *av, void *priv)
{
@@ -596,7 +596,7 @@ ccf_start(struct cli *cli, const char * const *av, void *priv)
/*--------------------------------------------------------------------*/
static void __match_proto__(cli_func_t)
static void v_matchproto_(cli_func_t)
ccf_listen_address(struct cli *cli, const char * const *av, void *priv)
{
struct listen_sock *ls;
@@ -150,7 +150,7 @@ vbe_dir_getfd(struct worker *wrk, struct backend *bp, struct busyobj *bo,
return (vtp);
}
static unsigned __match_proto__(vdi_healthy_f)
static unsigned v_matchproto_(vdi_healthy_f)
vbe_dir_healthy(const struct director *d, const struct busyobj *bo,
double *changed)
{
@@ -162,7 +162,7 @@ vbe_dir_healthy(const struct director *d, const struct busyobj *bo,
return (VDI_Healthy(be->director, changed));
}
static void __match_proto__(vdi_finish_f)
static void v_matchproto_(vdi_finish_f)
vbe_dir_finish(const struct director *d, struct worker *wrk,
struct busyobj *bo)
{
@@ -203,7 +203,7 @@ vbe_dir_finish(const struct director *d, struct worker *wrk,
bo->htc = NULL;
}
static int __match_proto__(vdi_gethdrs_f)
static int v_matchproto_(vdi_gethdrs_f)
vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
struct busyobj *bo)
{
@@ -272,7 +272,7 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
return (-1);
}
static const struct suckaddr * __match_proto__(vdi_getip_f)
static const struct suckaddr * v_matchproto_(vdi_getip_f)
vbe_dir_getip(const struct director *d, struct worker *wrk,
struct busyobj *bo)
{
@@ -365,7 +365,7 @@ vbe_dir_event(const struct director *d, enum vcl_event_e ev)
/*---------------------------------------------------------------------*/
static void __match_proto__(vdi_destroy_f)
static void v_matchproto_(vdi_destroy_f)
vbe_destroy(const struct director *d)
{
struct backend *be;
@@ -380,7 +380,7 @@ vbp_poke(struct vbp_target *vt)
/*--------------------------------------------------------------------
*/
static void __match_proto__(task_func_t)
static void v_matchproto_(task_func_t)
vbp_task(struct worker *wrk, void *priv)
{
struct vbp_target *vt;
@@ -415,7 +415,7 @@ vbp_task(struct worker *wrk, void *priv)
/*--------------------------------------------------------------------
*/
static void * __match_proto__()
static void * v_matchproto_()
vbp_thread(struct worker *wrk, void *priv)
{
double now, nxt;
@@ -653,7 +653,7 @@ VBP_Remove(struct backend *be)
/*-------------------------------------------------------------------*/
static int __match_proto__(binheap_cmp_t)
static int v_matchproto_(binheap_cmp_t)
vbp_cmp(void *priv, const void *a, const void *b)
{
const struct vbp_target *aa, *bb;
@@ -668,7 +668,7 @@ vbp_cmp(void *priv, const void *a, const void *b)
return (aa->due < bb->due);
}
static void __match_proto__(binheap_update_t)
static void v_matchproto_(binheap_update_t)
vbp_update(void *priv, void *p, unsigned u)
{
struct vbp_target *vt;
@@ -618,7 +618,7 @@ BAN_CheckObject(struct worker *wrk, struct objcore *oc, struct req *req)
* CLI functions to add bans
*/
static void __match_proto__(cli_func_t)
static void v_matchproto_(cli_func_t)
ccf_ban(struct cli *cli, const char * const *av, void *priv)
{
int narg, i;
@@ -707,7 +707,7 @@ ban_render(struct cli *cli, const uint8_t *bs)
}
}
static void __match_proto__(cli_func_t)
static void v_matchproto_(cli_func_t)
ccf_ban_list(struct cli *cli, const char * const *av, void *priv)
{
struct ban *b, *bl;
@@ -364,7 +364,7 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl)
return (dt);
}
void * __match_proto__(bgthread_t)
void * v_matchproto_(bgthread_t)
ban_lurker(struct worker *wrk, void *priv)
{
struct vsl_log vsl;
@@ -123,7 +123,7 @@ VDP_close(struct req *req)
/*--------------------------------------------------------------------*/
static int __match_proto__(objiterate_f)
static int v_matchproto_(objiterate_f)
vdp_objiterator(void *priv, int flush, const void *ptr, ssize_t len)
{
return (VDP_bytes(priv, flush ? VDP_FLUSH : VDP_NULL, ptr, len));
@@ -283,7 +283,7 @@ VDI_Healthy(const struct director *d, double *changed)
/*---------------------------------------------------------------------*/
static int __match_proto__(vcl_be_func)
static int v_matchproto_(vcl_be_func)
do_list(struct cli *cli, struct director *d, void *priv)
{
int *probes;
@@ -317,7 +317,7 @@ do_list(struct cli *cli, struct director *d, void *priv)
return (0);
}
static void __match_proto__(cli_func_t)
static void v_matchproto_(cli_func_t)
cli_backend_list(struct cli *cli, const char * const *av, void *priv)
{
int probes = 0;
@@ -343,7 +343,7 @@ cli_backend_list(struct cli *cli, const char * const *av, void *priv)
/*---------------------------------------------------------------------*/
static int __match_proto__(vcl_be_func)
static int v_matchproto_(vcl_be_func)
do_set_health(struct cli *cli, struct director *d, void *priv)
{
unsigned prev;
@@ -362,7 +362,7 @@ do_set_health(struct cli *cli, struct director *d, void *priv)
return (0);
}
static void __match_proto__()
static void v_matchproto_()
cli_backend_set_health(struct cli *cli, const char * const *av, void *priv)
{
const struct vdi_ahealth *ah;
@@ -77,7 +77,7 @@ static const struct transport VED_transport = {
/*--------------------------------------------------------------------*/
static void __match_proto__(vtr_reembark_f)
static void v_matchproto_(vtr_reembark_f)
ved_reembark(struct worker *wrk, struct req *req)
{
struct ecx *ecx;
@@ -249,7 +249,7 @@ ved_decode_len(struct req *req, const uint8_t **pp)
/*---------------------------------------------------------------------
*/
static int __match_proto__(vdp_bytes)
static int v_matchproto_(vdp_bytes)
ved_vdp(struct req *req, enum vdp_action act, void **priv,
const void *ptr, ssize_t len)
{
@@ -466,7 +466,7 @@ ved_bytes(struct req *req, struct req *preq, enum vdp_action act,
* the stream with a bit more overhead.
*/
static int __match_proto__(vdp_bytes)
static int v_matchproto_(vdp_bytes)
ved_pretend_gzip(struct req *req, enum vdp_action act, void **priv,
const void *pv, ssize_t l)
{
@@ -767,7 +767,7 @@ ved_stripgzip(struct req *req, const struct boc *boc)
/*--------------------------------------------------------------------*/
static int __match_proto__(vdp_bytes)
static int v_matchproto_(vdp_bytes)
ved_vdp_bytes(struct req *req, enum vdp_action act, void **priv,
const void *ptr, ssize_t len)
{
@@ -791,7 +791,7 @@ static const struct vdp ved_ved = {
/*--------------------------------------------------------------------*/
static void __match_proto__(vtr_deliver_f)
static void v_matchproto_(vtr_deliver_f)
ved_deliver(struct req *req, struct boc *boc, int wantbody)
{
int i;
@@ -145,7 +145,7 @@ vfp_esi_end(struct vfp_ctx *vc, struct vef_priv *vef,
return (retval);
}
static enum vfp_status __match_proto__(vfp_init_f)
static enum vfp_status v_matchproto_(vfp_init_f)
vfp_esi_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
{
struct vef_priv *vef;
@@ -176,7 +176,7 @@ vfp_esi_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
return (VFP_OK);
}
static enum vfp_status __match_proto__(vfp_pull_f)
static enum vfp_status v_matchproto_(vfp_pull_f)
vfp_esi_gzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
ssize_t *lp)
{
@@ -219,7 +219,7 @@ vfp_esi_gzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
return (vp);
}
static enum vfp_status __match_proto__(vfp_init_f)
static enum vfp_status v_matchproto_(vfp_init_f)
vfp_esi_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
{
struct vef_priv *vef;
@@ -234,7 +234,7 @@ vfp_esi_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
return (VFP_OK);
}
static enum vfp_status __match_proto__(vfp_pull_f)
static enum vfp_status v_matchproto_(vfp_pull_f)
vfp_esi_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p, ssize_t *lp)
{
enum vfp_status vp;
@@ -261,7 +261,7 @@ vfp_esi_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p, ssize_t *lp)
return (vp);
}
static void __match_proto__(vfp_fini_f)
static void v_matchproto_(vfp_fini_f)
vfp_esi_fini(struct vfp_ctx *vc, struct vfp_entry *vfe)
{
CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
@@ -395,7 +395,7 @@ vep_mark_pending(struct vep_state *vep, const char *p)
/*---------------------------------------------------------------------
*/
static void __match_proto__()
static void v_matchproto_()
vep_do_comment(struct vep_state *vep, enum dowhat what)
{
Debug("DO_COMMENT(%d)\n", what);
@@ -407,7 +407,7 @@ vep_do_comment(struct vep_state *vep, enum dowhat what)
/*---------------------------------------------------------------------
*/
static void __match_proto__()
static void v_matchproto_()
vep_do_remove(struct vep_state *vep, enum dowhat what)
{
Debug("DO_REMOVE(%d, end %d empty %d remove %d)\n",
@@ -426,7 +426,7 @@ vep_do_remove(struct vep_state *vep, enum dowhat what)
/*---------------------------------------------------------------------
*/
static void __match_proto__()
static void v_matchproto_()
vep_do_include(struct vep_state *vep, enum dowhat what)
{
const char *p, *q, *h;
@@ -1001,7 +1001,7 @@ VEP_Parse(struct vep_state *vep, const char *p, size_t l)
/*---------------------------------------------------------------------
*/
static ssize_t __match_proto__(vep_callback_t)
static ssize_t v_matchproto_(vep_callback_t)
vep_default_cb(struct vfp_ctx *vc, void *priv, ssize_t l, enum vgz_flag flg)
{
ssize_t *s;
Oops, something went wrong.

0 comments on commit 2061f88

Please sign in to comment.