[master] 61e8ab9 Various polishing
Poul-Henning Kamp
phk at varnish-cache.org
Thu Jan 27 18:03:20 CET 2011
commit 61e8ab914ab075c673ad8c5fb04f8ec1679b460b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Jan 27 17:02:53 2011 +0000
Various polishing
diff --git a/bin/varnishd/cache_vrt_var.c b/bin/varnishd/cache_vrt_var.c
index 3a50f29..d0af3f3 100644
--- a/bin/varnishd/cache_vrt_var.c
+++ b/bin/varnishd/cache_vrt_var.c
@@ -322,7 +322,7 @@ VRT_r_beresp_storage(struct sess *sp)
return (NULL);
}
-void
+void __match_proto__()
VRT_l_beresp_storage(struct sess *sp, const char *str, ...)
{
va_list ap;
diff --git a/bin/varnishd/mgt.h b/bin/varnishd/mgt.h
index 0abf533..2dd07bd 100644
--- a/bin/varnishd/mgt.h
+++ b/bin/varnishd/mgt.h
@@ -81,8 +81,8 @@ int mgt_vcc_default(const char *bflag, const char *f_arg, char *vcl, int Cflag);
int mgt_push_vcls_and_start(unsigned *status, char **p);
int mgt_has_vcl(void);
extern char *mgt_cc_cmd;
-extern char *mgt_vcl_dir;
-extern char *mgt_vmod_dir;
+extern const char *mgt_vcl_dir;
+extern const char *mgt_vmod_dir;
extern unsigned mgt_vcc_err_unref;
#define REPORT0(pri, fmt) \
diff --git a/bin/varnishd/mgt_vcc.c b/bin/varnishd/mgt_vcc.c
index 2ddec17..9c42393 100644
--- a/bin/varnishd/mgt_vcc.c
+++ b/bin/varnishd/mgt_vcc.c
@@ -67,8 +67,8 @@ struct vclprog {
static VTAILQ_HEAD(, vclprog) vclhead = VTAILQ_HEAD_INITIALIZER(vclhead);
char *mgt_cc_cmd;
-char *mgt_vcl_dir;
-char *mgt_vmod_dir;
+const char *mgt_vcl_dir;
+const char *mgt_vmod_dir;
unsigned mgt_vcc_err_unref;
static struct vcc *vcc;
diff --git a/bin/varnishd/varnishd.c b/bin/varnishd/varnishd.c
index d175c49..a6f1769 100644
--- a/bin/varnishd/varnishd.c
+++ b/bin/varnishd/varnishd.c
@@ -645,7 +645,7 @@ main(int argc, char * const *argv)
if (T_arg != NULL)
mgt_cli_telnet(T_arg);
- VSM_Alloc(0, VSM_CLASS_MARK, "", "");
+ AN(VSM_Alloc(0, VSM_CLASS_MARK, "", ""));
MGT_Run();
diff --git a/include/binary_heap.h b/include/binary_heap.h
index 8876b9c..869ebf9 100644
--- a/include/binary_heap.h
+++ b/include/binary_heap.h
@@ -63,7 +63,7 @@ void binheap_insert(struct binheap *, void *);
* Insert an item
*/
-void binheap_reorder(struct binheap *, unsigned idx);
+void binheap_reorder(const struct binheap *, unsigned idx);
/*
* Move an order after changing its key value.
*/
diff --git a/lib/libvarnish/binary_heap.c b/lib/libvarnish/binary_heap.c
index 74310c3..53ff738 100644
--- a/lib/libvarnish/binary_heap.c
+++ b/lib/libvarnish/binary_heap.c
@@ -379,7 +379,7 @@ binheap_delete(struct binheap *bh, unsigned idx)
*/
void
-binheap_reorder(struct binheap *bh, unsigned idx)
+binheap_reorder(const struct binheap *bh, unsigned idx)
{
assert(bh != NULL);
diff --git a/lib/libvmod_std/vmod.py b/lib/libvmod_std/vmod.py
index 9798e7c..32fb536 100755
--- a/lib/libvmod_std/vmod.py
+++ b/lib/libvmod_std/vmod.py
@@ -230,7 +230,7 @@ dumps(pstruct + "} Vmod_Func_" + modname + ";\n")
fc.write('\t;\n')
fc.write("\n");
-fc.write('const char *Vmod_Spec[] = {\n' + slist + '\t0\n};\n')
+fc.write('const char * const Vmod_Spec[] = {\n' + slist + '\t0\n};\n')
fc.write("\n")
diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index e032905..c6a51ea 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -36,14 +36,14 @@
#include "vcc_if.h"
-void
+void __match_proto__()
vmod_set_ip_tos(struct sess *sp, int tos)
{
TCP_Assert(setsockopt(sp->fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)));
}
-static const char *
+static const char * __match_proto__()
vmod_updown(struct sess *sp, int up, const char *s, va_list ap)
{
unsigned u;
@@ -79,7 +79,7 @@ vmod_updown(struct sess *sp, int up, const char *s, va_list ap)
}
}
-const char *
+const char * __match_proto__()
vmod_toupper(struct sess *sp, struct vmod_priv *priv, const char *s, ...)
{
const char *p;
@@ -98,7 +98,7 @@ vmod_toupper(struct sess *sp, struct vmod_priv *priv, const char *s, ...)
return (p);
}
-const char *
+const char * __match_proto__()
vmod_tolower(struct sess *sp, struct vmod_priv *priv, const char *s, ...)
{
const char *p;
@@ -135,7 +135,7 @@ vmod_random(struct sess *sp, double lo, double hi)
return (a);
}
-void
+void __match_proto__()
vmod_log(struct sess *sp, const char *fmt, ...)
{
char buf[8192], *p;
More information about the varnish-commit
mailing list