diff options
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_common.h | 2 | ||||
-rw-r--r-- | src/lua/lua_shingles.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h index accc6be86..23bccbd30 100644 --- a/src/lua/lua_common.h +++ b/src/lua/lua_common.h @@ -708,6 +708,8 @@ int rspamd_lua_geti(lua_State *L, int index, int i); #define RSPAMD_PREFIX_INDEX "PREFIX" #define RSPAMD_VERSION_INDEX "VERSION" +#define RSPAMD_LUA_SHINGLE_CLASS "rspamd{shingle}" + #ifdef WITH_LUA_TRACE extern ucl_object_t *lua_traces; #define LUA_TRACE_POINT \ diff --git a/src/lua/lua_shingles.cxx b/src/lua/lua_shingles.cxx index 355a9e7f2..b19a00c08 100644 --- a/src/lua/lua_shingles.cxx +++ b/src/lua/lua_shingles.cxx @@ -18,8 +18,6 @@ #include "shingles.h" #include "fmt/format.h" -#define RSPAMD_SHINGLE_CLASS "rspamd{shingle}" - /*** * @module rspamd_shingle * This module provides methods to work with text shingles @@ -58,9 +56,9 @@ static const struct luaL_reg shinglelib_m[] = { static struct rspamd_shingle * lua_check_shingle(lua_State *L, int pos) { - void *ud = rspamd_lua_check_udata(L, pos, RSPAMD_SHINGLE_CLASS); + void *ud = rspamd_lua_check_udata(L, pos, RSPAMD_LUA_SHINGLE_CLASS); luaL_argcheck(L, ud != nullptr, pos, "'shingle' expected"); - return static_cast<struct rspamd_shingle *>(ud); + return *static_cast<struct rspamd_shingle **>(ud); } static int @@ -117,6 +115,6 @@ lua_shingle_get_string(lua_State *L) void luaopen_shingle(lua_State *L) { - rspamd_lua_new_class(L, RSPAMD_SHINGLE_CLASS, shinglelib_m); + rspamd_lua_new_class(L, RSPAMD_LUA_SHINGLE_CLASS, shinglelib_m); lua_pop(L, 1); } |