Simplify working with values in interop

* Access primitive interop array elements and struct fields without `.value`
* Simplify C*Var* interop types names
This commit is contained in:
Svyatoslav Scherbina
2017-03-30 17:19:28 +03:00
committed by SvyatoslavScherbina
parent f94a47518a
commit 50c3be3fc2
29 changed files with 1070 additions and 627 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ fun main(args: Array<String>) {
"a", "b".cstr, (-1).toByte(), 2.toShort(), 3, Long.MAX_VALUE, 0.1.toFloat(), 0.2)
memScoped {
val aVar = alloc<CInt32Var>()
val bVar = alloc<CInt32Var>()
val aVar = alloc<IntVar>()
val bVar = alloc<IntVar>()
val sscanfResult = sscanf("42", "%d%d", aVar.ptr, bVar.ptr)
printf("%d %d\n", sscanfResult, aVar.value)
}