Commit 60971f17 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

silence a couple of Flexelint complaints.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3548 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 3abe6e1d
......@@ -216,8 +216,8 @@ void
TCP_set_read_timeout(int s, double seconds)
{
struct timeval timeout;
timeout.tv_sec = floor(seconds);
timeout.tv_usec = 1e6 * (seconds - timeout.tv_sec);
timeout.tv_sec = (int)floor(seconds);
timeout.tv_usec = (int)(1e6 * (seconds - timeout.tv_sec));
#ifdef SO_RCVTIMEO_WORKS
AZ(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout));
#endif
......
......@@ -155,7 +155,7 @@ VSS_resolve(const char *addr, const char *port, struct vss_addr ***vap)
XXXAN(va);
*vap = va;
for (res = res0, i = 0; res != NULL; res = res->ai_next, ++i) {
va[i] = calloc(1, sizeof(*va[i]));
va[i] = calloc(1, sizeof(**va));
XXXAN(va[i]);
va[i]->va_family = res->ai_family;
va[i]->va_socktype = res->ai_socktype;
......
......@@ -321,20 +321,20 @@ vcc_acl_entry(struct tokenlist *tl)
* Emit a function to match the ACL we have collected
*/
/*
* XXX: this is semi-silly. We try really hard to not depend in the
* XXX: systems include files while compiling VCL, but we need to know
* XXX: the size of the sa_familiy member.
* XXX: FlexeLint complains about these antics, so isolate it in a
* XXX: separate function.
*/
/*lint -save -e506 -e774 -e550 */
static void
vcc_acl_emit(const struct tokenlist *tl, const char *acln, int anon)
c_is_a_silly_language(const struct tokenlist *tl)
{
struct acl_e *ae;
int depth, l, m, i;
unsigned at[VRT_ACL_MAXADDR + 1];
const char *oc;
struct sockaddr sa;
Fh(tl, 0, "\nstatic int\n");
Fh(tl, 0, "match_acl_%s_%s(const struct sess *sp, const void *p)\n",
anon ? "anon" : "named", acln);
Fh(tl, 0, "{\n");
Fh(tl, 0, "\tconst unsigned char *a;\n");
assert(sizeof (unsigned char) == 1);
assert(sizeof (unsigned short) == 2);
assert(sizeof (unsigned int) == 4);
......@@ -346,6 +346,23 @@ vcc_acl_emit(const struct tokenlist *tl, const char *acln, int anon)
Fh(tl, 0, "\tunsigned int fam;\n");
else
assert(0 == __LINE__);
}
/*lint -restore */
static void
vcc_acl_emit(const struct tokenlist *tl, const char *acln, int anon)
{
struct acl_e *ae;
int depth, l, m, i;
unsigned at[VRT_ACL_MAXADDR + 1];
const char *oc;
Fh(tl, 0, "\nstatic int\n");
Fh(tl, 0, "match_acl_%s_%s(const struct sess *sp, const void *p)\n",
anon ? "anon" : "named", acln);
Fh(tl, 0, "{\n");
Fh(tl, 0, "\tconst unsigned char *a;\n");
c_is_a_silly_language(tl);
Fh(tl, 0, "\n");
Fh(tl, 0, "\ta = p;\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment