Mercurial > pub > dyncall > bindings
annotate lua/luadyncall/test/test_intutils.lua @ 39:b6114d9a9a98
- shdc: more sig chars for call conv mode selection
- readme cleanup
author | Tassilo Philipp |
---|---|
date | Mon, 13 Apr 2020 21:58:48 +0200 |
parents | 0cfcc391201f |
children |
rev | line source |
---|---|
0 | 1 require "intutils" |
2 u64 = intutils.u64 | |
3 i64 = intutils.i64 | |
4 local _print = print | |
5 | |
6 local function print(x) | |
7 local mt = getmetatable(x) | |
8 local tostring = mt.__tostring | |
9 if tostring then | |
10 _print( tostring(x) ) | |
11 else | |
12 _print(x) | |
13 end | |
14 end | |
15 | |
16 x = u64("0x00FFFFFFFFFFFF00") | |
17 y = u64("0xCA000000000000FE") | |
18 z = x + y | |
19 print(x) | |
20 print(y) | |
21 print(z) | |
22 | |
23 x = i64("0x00FFFFFFFFFFFF00") | |
24 y = i64("0xCA000000000000FE") | |
25 z = x + y | |
26 print(x) | |
27 print(y) | |
28 print(z) | |
29 |