From b583e8cd7b1a45fc83b28bba2af1de487a488c9d Mon Sep 17 00:00:00 2001 From: Martin O'Connor Date: Thu, 29 Nov 2018 01:47:24 -0500 Subject: [PATCH] Add toCValues() extension functions to Arrays of unsigned types (#2417) --- .../src/native/kotlin/kotlinx/cinterop/NativeUtils.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt index 0508f462ddd..b3df9278281 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt @@ -59,4 +59,9 @@ fun cValuesOf(vararg elements: UInt): CValues = createValues(elements.size) { index -> this.value = elements[index] } fun cValuesOf(vararg elements: ULong): CValues = - createValues(elements.size) { index -> this.value = elements[index] } \ No newline at end of file + createValues(elements.size) { index -> this.value = elements[index] } + +fun UByteArray.toCValues() = cValuesOf(*this) +fun UShortArray.toCValues() = cValuesOf(*this) +fun UIntArray.toCValues() = cValuesOf(*this) +fun ULongArray.toCValues() = cValuesOf(*this) \ No newline at end of file