[master] c8b2279 A spot of FlexeLinting

Poul-Henning Kamp phk at FreeBSD.org
Wed Jun 6 06:32:29 UTC 2018


commit c8b2279b62a779928d6f487dbfa08a9eef13e90e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jun 6 06:31:14 2018 +0000

    A spot of FlexeLinting

diff --git a/bin/varnishtest/teken.c b/bin/varnishtest/teken.c
index ad06c57..bf5f782 100644
--- a/bin/varnishtest/teken.c
+++ b/bin/varnishtest/teken.c
@@ -457,6 +457,8 @@ teken_state_numbers(teken_t *t, teken_char_t c)
 	return (0);
 }
 
+//lint -save -emacro((835),k,K)		'|' has zero RHS
+
 #define	k	TC_BLACK
 #define	b	TC_BLUE
 #define	y	TC_BROWN
@@ -642,6 +644,8 @@ static const teken_color_t teken_256to16tab[] = {
 #undef	R
 #undef	W
 
+//lint -restore
+
 teken_color_t
 teken_256to8(teken_color_t c)
 {
diff --git a/bin/varnishtest/teken_wcwidth.h b/bin/varnishtest/teken_wcwidth.h
index 6482305..7340169 100644
--- a/bin/varnishtest/teken_wcwidth.h
+++ b/bin/varnishtest/teken_wcwidth.h
@@ -104,7 +104,7 @@ static int teken_wcwidth(teken_char_t ucs)
   /* if we arrive here, ucs is not a combining or C0/C1 control character */
 
   return 1 +
-    (ucs >= 0x1100 &&
+    (int)(ucs >= 0x1100 &&
      (ucs <= 0x115f ||                    /* Hangul Jamo init. consonants */
       ucs == 0x2329 || ucs == 0x232a ||
       (ucs >= 0x2e80 && ucs <= 0xa4cf &&
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index fccc8e3..764710f 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -77,6 +77,7 @@ enum h2_type {
 	TYPE_MAX
 };
 
+//lint -save -e849	Same enum value
 enum {
 	ACK = 0x1,
 	END_STREAM = 0x1,
@@ -84,6 +85,7 @@ enum {
 	END_HEADERS = 0x4,
 	PRIORITY = 0x20,
 };
+//lint -restore
 
 struct stream {
 	unsigned		magic;
@@ -103,7 +105,7 @@ struct stream {
 	VTAILQ_HEAD(, frame)   fq;
 
 	char			*body;
-	int			bodylen;
+	long			bodylen;
 	struct hpk_hdr		req[MAX_HDR];
 	struct hpk_hdr		resp[MAX_HDR];
 
@@ -868,7 +870,7 @@ do { \
 
 #define RETURN_BUFFED(val) \
 do { \
-	snprintf(buf, 20, "%d", val); \
+	snprintf(buf, 20, "%ld", (long)val); \
 	return (buf); \
 } while (0)
 


More information about the varnish-commit mailing list