From 9ef2b353174433844d081172f05d1e93a516c627 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 19 Mar 2015 14:59:15 +0000 Subject: [PATCH] Revert "elua: more reliable eoid->lua number conversion" This reverts commit 8bb13b626f3a5d284f50af493f3f7b5566e06586. Seems like this method is not so reliable after all :) Results in precision loss for Eo IDs, so revert to the old hacky way. --- src/bindings/luajit/eo.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua index 0d84aa24ee..91c3034914 100644 --- a/src/bindings/luajit/eo.lua +++ b/src/bindings/luajit/eo.lua @@ -110,8 +110,11 @@ 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) - return tonumber(ffi.cast("intptr_t", x)) + local v = addr_d() + v.p = x + return tonumber(v.d) end local cutil = require("cutil")