From 950bc62c7bc29f9d547ab2d26b7c14999ac92d0e Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Tue, 22 Nov 2016 16:06:51 +0700 Subject: [PATCH] Review feedback, part 1 --- .../org/jetbrains/kotlin/native/interop/indexer/Indexer.kt | 4 +--- Interop/Runtime/src/main/kotlin/kotlin_/cinterop/Types.kt | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt b/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt index 3f9d48b5613..7444013972a 100644 --- a/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt +++ b/Interop/Indexer/src/main/kotlin/org/jetbrains/kotlin/native/interop/indexer/Indexer.kt @@ -182,9 +182,7 @@ private class NativeIndexImpl : NativeIndex() { CXType_ULongLong -> UInt64Type CXType_LongLong -> Int64Type - CXType_Typedef -> { - getTypedef(type) - } + CXType_Typedef -> getTypedef(type) CXType_Record -> RecordType(getStructTypeDecl(type)) CXType_Enum -> EnumType(getEnumTypeDef(type)) diff --git a/Interop/Runtime/src/main/kotlin/kotlin_/cinterop/Types.kt b/Interop/Runtime/src/main/kotlin/kotlin_/cinterop/Types.kt index ff3ec8e7b84..353bd7791f1 100644 --- a/Interop/Runtime/src/main/kotlin/kotlin_/cinterop/Types.kt +++ b/Interop/Runtime/src/main/kotlin/kotlin_/cinterop/Types.kt @@ -84,8 +84,7 @@ class CPointer private constructor(val rawValue: NativePtr) { } override fun toString(): String { - val hex = "%x".format(rawValue) - return "CPointer(raw=0x$hex)" + return "CPointer(raw=0x%x)".format(rawValue) } } @@ -107,7 +106,7 @@ inline val CPointer.pointed: T val CPointer<*>?.rawValue: NativePtr get() = this?.rawValue ?: nativeNullPtr -fun CPointer<*>.reinterpret() = this as CPointer +fun CPointer<*>.reinterpret(): CPointer = CPointer.create(this.rawValue) /** * The [CPointed] without any specified interpretation. @@ -155,7 +154,7 @@ interface CVariable : CPointed { } /** - * The C data which is composed from number of members. + * The C data which is composed from several members. */ interface CAggregate : CPointed