[master] 006f3ec4d param: Rename conflicting EXPERIMENTAL macros
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Tue Feb 22 14:03:05 UTC 2022
commit 006f3ec4d2271641f20a5005aa7533bba3d11752
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Tue Feb 22 14:59:36 2022 +0100
param: Rename conflicting EXPERIMENTAL macros
There was already a macro called EXPERIMENTAL, so it clashes with the
new set of EXPERIMENTAL* macros. Anything directly referring to the
parameter keeps the experimental prefix, otherwise, experiment.
Spotted by Flexelint.
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index ba68a2c64..6d854c127 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -197,7 +197,7 @@ pool_poolherder(void *priv)
continue;
}
} else if (nwq > cache_param->wthread_pools &&
- EXPERIMENTAL(EXPERIMENTAL_DROP_POOLS)) {
+ EXPERIMENT(EXPERIMENT_DROP_POOLS)) {
Lck_Lock(&pool_mtx);
pp = VTAILQ_FIRST(&pools);
CHECK_OBJ_NOTNULL(pp, POOL_MAGIC);
diff --git a/bin/varnishd/cache/cache_varnishd.h b/bin/varnishd/cache/cache_varnishd.h
index 096856bf1..f5c377448 100644
--- a/bin/varnishd/cache/cache_varnishd.h
+++ b/bin/varnishd/cache/cache_varnishd.h
@@ -570,7 +570,7 @@ void SMP_Ready(void);
#endif
#define FEATURE(x) COM_FEATURE(cache_param->feature_bits, x)
-#define EXPERIMENTAL(x) COM_EXPERIMENTAL(cache_param->experimental_bits, x)
+#define EXPERIMENT(x) COM_EXPERIMENT(cache_param->experimental_bits, x)
#define DO_DEBUG(x) COM_DO_DEBUG(cache_param->debug_bits, x)
#define DSL(debug_bit, id, ...) \
diff --git a/bin/varnishd/common/common_param.h b/bin/varnishd/common/common_param.h
index 89df97f91..201bfd381 100644
--- a/bin/varnishd/common/common_param.h
+++ b/bin/varnishd/common/common_param.h
@@ -53,13 +53,13 @@ COM_DO_DEBUG(const volatile uint8_t *p, enum debug_bits x)
}
enum experimental_bits {
-#define EXPERIMENTAL_BIT(U, l, d) EXPERIMENTAL_##U,
+#define EXPERIMENTAL_BIT(U, l, d) EXPERIMENT_##U,
#include "tbl/experimental_bits.h"
- EXPERIMENTAL_Reserved
+ EXPERIMENT_Reserved
};
static inline int
-COM_EXPERIMENTAL(const volatile uint8_t *p, enum experimental_bits x)
+COM_EXPERIMENT(const volatile uint8_t *p, enum experimental_bits x)
{
return (p[(unsigned)x>>3] & (0x80U >> ((unsigned)x & 7)));
}
@@ -86,7 +86,7 @@ struct poolparam {
PARAM_BITMAP(vsl_mask_t, 256);
PARAM_BITMAP(debug_t, DBG_Reserved);
-PARAM_BITMAP(experimental_t, EXPERIMENTAL_Reserved);
+PARAM_BITMAP(experimental_t, EXPERIMENT_Reserved);
PARAM_BITMAP(feature_t, FEATURE_Reserved);
#undef PARAM_BITMAP
diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h
index 5df9f5fff..9853f51a5 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -245,5 +245,5 @@ extern const char *mgt_vmod_path;
#endif
#define MGT_FEATURE(x) COM_FEATURE(mgt_param.feature_bits, x)
-#define MGT_EXPERIMENTAL(x) COM_EXPERIMENTAL(mgt_param.experimental_bits, x)
+#define MGT_EXPERIMENT(x) COM_EXPERIMENT(mgt_param.experimental_bits, x)
#define MGT_DO_DEBUG(x) COM_DO_DEBUG(mgt_param.debug_bits, x)
diff --git a/bin/varnishd/mgt/mgt_param_bits.c b/bin/varnishd/mgt/mgt_param_bits.c
index 02f5e1463..bec9625b4 100644
--- a/bin/varnishd/mgt/mgt_param_bits.c
+++ b/bin/varnishd/mgt/mgt_param_bits.c
@@ -185,7 +185,7 @@ tweak_debug(struct vsb *vsb, const struct parspec *par, const char *arg)
*/
static const char * const experimental_tags[] = {
-# define EXPERIMENTAL_BIT(U, l, d) [EXPERIMENTAL_##U] = #l,
+# define EXPERIMENTAL_BIT(U, l, d) [EXPERIMENT_##U] = #l,
# include "tbl/experimental_bits.h"
NULL
};
@@ -195,7 +195,7 @@ tweak_experimental(struct vsb *vsb, const struct parspec *par, const char *arg)
{
return (tweak_generic_bits(vsb, par, arg, mgt_param.experimental_bits,
- EXPERIMENTAL_Reserved, experimental_tags, "experimental bit", '+'));
+ EXPERIMENT_Reserved, experimental_tags, "experimental bit", '+'));
}
/*--------------------------------------------------------------------
More information about the varnish-commit
mailing list