diff options
author | Gerald Combs <gerald@zing.org> | 2015-05-04 18:07:09 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-05-05 01:15:25 +0000 |
commit | cdaad860720a17d889e759d9e263c5fcadaf36a2 (patch) | |
tree | 9658a78378c26981b839d831b69e56a73563e949 /epan/wslua | |
parent | 9b9b994ea64042fc797c61fa01e45f5c940d7aad (diff) |
Try to please both GCC (the compiler, not me) and clang.
The fix for GCC 5's -Wlogical-not-parentheses d7b2327 triggers
-Wparentheses-equality in clang. Try to work around the issue with
diagnostic suppression.
Change-Id: I5eea1d3e76f6d2aa14a2595cd4455dcd2818f6a1
Reviewed-on: https://code.wireshark.org/review/8295
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/lrexlib_algo.h | 12 | ||||
-rw-r--r-- | epan/wslua/lrexlib_glib.c | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/epan/wslua/lrexlib_algo.h b/epan/wslua/lrexlib_algo.h index 1578bb268f..350a7f838a 100644 --- a/epan/wslua/lrexlib_algo.h +++ b/epan/wslua/lrexlib_algo.h @@ -31,6 +31,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "lrexlib.h" +#include <wsutil/ws_diag_control.h> + #ifdef LREXLIB_WIRESHARK # define WSLUA_TYPEOF_FIELD "__typeof" # define REX_CREATEGLOBALVAR @@ -277,6 +279,7 @@ static void push_substrings (lua_State *L, TUserdata *ud, const char *text, } } +DIAG_OFF(parentheses-equality) static int algf_gsub (lua_State *L) { TUserdata *ud; TArgComp argC; @@ -459,8 +462,10 @@ static int algf_gsub (lua_State *L) { freelist_free (&freelist); return 3; } +DIAG_ON(parentheses-equality) +DIAG_OFF(parentheses-equality) static int finish_generic_find (lua_State *L, TUserdata *ud, TArgExec *argE, int method, int res) { @@ -480,6 +485,7 @@ static int finish_generic_find (lua_State *L, TUserdata *ud, TArgExec *argE, else return generate_error (L, ud, res); } +DIAG_ON(parentheses-equality) static int generic_find_func (lua_State *L, int method) { @@ -512,6 +518,7 @@ static int algf_match (lua_State *L) { } +DIAG_OFF(parentheses-equality) static int gmatch_iter (lua_State *L) { int retry; TArgExec argE; @@ -572,8 +579,10 @@ static int gmatch_iter (lua_State *L) { return generate_error (L, ud, res); } } +DIAG_ON(parentheses-equality) +DIAG_OFF(parentheses-equality) static int split_iter (lua_State *L) { int incr, newoffset, res; TArgExec argE; @@ -619,6 +628,7 @@ nomatch: lua_pushlstring (L, argE.text+argE.startoffset, argE.textlen-argE.startoffset); return 1; } +DIAG_ON(parentheses-equality) static int algf_gmatch (lua_State *L) @@ -694,6 +704,7 @@ static void push_offset_table (lua_State *L, TUserdata *ud, int startoffset) { } +DIAG_OFF(parentheses-equality) static int generic_find_method (lua_State *L, int method) { TUserdata *ud; TArgExec argE; @@ -727,6 +738,7 @@ static int generic_find_method (lua_State *L, int method) { else return generate_error(L, ud, res); } +DIAG_ON(parentheses-equality) static int algm_find (lua_State *L) { diff --git a/epan/wslua/lrexlib_glib.c b/epan/wslua/lrexlib_glib.c index fd24c28a5c..91043410ab 100644 --- a/epan/wslua/lrexlib_glib.c +++ b/epan/wslua/lrexlib_glib.c @@ -276,6 +276,7 @@ static void checkarg_dfa_exec (lua_State *L, TArgExec *argE, TGrgx **ud) { argE->eflags = ALG_GETEFLAGS (L, 4); } +DIAG_OFF(parentheses-equality) /* unlike PCRE, partial matching won't return the actual substrings/matches */ static int Gregex_dfa_exec (lua_State *L) { @@ -319,6 +320,7 @@ static int Gregex_dfa_exec (lua_State *L) return generate_error (L, ud, 0); } } +DIAG_ON(parentheses-equality) #ifdef ALG_USERETRY static int gmatch_exec (TUserdata *ud, TArgExec *argE, int retry) { |