LuaJIT compatibility.

This commit is contained in:
jussi
2023-07-02 17:44:24 +03:00
parent 0e77452a1b
commit 8ad7254292
23 changed files with 966 additions and 53 deletions

View File

@@ -41,27 +41,6 @@ function utillib.clamp( val, min, max )
return math.max( min, math.min( val, max ) )
end
-- Returns changed value ( value to be changed, index, state( bool ) )
function utillib.setBit( v, i, b )
if b then
return v | 1 << i
else
return v & ~( 1 << i )
end
end
function utillib.toggleBit( v, i )
return v ~ ( 1 << i )
end
function utillib.getBit( v, i )
if v == nil then
return false
end
return v & ( 1 << i ) > 0
end
function utillib.utf8Sub( s, i, j )
i = i or 1
j = j or -1
@@ -114,9 +93,6 @@ function utillib.split( str, sep )
for str in string.gmatch( str, "([^"..sep.."]+)" ) do
table.insert( t, str )
end
-- for s in string.gmatch( str, "([^"..sep.."]+)" ) do
-- table.insert( t, s )
-- end
return t
end