aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-30 11:32:54 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-30 11:32:54 +0100
commitb0bc4a9e9c89e4976e7a14f18d0595ec2b6e8213 (patch)
tree51b139d12ff2fcc59c00d32a5fcd46952a4b841b /src/lua
parent9f8bcbd508f081c79d75bc32b81cfb8ac09c4b1c (diff)
downloadrspamd-b0bc4a9e9c89e4976e7a14f18d0595ec2b6e8213.tar.gz
rspamd-b0bc4a9e9c89e4976e7a14f18d0595ec2b6e8213.zip
[Rework] Use floating point arithmetics in Rspamd expressions
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_expression.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lua/lua_expression.c b/src/lua/lua_expression.c
index 7bacf5a75..7975cc227 100644
--- a/src/lua/lua_expression.c
+++ b/src/lua/lua_expression.c
@@ -98,7 +98,7 @@ static const struct luaL_reg exprlib_f[] = {
static rspamd_expression_atom_t * lua_atom_parse (const gchar *line, gsize len,
rspamd_mempool_t *pool, gpointer ud, GError **err);
-static gint lua_atom_process (gpointer input, rspamd_expression_atom_t *atom);
+static gdouble lua_atom_process (gpointer input, rspamd_expression_atom_t *atom);
static const struct rspamd_atom_subr lua_atom_subr = {
.parse = lua_atom_parse,
@@ -165,11 +165,11 @@ lua_atom_parse (const gchar *line, gsize len,
return atom;
}
-static gint
+static gdouble
lua_atom_process (gpointer input, rspamd_expression_atom_t *atom)
{
struct lua_expression *e = (struct lua_expression *)atom->data;
- gint ret = 0;
+ gdouble ret = 0;
lua_rawgeti (e->L, LUA_REGISTRYINDEX, e->process_idx);
lua_pushlstring (e->L, atom->str, atom->len);
@@ -191,7 +191,7 @@ static gint
lua_expr_process (lua_State *L)
{
struct lua_expression *e = rspamd_lua_expression (L, 1);
- gint res;
+ gdouble res;
gint flags = 0;
if (lua_gettop (L) >= 3) {