Submitted By:            Fernando de Oliveira <famobr at yahoo dot com dot br>
Date:                    2015-01-24
Initial Package Version: 1.12.3
Upstream Status:         not submitted
Origin:                  Self
Description:             Fix build against lua-5.3.0

diff -Naur wireshark-1.12.3.orig/epan/wslua/lrexlib_algo.h wireshark-1.12.3/epan/wslua/lrexlib_algo.h
--- wireshark-1.12.3.orig/epan/wslua/lrexlib_algo.h	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/lrexlib_algo.h	2015-01-24 11:59:59.552263065 -0300
@@ -64,7 +64,7 @@
 #endif
 
 #ifndef ALG_GETEFLAGS
-#  define ALG_GETEFLAGS(L,idx) luaL_optint (L, idx, ALG_EFLAGS_DFLT)
+#  define ALG_GETEFLAGS(L,idx) luaL_optinteger (L, idx, ALG_EFLAGS_DFLT)
 #endif
 
 #ifndef DO_NAMED_SUBPATTERNS
@@ -118,7 +118,7 @@
 
 
 static int get_startoffset(lua_State *L, int stackpos, size_t len) {
-  int startoffset = luaL_optint(L, stackpos, 1);
+  int startoffset = (int)luaL_optinteger(L, stackpos, 1);
   if(startoffset > 0)
     startoffset--;
   else if(startoffset < 0) {
diff -Naur wireshark-1.12.3.orig/epan/wslua/lrexlib_glib.c wireshark-1.12.3/epan/wslua/lrexlib_glib.c
--- wireshark-1.12.3.orig/epan/wslua/lrexlib_glib.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/lrexlib_glib.c	2015-01-24 11:59:59.428266138 -0300
@@ -232,7 +232,7 @@
 }
 
 static int check_eflags(lua_State *L, const int idx, const int def) {
-  int eflags = luaL_optint (L, idx, def);
+  int eflags = luaL_optinteger (L, idx, def);
   if ((eflags & ~G_REGEX_MATCH_MASK) != 0) {
     return luaL_error (L, "GLib Regex match flag is invalid");
   }
diff -Naur wireshark-1.12.3.orig/epan/wslua/lua_bitop.c wireshark-1.12.3/epan/wslua/lua_bitop.c
--- wireshark-1.12.3.orig/epan/wslua/lua_bitop.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/lua_bitop.c	2015-01-24 11:59:59.432266039 -0300
@@ -48,7 +48,7 @@
 
 typedef union {
   lua_Number n;
-#ifdef LUA_NUMBER_DOUBLE
+#ifdef LUA_REAL_DOUBLE
   uint64_t b;
 #else
   UBits b;
@@ -65,21 +65,21 @@
 #else
   bn.n = luaL_checknumber(L, idx);
 #endif
-#if defined(LUA_NUMBER_DOUBLE)
+#if defined(LUA_REAL_DOUBLE)
   bn.n += 6755399441055744.0;  /* 2^52+2^51 */
 #ifdef SWAPPED_DOUBLE
   b = (UBits)(bn.b >> 32);
 #else
   b = (UBits)bn.b;
 #endif
-#elif defined(LUA_NUMBER_INT) || defined(LUA_NUMBER_LONG) || \
-      defined(LUA_NUMBER_LONGLONG) || defined(LUA_NUMBER_LONG_LONG) || \
+#elif defined(LUA_INTEGER) || defined(LUA_INT_LONG) || \
+      defined(LUA_INT_LONGLONG) || defined(LUA_NUMBER_LONG_LONG) || \
       defined(LUA_NUMBER_LLONG)
   if (sizeof(UBits) == sizeof(lua_Number))
     b = bn.b;
   else
     b = (UBits)(SBits)bn.n;
-#elif defined(LUA_NUMBER_FLOAT)
+#elif defined(LUA_REAL_FLOAT)
 #error "A 'float' lua_Number type is incompatible with this library"
 #else
 #error "Unknown number type, check LUA_NUMBER_* in luaconf.h"
@@ -169,7 +169,7 @@
   b = barg(L, -1);
   if (b != (UBits)1437217655L || BAD_SAR) {  /* Perform a simple self-test. */
     const char *msg = "compiled with incompatible luaconf.h";
-#ifdef LUA_NUMBER_DOUBLE
+#ifdef LUA_REAL_DOUBLE
 #ifdef _WIN32
     if (b == (UBits)1610612736L)
       msg = "use D3DCREATE_FPU_PRESERVE with DirectX";
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_dumper.c wireshark-1.12.3/epan/wslua/wslua_dumper.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_dumper.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_dumper.c	2015-01-24 11:59:59.441265816 -0300
@@ -92,7 +92,7 @@
     PseudoHeader ph = (PseudoHeader)g_malloc(sizeof(struct lua_pseudo_header));
     ph->type = PHDR_ETH;
     ph->wph = (union wtap_pseudo_header *)g_malloc(sizeof(union wtap_pseudo_header));
-    ph->wph->eth.fcs_len = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_eth_FCSLEN,-1);
+    ph->wph->eth.fcs_len = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_eth_FCSLEN,-1);
 
     pushPseudoHeader(L,ph);
 
@@ -114,13 +114,13 @@
     PseudoHeader ph = (PseudoHeader)g_malloc(sizeof(struct lua_pseudo_header));
     ph->type = PHDR_ATM;
     ph->wph = (union wtap_pseudo_header *)g_malloc(sizeof(union wtap_pseudo_header));
-    ph->wph->atm.aal = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_atm_AAL,5);
-    ph->wph->atm.vpi = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_atm_VPI,1);
-    ph->wph->atm.vci = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_atm_VCI,1);
-    ph->wph->atm.channel = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_atm_CHANNEL,0);
-    ph->wph->atm.cells = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_atm_CELLS,1);
-    ph->wph->atm.aal5t_u2u = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_atm_AAL5U2U,1);
-    ph->wph->atm.aal5t_len = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_atm_AAL5LEN,0);
+    ph->wph->atm.aal = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_atm_AAL,5);
+    ph->wph->atm.vpi = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_atm_VPI,1);
+    ph->wph->atm.vci = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_atm_VCI,1);
+    ph->wph->atm.channel = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_atm_CHANNEL,0);
+    ph->wph->atm.cells = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_atm_CELLS,1);
+    ph->wph->atm.aal5t_u2u = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_atm_AAL5U2U,1);
+    ph->wph->atm.aal5t_len = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_atm_AAL5LEN,0);
 
     pushPseudoHeader(L,ph);
     WSLUA_RETURN(1);
