[master] cbff1d8 Argument constification polishing

Poul-Henning Kamp phk at FreeBSD.org
Thu Sep 7 10:54:05 UTC 2017


commit cbff1d80f45623d7156cf0abdda7ff66c3986902
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Sep 7 10:52:41 2017 +0000

    Argument constification polishing
    
    Helped by: PC-Lint-Plus-RC2

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 3f517e4..e3bc4d4 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -849,7 +849,7 @@ void Lck_DestroyClass(struct VSC_lck **vsclck);
 #include "tbl/locks.h"
 
 /* cache_mempool.c */
-void MPL_AssertSane(void *item);
+void MPL_AssertSane(const void *item);
 struct mempool * MPL_New(const char *name, volatile struct poolparam *pp,
     volatile unsigned *cur_size);
 void MPL_Destroy(struct mempool **mpp);
diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index f86f648..91f5c08 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -517,7 +517,7 @@ VCA_DestroyPool(struct pool *pp)
 
 /*--------------------------------------------------------------------*/
 
-static void *
+static void * __match_proto__()
 vca_acct(void *arg)
 {
 	struct listen_sock *ls;
@@ -573,7 +573,7 @@ vca_acct(void *arg)
 
 /*--------------------------------------------------------------------*/
 
-static void
+static void __match_proto__(cli_func_t)
 ccf_start(struct cli *cli, const char * const *av, void *priv)
 {
 
@@ -586,7 +586,7 @@ ccf_start(struct cli *cli, const char * const *av, void *priv)
 
 /*--------------------------------------------------------------------*/
 
-static void
+static void __match_proto__(cli_func_t)
 ccf_listen_address(struct cli *cli, const char * const *av, void *priv)
 {
 	struct listen_sock *ls;
diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index 1ec9ef5..64154f4 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -366,7 +366,7 @@ do_list(struct cli *cli, struct backend *b, void *priv)
 	return (0);
 }
 
-static void
+static void __match_proto__(cli_func_t)
 cli_backend_list(struct cli *cli, const char * const *av, void *priv)
 {
 	int probes = 0;
@@ -412,7 +412,7 @@ do_set_health(struct cli *cli, struct backend *b, void *priv)
 	return (0);
 }
 
-static void
+static void __match_proto__()
 cli_backend_set_health(struct cli *cli, const char * const *av, void *priv)
 {
 	const char *ah;
diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index 55932e8..39cb394 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -616,7 +616,7 @@ BAN_CheckObject(struct worker *wrk, struct objcore *oc, struct req *req)
  * CLI functions to add bans
  */
 
-static void
+static void __match_proto__(cli_func_t)
 ccf_ban(struct cli *cli, const char * const *av, void *priv)
 {
 	int narg, i;
@@ -705,7 +705,7 @@ ban_render(struct cli *cli, const uint8_t *bs)
 	}
 }
 
-static void
+static void __match_proto__(cli_func_t)
 ccf_ban_list(struct cli *cli, const char * const *av, void *priv)
 {
 	struct ban *b, *bl;
diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index afa8959..9a2af88 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -223,7 +223,7 @@ VFP_Push(struct vfp_ctx *vc, const struct vfp *vfp, int top)
  * Debugging aids
  */
 
-static void
+static void __match_proto__(cli_func_t)
 debug_fragfetch(struct cli *cli, const char * const *av, void *priv)
 {
 	(void)priv;
diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index 3624c28..8602fcf 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -154,7 +154,7 @@ VXID_Get(struct worker *wrk, uint32_t mask)
  * Dumb down the VXID allocation to make it predictable for
  * varnishtest cases
  */
-static void
+static void __match_proto__(cli_func_t)
 cli_debug_xid(struct cli *cli, const char * const *av, void *priv)
 {
 	(void)priv;
diff --git a/bin/varnishd/cache/cache_mempool.c b/bin/varnishd/cache/cache_mempool.c
index 45197e8..98c22f0 100644
--- a/bin/varnishd/cache/cache_mempool.c
+++ b/bin/varnishd/cache/cache_mempool.c
@@ -337,7 +337,7 @@ MPL_Free(struct mempool *mpl, void *item)
 }
 
 void
-MPL_AssertSane(void *item)
+MPL_AssertSane(const void *item)
 {
 	struct memitem *mi;
 	mi = (void*)((uintptr_t)item - sizeof(*mi));
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 03b3911..0bf34f2 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -178,7 +178,7 @@ pool_mkpool(unsigned pool_no)
  * NB: be maintained for params which require action.
  */
 
-static void *
+static void * __match_proto__()
 pool_poolherder(void *priv)
 {
 	unsigned nwq;
diff --git a/bin/varnishd/cache/cache_vrt_vmod.c b/bin/varnishd/cache/cache_vrt_vmod.c
index 719df9f..cb73247 100644
--- a/bin/varnishd/cache/cache_vrt_vmod.c
+++ b/bin/varnishd/cache/cache_vrt_vmod.c
@@ -202,7 +202,7 @@ VMOD_Panic(struct vsb *vsb)
 
 /*---------------------------------------------------------------------*/
 
-static void
+static void __match_proto__(cli_func_t)
 ccf_debug_vmod(struct cli *cli, const char * const *av, void *priv)
 {
 	struct vmod *v;
diff --git a/bin/varnishd/hash/hash_critbit.c b/bin/varnishd/hash/hash_critbit.c
index f29a815..b84eee1 100644
--- a/bin/varnishd/hash/hash_critbit.c
+++ b/bin/varnishd/hash/hash_critbit.c
@@ -128,7 +128,7 @@ hcb_is_y(uintptr_t u)
 }
 
 static uintptr_t
-hcb_r_node(struct objhead *n)
+hcb_r_node(const struct objhead *n)
 {
 
 	AZ((uintptr_t)n & (HCB_BIT_NODE | HCB_BIT_Y));
@@ -145,7 +145,7 @@ hcb_l_node(uintptr_t u)
 }
 
 static uintptr_t
-hcb_r_y(struct hcb_y *y)
+hcb_r_y(const struct hcb_y *y)
 {
 
 	CHECK_OBJ_NOTNULL(y, HCB_Y_MAGIC);
@@ -273,7 +273,7 @@ hcb_insert(struct worker *wrk, struct hcb_root *root, const uint8_t *digest,
 /*--------------------------------------------------------------------*/
 
 static void
-hcb_delete(struct hcb_root *r, struct objhead *oh)
+hcb_delete(struct hcb_root *r, const struct objhead *oh)
 {
 	struct hcb_y *y;
 	volatile uintptr_t *p;
diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 41456fd..125cc31 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -209,7 +209,7 @@ MCH_Fd_Inherit(int fd, const char *what)
  * Listen to stdout+stderr from the child
  */
 
-static int
+static int __match_proto__(vlu_f)
 child_line(void *priv, const char *p)
 {
 	(void)priv;
@@ -686,7 +686,7 @@ mch_cli_server_stop(struct cli *cli, const char * const *av, void *priv)
 	}
 }
 
-static void
+static void __match_proto__(cli_func_t)
 mch_cli_server_status(struct cli *cli, const char * const *av, void *priv)
 {
 	(void)av;
diff --git a/bin/varnishd/mgt/mgt_cli.c b/bin/varnishd/mgt/mgt_cli.c
index d982511..e845c63 100644
--- a/bin/varnishd/mgt/mgt_cli.c
+++ b/bin/varnishd/mgt/mgt_cli.c
@@ -69,7 +69,7 @@ static const char	*secret_file;
 
 /*--------------------------------------------------------------------*/
 
-static void
+static void __match_proto__(cli_func_t)
 mcf_banner(struct cli *cli, const char *const *av, void *priv)
 {
 
@@ -97,7 +97,7 @@ static struct cli_proto cli_proto[] = {
 
 /*--------------------------------------------------------------------*/
 
-static void
+static void __match_proto__(cli_func_t)
 mcf_panic(struct cli *cli, const char * const *av, void *priv)
 {
 
@@ -114,7 +114,7 @@ static struct cli_proto cli_debug[] = {
 
 /*--------------------------------------------------------------------*/
 
-static void
+static void __match_proto__(cli_func_t)
 mcf_askchild(struct cli *cli, const char * const *av, void *priv)
 {
 	int i;
@@ -596,7 +596,7 @@ static double M_poll = 0.1;
 static VTAILQ_HEAD(,m_addr)	m_addr_list =
     VTAILQ_HEAD_INITIALIZER(m_addr_list);
 
-static void
+static void __match_proto__(mgt_cli_close_f)
 Marg_closer(void *priv)
 {
 
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 74bec16..53db1ee 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -173,7 +173,7 @@ cli_check(const struct cli *cli)
  * This function is called when the CLI on stdin is closed.
  */
 
-static void
+static void __match_proto__(mgt_cli_close_f)
 mgt_stdin_close(void *priv)
 {
 
@@ -423,7 +423,7 @@ mgt_uptime(const struct vev *e, int what)
 
 /*--------------------------------------------------------------------*/
 
-static void
+static void __match_proto__(mgt_cli_close_f)
 mgt_I_close(void *priv)
 {
 	(void)priv;
diff --git a/bin/varnishd/storage/mgt_stevedore.c b/bin/varnishd/storage/mgt_stevedore.c
index c4b0285..b1d0288 100644
--- a/bin/varnishd/storage/mgt_stevedore.c
+++ b/bin/varnishd/storage/mgt_stevedore.c
@@ -88,7 +88,7 @@ static struct cli_proto cli_stv[] = {
 /*--------------------------------------------------------------------
  */
 
-static void
+static void __match_proto__(storage_init_f)
 smp_fake_init(struct stevedore *parent, int ac, char * const *av)
 {
 
diff --git a/bin/varnishd/storage/storage_persistent.c b/bin/varnishd/storage/storage_persistent.c
index b4283f3..6c4d79e 100644
--- a/bin/varnishd/storage/storage_persistent.c
+++ b/bin/varnishd/storage/storage_persistent.c
@@ -72,7 +72,7 @@ static VTAILQ_HEAD(,smp_sc)	silos = VTAILQ_HEAD_INITIALIZER(silos);
  */
 
 static int
-smp_appendban(struct smp_sc *sc, struct smp_signspace *spc,
+smp_appendban(const struct smp_sc *sc, struct smp_signspace *spc,
     uint32_t len, const uint8_t *ban)
 {
 
@@ -135,7 +135,7 @@ smp_banexport(const struct stevedore *stv, const uint8_t *bans, unsigned len)
  */
 
 static int
-smp_open_bans(struct smp_sc *sc, struct smp_signspace *spc)
+smp_open_bans(const struct smp_sc *sc, struct smp_signspace *spc)
 {
 	uint8_t *ptr, *pe;
 	int i;
@@ -630,7 +630,7 @@ debug_report_silo(struct cli *cli, const struct smp_sc *sc)
 	}
 }
 
-static void
+static void __match_proto__(cli_func_t)
 debug_persistent(struct cli *cli, const char * const * av, void *priv)
 {
 	struct smp_sc *sc;


More information about the varnish-commit mailing list