[master] e6d5818 replace NEEDLESS_RETURN(x) with NEEDLESS(return(x))

Nils Goroll nils.goroll at uplex.de
Thu Dec 8 16:30:05 CET 2016


commit e6d58182d39863fc08fe91bf7efdfd2dde6f3262
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Dec 8 16:28:33 2016 +0100

    replace NEEDLESS_RETURN(x) with NEEDLESS(return(x))

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 0d25a8a..82e873c 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -926,7 +926,7 @@ static enum fetch_step
 vbf_stp_done(void)
 {
 	WRONG("Just plain wrong");
-	NEEDLESS_RETURN(F_STP_DONE);
+	NEEDLESS(return(F_STP_DONE));
 }
 
 static void __match_proto__(task_func_t)
diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index 3a8522a..6062b24 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -241,7 +241,7 @@ macro_expand(struct vtclog *vl, const char *text)
 			VSB_destroy(&vsb);
 			vtc_log(vl, 0, "Macro ${%.*s} not found", (int)(q - p),
 			    p);
-			NEEDLESS_RETURN (NULL);
+			NEEDLESS(return (NULL));
 		}
 		VSB_printf(vsb, "%s", m);
 		free(m);
@@ -381,7 +381,7 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
 				break;
 		if (cp->name == NULL) {
 			vtc_log(vl, 0, "Unknown command: \"%s\"", token_s[0]);
-			NEEDLESS_RETURN;
+			NEEDLESS(return);
 		}
 
 		assert(cp->cmd != NULL);
diff --git a/flint.lnt b/flint.lnt
index 9f3f158..4a52501 100644
--- a/flint.lnt
+++ b/flint.lnt
@@ -95,7 +95,7 @@
 
 ///////////////////////////////////////////////////////////////////////
 // <vdef.h>
--emacro(527, NEEDLESS_RETURN)	// unreachable code
+-emacro(527, NEEDLESS)	// unreachable code
 
 ///////////////////////////////////////////////////////////////////////
 
diff --git a/include/vdef.h b/include/vdef.h
index 9e18a1d..892eda6 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -112,11 +112,9 @@
 #define __state_variable__(varname)	varname /*lint -esym(838,varname) */
 
 #ifdef __SUNPRO_C
-#define NEEDLESS_RETURN		{}
 #define NEEDLESS(s)		{}
 #define __unused
 #else
-#define NEEDLESS_RETURN		return
 #define NEEDLESS(s)		s
 #endif
 
diff --git a/lib/libvarnish/vsa.c b/lib/libvarnish/vsa.c
index a20d713..299deb7 100644
--- a/lib/libvarnish/vsa.c
+++ b/lib/libvarnish/vsa.c
@@ -336,7 +336,7 @@ VSA_Compare_IP(const struct suckaddr *sua1, const struct suckaddr *sua2)
 	}
 
 	WRONG("Just plain insane");
-	NEEDLESS_RETURN(-1);
+	NEEDLESS(return(-1));
 }
 
 struct suckaddr *
diff --git a/lib/libvmod_directors/shard_hash.c b/lib/libvmod_directors/shard_hash.c
index aa66410..35f1df8 100644
--- a/lib/libvmod_directors/shard_hash.c
+++ b/lib/libvmod_directors/shard_hash.c
@@ -101,7 +101,7 @@ _shard_hash_invalid(VCL_STRING s)
 {
 	(void) s;
 	WRONG("invalid hash fp _ALG_E_ENVALID");
-	NEEDLESS_RETURN(0);
+	NEEDLESS(return(0));
 }
 
 const hash_func shard_hash_f[_ALG_E_MAX] = {



More information about the varnish-commit mailing list