Skip to content

Commit

Permalink
diktat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
icemachined committed Oct 25, 2023
1 parent d54dd98 commit 83b1710
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kotlin {
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}

val targetNames = nativeTargets.map{ it.name }.filter { !currentTargetName.equals(it) }.toList()
val targetNames = nativeTargets.map { it.name }.filterNot { it == currentTargetName }.toList()
tasks.matching { task ->
!(targetNames.find {
task.name.contains(it, true)
Expand Down
5 changes: 3 additions & 2 deletions kafka-client-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ fun linkProperExecutable(os: org.gradle.nativeplatform.platform.internal.Default
os.isLinux -> tasks.getByName("linkReleaseExecutableLinuxX64")
os.isWindows -> tasks.getByName("linkReleaseExecutableMingwX64")
os.isMacOsX ->
if (getCurrentArchitecture().isArm)
if (getCurrentArchitecture().isArm) {
tasks.getByName("linkReleaseExecutableMacosArm64")
else
} else {
tasks.getByName("linkReleaseExecutableMacosX64")
}
else -> throw GradleException("Unknown operating system $os")
}
project.tasks.register("linkReleaseExecutableMultiplatform") {
Expand Down
2 changes: 0 additions & 2 deletions kafka-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ kotlin {
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}

println("nativeTarget = ${nativeTarget.name}")

nativeTarget.apply {
compilations.getByName("main") {
cinterops {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
package com.icemachined.kafka.clients

import com.icemachined.kafka.common.*

import kotlinx.cinterop.*
import kotlinx.coroutines.delay
import librdkafka.*
import platform.posix.size_t
import platform.posix.stdout

import kotlin.native.concurrent.freeze
import kotlinx.cinterop.*
import kotlinx.coroutines.delay

typealias KafkaNativeProperties = Map<String, String>

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,11 @@ internal fun rebalanceCallback(
}
}

error?.let {
logError("rebalanceCallback", "incremental assign failure: ${rd_kafka_error_string(it)?.toKString()}")
rd_kafka_error_destroy(it)
} ?: if (returnError != RD_KAFKA_RESP_ERR_NO_ERROR) {
if (error != null) {
logError("rebalanceCallback", "incremental assign failure: ${rd_kafka_error_string(error)?.toKString()}")
rd_kafka_error_destroy(error)
} else if (returnError != RD_KAFKA_RESP_ERR_NO_ERROR) {
logError("rebalanceCallback", "assign failure: ${rd_kafka_err2str(returnError)?.toKString()}")
} else {

}

}

0 comments on commit 83b1710

Please sign in to comment.