@@ -135,9 +135,9 @@
     PseudoHeader ph = (PseudoHeader)g_malloc(sizeof(struct lua_pseudo_header));
     ph->type = PHDR_MTP2;
     ph->wph = (union wtap_pseudo_header *)g_malloc(sizeof(union wtap_pseudo_header));
-    ph->wph->mtp2.sent = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_mtp2_SENT,0);
-    ph->wph->mtp2.annex_a_used = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_mtp2_ANNEXA,0);
-    ph->wph->mtp2.link_number = luaL_optint(L,WSLUA_OPTARG_PseudoHeader_mtp2_LINKNUM,0);
+    ph->wph->mtp2.sent = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_mtp2_SENT,0);
+    ph->wph->mtp2.annex_a_used = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_mtp2_ANNEXA,0);
+    ph->wph->mtp2.link_number = (int)luaL_optinteger(L,WSLUA_OPTARG_PseudoHeader_mtp2_LINKNUM,0);
 
     pushPseudoHeader(L,ph);
     WSLUA_RETURN(1); /* The MTP2 pseudoheader */
@@ -213,8 +213,8 @@
 #define WSLUA_OPTARG_Dumper_new_ENCAP 3 /* The encapsulation to be used in the file to be created - a number entry from the `wtap_encaps` table in `init.lua`. */
     Dumper d;
     const char* fname = luaL_checkstring(L,WSLUA_ARG_Dumper_new_FILENAME);
-    int filetype = luaL_optint(L,WSLUA_OPTARG_Dumper_new_FILETYPE,WTAP_FILE_TYPE_SUBTYPE_PCAP);
-    int encap  = luaL_optint(L,WSLUA_OPTARG_Dumper_new_ENCAP,WTAP_ENCAP_ETHERNET);
+    int filetype = (int)luaL_optinteger(L,WSLUA_OPTARG_Dumper_new_FILETYPE,WTAP_FILE_TYPE_SUBTYPE_PCAP);
+    int encap  = (int)luaL_optinteger(L,WSLUA_OPTARG_Dumper_new_ENCAP,WTAP_ENCAP_ETHERNET);
     int err = 0;
     const char* filename;
 
@@ -355,7 +355,7 @@
 #define WSLUA_OPTARG_Dumper_new_for_current_FILETYPE 2 /* The file type. Defaults to pcap. */
     Dumper d;
     const char* fname = luaL_checkstring(L,1);
-    int filetype = luaL_optint(L,WSLUA_OPTARG_Dumper_new_for_current_FILETYPE,WTAP_FILE_TYPE_SUBTYPE_PCAP);
+    int filetype = (int)luaL_optinteger(L,WSLUA_OPTARG_Dumper_new_for_current_FILETYPE,WTAP_FILE_TYPE_SUBTYPE_PCAP);
     int encap;
     int err = 0;
     const char* filename;
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_file.c wireshark-1.12.3/epan/wslua/wslua_file.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_file.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_file.c	2015-01-24 11:59:59.467265172 -0300
@@ -341,7 +341,7 @@
     static const char *const modenames[] = {"set", "cur", "end", NULL};
     File f = checkFile(L,1);
     int op = luaL_checkoption(L, 2, "cur", modenames);
