Windows: Fix Release (unused variables)

- ws_assert does not work, because _ASSERT_ENABLED is false and gets optimized
- add _U_ to unused variables because of compile flag /W3
- local variables need suppression of warning 4189
This commit is contained in:
Philipp Dittmann 2023-01-03 13:09:43 +01:00 committed by João Valverde
parent 02894b1cb9
commit 9c68879a27
5 changed files with 12 additions and 11 deletions

View File

@ -30,7 +30,7 @@
/* Convert an FT_STRING using a callback function */ /* Convert an FT_STRING using a callback function */
static gboolean static gboolean
string_walk(GSList *args, guint32 arg_count, GSList **retval, gchar(*conv_func)(gchar)) string_walk(GSList *args, guint32 arg_count _U_, GSList **retval, gchar(*conv_func)(gchar))
{ {
GSList *arg1; GSList *arg1;
fvalue_t *arg_fvalue; fvalue_t *arg_fvalue;
@ -79,7 +79,7 @@ df_func_upper(GSList *args, guint32 arg_count, GSList **retval)
/* dfilter function: count() */ /* dfilter function: count() */
static gboolean static gboolean
df_func_count(GSList *args, guint32 arg_count, GSList **retval) df_func_count(GSList *args, guint32 arg_count _U_, GSList **retval)
{ {
GSList *arg1; GSList *arg1;
fvalue_t *ft_ret; fvalue_t *ft_ret;
@ -100,7 +100,7 @@ df_func_count(GSList *args, guint32 arg_count, GSList **retval)
/* dfilter function: string() */ /* dfilter function: string() */
static gboolean static gboolean
df_func_string(GSList *args, guint32 arg_count, GSList **retval) df_func_string(GSList *args, guint32 arg_count _U_, GSList **retval)
{ {
GSList *arg1; GSList *arg1;
fvalue_t *arg_fvalue; fvalue_t *arg_fvalue;
@ -207,7 +207,7 @@ df_func_min(GSList *args, guint32 arg_count, GSList **retval)
} }
static gboolean static gboolean
df_func_abs(GSList *args, guint32 arg_count, GSList **retval) df_func_abs(GSList *args, guint32 arg_count _U_, GSList **retval)
{ {
GSList *arg1; GSList *arg1;
fvalue_t *fv_arg, *new_fv; fvalue_t *fv_arg, *new_fv;

View File

@ -596,7 +596,7 @@ dfilter_fvalue_from_charconst(dfwork_t *dfw, ftenum_t ftype, stnode_t *st)
/* If the LHS of a relation test is a FIELD, run some checks /* If the LHS of a relation test is a FIELD, run some checks
* and possibly some modifications of syntax tree nodes. */ * and possibly some modifications of syntax tree nodes. */
static void static void
check_relation_LHS_FIELD(dfwork_t *dfw, stnode_op_t st_op, check_relation_LHS_FIELD(dfwork_t *dfw, stnode_op_t st_op _U_,
FtypeCanFunc can_func, gboolean allow_partial_value, FtypeCanFunc can_func, gboolean allow_partial_value,
stnode_t *st_node, stnode_t *st_node,
stnode_t *st_arg1, stnode_t *st_arg2) stnode_t *st_arg1, stnode_t *st_arg2)
@ -795,7 +795,7 @@ check_relation_LHS_FVALUE(dfwork_t *dfw, stnode_op_t st_op _U_,
} }
static void static void
check_relation_LHS_SLICE(dfwork_t *dfw, stnode_op_t st_op, check_relation_LHS_SLICE(dfwork_t *dfw, stnode_op_t st_op _U_,
FtypeCanFunc can_func _U_, FtypeCanFunc can_func _U_,
gboolean allow_partial_value, gboolean allow_partial_value,
stnode_t *st_node _U_, stnode_t *st_node _U_,
@ -894,7 +894,7 @@ check_relation_LHS_SLICE(dfwork_t *dfw, stnode_op_t st_op,
/* If the LHS of a relation test is a FUNCTION, run some checks /* If the LHS of a relation test is a FUNCTION, run some checks
* and possibly some modifications of syntax tree nodes. */ * and possibly some modifications of syntax tree nodes. */
static void static void
check_relation_LHS_FUNCTION(dfwork_t *dfw, stnode_op_t st_op, check_relation_LHS_FUNCTION(dfwork_t *dfw, stnode_op_t st_op _U_,
FtypeCanFunc can_func, gboolean allow_partial_value, FtypeCanFunc can_func, gboolean allow_partial_value,
stnode_t *st_node, stnode_t *st_arg1, stnode_t *st_arg2) stnode_t *st_node, stnode_t *st_arg1, stnode_t *st_arg2)
{ {
@ -1005,7 +1005,7 @@ check_relation_LHS_FUNCTION(dfwork_t *dfw, stnode_op_t st_op,
} }
static void static void
check_relation_LHS_ARITHMETIC(dfwork_t *dfw, stnode_op_t st_op, check_relation_LHS_ARITHMETIC(dfwork_t *dfw, stnode_op_t st_op _U_,
FtypeCanFunc can_func, gboolean allow_partial_value, FtypeCanFunc can_func, gboolean allow_partial_value,
stnode_t *st_node, stnode_t *st_arg1, stnode_t *st_arg2) stnode_t *st_node, stnode_t *st_arg1, stnode_t *st_arg2)
{ {

View File

@ -21,7 +21,7 @@ typedef struct {
#define OPER_MAGIC 0xab9009ba #define OPER_MAGIC 0xab9009ba
static gpointer static gpointer
oper_new(gpointer junk) oper_new(gpointer junk _U_)
{ {
oper_t *oper; oper_t *oper;

View File

@ -233,7 +233,8 @@ WSLUA_METHOD Proto_register_heuristic(lua_State* L) {
Proto proto = checkProto(L,1); Proto proto = checkProto(L,1);
const gchar *listname = luaL_checkstring(L, WSLUA_ARG_Proto_register_heuristic_LISTNAME); const gchar *listname = luaL_checkstring(L, WSLUA_ARG_Proto_register_heuristic_LISTNAME);
const gchar *proto_name = proto->name; const gchar *proto_name = proto->name;
const int top = lua_gettop(L); const int top _U_ = lua_gettop(L);
gchar *short_name; gchar *short_name;
if (!proto_name || proto->hfid == -1) { if (!proto_name || proto->hfid == -1) {

View File

@ -28,7 +28,7 @@ extern "C" {
/* This includes clang */ /* This includes clang */
#define _U_ __attribute__((unused)) #define _U_ __attribute__((unused))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define _U_ __pragma(warning(suppress:4100)) #define _U_ __pragma(warning(suppress:4100 4189))
#else #else
#define _U_ #define _U_
#endif #endif