Move Kotlin version to 1.1.4, fix some warnings. (#802)

This commit is contained in:
Nikolay Igotti
2017-08-22 14:50:05 +03:00
committed by GitHub
parent 9402a9c6a2
commit 87f2bed5c8
8 changed files with 16 additions and 11 deletions
@@ -139,10 +139,10 @@ internal fun visitChildren(parent: CValue<CXCursor>, visitor: CursorVisitor) {
val visitorPtr = StableObjPtr.create(visitor)
try {
val clientData = visitorPtr.value
clang_visitChildren(parent, staticCFunction { cursor, parent, clientData ->
@Suppress("NAME_SHADOWING", "UNCHECKED_CAST")
val visitor = StableObjPtr.fromValue(clientData!!).get() as CursorVisitor
visitor(cursor, parent)
clang_visitChildren(parent, staticCFunction { cursorIt, parentIt, clientDataIt ->
@Suppress("UNCHECKED_CAST")
val visitorIt = StableObjPtr.fromValue(clientDataIt!!).get() as CursorVisitor
visitorIt(cursorIt, parentIt)
}, clientData)
} finally {
visitorPtr.dispose()
@@ -345,16 +345,20 @@ internal fun indexTranslationUnit(index: CXIndex, translationUnit: CXTranslation
val indexerCallbacks = alloc<IndexerCallbacks>().apply {
abortQuery = null
diagnostic = null
enteredMainFile = staticCFunction { clientData, mainFile, reserved ->
enteredMainFile = staticCFunction { clientData, mainFile, _ ->
@Suppress("NAME_SHADOWING")
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
indexer.enteredMainFile(mainFile!!)
// We must ensure only interop types exist in function signature.
@Suppress("USELESS_CAST")
null as CXIdxClientFile?
}
ppIncludedFile = staticCFunction { clientData, info ->
@Suppress("NAME_SHADOWING")
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
indexer.ppIncludedFile(info!!.pointed)
// We must ensure only interop types exist in function signature.
@Suppress("USELESS_CAST")
null as CXIdxClientFile?
}
importedASTFile = null
@@ -258,7 +258,7 @@ private fun createStaticCFunctionImpl(
val impl: FfiClosureImpl = when (arity) {
0 -> {
val f = function as () -> Any?
ffiClosureImpl(returnType) { args ->
ffiClosureImpl(returnType) { _ ->
f()
}
}
@@ -123,7 +123,7 @@ class MappingBridgeGeneratorImpl(
val bridgeArguments = mutableListOf<BridgeTypedNativeValue>()
nativeValues.forEachIndexed { index, (type, value) ->
nativeValues.forEachIndexed { _, (type, value) ->
val bridgeArgument = if (type.unwrapTypedefs() is RecordType) {
BridgeTypedNativeValue(BridgedType.NATIVE_PTR, "&$value")
} else {
@@ -25,7 +25,7 @@ private fun ObjCMethod.getKotlinParameterNames(): List<String> {
val result = mutableListOf<String>()
// The names of all parameters except first must depend only on the selector:
this.parameters.forEachIndexed { index, parameter ->
this.parameters.forEachIndexed { index, _ ->
if (index > 0) {
var name = selectorParts[index]
if (name.isEmpty()) {