-    gint64 offset = (gint64) luaL_optlong(L, 3, 0);
+    gint64 offset = (gint64) (long)luaL_optinteger(L, 3, 0);
     int err = WTAP_ERR_INTERNAL;
 
 
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_gui.c wireshark-1.12.3/epan/wslua/wslua_gui.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_gui.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_gui.c	2015-01-24 11:59:59.473265023 -0300
@@ -823,7 +823,7 @@
 WSLUA_FUNCTION wslua_set_color_filter_slot(lua_State* L) { /* Set packet-coloring rule for the current session. */
 #define WSLUA_ARG_set_color_filter_slot_ROW 1 /* The index of the desired color in the temporary coloring rules list. */
 #define WSLUA_ARG_set_color_filter_slot_TEXT  2 /* Display filter for selecting packets to be colorized. */
-    guint8 row = luaL_checkint(L,WSLUA_ARG_set_color_filter_slot_ROW);
+    guint8 row = (int)luaL_checkinteger(L,WSLUA_ARG_set_color_filter_slot_ROW);
     const gchar* filter_str = luaL_checkstring(L,WSLUA_ARG_set_color_filter_slot_TEXT);
 
     if (!ops->set_color_filter_slot) {
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua.h wireshark-1.12.3/epan/wslua/wslua.h
--- wireshark-1.12.3.orig/epan/wslua/wslua.h	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua.h	2015-01-24 11:59:59.560262867 -0300
@@ -68,7 +68,7 @@
 #define LOG_DOMAIN_LUA "wslua"
 
 /* type conversion macros - lua_Number is a double, so casting isn't kosher; and
-   using Lua's already-available lua_tointeger() and luaL_checkint() might be different
+   using Lua's already-available lua_tointeger() and (int)luaL_checkinteger() might be different
    on different machines; so use these instead please! */
 #define wslua_togint(L,i)       (gint)            ( lua_tointeger(L,i) )
 #define wslua_togint32(L,i)     (gint32)          ( lua_tonumber(L,i) )
@@ -77,17 +77,17 @@
 #define wslua_toguint32(L,i)    (guint32)         ( lua_tonumber(L,i) )
 #define wslua_toguint64(L,i)    (guint64)         ( lua_tonumber(L,i) )
 
-#define wslua_checkgint(L,i)    (gint)            ( luaL_checkint(L,i) )
+#define wslua_checkgint(L,i)    (gint)            ( (int)luaL_checkinteger(L,i) )
 #define wslua_checkgint32(L,i)  (gint32)          ( luaL_checknumber(L,i) )
 #define wslua_checkgint64(L,i)  (gint64)          ( luaL_checknumber(L,i) )
-#define wslua_checkguint(L,i)   (guint)           ( luaL_checkint(L,i) )
+#define wslua_checkguint(L,i)   (guint)           ( (int)luaL_checkinteger(L,i) )
 #define wslua_checkguint32(L,i) (guint32)         ( luaL_checknumber(L,i) )
 #define wslua_checkguint64(L,i) (guint64)         ( luaL_checknumber(L,i) )
 
-#define wslua_optgint(L,i,d)    (gint)            ( luaL_optint(L,i,d) )
+#define wslua_optgint(L,i,d)    (gint)            ( (int)luaL_optinteger(L,i,d) )
 #define wslua_optgint32(L,i,d)  (gint32)          ( luaL_optnumber(L,i,d) )
 #define wslua_optgint64(L,i,d)  (gint64)          ( luaL_optnumber(L,i,d) )
-#define wslua_optguint(L,i,d)   (guint)           ( luaL_optint(L,i,d) )
+#define wslua_optguint(L,i,d)   (guint)           ( (int)luaL_optinteger(L,i,d) )
 #define wslua_optguint32(L,i,d) (guint32)         ( luaL_optnumber(L,i,d) )
 #define wslua_optguint64(L,i,d) (guint64)         ( luaL_optnumber(L,i,d) )
 
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_int64.c wireshark-1.12.3/epan/wslua/wslua_int64.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_int64.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_int64.c	2015-01-24 11:59:59.482264800 -0300
@@ -269,7 +269,7 @@
 #define WSLUA_OPTARG_Int64_new_NUMBYTES 2 /* The number of hex-chars/nibbles to generate,
                                              negative means uppercase (default=16). */
     gint64 b = getInt64(L,1);
-    gint n = luaL_optint(L, WSLUA_OPTARG_Int64_new_NUMBYTES, 16);
+    gint n = (int)luaL_optinteger(L, WSLUA_OPTARG_Int64_new_NUMBYTES, 16);
     const gchar *hexdigits = "0123456789abcdef";
     gchar buf[16];
     gint i;
@@ -829,7 +829,7 @@
 #define WSLUA_OPTARG_UInt64_new_NUMBYTES 2 /* The number of hex-chars/nibbles to generate,
                                               negative means uppercase (default=16). */
     guint64 b = getUInt64(L,1);
-    gint n = luaL_optint(L, WSLUA_OPTARG_UInt64_new_NUMBYTES, 16);
+    gint n = (int)luaL_optinteger(L, WSLUA_OPTARG_UInt64_new_NUMBYTES, 16);
     const gchar *hexdigits = "0123456789abcdef";
     gchar buf[16];
     gint i;
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_internals.c wireshark-1.12.3/epan/wslua/wslua_internals.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_internals.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_internals.c	2015-01-24 11:59:59.487264676 -0300
@@ -54,7 +54,7 @@
     if ( lua_isboolean(L,n) ||  lua_isnil(L,n)  || lua_gettop(L) < n ) {
         val = lua_toboolean(L,n);
     } else if ( lua_type(L,n) == LUA_TNUMBER ) {
-        int num = luaL_checkint(L,n);
+        int num = (int)luaL_checkinteger(L,n);
         val = num != 0 ? TRUE : FALSE;
     } else {
         luaL_argerror(L,n,"must be a boolean or number");
@@ -63,7 +63,7 @@
     return val;
 }
 
-/* like luaL_checkint, except for booleans - this does not coerce other types */
+/* like luaL_checkinteger, except for booleans - this does not coerce other types */
 WSLUA_API gboolean wslua_checkboolean(lua_State* L, int n) {
 
     if (!lua_isboolean(L,n) ) {
@@ -105,7 +105,7 @@
     return val;
 }
 
-/* like luaL_optint, except converts/handles Lua booleans as well */
+/* like luaL_optinteger, except converts/handles Lua booleans as well */
 WSLUA_API int wslua_optboolint(lua_State* L, int n, int def) {
     int val = 0;
 
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_listener.c wireshark-1.12.3/epan/wslua/wslua_listener.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_listener.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_listener.c	2015-01-24 11:59:59.490264602 -0300
@@ -110,7 +110,7 @@
 
     switch ( lua_pcall(tap->L,3,1,1) ) {
         case 0:
-            retval = luaL_optint(tap->L,-1,1);
+            retval = (int)luaL_optinteger(tap->L,-1,1);
             break;
         case LUA_ERRRUN:
             break;
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_pinfo.c wireshark-1.12.3/epan/wslua/wslua_pinfo.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_pinfo.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_pinfo.c	2015-01-24 11:59:59.497264428 -0300
@@ -81,8 +81,8 @@
 
     if (!nstime) return 0;
 
-    nstime->secs = (time_t) luaL_optint(L,WSLUA_OPTARG_NSTime_new_SECONDS,0);
-    nstime->nsecs = luaL_optint(L,WSLUA_OPTARG_NSTime_new_NSECONDS,0);
+    nstime->secs = (time_t) (int)luaL_optinteger(L,WSLUA_OPTARG_NSTime_new_SECONDS,0);
+    nstime->nsecs = (int)luaL_optinteger(L,WSLUA_OPTARG_NSTime_new_NSECONDS,0);
 
     pushNSTime(L,nstime);
 
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_proto.c wireshark-1.12.3/epan/wslua/wslua_proto.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_proto.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_proto.c	2015-01-24 11:59:59.519263883 -0300
@@ -754,7 +754,7 @@
     const gchar *blob = luaL_optstring(L,WSLUA_OPTARG_ProtoField_new_DESCR,NULL);
 
     if (lua_isnumber(L,WSLUA_ARG_ProtoField_new_TYPE)) {
-        type = (enum ftenum)luaL_checkint(L,WSLUA_ARG_ProtoField_new_TYPE);
+        type = (enum ftenum)luaL_checkinteger(L,WSLUA_ARG_ProtoField_new_TYPE);
     } else {
         type = get_ftenum(luaL_checkstring(L,WSLUA_ARG_ProtoField_new_TYPE));
     }
@@ -762,7 +762,7 @@
     abbr = check_field_name(L,WSLUA_ARG_ProtoField_new_ABBR,type);
 
     if (lua_isnumber(L, WSLUA_OPTARG_ProtoField_new_BASE)) {
-        base = luaL_optint(L, WSLUA_OPTARG_ProtoField_new_BASE, BASE_NONE);
+        base = (int)luaL_optinteger(L, WSLUA_OPTARG_ProtoField_new_BASE, BASE_NONE);
     } else {
         base = string_to_base(luaL_optstring(L, WSLUA_OPTARG_ProtoField_new_BASE, "BASE_NONE"));
     }
@@ -899,7 +899,7 @@
     ProtoField f;
     const gchar* abbr = check_field_name(L,1,type);
     const gchar* name = luaL_optstring(L,2,abbr);
-    unsigned base = luaL_optint(L, 3, BASE_DEC);
+    unsigned base = (int)luaL_optinteger(L, 3, BASE_DEC);
     value_string* vs32 = NULL;
     val64_string* vs64 = NULL;
     guint32 mask = wslua_optguint32(L,5,0);
@@ -1071,7 +1071,7 @@
     ProtoField f;
     const gchar* abbr = check_field_name(L,1,type);
     const gchar* name = luaL_optstring(L,2,abbr);
-    unsigned base = luaL_optint(L, 3, BASE_NONE);
+    unsigned base = (int)luaL_optinteger(L, 3, BASE_NONE);
     true_false_string* tfs = NULL;
     guint32 mask = wslua_optguint32(L,5,0);
     const gchar* blob = luaL_optstring(L,6,NULL);
@@ -1130,7 +1130,7 @@
     ProtoField f;
     const gchar* abbr = NULL;
     const gchar* name = luaL_optstring(L,2,abbr);
-    unsigned base = luaL_optint(L,3,ABSOLUTE_TIME_LOCAL);
+    unsigned base = (int)luaL_optinteger(L,3,ABSOLUTE_TIME_LOCAL);
     const gchar* blob = NULL;
 
     if (type == FT_ABSOLUTE_TIME) {
@@ -1412,8 +1412,8 @@
     ProtoExpert pe    = NULL;
     const gchar* abbr = wslua_checkstring_only(L,WSLUA_ARG_ProtoExpert_new_ABBR);
     const gchar* text = wslua_checkstring_only(L,WSLUA_ARG_ProtoExpert_new_TEXT);
-    int group         = luaL_checkint         (L, WSLUA_ARG_ProtoExpert_new_GROUP);
-    int severity      = luaL_checkint         (L, WSLUA_ARG_ProtoExpert_new_SEVERITY);
+    int group         = luaL_checkinteger         (L, WSLUA_ARG_ProtoExpert_new_GROUP);
+    int severity      = luaL_checkinteger         (L, WSLUA_ARG_ProtoExpert_new_SEVERITY);
 
     pe = g_new(wslua_expert_field_t,1);
 
@@ -2164,8 +2164,8 @@
                                                   (defaults to `base.DEC`). */
     const gchar* name = (const gchar*)luaL_checkstring(L,WSLUA_ARG_DissectorTable_new_TABLENAME);
     const gchar* ui_name = (const gchar*)luaL_optstring(L,WSLUA_OPTARG_DissectorTable_new_UINAME,name);
-    enum ftenum type = (enum ftenum)luaL_optint(L,WSLUA_OPTARG_DissectorTable_new_TYPE,FT_UINT32);
-    unsigned base = (unsigned)luaL_optint(L,WSLUA_OPTARG_DissectorTable_new_BASE,BASE_DEC);
+    enum ftenum type = (enum ftenum)luaL_optinteger(L,WSLUA_OPTARG_DissectorTable_new_TYPE,FT_UINT32);
+    unsigned base = (unsigned)luaL_optinteger(L,WSLUA_OPTARG_DissectorTable_new_BASE,BASE_DEC);
 
     if(!(name && ui_name)) return 0;
 
@@ -2321,7 +2321,7 @@
         g_free (pattern);
     } else if ( type == FT_UINT32 || type == FT_UINT16 || type ==  FT_UINT8 || type ==  FT_UINT24 ) {
         if (lua_isnumber(L, WSLUA_ARG_DissectorTable_add_PATTERN)) {
-            int port = luaL_checkint(L, WSLUA_ARG_DissectorTable_add_PATTERN);
+            int port = (int)luaL_checkinteger(L, WSLUA_ARG_DissectorTable_add_PATTERN);
             dissector_add_uint(dt->name, port, handle);
         } else {
             /* Not a number, try as range */
@@ -2383,7 +2383,7 @@
         dissector_add_string(dt->name, pattern,handle);
     } else if ( type == FT_UINT32 || type == FT_UINT16 || type ==  FT_UINT8 || type ==  FT_UINT24 ) {
         if (lua_isnumber(L, WSLUA_ARG_DissectorTable_set_PATTERN)) {
-            int port = luaL_checkint(L, WSLUA_ARG_DissectorTable_set_PATTERN);
+            int port = (int)luaL_checkinteger(L, WSLUA_ARG_DissectorTable_set_PATTERN);
             dissector_delete_all(dt->name, handle);
             dissector_add_uint(dt->name, port, handle);
         } else {
@@ -2437,7 +2437,7 @@
         g_free (pattern);
     } else if ( type == FT_UINT32 || type == FT_UINT16 || type ==  FT_UINT8 || type ==  FT_UINT24 ) {
         if (lua_isnumber(L, WSLUA_ARG_DissectorTable_remove_PATTERN)) {
-          int port = luaL_checkint(L, WSLUA_ARG_DissectorTable_remove_PATTERN);
+          int port = (int)luaL_checkinteger(L, WSLUA_ARG_DissectorTable_remove_PATTERN);
           dissector_delete_uint(dt->name, port, handle);
         } else {
             /* Not a number, try as range */
@@ -2518,7 +2518,7 @@
                 handled = TRUE;
 
         } else if ( type == FT_UINT32 || type == FT_UINT16 || type ==  FT_UINT8 || type ==  FT_UINT24 ) {
-            int port = luaL_checkint(L, WSLUA_ARG_DissectorTable_try_PATTERN);
+            int port = (int)luaL_checkinteger(L, WSLUA_ARG_DissectorTable_try_PATTERN);
 
             if (dissector_try_uint(dt->table,port,tvb->ws_tvb,pinfo->ws_pinfo,ti->tree))
                 handled = TRUE;
@@ -2565,7 +2565,7 @@
 
         handle = dissector_get_string_handle(dt->table,pattern);
     } else if ( type == FT_UINT32 || type == FT_UINT16 || type ==  FT_UINT8 || type ==  FT_UINT24 ) {
-        int port = luaL_checkint(L, WSLUA_ARG_DissectorTable_try_PATTERN);
+        int port = (int)luaL_checkinteger(L, WSLUA_ARG_DissectorTable_try_PATTERN);
         handle = dissector_get_uint_handle(dt->table,port);
     }
 
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_struct.c wireshark-1.12.3/epan/wslua/wslua_struct.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_struct.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_struct.c	2015-01-24 11:59:59.525263734 -0300
@@ -462,7 +462,7 @@
   const char *fmt = wslua_checkstring_only(L, WSLUA_ARG_Struct_unpack_FORMAT);
   size_t ld;
   const char *data = wslua_checklstring_only(L, WSLUA_ARG_Struct_unpack_STRUCT, &ld);
-  size_t pos = luaL_optinteger(L, WSLUA_OPTARG_Struct_unpack_BEGIN, 1) - 1;
+  size_t pos = (int)luaL_optinteger(L, WSLUA_OPTARG_Struct_unpack_BEGIN, 1) - 1;
   defaultoptions(&h);
   lua_settop(L, 2);
   while (*fmt) {
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_tree.c wireshark-1.12.3/epan/wslua/wslua_tree.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_tree.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_tree.c	2015-01-24 11:59:59.530263610 -0300
@@ -521,8 +521,8 @@
                                                             `PI_WARN`, or `PI_ERROR`. */
 #define WSLUA_OPTARG_TreeItem_add_expert_info_TEXT 4 /* The text for the expert info display. */
     TreeItem ti           = checkTreeItem(L,1);
-    int group             = luaL_optint(L,WSLUA_OPTARG_TreeItem_add_expert_info_GROUP,PI_DEBUG);
-    int severity          = luaL_optint(L,WSLUA_OPTARG_TreeItem_add_expert_info_SEVERITY,PI_CHAT);
+    int group             = (int)luaL_optinteger(L,WSLUA_OPTARG_TreeItem_add_expert_info_GROUP,PI_DEBUG);
+    int severity          = (int)luaL_optinteger(L,WSLUA_OPTARG_TreeItem_add_expert_info_SEVERITY,PI_CHAT);
     expert_field* ei_info = wslua_get_expert_field(group, severity);
     const gchar* str;
 
@@ -656,7 +656,7 @@
     */
 #define WSLUA_ARG_TreeItem_set_len_LEN 2 /* The length to be used. */
     TreeItem ti = checkTreeItem(L,1);
-    gint len = luaL_checkint(L,WSLUA_ARG_TreeItem_set_len_LEN);
+    gint len = (int)luaL_checkinteger(L,WSLUA_ARG_TreeItem_set_len_LEN);
 
     proto_item_set_len(ti->item, len);
 
diff -Naur wireshark-1.12.3.orig/epan/wslua/wslua_tvb.c wireshark-1.12.3/epan/wslua/wslua_tvb.c
--- wireshark-1.12.3.orig/epan/wslua/wslua_tvb.c	2015-01-07 17:19:44.000000000 -0300
+++ wireshark-1.12.3/epan/wslua/wslua_tvb.c	2015-01-24 11:59:59.542263313 -0300
@@ -154,7 +154,7 @@
 #define WSLUA_ARG_ByteArray_set_size_SIZE 2 /* New size of the array. */
 
     ByteArray ba = checkByteArray(L,1);
-    int siz = luaL_checkint(L,WSLUA_ARG_ByteArray_set_size_SIZE);
+    int siz = (int)luaL_checkinteger(L,WSLUA_ARG_ByteArray_set_size_SIZE);
     guint8* padding;
 
     if (siz < 0) {
@@ -177,8 +177,8 @@
 #define WSLUA_ARG_ByteArray_set_index_INDEX 2 /* The position of the byte to be set. */
 #define WSLUA_ARG_ByteArray_set_index_VALUE 3 /* The char value to set [0-255]. */
     ByteArray ba = checkByteArray(L,1);
-    int idx = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_INDEX);
-    int v = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_VALUE);
+    int idx = (int)luaL_checkinteger(L,WSLUA_ARG_ByteArray_set_index_INDEX);
+    int v = (int)luaL_checkinteger(L,WSLUA_ARG_ByteArray_set_index_VALUE);
 
     if (idx == 0 && ! g_str_equal(luaL_optstring(L,2,""),"0") ) {
         luaL_argerror(L,2,"bad index");
@@ -205,7 +205,7 @@
 	/* Get the value of a byte in a `ByteArray`. */
 #define WSLUA_ARG_ByteArray_get_index_INDEX 2 /* The position of the byte to get. */
     ByteArray ba = checkByteArray(L,1);
-    int idx = luaL_checkint(L,WSLUA_ARG_ByteArray_get_index_INDEX);
+    int idx = (int)luaL_checkinteger(L,WSLUA_ARG_ByteArray_get_index_INDEX);
 
     if (idx == 0 && ! g_str_equal(luaL_optstring(L,2,""),"0") ) {
         luaL_argerror(L,2,"bad index");
@@ -235,8 +235,8 @@
 #define WSLUA_ARG_ByteArray_set_index_OFFSET 2 /* The position of the first byte (0=first). */
 #define WSLUA_ARG_ByteArray_set_index_LENGTH 3 /* The length of the segment. */
     ByteArray ba = checkByteArray(L,1);
-    int offset = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_OFFSET);
-    int len = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_LENGTH);
+    int offset = (int)luaL_checkinteger(L,WSLUA_ARG_ByteArray_set_index_OFFSET);
+    int len = (int)luaL_checkinteger(L,WSLUA_ARG_ByteArray_set_index_LENGTH);
     ByteArray sub;
 
     if ((offset + len) > (int)ba->len || offset < 0 || len < 1) {
@@ -277,7 +277,7 @@
 #define WSLUA_OPTARG_ByteArray_raw_OFFSET 2 /* The position of the first byte (default=0/first). */
 #define WSLUA_OPTARG_ByteArray_raw_LENGTH 3 /* The length of the segment to get (default=all). */
     ByteArray ba = checkByteArray(L,1);
-    guint offset = (guint) luaL_optint(L,WSLUA_OPTARG_ByteArray_raw_OFFSET,0);
+    guint offset = (guint) (int)luaL_optinteger(L,WSLUA_OPTARG_ByteArray_raw_OFFSET,0);
     int len;
 
     if (!ba) return 0;
@@ -286,7 +286,7 @@
         return 0;
     }
 
-    len = luaL_optint(L,WSLUA_OPTARG_ByteArray_raw_LENGTH, ba->len - offset);
+    len = (int)luaL_optinteger(L,WSLUA_OPTARG_ByteArray_raw_LENGTH, ba->len - offset);
     if ((len < 0) || ((guint)len > (ba->len - offset)))
         len = ba->len - offset;
 
@@ -546,7 +546,7 @@
        offset is beyond the end of the `Tvb`. */
 #define Tvb_reported_length_remaining_OFFSET 2 /* offset */
     Tvb tvb = checkTvb(L,1);
-    int offset = luaL_optint(L, Tvb_reported_length_remaining_OFFSET, 0);
+    int offset = (int)luaL_optinteger(L, Tvb_reported_length_remaining_OFFSET, 0);
 
     lua_pushnumber(L,tvb_reported_length_remaining(tvb->ws_tvb, offset));
     WSLUA_RETURN(1); /* The captured length of the `Tvb`. */
@@ -615,8 +615,8 @@
 #define WSLUA_OPTARG_Tvb_range_LENGTH 3 /* The length (in octets) of the range. Defaults to until the end of the `Tvb`. */
 
     Tvb tvb = checkTvb(L,1);
-    int offset = luaL_optint(L,WSLUA_OPTARG_Tvb_range_OFFSET,0);
-    int len = luaL_optint(L,WSLUA_OPTARG_Tvb_range_LENGTH,-1);
+    int offset = (int)luaL_optinteger(L,WSLUA_OPTARG_Tvb_range_OFFSET,0);
+    int len = (int)luaL_optinteger(L,WSLUA_OPTARG_Tvb_range_LENGTH,-1);
 
     if (push_TvbRange(L,tvb->ws_tvb,offset,len)) {
         WSLUA_RETURN(1); /* The TvbRange */
@@ -630,8 +630,8 @@
 #define WSLUA_OPTARG_Tvb_raw_OFFSET 2 /* The position of the first byte (default=0/first). */
 #define WSLUA_OPTARG_Tvb_raw_LENGTH 3 /* The length of the segment to get (default=all). */
     Tvb tvb = checkTvb(L,1);
-    int offset = luaL_optint(L,WSLUA_OPTARG_Tvb_raw_OFFSET,0);
-    int len = luaL_optint(L,WSLUA_OPTARG_Tvb_raw_LENGTH,-1);
+    int offset = (int)luaL_optinteger(L,WSLUA_OPTARG_Tvb_raw_OFFSET,0);
+    int len = (int)luaL_optinteger(L,WSLUA_OPTARG_Tvb_raw_LENGTH,-1);
 
     if (!tvb) return 0;
     if (tvb->expired) {
@@ -1080,7 +1080,7 @@
 #define WSLUA_OPTARG_TvbRange_nstime_ENCODING 2 /* An optional ENC_* encoding value to use */
     TvbRange tvbr = checkTvbRange(L,1);
     NSTime nstime;
-    const guint encoding = luaL_optint(L, WSLUA_OPTARG_TvbRange_nstime_ENCODING, 0);
+    const guint encoding = (int)luaL_optinteger(L, WSLUA_OPTARG_TvbRange_nstime_ENCODING, 0);
 
     if ( !(tvbr && tvbr->tvb)) return 0;
     if (tvbr->tvb->expired) {
@@ -1161,7 +1161,7 @@
 	/* Obtain a string from a `TvbRange`. */
 #define WSLUA_OPTARG_TvbRange_string_ENCODING 2 /* The encoding to use. Defaults to ENC_ASCII. */
     TvbRange tvbr = checkTvbRange(L,1);
-    guint encoding = (guint)luaL_optint(L,WSLUA_OPTARG_TvbRange_string_ENCODING, ENC_ASCII|ENC_NA);
+    guint encoding = (lua_Unsigned)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_string_ENCODING, ENC_ASCII|ENC_NA);
 
     if ( !(tvbr && tvbr->tvb)) return 0;
     if (tvbr->tvb->expired) {
@@ -1205,7 +1205,7 @@
 	/* Obtain a zero terminated string from a `TvbRange`. */
 #define WSLUA_OPTARG_TvbRange_stringz_ENCODING 2 /* The encoding to use. Defaults to ENC_ASCII. */
     TvbRange tvbr = checkTvbRange(L,1);
-    guint encoding = (guint)luaL_optint(L,WSLUA_OPTARG_TvbRange_stringz_ENCODING, ENC_ASCII|ENC_NA);
+    guint encoding = (lua_Unsigned)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_stringz_ENCODING, ENC_ASCII|ENC_NA);
     gint offset;
     gunichar2 uchar;
 
@@ -1249,7 +1249,7 @@
            The size of the string includes the terminating zero. */
 #define WSLUA_OPTARG_TvbRange_strsize_ENCODING 2 /* The encoding to use. Defaults to ENC_ASCII. */
     TvbRange tvbr = checkTvbRange(L,1);
-    guint encoding = (guint)luaL_optint(L,WSLUA_OPTARG_TvbRange_strsize_ENCODING, ENC_ASCII|ENC_NA);
+    guint encoding = (lua_Unsigned)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_strsize_ENCODING, ENC_ASCII|ENC_NA);
     gint offset;
     gunichar2 uchar;
 
@@ -1349,7 +1349,7 @@
 #define WSLUA_OPTARG_TvbRange_bytes_ENCODING 2 /* An optional ENC_* encoding value to use */
     TvbRange tvbr = checkTvbRange(L,1);
     GByteArray* ba;
-    const guint encoding = luaL_optint(L, WSLUA_OPTARG_TvbRange_bytes_ENCODING, 0);
+    const guint encoding = (int)luaL_optinteger(L, WSLUA_OPTARG_TvbRange_bytes_ENCODING, 0);
 
     if ( !(tvbr && tvbr->tvb)) return 0;
     if (tvbr->tvb->expired) {
@@ -1392,8 +1392,8 @@
 #define WSLUA_OPTARG_TvbRange_bitfield_LENGTH 3 /* The length (in bits) of the field. Defaults to 1. */
 
     TvbRange tvbr = checkTvbRange(L,1);
-    int pos = luaL_optint(L,WSLUA_OPTARG_TvbRange_bitfield_POSITION,0);
-    int len = luaL_optint(L,WSLUA_OPTARG_TvbRange_bitfield_LENGTH,1);
+    int pos = (int)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_bitfield_POSITION,0);
+    int len = (int)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_bitfield_LENGTH,1);
 
     if (!(tvbr && tvbr->tvb)) return 0;
     if (tvbr->tvb->expired) {
@@ -1430,12 +1430,12 @@
 #define WSLUA_OPTARG_TvbRange_range_LENGTH 3 /* The length (in octets) of the range. Defaults to until the end of the `TvbRange`. */
 
     TvbRange tvbr = checkTvbRange(L,1);
-    int offset = luaL_optint(L,WSLUA_OPTARG_TvbRange_range_OFFSET,0);
+    int offset = (int)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_range_OFFSET,0);
     int len;
 
     if (!(tvbr && tvbr->tvb)) return 0;
 
-    len = luaL_optint(L,WSLUA_OPTARG_TvbRange_range_LENGTH,tvbr->len-offset);
+    len = (int)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_range_LENGTH,tvbr->len-offset);
 
     if (tvbr->tvb->expired) {
         luaL_error(L,"expired tvb");
@@ -1526,8 +1526,8 @@
 #define WSLUA_OPTARG_TvbRange_raw_OFFSET 2 /* The position of the first byte (default=0/first). */
 #define WSLUA_OPTARG_TvbRange_raw_LENGTH 3 /* The length of the segment to get (default=all). */
     TvbRange tvbr = checkTvbRange(L,1);
-    int offset = luaL_optint(L,WSLUA_OPTARG_TvbRange_raw_OFFSET,0);
-    int len = luaL_optint(L,WSLUA_OPTARG_TvbRange_raw_LENGTH,-1);
+    int offset = (int)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_raw_OFFSET,0);
+    int len = (int)luaL_optinteger(L,WSLUA_OPTARG_TvbRange_raw_LENGTH,-1);
 
     if (!tvbr || !tvbr->tvb) return 0;
     if (tvbr->tvb->expired) {
