[PATCH] Add support for REAL [+-] REAL operations

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Feb 2 09:06:24 CET 2016


--------
In message <CAJV_h0bAm4dZs=+9QCznw9hifsnwLdKx68Ey83FRc7eDsou90Q at mail.gmail.com>
, Federico Schwindt writes:

>Someone on #varnish mentioned the need for this.
>
>Personally I can't think of any reason for not allowing it.
>
>Comments? OK?

OK.

Also allow multiplication/division, while you're at it:

  @@ -942,6 +942,7 @@ vcc_expr_mul(struct vcc *tl, struct expr **e, enum var_type fmt)
          case INT:       f2 = INT; break;
          case DURATION:  f2 = REAL; break;
          case BYTES:     f2 = REAL; break;
  +       case REAL:      f2 = REAL; break;
          default:
                  if (tl->t->tok != '*' && tl->t->tok != '/')
                          return;

(also add to the test-case).

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list