Mercurial > pub > dyncall > bindings
annotate lua/luadyncall/test/test_intutils.lua @ 37:8c8f848131c6
- version bump
- better doc
- made calling convention mode reset by default, as only way to specify convention used is via signature string
author | Tassilo Philipp |
---|---|
date | Mon, 13 Apr 2020 20:08:54 +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 |