Mailing List Archive

[master] cccb8c1d4 Flexelint d5bbb1a92322232591f48cc491dc7d266cdcfa11
commit cccb8c1d44daff940e89649be5f69d7b8797ad85
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Wed Jan 20 16:03:45 2021 +0100

Flexelint d5bbb1a92322232591f48cc491dc7d266cdcfa11

We do not need to call trunc() to truncate a double into an integert.

Mark the intention for flexelint with a cast.

diff --git a/lib/libvarnishapi/vsl_query.c b/lib/libvarnishapi/vsl_query.c
index b214a38da..d6a30d0bb 100644
--- a/lib/libvarnishapi/vsl_query.c
+++ b/lib/libvarnishapi/vsl_query.c
@@ -217,7 +217,7 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
if (q != NULL)
t = (q > p) ? q - 1 : q;
p = TRUST_ME(t);
- lhs_int = trunc(lhs_float);
+ lhs_int = (long long)lhs_float;
}
if (*p != '\0' && !isspace(*p))
return (0); /* Can't parse - no match */
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit