From 7a9b024b96e3f0235b1cce54bda6ad4b2a811c72 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 24 Jun 2007 10:03:09 +0000 Subject: [PATCH] Use C-unsigned for VCL-BOOL variables git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1542 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vrt.c | 4 ++-- varnish-cache/include/vrt_obj.h | 8 ++++---- varnish-cache/lib/libvcl/syntax.txt | 6 ++++++ varnish-cache/lib/libvcl/vcc_gen_obj.tcl | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index 4109d4c0..d54a5233 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -217,8 +217,8 @@ VRT_r_obj_##onm(struct sess *sp) \ return (sp->obj->field); \ } -VOBJ(double, valid, valid) -VOBJ(double, cacheable, cacheable) +VOBJ(unsigned, valid, valid) +VOBJ(unsigned, cacheable, cacheable) /*--------------------------------------------------------------------*/ diff --git a/varnish-cache/include/vrt_obj.h b/varnish-cache/include/vrt_obj.h index 07fabade..2208da7a 100644 --- a/varnish-cache/include/vrt_obj.h +++ b/varnish-cache/include/vrt_obj.h @@ -28,10 +28,10 @@ struct backend * VRT_r_req_backend(struct sess *); void VRT_l_req_backend(struct sess *, struct backend *); const char * VRT_r_req_hash(struct sess *); void VRT_l_req_hash(struct sess *, const char *); -double VRT_r_obj_valid(struct sess *); -void VRT_l_obj_valid(struct sess *, double); -double VRT_r_obj_cacheable(struct sess *); -void VRT_l_obj_cacheable(struct sess *, double); +unsigned VRT_r_obj_valid(struct sess *); +void VRT_l_obj_valid(struct sess *, unsigned); +unsigned VRT_r_obj_cacheable(struct sess *); +void VRT_l_obj_cacheable(struct sess *, unsigned); double VRT_r_obj_ttl(struct sess *); void VRT_l_obj_ttl(struct sess *, double); const char * VRT_r_req_http_(struct sess *); diff --git a/varnish-cache/lib/libvcl/syntax.txt b/varnish-cache/lib/libvcl/syntax.txt index 489d8c23..0d1502f4 100644 --- a/varnish-cache/lib/libvcl/syntax.txt +++ b/varnish-cache/lib/libvcl/syntax.txt @@ -154,6 +154,8 @@ assignment: var_float '-=' double var_float '=' double var_backend '=' ident + var_string '=' stringval + var_string '+=' stringval assign_int: '+=' cnum @@ -184,6 +186,10 @@ rule0: cstr '/' cnum '!' cstr +stringval: + cstr + var_string + cstr: (string constant) cnum: (numeric constant) diff --git a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl index 4674f132..b188fbbe 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl @@ -57,7 +57,7 @@ set spobj { set tt(IP) "struct sockaddr *" set tt(STRING) "const char *" -set tt(BOOL) "double" +set tt(BOOL) "unsigned" set tt(BACKEND) "struct backend *" set tt(TIME) "double" set tt(HEADER) "const char *" -- 2.39.5