diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-03-28 18:47:48 -0400 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-03-29 12:36:48 +0000 |
commit | 302632f4b3dba9fd4287795347598ad767eca8ee (patch) | |
tree | 13215d4c88253247571a120cd7a1e120b890ece0 | |
parent | 48fc43baadae5d82b6a7969fef03d305c2c40a31 (diff) | |
download | wireshark-302632f4b3dba9fd4287795347598ad767eca8ee.tar.gz wireshark-302632f4b3dba9fd4287795347598ad767eca8ee.tar.bz2 wireshark-302632f4b3dba9fd4287795347598ad767eca8ee.zip |
Fix some compiler issues on windows with Lua 5.2
Change-Id: I5c692bbc5fd1a9f0d361413e44e70282c3299901
Reviewed-on: https://code.wireshark.org/review/860
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r-- | epan/wslua/lrexlib.c | 2 | ||||
-rw-r--r-- | epan/wslua/lrexlib.h | 10 | ||||
-rw-r--r-- | epan/wslua/lrexlib_algo.h | 2 | ||||
-rw-r--r-- | epan/wslua/lrexlib_glib.c | 5 |
4 files changed, 13 insertions, 6 deletions
diff --git a/epan/wslua/lrexlib.c b/epan/wslua/lrexlib.c index 5d99522678..d3307da2f4 100644 --- a/epan/wslua/lrexlib.c +++ b/epan/wslua/lrexlib.c @@ -272,7 +272,7 @@ void bufferZ_putrepstring (TBuffer *BufRep, int reppos, int nsub) { */ int bufferZ_next (TBuffer *buf, size_t *iter, size_t *num, const char **str) { if (*iter < buf->top) { - size_t *ptr_header = (size_t*)(buf->arr + *iter); + size_t *ptr_header = (size_t*)(void*)(buf->arr + *iter); *num = ptr_header[1]; *iter += 2 * sizeof (size_t); *str = NULL; diff --git a/epan/wslua/lrexlib.h b/epan/wslua/lrexlib.h index ae578034d7..eff305cecb 100644 --- a/epan/wslua/lrexlib.h +++ b/epan/wslua/lrexlib.h @@ -47,6 +47,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # define REX_API LUALIB_API #endif +#ifndef REX_OPENLIB +# define REX_OPENLIB luaopen_rex_glib +#endif + +/* public function declarations */ +REX_API int REX_OPENLIB (lua_State *L); +int Gregex_get_compile_flags (lua_State *L); +int Gregex_get_match_flags (lua_State *L); +int Gregex_get_flags (lua_State *L); + /* Special values for maxmatch in gsub. They all must be negative. */ #define GSUB_UNLIMITED -1 #define GSUB_CONDITIONAL -2 diff --git a/epan/wslua/lrexlib_algo.h b/epan/wslua/lrexlib_algo.h index c2c86d409a..6b9beb0212 100644 --- a/epan/wslua/lrexlib_algo.h +++ b/epan/wslua/lrexlib_algo.h @@ -350,7 +350,7 @@ static int algf_gsub (lua_State *L) { /*----------------------------------------------------------------*/ else if (argE.reptype == LUA_TTABLE) { if (ALG_NSUB(ud) > 0) - ALG_PUSHSUB_OR_FALSE (L, ud, argE.text + ALG_BASE(st), 1); + ALG_PUSHSUB_OR_FALSE (L, ud, argE.text + ALG_BASE(st), 1) else lua_pushlstring (L, argE.text + from, to - from); lua_gettable (L, argE.funcpos); diff --git a/epan/wslua/lrexlib_glib.c b/epan/wslua/lrexlib_glib.c index 3b6aed5dc7..ad10925c61 100644 --- a/epan/wslua/lrexlib_glib.c +++ b/epan/wslua/lrexlib_glib.c @@ -70,9 +70,6 @@ extern flag_pair gregex_error_flags[]; # define REX_LIBNAME "rex_glib" # endif #endif -#ifndef REX_OPENLIB -# define REX_OPENLIB luaopen_rex_glib -#endif #define REX_TYPENAME REX_LIBNAME"_regex" @@ -94,7 +91,7 @@ static int getcflags (lua_State *L, int pos); lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n)) #define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \ - (ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0)) + { if ( ALG_SUBVALID(ud,n) ) { ALG_PUSHSUB (L,ud,text,n); } else { lua_pushboolean (L,0); } } #define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1) #define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n)) |