[master] ebbbad964 Flexelinting

Poul-Henning Kamp phk at FreeBSD.org
Tue Feb 5 07:08:07 UTC 2019


commit ebbbad96484f2ec6823911f460ad5a1107c8a9c3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Feb 5 07:07:42 2019 +0000

    Flexelinting

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index db16284f6..19e3463b3 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -73,7 +73,7 @@
 	} while (0)
 
 
-static double timeout = 5;	// XXX should be settable by arg ?
+static const double timeout = 5;	// XXX should be settable by arg ?
 
 static void
 cli_write(int sock, const char *s)
diff --git a/bin/varnishd/cache/cache_objhead.h b/bin/varnishd/cache/cache_objhead.h
index e12463981..41b7781a5 100644
--- a/bin/varnishd/cache/cache_objhead.h
+++ b/bin/varnishd/cache/cache_objhead.h
@@ -66,7 +66,6 @@ void HSH_DeleteObjHead(const struct worker *, struct objhead *);
 
 int HSH_DerefObjCore(struct worker *, struct objcore **, int rushmax);
 #define HSH_RUSH_POLICY -1
-#define HSH_RUSH_ALL	INT_MAX
 
 enum lookup_e HSH_Lookup(struct req *, struct objcore **, struct objcore **);
 void HSH_Ref(struct objcore *o);
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index ed89868d7..a524a7981 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -50,7 +50,9 @@ const char * const VCL_TEMP_COLD = "cold";
 const char * const VCL_TEMP_WARM = "warm";
 const char * const VCL_TEMP_BUSY = "busy";
 const char * const VCL_TEMP_COOLING = "cooling";
-const char * const VCL_TEMP_LABEL = "label";
+
+// not really a state
+static const char * const VCL_TEMP_LABEL = "label";
 
 /*
  * XXX: Presently all modifications to this list happen from the
diff --git a/bin/varnishd/cache/cache_vcl.h b/bin/varnishd/cache/cache_vcl.h
index e9d99a710..aa530cb5b 100644
--- a/bin/varnishd/cache/cache_vcl.h
+++ b/bin/varnishd/cache/cache_vcl.h
@@ -75,7 +75,6 @@ extern const char * const VCL_TEMP_COLD;
 extern const char * const VCL_TEMP_WARM;
 extern const char * const VCL_TEMP_BUSY;
 extern const char * const VCL_TEMP_COOLING;
-extern const char * const VCL_TEMP_LABEL;
 
 /*
  * NB: The COOLING temperature is neither COLD nor WARM.
diff --git a/bin/varnishd/flint.lnt b/bin/varnishd/flint.lnt
index 88e89b36d..238dec743 100644
--- a/bin/varnishd/flint.lnt
+++ b/bin/varnishd/flint.lnt
@@ -72,7 +72,8 @@
 // Macros defined differently in each VMOD
 -esym(767, VPFX)	// macro '___' was defined differently in another module
 -esym(767, VARGS)	// macro '___' was defined differently in another module
--esym(767, VENUM)	// macro '___' was defined differently in another module 
+-esym(767, VENUM)	// macro '___' was defined differently in another module
+-esym(14, enum_vmod*)	// Symbol '___' previously defined (___)
 //////////////
 -efunc(1791, pdiff)	// return last on line
 //////////////
diff --git a/lib/libvmod_blob/vmod_blob.h b/lib/libvmod_blob/vmod_blob.h
index 032f59986..3b027480a 100644
--- a/lib/libvmod_blob/vmod_blob.h
+++ b/lib/libvmod_blob/vmod_blob.h
@@ -32,13 +32,13 @@
 #include <sys/types.h>
 
 enum encoding {
-	_INVALID = 0,
+	__INVALID_ENCODING = 0,
 #define VMODENUM(x) x,
 #include "tbl_encodings.h"
 	__MAX_ENCODING
 };
 
-#define AENC(enc) assert((enc) > _INVALID && (enc) < __MAX_ENCODING)
+#define AENC(enc) assert((enc) > __INVALID_ENCODING && (enc) < __MAX_ENCODING)
 
 /*
  * The enums MUST appear in this order, since LOWER and UPPER are used to
diff --git a/lib/libvmod_directors/shard_cfg.c b/lib/libvmod_directors/shard_cfg.c
index d8ac65109..154595e8f 100644
--- a/lib/libvmod_directors/shard_cfg.c
+++ b/lib/libvmod_directors/shard_cfg.c
@@ -41,7 +41,7 @@
 
 /*lint -esym(749,  shard_change_task_e::*) */
 enum shard_change_task_e {
-	_INVALID = 0,
+	_SHARD_TASK_E_INVALID = 0,
 	CLEAR,
 	ADD_BE,
 	REMOVE_BE,


More information about the varnish-commit mailing list