]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: lua: Get rid of obsolete (size_t *) cast in hlua_lua2(smp|arg)
authorTim Duesterhus <tim@bastelstu.be>
Sun, 29 Sep 2019 21:03:08 +0000 (23:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 30 Sep 2019 02:11:36 +0000 (04:11 +0200)
This was required for the `chunk` API (`data` was an int), but is not
required with the `buffer` API.

src/hlua.c

index be959d847dd493d2681d0d7b6d31bf82fe8aac43..bc6c7f767567c30bf8dd86b30acde04232e9768c 100644 (file)
@@ -419,7 +419,7 @@ static int hlua_lua2arg(lua_State *L, int ud, struct arg *arg)
 
        case LUA_TSTRING:
                arg->type = ARGT_STR;
-               arg->data.str.area = (char *)lua_tolstring(L, ud, (size_t *)&arg->data.str.data);
+               arg->data.str.area = (char *)lua_tolstring(L, ud, &arg->data.str.data);
                /* We don't know the actual size of the underlying allocation, so be conservative. */
                arg->data.str.size = arg->data.str.data;
                arg->data.str.head = 0;
@@ -562,7 +562,7 @@ static int hlua_lua2smp(lua_State *L, int ud, struct sample *smp)
        case LUA_TSTRING:
                smp->data.type = SMP_T_STR;
                smp->flags |= SMP_F_CONST;
-               smp->data.u.str.area = (char *)lua_tolstring(L, ud, (size_t *)&smp->data.u.str.data);
+               smp->data.u.str.area = (char *)lua_tolstring(L, ud, &smp->data.u.str.data);
                /* We don't know the actual size of the underlying allocation, so be conservative. */
                smp->data.u.str.size = smp->data.u.str.data;
                smp->data.u.str.head = 0;