From 8bb13b626f3a5d284f50af493f3f7b5566e06586 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 6 Mar 2015 14:36:25 +0000 Subject: [PATCH] elua: more reliable eoid->lua number conversion --- src/bindings/luajit/eo.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua index f26a907031..03303b0fc3 100644 --- a/src/bindings/luajit/eo.lua +++ b/src/bindings/luajit/eo.lua @@ -112,11 +112,8 @@ ffi.cdef [[ extern const Eo_Event_Description _EO_BASE_EVENT_DEL; ]] -local addr_d = ffi.typeof("union { double d; const Eo *p; }") local eo_obj_addr_get = function(x) - local v = addr_d() - v.p = x - return tonumber(v.d) + return tonumber(ffi.cast("intptr_t", x)) end local cutil = require("cutil")