]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/lua: remove lua_int8 feature
authorJason Ish <jason.ish@oisf.net>
Tue, 30 Apr 2024 22:45:18 +0000 (16:45 -0600)
committerJason Ish <jason.ish@oisf.net>
Mon, 27 May 2024 22:00:17 +0000 (16:00 -0600)
Now that we're fixed to Lua 5.4, the integer size is always 8.

configure.ac
rust/Cargo.toml.in
rust/src/lua.rs

index 242862722a977463e260acb924c9528e7ada2788..c58cf7d869d64e4ea91cf830de98ebced5f2ac6c 100644 (file)
   # TODO: Update the code to not require this.
     AC_DEFINE([HAVE_LUA], [1], [lua support available])
     AM_CONDITIONAL([HAVE_LUA], [true])
-    AC_SUBST([LUA_INT8], ["lua_int8"])
 
   # libmaxminddb
     AC_ARG_ENABLE(geoip,
index afb1060af12388df1c8498b0a9301abf1e90ee3f..65f2a7523a9abe5d8121cf89032c14dbf8dffa1f 100644 (file)
@@ -18,7 +18,6 @@ debug = true
 
 [features]
 lua = []
-lua_int8 = ["lua"]
 strict = []
 debug = []
 debug-validate = []
index 4fce2a824944fd3c99b6e29eb40e95d81f843b3d..33dfe375f4bdaa50e0eeb8c65abf190ce55df71a 100644 (file)
@@ -21,12 +21,6 @@ use std::os::raw::c_char;
 use std::os::raw::c_int;
 use std::os::raw::c_long;
 
-#[cfg(feature = "lua_int8")]
-type LuaInteger = i64;
-
-#[cfg(not(feature = "lua_int8"))]
-type LuaInteger = i32;
-
 /// The Rust place holder for lua_State.
 pub enum CLuaState {}
 
@@ -34,7 +28,7 @@ extern {
     fn lua_createtable(lua: *mut CLuaState, narr: c_int, nrec: c_int);
     fn lua_settable(lua: *mut CLuaState, idx: c_long);
     fn lua_pushlstring(lua: *mut CLuaState, s: *const c_char, len: usize);
-    fn lua_pushinteger(lua: *mut CLuaState, n: LuaInteger);
+    fn lua_pushinteger(lua: *mut CLuaState, n: i64);
 }
 
 pub struct LuaState {
@@ -63,7 +57,7 @@ impl LuaState {
 
     pub fn pushinteger(&self, val: i64) {
         unsafe {
-            lua_pushinteger(self.lua, val as LuaInteger);
+            lua_pushinteger(self.lua, val);
         }
     }
 }