elua: more reliable eoid->lua number conversion
authorDaniel Kolesa <d.kolesa@samsung.com>
Fri, 6 Mar 2015 14:36:25 +0000 (14:36 +0000)
committerDaniel Kolesa <d.kolesa@samsung.com>
Fri, 6 Mar 2015 14:36:25 +0000 (14:36 +0000)
src/bindings/luajit/eo.lua

index f26a907..03303b0 100644 (file)
@@ -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")