-sem(strchr, 1p, type(1), 2n == 0 ? (@p < 1p) : (@p < 1p || @p == 0 ))
-sem(vcc_new_source, custodial(1))
--ffc // No automatic custody
+// -ffc // No automatic custody
+
+-esym(534, vsb_printf) // Ignoring return value of function
+-esym(534, vsb_cat) // Ignoring return value of function
+-esym(534, vsb_bcat) // Ignoring return value of function
+-esym(534, vsb_vprintf) // Ignoring return value of function
+-esym(534, memset) // Ignoring return value of function
+-e788 // enum constant 'HND_Unclass' not used within defaulted switch
+-e716 // while(1) ...
+-e786 // String concatenation within initializer
+-e732 // Loss of sign (arg. no. 2) (int to unsigned int)
-e763 // Redundant declaration for symbol '...' previously declared
-e737 // Loss of sign in promotion from int to unsigned int
--e715 // Symbol 'arg' (line 43) not referenced
--e818 // Pointer parameter '...' could be declared as pointing to const
-
-e534 // Ignoring return value of function
--e767 // macro 'LIST_INIT' was defined differently
-
-e506 // Constant value boolean
--e527 // Unreachable code at token 'return'
--e732 // Loss of sign (arg. no. 2) (int to unsigned int)
-e774 // Boolean within 'if' always evaluates to False
-e713 // Loss of precision (assignment) (unsigned long long to long long)
-e574 // Signed-unsigned mix with relational
-
--e525 // Negative indentation from line 90
-e539 // Did not expect positive indentation
--e725 // Expected positive indentation from line 136
-e734 // Loss of precision (assignment) (31 bits to 8 bits)
-e747 // Significant prototype coercion (arg. no. 2) long
-e712 // Loss of precision (assignment) (long long to
-
-
--e785 // Too few initializers for aggregate
-
-// -e766 // Header file '../../include/libvarnish.h' not used in module
-
--e773 // Expression-like macro 'VCL_FARGS' not parenthesized
-
--e788 // enum constant 'HND_Unclass' not used within defaulted switch
-
--e716 // while(1) ...
--e641 // Converting enum 'cli_status_e' to int
-
--e786 // String concatenation within initializer
* $Id$
*/
-#include <assert.h>
#include <stdio.h>
#include "vsb.h"
#include "vcc_priv.h"
#include "vcc_compile.h"
+#include "libvarnish.h"
/*--------------------------------------------------------------------*/
#include <sys/types.h>
#include <sys/socket.h>
-#include <assert.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include "vcc_priv.h"
#include "vcc_compile.h"
-
+#include "libvarnish.h"
static const char *
CheckHostPort(const char *host, const char *port)
* and all the rest...
*/
-#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include "vcc_compile.h"
#include "libvcl.h"
+#include "libvarnish.h"
struct method method_tab[] = {
#define VCL_RET_MAC(l,U,b,n)
/*--------------------------------------------------------------------*/
int
-IsMethod(struct token *t)
+IsMethod(const struct token *t)
{
struct method *m;
*/
void
-Fh(struct tokenlist *tl, int indent, const char *fmt, ...)
+Fh(const struct tokenlist *tl, int indent, const char *fmt, ...)
{
va_list ap;
}
void
-Fb(struct tokenlist *tl, int indent, const char *fmt, ...)
+Fb(const struct tokenlist *tl, int indent, const char *fmt, ...)
{
va_list ap;
}
void
-Fc(struct tokenlist *tl, int indent, const char *fmt, ...)
+Fc(const struct tokenlist *tl, int indent, const char *fmt, ...)
{
va_list ap;
}
void
-Fi(struct tokenlist *tl, int indent, const char *fmt, ...)
+Fi(const struct tokenlist *tl, int indent, const char *fmt, ...)
{
va_list ap;
}
void
-Ff(struct tokenlist *tl, int indent, const char *fmt, ...)
+Ff(const struct tokenlist *tl, int indent, const char *fmt, ...)
{
va_list ap;
}
void
-EncToken(struct vsb *sb, struct token *t)
+EncToken(struct vsb *sb, const struct token *t)
{
assert(t->tok == CSTR);
/*--------------------------------------------------------------------*/
static struct var *
-HeaderVar(struct tokenlist *tl, struct token *t, struct var *vh)
+HeaderVar(struct tokenlist *tl, const struct token *t, const struct var *vh)
{
char *p;
struct var *v;
/*--------------------------------------------------------------------*/
struct var *
-FindVar(struct tokenlist *tl, struct token *t, struct var *vl)
+FindVar(struct tokenlist *tl, const struct token *t, struct var *vl)
{
struct var *v;
for (v = vl; v->name != NULL; v++) {
- if (v->fmt == HEADER && t->e - t->b <= v->len)
+ if (v->fmt == HEADER && (t->e - t->b) <= v->len)
continue;
if (v->fmt != HEADER && t->e - t->b != v->len)
continue;
*/
static void
-LocTable(struct tokenlist *tl)
+LocTable(const struct tokenlist *tl)
{
struct token *t;
unsigned lin, pos;
/*--------------------------------------------------------------------*/
static void
-EmitInitFunc(struct tokenlist *tl)
+EmitInitFunc(const struct tokenlist *tl)
{
Fc(tl, 0, "\nstatic void\nVGC_Init(void)\n{\n\n");
}
static void
-EmitFiniFunc(struct tokenlist *tl)
+EmitFiniFunc(const struct tokenlist *tl)
{
Fc(tl, 0, "\nstatic void\nVGC_Fini(void)\n{\n\n");
/*--------------------------------------------------------------------*/
static void
-EmitStruct(struct tokenlist *tl)
+EmitStruct(const struct tokenlist *tl)
{
struct source *sp;
*/
static char *
-vcc_CallCc(char *source, struct vsb *sb)
+vcc_CallCc(const char *source, struct vsb *sb)
{
FILE *fo, *fs;
char *of, *sf, buf[BUFSIZ];
/* vcc_compile.c */
extern struct method method_tab[];
-void Fh(struct tokenlist *tl, int indent, const char *fmt, ...);
-void Fc(struct tokenlist *tl, int indent, const char *fmt, ...);
-void Fb(struct tokenlist *tl, int indent, const char *fmt, ...);
-void Fi(struct tokenlist *tl, int indent, const char *fmt, ...);
-void Ff(struct tokenlist *tl, int indent, const char *fmt, ...);
-void EncToken(struct vsb *sb, struct token *t);
-struct var *FindVar(struct tokenlist *tl, struct token *t, struct var *vl);
-int IsMethod(struct token *t);
+void Fh(const struct tokenlist *tl, int indent, const char *fmt, ...);
+void Fc(const struct tokenlist *tl, int indent, const char *fmt, ...);
+void Fb(const struct tokenlist *tl, int indent, const char *fmt, ...);
+void Fi(const struct tokenlist *tl, int indent, const char *fmt, ...);
+void Ff(const struct tokenlist *tl, int indent, const char *fmt, ...);
+void EncToken(struct vsb *sb, const struct token *t);
+struct var *FindVar(struct tokenlist *tl, const struct token *t, struct var *vl);
+int IsMethod(const struct token *t);
void *TlAlloc(struct tokenlist *tl, unsigned len);
/* vcc_obj.c */
double vcc_DoubleVal(struct tokenlist *tl);
/* vcc_token.c */
-void vcc_ErrToken(struct tokenlist *tl, struct token *t);
-void vcc_ErrWhere(struct tokenlist *tl, struct token *t);
+void vcc_ErrToken(const struct tokenlist *tl, const struct token *t);
+void vcc_ErrWhere(struct tokenlist *tl, const struct token *t);
void vcc__Expect(struct tokenlist *tl, unsigned tok, int line);
-int vcc_Teq(struct token *t1, struct token *t2);
-int vcc_IdIs(struct token *t, const char *p);
+int vcc_Teq(const struct token *t1, const struct token *t2);
+int vcc_IdIs(const struct token *t, const char *p);
void vcc_Lexer(struct tokenlist *tl, struct source *sp);
void vcc_NextToken(struct tokenlist *tl);
void vcc__ErrInternal(struct tokenlist *tl, const char *func, unsigned line);
* $Id$
*/
-#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "vcc_priv.h"
#include "vcc_compile.h"
+#include "libvarnish.h"
#include "vrt.h"
/*--------------------------------------------------------------------*/
static void
-vcc_re(struct tokenlist *tl, const char *str, struct token *re)
+vcc_re(struct tokenlist *tl, const char *str, const struct token *re)
{
char buf[32];
/*--------------------------------------------------------------------*/
static void
-Cond_String(struct var *vp, struct tokenlist *tl)
+Cond_String(const struct var *vp, struct tokenlist *tl)
{
switch (tl->t->tok) {
}
static void
-Cond_Int(struct var *vp, struct tokenlist *tl)
+Cond_Int(const struct var *vp, struct tokenlist *tl)
{
Fb(tl, 1, "%s ", vp->rname);
}
static void
-Cond_Bool(struct var *vp, struct tokenlist *tl)
+Cond_Bool(const struct var *vp, const struct tokenlist *tl)
{
Fb(tl, 1, "%s\n", vp->rname);
}
static void
-Cond_Backend(struct var *vp, struct tokenlist *tl)
+Cond_Backend(const struct var *vp, const struct tokenlist *tl)
{
Fb(tl, 1, "%s\n", vp->rname);
/*--------------------------------------------------------------------*/
void
-vcc_ErrToken(struct tokenlist *tl, struct token *t)
+vcc_ErrToken(const struct tokenlist *tl, const struct token *t)
{
if (t->tok == EOI)
}
void
-vcc_ErrWhere(struct tokenlist *tl, struct token *t)
+vcc_ErrWhere(struct tokenlist *tl, const struct token *t)
{
unsigned lin, pos, x, y;
const char *p, *l, *f, *b, *e;
void
vcc_NextToken(struct tokenlist *tl)
{
+
tl->t = TAILQ_NEXT(tl->t, list);
if (tl->t == NULL) {
vsb_printf(tl->sb,
*/
int
-vcc_Teq(struct token *t1, struct token *t2)
+vcc_Teq(const struct token *t1, const struct token *t2)
{
if (t1->e - t1->b != t2->e - t2->b)
return (0);
*/
int
-vcc_IdIs(struct token *t, const char *p)
+vcc_IdIs(const struct token *t, const char *p)
{
const char *q;
* Decode %xx in a string
*/
-static int
+static int8_t
vcc_xdig(const char c)
{
static const char *xdigit =
* they are called.
*/
-#include <assert.h>
#include <stdio.h>
#include "vsb.h"
+#include "libvarnish.h"
#include "vcc_priv.h"
#include "vcc_compile.h"
}
u = p->returns & ~returns;
if (u) {
+/*lint -e525 */
#define VCL_RET_MAC(a, b, c, d) \
if (u & VCL_RET_##b) { \
vsb_printf(tl->sb, "Illegal return \"%s\"\n", #a); \
vcc_ErrWhere(tl, p->return_tok[d]); \
}
+/*lint -e525 */
#include "vcl_returns.h"
+/*lint +e525 */
#undef VCL_RET_MAC
vsb_printf(tl->sb, "\n...in function \"%.*s\"\n", PF(p->name));
vcc_ErrWhere(tl, p->name);
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 */
#include "vcl_returns.h"
+/*lint +e525 */
#undef VCL_RET_MAC
#undef VCL_RET_MAC_E
vsb_printf(tl->sb, "\n");