[master] acb7c01 Flexelinting

Poul-Henning Kamp phk at FreeBSD.org
Mon Feb 19 10:56:08 UTC 2018


commit acb7c01214bce59de85e754d6f7d0c85cdea21bf
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 19 10:55:22 2018 +0000

    Flexelinting

diff --git a/lib/libvcc/flint.lnt b/lib/libvcc/flint.lnt
index 6b931e0..7d7d60d 100644
--- a/lib/libvcc/flint.lnt
+++ b/lib/libvcc/flint.lnt
@@ -1,43 +1,5 @@
--passes=3
 
-// Review all below this line
-
--printf_code( H, void *, unsigned)
--printf_code( ju, long long unsigned)
--printf_code( jx, long long unsigned)
-
-+libh ../../config.h
--header(../../config.h)
--sem(lbv_assert, r_no)
--sem(strchr, 1p, type(1), 2n == 0 ? (@p < 1p) : (@p < 1p || @p == 0 ))
 -sem(vcc_new_source, custodial(1))
 
--emacro((???),va_arg)	// the va_arg() macro can yield 415, 416, 661, 662
-			// 796 and 797 (out-of-bounds errors).
-
-
--emacro(413, offsetof)	// likely null pointer
-
-// -ffc    // No automatic custody
-
--esym(534, vsb_printf)	// Ignoring return value of function
--esym(534, vsb_cat)	// Ignoring return value of function
--esym(534, vsb_bcat)	// Ignoring return value of function
--esym(534, vsb_vprintf)	// Ignoring return value of function
--esym(534, memset)	// Ignoring return value of function
--e788			// enum constant 'HND_Unclass' not used within defaulted switch
--e732			// Loss of sign (arg. no. 2) (int to unsigned int)
-
--emacro(835, EXPR_VAR)	// // Info 835: A zero has been given as right argument to operator '<<'
-
--e763	// Redundant declaration for symbol '...' previously declared
-
-
--e534	// Ignoring return value of function
--e506	// Constant value boolean
--e774	// Boolean within 'if' always evaluates to False
--e713	// Loss of precision (assignment) (unsigned long long to long long)
--e539	// Did not expect positive indentation
--e734	// Loss of precision (assignment) (31 bits to 8 bits)
--e747	// Significant prototype coercion (arg. no. 2) long
--e712	// Loss of precision (assignment) (long long to
+-emacro(835, EXPR_VAR)	// Info 835: A zero has been given as right argument to operator '<<'
+-esym(755, VCL_40)	// Not used (right now)
diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c
index d3536ab..eb6304b 100644
--- a/lib/libvcc/vcc_acl.c
+++ b/lib/libvcc/vcc_acl.c
@@ -391,9 +391,9 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon)
 			depth--;
 		}
 
-		m = ae->mask;
+		m = (int)ae->mask;
+		assert(m >= l*8);
 		m -= l * 8;
-		assert(m >= 0);
 
 		/* Do whole byte compares */
 		for (i = l; m >= 8; m -= 8, i++) {
@@ -416,7 +416,7 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon)
 			depth = i;
 		}
 
-		i = (ae->mask + 7) / 8;
+		i = ((int)ae->mask + 7) / 8;
 
 		if (!anon) {
 			Fh(tl, 0, "\t%*sVRT_acl_log(ctx, \"%sMATCH %s \" ",
diff --git a/lib/libvcc/vcc_parse.c b/lib/libvcc/vcc_parse.c
index bccd27e..95b459f 100644
--- a/lib/libvcc/vcc_parse.c
+++ b/lib/libvcc/vcc_parse.c
@@ -430,5 +430,5 @@ vcc_Parse_Init(struct vcc *tl)
 	struct toplev *tp;
 
 	for (tp = toplev; tp->name != NULL; tp++)
-		VCC_MkSym(tl, tp->name, SYM_NONE);
+		AN(VCC_MkSym(tl, tp->name, SYM_NONE));
 }


More information about the varnish-commit mailing list