r4236 - in trunk/varnish-cache: bin/varnishd include lib/libvarnish lib/libvcl
phk at projects.linpro.no
phk at projects.linpro.no
Mon Sep 14 10:47:04 CEST 2009
Author: phk
Date: 2009-09-14 10:47:03 +0200 (Mon, 14 Sep 2009)
New Revision: 4236
Modified:
trunk/varnish-cache/bin/varnishd/cache_vcl.c
trunk/varnish-cache/bin/varnishd/cache_vrt.c
trunk/varnish-cache/bin/varnishd/flint.lnt
trunk/varnish-cache/include/cli_priv.h
trunk/varnish-cache/include/shmlog_tags.h
trunk/varnish-cache/include/varnishapi.h
trunk/varnish-cache/include/vcl.h
trunk/varnish-cache/include/vcl_returns.h
trunk/varnish-cache/include/vct.h
trunk/varnish-cache/include/vrt.h
trunk/varnish-cache/include/vsb.h
trunk/varnish-cache/lib/libvarnish/cli_common.c
trunk/varnish-cache/lib/libvarnish/vct.c
trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
trunk/varnish-cache/lib/libvcl/vcc_token_defs.h
Log:
Another FlexeLint washing of the source.
Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vcl.c 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/bin/varnishd/cache_vcl.c 2009-09-14 08:47:03 UTC (rev 4236)
@@ -315,11 +315,11 @@
sp->handling = 0; \
sp->cur_method = VCL_MET_ ## upper; \
WSP(sp, SLT_VCL_call, "%s", #func); \
- sp->vcl->func##_func(sp); \
+ (void)sp->vcl->func##_func(sp); \
WSP(sp, SLT_VCL_return, "%s", VCC_Return_Name(sp->handling)); \
sp->cur_method = 0; \
- assert((1 << sp->handling) & bitmap); \
- assert(!((1 << sp->handling) & ~bitmap)); \
+ assert((1U << sp->handling) & bitmap); \
+ assert(!((1U << sp->handling) & ~bitmap)); \
}
#include "vcl_returns.h"
Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2009-09-14 08:47:03 UTC (rev 4236)
@@ -57,7 +57,7 @@
/*XXX: sort of a hack, improve the Tcl code in the compiler to avoid */
/*lint -save -esym(818,sp) */
-void *vrt_magic_string_end = &vrt_magic_string_end;
+const void * const vrt_magic_string_end = &vrt_magic_string_end;
static char vrt_hostname[255] = "";
/*--------------------------------------------------------------------*/
Modified: trunk/varnish-cache/bin/varnishd/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/varnishd/flint.lnt 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/bin/varnishd/flint.lnt 2009-09-14 08:47:03 UTC (rev 4236)
@@ -1,13 +1,68 @@
-d__flexelint_v9__=1
+-libdir(../../include)
+-libdir(../../lib/)
+
+// -efile(765, ../../lib/)
+// -efile(765, ../../include/)
+// -efile(759, ../../lib/)
+// -efile(759, ../../include/)
+
+-esym(755, vct_*)
+-esym(759, vev_*)
+-esym(765, vev_*)
+-esym(714, vev_*)
+-esym(759, vsb_*)
+-esym(765, vsb_*)
+-esym(714, vsb_*)
+-esym(759, vpf_*)
+-esym(765, vpf_*)
+-esym(714, vpf_*)
+-esym(759, H_*)
+-esym(765, H_*)
+-esym(757, VSL_*)
+-esym(765, VLU_*)
+-esym(759, VLU_*)
+-esym(714, VLU_*)
+-esym(765, VSS_*)
+-esym(759, VSS_*)
+-esym(755, VSL_*)
+-esym(765, VSL_*)
+-esym(759, VSL_*)
+-esym(765, CLI_*)
+-esym(759, CLI_*)
+-esym(755, CLI_*)
+
+-esym(755, VLIST_*)
+-esym(755, VSLIST_*)
+-esym(755, VSTAILQ_*)
+-esym(755, VTAILQ_*)
+
+// Stuff used outside varnishd
+-esym(759, BackSlash)
+-esym(765, BackSlash)
+-esym(759, BackSlashDecode)
+-esym(765, BackSlashDecode)
+-esym(714, VSS_open)
+-esym(757, base64*)
+
+
+// Stuff used by compiled VCL
+-esym(757, VRT_*)
+-esym(759, VRT_*)
+-esym(765, VRT_*)
+-esym(714, VRT_*)
+-esym(755, VRT_*)
+-esym(765, vrt_magic_string_end)
+-esym(759, vrt_magic_string_end)
+-esym(768, vrt_ref::*)
+-esym(768, VCL_conf::*)
+
// FLINT Bug20090910_838
-efunc(838, VRT_purge)
-efunc(838, VRT_purge_string)
-// FLINT Bug Bug20090908_766
--efile(766, cache_vcl.c)
-
//-sem (pthread_mutex_lock, thread_lock)
-sem (pthread_mutex_trylock, thread_lock)
-sem (VBE_DropRefLocked, thread_unlock)
@@ -25,8 +80,8 @@
//////////////
-efunc(1791, pdiff) // return last on line
//////////////
--efile(451, "sys/*.h") // No include guard
--efile(451, "machine/*.h") // No include guard
+-efile(451, "sys/\*.h") // No include guard
+-efile(451, "machine/\*.h") // No include guard
-efile(451, "vcl_returns.h") // No include guard
-efile(451, "cache_backend_poll.h") // No include guard
-efile(451, "steps.h") // No include guard
Modified: trunk/varnish-cache/include/cli_priv.h
===================================================================
--- trunk/varnish-cache/include/cli_priv.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/cli_priv.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -55,7 +55,6 @@
/* The implementation must provide these functions */
void cli_out(struct cli *cli, const char *fmt, ...);
void cli_quote(struct cli *cli, const char *str);
-void cli_param(struct cli *cli);
void cli_result(struct cli *cli, unsigned r);
/* From libvarnish/cli.c */
Modified: trunk/varnish-cache/include/shmlog_tags.h
===================================================================
--- trunk/varnish-cache/include/shmlog_tags.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/shmlog_tags.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -49,9 +49,7 @@
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
-SLTM(HttpError)
SLTM(HttpGarbage)
-SLTM(ClientAddr)
SLTM(Backend)
SLTM(Length)
@@ -86,17 +84,13 @@
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(VCL_error)
-SLTM(VCL_info)
SLTM(ReqStart)
SLTM(Hit)
SLTM(HitPass)
SLTM(ExpBan)
-SLTM(ExpPick)
SLTM(ExpKill)
SLTM(WorkThread)
-SLTM(Terminate)
-SLTM(ESItrace)
SLTM(ESI_xmlerror)
SLTM(Hash)
Modified: trunk/varnish-cache/include/varnishapi.h
===================================================================
--- trunk/varnish-cache/include/varnishapi.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/varnishapi.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -34,8 +34,6 @@
#include "shmlog.h"
-#define V_DEAD __attribute__ ((noreturn))
-
/* base64.c */
void base64_init(void);
int base64_decode(char *d, unsigned dlen, const char *s);
Modified: trunk/varnish-cache/include/vcl.h
===================================================================
--- trunk/varnish-cache/include/vcl.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/vcl.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -14,15 +14,15 @@
typedef int vcl_func_f(struct sess *sp);
/* VCL Methods */
-#define VCL_MET_RECV (1 << 0)
-#define VCL_MET_PIPE (1 << 1)
-#define VCL_MET_PASS (1 << 2)
-#define VCL_MET_HASH (1 << 3)
-#define VCL_MET_MISS (1 << 4)
-#define VCL_MET_HIT (1 << 5)
-#define VCL_MET_FETCH (1 << 6)
-#define VCL_MET_DELIVER (1 << 7)
-#define VCL_MET_ERROR (1 << 8)
+#define VCL_MET_RECV (1U << 0)
+#define VCL_MET_PIPE (1U << 1)
+#define VCL_MET_PASS (1U << 2)
+#define VCL_MET_HASH (1U << 3)
+#define VCL_MET_MISS (1U << 4)
+#define VCL_MET_HIT (1U << 5)
+#define VCL_MET_FETCH (1U << 6)
+#define VCL_MET_DELIVER (1U << 7)
+#define VCL_MET_ERROR (1U << 8)
#define VCL_MET_MAX 9
Modified: trunk/varnish-cache/include/vcl_returns.h
===================================================================
--- trunk/varnish-cache/include/vcl_returns.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/vcl_returns.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -19,47 +19,47 @@
#ifdef VCL_MET_MAC
VCL_MET_MAC(recv,RECV,
- ((1 << VCL_RET_ERROR)
- | (1 << VCL_RET_PASS)
- | (1 << VCL_RET_PIPE)
- | (1 << VCL_RET_LOOKUP)
+ ((1U << VCL_RET_ERROR)
+ | (1U << VCL_RET_PASS)
+ | (1U << VCL_RET_PIPE)
+ | (1U << VCL_RET_LOOKUP)
))
VCL_MET_MAC(pipe,PIPE,
- ((1 << VCL_RET_ERROR)
- | (1 << VCL_RET_PIPE)
+ ((1U << VCL_RET_ERROR)
+ | (1U << VCL_RET_PIPE)
))
VCL_MET_MAC(pass,PASS,
- ((1 << VCL_RET_ERROR)
- | (1 << VCL_RET_RESTART)
- | (1 << VCL_RET_PASS)
+ ((1U << VCL_RET_ERROR)
+ | (1U << VCL_RET_RESTART)
+ | (1U << VCL_RET_PASS)
))
VCL_MET_MAC(hash,HASH,
- ((1 << VCL_RET_HASH)
+ ((1U << VCL_RET_HASH)
))
VCL_MET_MAC(miss,MISS,
- ((1 << VCL_RET_ERROR)
- | (1 << VCL_RET_RESTART)
- | (1 << VCL_RET_PASS)
- | (1 << VCL_RET_FETCH)
+ ((1U << VCL_RET_ERROR)
+ | (1U << VCL_RET_RESTART)
+ | (1U << VCL_RET_PASS)
+ | (1U << VCL_RET_FETCH)
))
VCL_MET_MAC(hit,HIT,
- ((1 << VCL_RET_ERROR)
- | (1 << VCL_RET_RESTART)
- | (1 << VCL_RET_PASS)
- | (1 << VCL_RET_DELIVER)
+ ((1U << VCL_RET_ERROR)
+ | (1U << VCL_RET_RESTART)
+ | (1U << VCL_RET_PASS)
+ | (1U << VCL_RET_DELIVER)
))
VCL_MET_MAC(fetch,FETCH,
- ((1 << VCL_RET_ERROR)
- | (1 << VCL_RET_RESTART)
- | (1 << VCL_RET_PASS)
- | (1 << VCL_RET_DELIVER)
+ ((1U << VCL_RET_ERROR)
+ | (1U << VCL_RET_RESTART)
+ | (1U << VCL_RET_PASS)
+ | (1U << VCL_RET_DELIVER)
))
VCL_MET_MAC(deliver,DELIVER,
- ((1 << VCL_RET_RESTART)
- | (1 << VCL_RET_DELIVER)
+ ((1U << VCL_RET_RESTART)
+ | (1U << VCL_RET_DELIVER)
))
VCL_MET_MAC(error,ERROR,
- ((1 << VCL_RET_RESTART)
- | (1 << VCL_RET_DELIVER)
+ ((1U << VCL_RET_RESTART)
+ | (1U << VCL_RET_DELIVER)
))
#endif
Modified: trunk/varnish-cache/include/vct.h
===================================================================
--- trunk/varnish-cache/include/vct.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/vct.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -40,7 +40,7 @@
#define VCT_DIGIT (1<<5)
#define VCT_HEX (1<<6)
-extern unsigned char vct_typtab[256];
+extern const unsigned char vct_typtab[256];
static inline int
vct_is(unsigned char x, unsigned char y)
Modified: trunk/varnish-cache/include/vrt.h
===================================================================
--- trunk/varnish-cache/include/vrt.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/vrt.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -45,7 +45,7 @@
* A backend probe specification
*/
-extern void *vrt_magic_string_end;
+extern const void * const vrt_magic_string_end;
struct vrt_backend_probe {
const char *url;
Modified: trunk/varnish-cache/include/vsb.h
===================================================================
--- trunk/varnish-cache/include/vsb.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/include/vsb.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -36,7 +36,6 @@
struct vsb {
unsigned s_magic;
char *s_buf; /* storage buffer */
- void *s_unused; /* binary compatibility. */
size_t s_size; /* size of storage buffer */
size_t s_len; /* current length of string */
#define VSB_FIXEDLEN 0x00000000 /* fixed length buffer (default) */
Modified: trunk/varnish-cache/lib/libvarnish/cli_common.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/cli_common.c 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/lib/libvarnish/cli_common.c 2009-09-14 08:47:03 UTC (rev 4236)
@@ -85,15 +85,6 @@
printf("CLI result = %u\n", res);
}
-void
-cli_param(struct cli *cli)
-{
-
- cli_result(cli, CLIS_PARAM);
- cli_out(cli,
- "Parameter error, use \"help [command]\" for more info.\n");
-}
-
int
cli_writeres(int fd, const struct cli *cli)
{
Modified: trunk/varnish-cache/lib/libvarnish/vct.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/vct.c 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/lib/libvarnish/vct.c 2009-09-14 08:47:03 UTC (rev 4236)
@@ -40,7 +40,7 @@
#define VCT_UPALPHA VCT_ALPHA
#define VCT_LOALPHA VCT_ALPHA
-unsigned char vct_typtab[256] = {
+unsigned const char vct_typtab[256] = {
[0x00] = VCT_CTL,
[0x01] = VCT_CTL,
[0x02] = VCT_CTL,
Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2009-09-14 08:47:03 UTC (rev 4236)
@@ -166,15 +166,15 @@
vsb_cat(sb, "struct cli;\n\ntypedef void vcl_init_f(struct cli *);\n");
vsb_cat(sb, "typedef void vcl_fini_f(struct cli *);\n");
vsb_cat(sb, "typedef int vcl_func_f(struct sess *sp);\n");
- vsb_cat(sb, "\n/* VCL Methods */\n#define VCL_MET_RECV\t\t(1 << 0)\n");
- vsb_cat(sb, "#define VCL_MET_PIPE\t\t(1 << 1)\n");
- vsb_cat(sb, "#define VCL_MET_PASS\t\t(1 << 2)\n");
- vsb_cat(sb, "#define VCL_MET_HASH\t\t(1 << 3)\n");
- vsb_cat(sb, "#define VCL_MET_MISS\t\t(1 << 4)\n");
- vsb_cat(sb, "#define VCL_MET_HIT\t\t(1 << 5)\n");
- vsb_cat(sb, "#define VCL_MET_FETCH\t\t(1 << 6)\n");
- vsb_cat(sb, "#define VCL_MET_DELIVER\t\t(1 << 7)\n");
- vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1 << 8)\n");
+ vsb_cat(sb, "\n/* VCL Methods */\n#define VCL_MET_RECV\t\t(1U << 0)");
+ vsb_cat(sb, "\n#define VCL_MET_PIPE\t\t(1U << 1)\n");
+ vsb_cat(sb, "#define VCL_MET_PASS\t\t(1U << 2)\n");
+ vsb_cat(sb, "#define VCL_MET_HASH\t\t(1U << 3)\n");
+ vsb_cat(sb, "#define VCL_MET_MISS\t\t(1U << 4)\n");
+ vsb_cat(sb, "#define VCL_MET_HIT\t\t(1U << 5)\n");
+ vsb_cat(sb, "#define VCL_MET_FETCH\t\t(1U << 6)\n");
+ vsb_cat(sb, "#define VCL_MET_DELIVER\t\t(1U << 7)\n");
+ vsb_cat(sb, "#define VCL_MET_ERROR\t\t(1U << 8)\n");
vsb_cat(sb, "\n#define VCL_MET_MAX\t\t9\n\n/* VCL Returns */\n");
vsb_cat(sb, "#define VCL_RET_DELIVER\t\t0\n#define VCL_RET_ERROR\t\t");
vsb_cat(sb, "1\n#define VCL_RET_FETCH\t\t2\n");
@@ -228,15 +228,15 @@
vsb_cat(sb, " * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWI");
vsb_cat(sb, "SE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFT");
vsb_cat(sb, "WARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n");
- vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id: vrt.h 4185 2009-08-17 11:");
- vsb_cat(sb, "53:01Z phk $\n *\n * Runtime support for compiled VCL ");
+ vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id: vrt.h 4235 2009-09-11 13:");
+ vsb_cat(sb, "06:15Z phk $\n *\n * Runtime support for compiled VCL ");
vsb_cat(sb, "programs.\n *\n * XXX: When this file is changed, lib/");
vsb_cat(sb, "libvcl/vcc_gen_fixed_token.tcl\n");
vsb_cat(sb, " * XXX: *MUST* be rerun.\n */\n");
vsb_cat(sb, "\nstruct sess;\nstruct vsb;\nstruct cli;\n");
vsb_cat(sb, "struct director;\nstruct VCL_conf;\n");
vsb_cat(sb, "struct sockaddr;\n\n/*\n * A backend probe specificati");
- vsb_cat(sb, "on\n */\n\nextern void *vrt_magic_string_end;\n");
+ vsb_cat(sb, "on\n */\n\nextern const void *vrt_magic_string_end;\n");
vsb_cat(sb, "\nstruct vrt_backend_probe {\n\tconst char\t*url;\n");
vsb_cat(sb, "\tconst char\t*request;\n\tdouble\t\ttimeout;\n");
vsb_cat(sb, "\tdouble\t\tinterval;\n\tunsigned\twindow;\n");
Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2009-09-14 08:47:03 UTC (rev 4236)
@@ -554,7 +554,7 @@
} else {
set sp ""
}
- puts $fo "#define VCL_MET_[string toupper [lindex $m 0]]\t${sp}(1 << $u)"
+ puts $fo "#define VCL_MET_[string toupper [lindex $m 0]]\t${sp}(1U << $u)"
incr u
}
@@ -620,9 +620,9 @@
puts -nonewline $for ",[string toupper [lindex $m 0]]"
set l [lindex $m 1]
puts $for ","
- puts $for " ((1 << VCL_RET_[string toupper [lindex $l 0]])"
+ puts $for " ((1U << VCL_RET_[string toupper [lindex $l 0]])"
foreach r [lrange $l 1 end] {
- puts $for " | (1 << VCL_RET_[string toupper $r])"
+ puts $for " | (1U << VCL_RET_[string toupper $r])"
}
puts $for "))"
incr u
@@ -647,9 +647,7 @@
puts $fo "#include \"vsb.h\""
set tn 128
-puts $foh "#define LOW_TOKEN $tn"
-
proc add_token {tok str alpha} {
global tokens tn fixed foh
Modified: trunk/varnish-cache/lib/libvcl/vcc_token_defs.h
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2009-09-11 13:06:15 UTC (rev 4235)
+++ trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2009-09-14 08:47:03 UTC (rev 4236)
@@ -6,7 +6,6 @@
* Edit and run vcc_gen_fixed_token.tcl instead
*/
-#define LOW_TOKEN 128
#define T_INCLUDE 128
#define T_IF 129
#define T_ELSE 130
More information about the varnish-commit
mailing list