[master] 338550eda FlexeLinting: Default is always last in switch, and there is one.

Poul-Henning Kamp phk at FreeBSD.org
Tue Aug 6 09:15:11 UTC 2019


commit 338550eda003a320a4a6d8b80eea7ab8066c9c8a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Aug 6 08:19:07 2019 +0000

    FlexeLinting: Default is always last in switch, and there is one.

diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 8a9c88775..2580b4ada 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -725,8 +725,8 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
 		    "Incomplete code in %s(), %s line %d:\n",
 		    func, file, line);
 		break;
-	default:
 	case VAS_ASSERT:
+	default:
 		VSB_printf(pan_vsb,
 		    "Assert error in %s(), %s line %d:\n"
 		    "  Condition(%s) not true.\n",
diff --git a/bin/varnishd/cache/cache_rfc2616.c b/bin/varnishd/cache/cache_rfc2616.c
index e2bffa216..e411f6aaf 100644
--- a/bin/varnishd/cache/cache_rfc2616.c
+++ b/bin/varnishd/cache/cache_rfc2616.c
@@ -126,9 +126,6 @@ RFC2616_Ttl(struct busyobj *bo, vtim_real now, vtim_real *t_origin,
 		h_date = VTIM_parse(p);
 
 	switch (http_GetStatus(hp)) {
-	default:
-		*ttl = -1.;
-		break;
 	case 302: /* Moved Temporarily */
 	case 307: /* Temporary Redirect */
 		/*
@@ -192,7 +189,10 @@ RFC2616_Ttl(struct busyobj *bo, vtim_real now, vtim_real *t_origin,
 			 */
 			*ttl = (int)(h_expires - h_date);
 		}
-
+		break;
+	default:
+		*ttl = -1.;
+		break;
 	}
 
 	/*
diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 5a1c0ca29..3a0b57f61 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -691,7 +691,8 @@ MCF_InitParams(struct cli *cli)
 /*--------------------------------------------------------------------*/
 
 void
-MCF_ParamConf(enum mcf_which_e which, const char *param, const char *fmt, ...)
+MCF_ParamConf(enum mcf_which_e which, const char * const param,
+    const char *fmt, ...)
 {
 	struct parspec *pp;
 	struct vsb *vsb;
@@ -718,6 +719,8 @@ MCF_ParamConf(enum mcf_which_e which, const char *param, const char *fmt, ...)
 		pp->max = strdup(VSB_data(vsb));
 		AN(pp->max);
 		break;
+	default:
+		WRONG("bad 'which'");
 	}
 	VSB_delete(vsb);
 }


More information about the varnish-commit mailing list