r4916 - in trunk/varnish-cache/bin: . varnishlog
phk at varnish-cache.org
phk at varnish-cache.org
Sun Jun 6 15:54:02 CEST 2010
Author: phk
Date: 2010-06-06 15:54:01 +0200 (Sun, 06 Jun 2010)
New Revision: 4916
Added:
trunk/varnish-cache/bin/varnishlog/flint.lnt
trunk/varnish-cache/bin/varnishlog/flint.sh
Modified:
trunk/varnish-cache/bin/flint.lnt
trunk/varnish-cache/bin/varnishlog/varnishlog.c
Log:
FlexeLint cleanup
Modified: trunk/varnish-cache/bin/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/flint.lnt 2010-06-06 13:39:58 UTC (rev 4915)
+++ trunk/varnish-cache/bin/flint.lnt 2010-06-06 13:54:01 UTC (rev 4916)
@@ -20,6 +20,8 @@
-emacro(506, assert) // constant value boolean
-emacro(827, assert) // loop not reachable
-emacro(774, assert) // booelan always true
+-emacro(731, assert) // booelan arg to eq/non-eq
+-emacro(731, xxxassert) // arg to eq/non-eq
-emacro(527, WRONG) // unreachable code
///////////////////////////////////////////////////////////////////////
Added: trunk/varnish-cache/bin/varnishlog/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/varnishlog/flint.lnt (rev 0)
+++ trunk/varnish-cache/bin/varnishlog/flint.lnt 2010-06-06 13:54:01 UTC (rev 4916)
@@ -0,0 +1,18 @@
+
+-e712 // 14 Info 712 Loss of precision (___) (___ to ___)
+-e747 // 16 Info 747 Significant prototype coercion (___) ___ to ___
+
+-e763 // Redundant declaration for symbol '...' previously declared
+-e716 // while(1) ...
+
+-e457 // unprotected write access
+-e459 // unprotected access
+-e458 // unprotected access
+
+-e732 // Loss of sign (arg. no. 2) (int to unsigned
+-e737 // [45] Loss of sign in promotion from int to unsigned
+-e713 // Loss of precision (assignment) (unsigned long long to long long)
+-e574 // Signed-unsigned mix with relational
+
+-e788 // enum constant '___' not used within defaulted switch
+
Added: trunk/varnish-cache/bin/varnishlog/flint.sh
===================================================================
--- trunk/varnish-cache/bin/varnishlog/flint.sh (rev 0)
+++ trunk/varnish-cache/bin/varnishlog/flint.sh 2010-06-06 13:54:01 UTC (rev 4916)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+flexelint \
+ -I/usr/include \
+ -I. \
+ -I../../include \
+ -I../.. \
+ ../flint.lnt \
+ flint.lnt \
+ *.c \
+ ../../lib/libvarnishapi/*.c
Property changes on: trunk/varnish-cache/bin/varnishlog/flint.sh
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishlog/varnishlog.c 2010-06-06 13:39:58 UTC (rev 4915)
+++ trunk/varnish-cache/bin/varnishlog/varnishlog.c 2010-06-06 13:54:01 UTC (rev 4916)
@@ -124,7 +124,7 @@
if (!(spec & (VSL_S_CLIENT|VSL_S_BACKEND))) {
if (!b_flag && !c_flag)
- VSL_H_Print(stdout, tag, fd, len, spec, ptr);
+ (void)VSL_H_Print(stdout, tag, fd, len, spec, ptr);
return (0);
}
if (ob[fd] == NULL) {
@@ -195,7 +195,7 @@
}
static void
-do_order(struct VSL_data *vd, int argc, char **argv)
+do_order(struct VSL_data *vd, int argc, char * const *argv)
{
int i;
const char *error;
@@ -227,7 +227,7 @@
i = VSL_Dispatch(vd, h_order, NULL);
if (i == 0) {
clean_order();
- fflush(stdout);
+ AZ(fflush(stdout));
}
else if (i < 0)
break;
@@ -274,7 +274,8 @@
uint32_t *p;
fd = open_log(w_arg, a_flag);
- signal(SIGHUP, sighup);
+ XXXAN(fd >= 0);
+ (void)signal(SIGHUP, sighup);
while (1) {
i = VSL_NextLog(vd, &p);
if (i < 0)
@@ -288,8 +289,9 @@
}
}
if (reopen) {
- close(fd);
+ AZ(close(fd));
fd = open_log(w_arg, a_flag);
+ XXXAN(fd >= 0);
reopen = 0;
}
}
@@ -307,7 +309,7 @@
}
int
-main(int argc, char **argv)
+main(int argc, char * const *argv)
{
int c;
int a_flag = 0, D_flag = 0, o_flag = 0, u_flag = 0;
@@ -325,11 +327,11 @@
break;
case 'b':
b_flag = 1;
- VSL_Log_Arg(vd, c, optarg);
+ AN(VSL_Log_Arg(vd, c, optarg));
break;
case 'c':
c_flag = 1;
- VSL_Log_Arg(vd, c, optarg);
+ AN(VSL_Log_Arg(vd, c, optarg));
break;
case 'D':
D_flag = 1;
More information about the varnish-commit
mailing list