/*--------------------------------------------------------------------*/
+/*lint -e{818} ap,hp could be const */
static char *
vrt_assemble_string(struct http *hp, const char *h, const char *p, va_list ap)
{
sp->director = be;
}
+/*lint -e{818} sp could be const */
struct director *
VRT_r_req_backend(struct sess *sp)
{
sp->grace = a;
}
+/*lint -e{818} sp could be const */
double
VRT_r_req_grace(struct sess *sp)
{
/*--------------------------------------------------------------------*/
+/*lint -e{818} sp could be const */
void
VRT_panic(struct sess *sp, const char *str, ...)
{
-efile(766, ../../config.h)
-emacro(413, offsetof) // likely null pointer
+-emacro(702, WEXITSTATUS) // signed shift right
+
// -header(../../config.h)
-emacro((826), VTAILQ_LAST) // Suspicious pointer-to-pointer conversion (area too small)
-emacro(506, VTAILQ_FOREACH_SAFE) // constant value boolean
+-esym(765, vcc_ProcAction) // could be made static
+-esym(759, vcc_ProcAction) // could be moved to module
+-esym(714, vcc_ProcAction) // not ref.
+
-esym(534, sprintf) // Ignoring return value of function
-esym(534, asprintf) // Ignoring return value of function
-esym(534, printf) // Ignoring return value of function
/*--------------------------------------------------------------------*/
+/*lint -e{818} priv could be const */
void
mcf_server_startstop(struct cli *cli, const char * const *av, void *priv)
{
va_end(ap);
}
+/*lint -e{818} cli could be const */
void
cli_quote(struct cli *cli, const char *s)
{
AN(ae2);
*ae2 = *ae;
- ae2->data[0] = fam;
+ ae2->data[0] = fam & 0xff;
ae2->mask += 8; /* family matching */
memcpy(ae2->data + 1, u, l);
struct sockaddr_in *sin4;
struct sockaddr_in6 *sin6;
unsigned char *u, i4, i6;
- int error, l;
+ int error;
memset(&hint, 0, sizeof hint);
hint.ai_family = PF_UNSPEC;
switch(res->ai_family) {
case PF_INET:
sin4 = (void*)res->ai_addr;
+ assert(sizeof(sin4->sin_family) == 1);
+ assert(sizeof(sin4->sin_addr) == 4);
u = (void*)&sin4->sin_addr;
- l = 4;
if (ae->t_mask == NULL)
ae->mask = 32;
i4++;
- vcc_acl_emit_entry(tl, ae, l, u, res->ai_family);
+ vcc_acl_emit_entry(tl, ae, 4, u, res->ai_family);
break;
case PF_INET6:
sin6 = (void*)res->ai_addr;
+ assert(sizeof(sin4->sin_family) == 1);
+ assert(sizeof(sin4->sin_addr) == 16);
u = (void*)&sin6->sin6_addr;
- l = 16;
if (ae->t_mask == NULL)
ae->mask = 128;
i6++;
- vcc_acl_emit_entry(tl, ae, l, u, res->ai_family);
+ vcc_acl_emit_entry(tl, ae, 16, u, res->ai_family);
break;
default:
vsb_printf(tl->sb,
void vcc__Expect(struct tokenlist *tl, unsigned tok, int line);
int vcc_Teq(const struct token *t1, const struct token *t2);
int vcc_IdIs(const struct token *t, const char *p);
-int vcc_isCid(const struct token *t);
void vcc_ExpectCid(struct tokenlist *tl);
void vcc_Lexer(struct tokenlist *tl, struct source *sp);
void vcc_NextToken(struct tokenlist *tl);
* Check that we have a C-identifier
*/
-int
+static int
vcc_isCid(const struct token *t)
{
const char *q;
vcc_ErrWhere(tl, tl->t);
return(1);
}
- u = vcc_xdig(p[1]) * 16 + vcc_xdig(p[2]);
+ u = (vcc_xdig(p[1]) * 16 + vcc_xdig(p[2])) & 0xff;
if (!isgraph(u)) {
vcc_AddToken(tl, CSTR, p, p + 3);
vsb_printf(tl->sb,
else
VTAILQ_INSERT_TAIL(&tl->tokens, t, list);
tl->t = t;
- if (0) {
- fprintf(stderr, "[%s %.*s] ",
- vcl_tnames[tok], PF(t));
- if (tok == EOI)
- fprintf(stderr, "\n");
- }
}
/*--------------------------------------------------------------------
vcc_ProcAction(struct proc *p, unsigned returns, struct token *t)
{
- p->returns |= (1 << returns);
+ p->returns |= (1U << returns);
/* Record the first instance of this return */
if (p->return_tok[returns] == NULL)
p->return_tok[returns] = t;
}
u = p->returns & ~returns;
if (u) {
-/*lint -e525 */
+/*lint -save -e525 -e539 */
#define VCL_RET_MAC(a, b, c, d) \
if (u & VCL_RET_##b) { \
vsb_printf(tl->sb, "Invalid return \"%s\"\n", #a); \
vcc_ErrWhere(tl, p->return_tok[d]); \
}
-/*lint -e525 */
#include "vcl_returns.h"
-/*lint +e525 */
#undef VCL_RET_MAC
+/*lint -restore */
vsb_printf(tl->sb, "\n...in function \"%.*s\"\n", PF(p->name));
vcc_ErrWhere(tl, p->name);
return (1);
if (m->returns & c) \
vsb_printf(tl->sb, " \"%s\"", #a);
#define VCL_RET_MAC_E(a, b, c, d) VCL_RET_MAC(a, b, c, d)
-/*lint -e525 */
+/*lint -save -e525 -e539 */
#include "vcl_returns.h"
/*lint +e525 */
#undef VCL_RET_MAC
#undef VCL_RET_MAC_E
+/*lint -restore */
vsb_printf(tl->sb, "\n");
return (1);
}