[master] 6cb0c66 Add parenthesis to clearify code

Martin Blix Grydeland martin at varnish-software.com
Thu Mar 23 13:55:06 CET 2017


commit 6cb0c6664bb5ef53b6e2cd6fdc5e4b56567eca44
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Wed Mar 22 14:04:37 2017 +0100

    Add parenthesis to clearify code

diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c
index 9c1e412..9f6672c 100644
--- a/bin/varnishd/mgt/mgt_vcl.c
+++ b/bin/varnishd/mgt/mgt_vcl.c
@@ -387,14 +387,14 @@ mgt_vcl_setstate(struct cli *cli, struct vclprog *vp, const char *vs)
 	}
 	if (vs == VCL_STATE_AUTO) {
 		now = VTIM_mono();
-		vs = vp->warm ? VCL_STATE_WARM : VCL_STATE_COLD;
+		vs = (vp->warm ? VCL_STATE_WARM : VCL_STATE_COLD);
 		if (vp->go_cold > 0 && vp->state == VCL_STATE_AUTO &&
 		    vp->go_cold + mgt_param.vcl_cooldown < now)
 			vs = VCL_STATE_COLD;
 	}
 
 	assert(vs != VCL_STATE_AUTO);
-	warm = vs == VCL_STATE_WARM ? 1 : 0;
+	warm = (vs == VCL_STATE_WARM ? 1 : 0);
 
 	if (vp->warm == warm)
 		return (0);



More information about the varnish-commit mailing list