summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2020-05-29 17:00:28 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2020-05-29 17:00:28 +0200
commitb0203b3160f2a39c3afe549fd34a513f71532fc3 (patch)
treea1df129ac90004e59dcfe1bdda47cca4275f70a6
parent5197200ac1d49366f205a62a09a377fdece62ff9 (diff)
bindings/luajit/eolian: get rid of using bitops
-rw-r--r--src/bindings/luajit/eolian.lua24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 7bd8f96894..e9001dbc66 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -2,7 +2,6 @@
2-- For use with Elua 2-- For use with Elua
3 3
4local ffi = require("ffi") 4local ffi = require("ffi")
5local bit = require("bit")
6 5
7ffi.cdef [[ 6ffi.cdef [[
8 void eina_stringshare_del(const char *str); 7 void eina_stringshare_del(const char *str);
@@ -1564,22 +1563,21 @@ M.expression_type = {
1564local etype = M.expression_type 1563local etype = M.expression_type
1565 1564
1566M.expression_mask = { 1565M.expression_mask = {
1567 SINT = bit.lshift(1, 0), 1566 SINT = 2 ^ 0,
1568 UINT = bit.lshift(1, 1), 1567 UINT = 2 ^ 1,
1569 FLOAT = bit.lshift(1, 2), 1568 FLOAT = 2 ^ 2,
1570 BOOL = bit.lshift(1, 3), 1569 BOOL = 2 ^ 3,
1571 STRING = bit.lshift(1, 4), 1570 STRING = 2 ^ 4,
1572 CHAR = bit.lshift(1, 5), 1571 CHAR = 2 ^ 5,
1573 NULL = bit.lshift(1, 6) 1572 NULL = 2 ^ 6
1574} 1573}
1575 1574
1576local emask = M.expression_mask 1575local emask = M.expression_mask
1577 1576
1578emask.INT = bit.bor(emask.SINT , emask.UINT ) 1577emask.INT = emask.SINT + emask.UINT
1579emask.SIGNED = bit.bor(emask.SINT , emask.FLOAT) 1578emask.SIGNED = emask.SINT + emask.FLOAT
1580emask.NUMBER = bit.bor(emask.INT , emask.FLOAT) 1579emask.NUMBER = emask.INT + emask.FLOAT
1581emask.ALL = bit.bor(emask.NUMBER, emask.BOOL, 1580emask.ALL = emask.NUMBER + emask.BOOL + emask.STRING + emask.CHAR + emask.NULL
1582 emask.STRING, emask.CHAR, emask.NULL)
1583 1581
1584local value_con = { 1582local value_con = {
1585 [etype.INT ] = function(v) return tonumber(v.value.i ) end, 1583 [etype.INT ] = function(v) return tonumber(v.value.i ) end,