[6.0] b84afa939 A spot of FlexeLinting
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:07 UTC 2018
commit b84afa939a0532397926bccb7860b2b87c1ae964
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 ad06c57c6..bf5f782ce 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 6482305e1..73401698f 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 fccc8e35d..764710f35 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