Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
szysas committed Aug 14, 2024
1 parent 35dbe3e commit b1558de
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 4 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ allprojects {
}

kotlin {
compilerOptions.jvmTarget.set(JvmTarget.JVM_1_8)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.add("-Werror")
}
}

tasks {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls)
* Copyright (c) 2022-2024 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls)
* SPDX-License-Identifier: Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -133,7 +133,7 @@ open class NettyBenchmark {
"direct" -> PooledByteBufAllocator(true)
"unpooled" -> UnpooledByteBufAllocator(false)
"heap" -> PooledByteBufAllocator(false)
"heap-8kb" -> PooledByteBufAllocator(false, 2, 2, 8192, 1)
"heap-8kb" -> PooledByteBufAllocator(false, 2, 2, 8192, 1, 256, 64, false)
// Note: max order is set to 2 so that allocated single byte[] is 8kB, with default one it is 4MB and slows down drastically performance

else -> throw IllegalArgumentException()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls)
* Copyright (c) 2022-2024 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls)
* SPDX-License-Identifier: Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@ internal class CompletableQueue<T> {

@Synchronized
fun add(obj: T) {
if (!queue.isEmpty() && !queue.first.isDone) {
if (!queue.isEmpty() && !queue.first().isDone) {
queue.removeFirst().complete(obj)
} else {
queue.addLast(CompletableFuture.completedFuture(obj))
Expand All @@ -33,7 +33,7 @@ internal class CompletableQueue<T> {

@Synchronized
fun poll(): CompletableFuture<T> {
if (!queue.isEmpty() && queue.first.isDone) {
if (!queue.isEmpty() && queue.first().isDone) {
return queue.removeFirst()
}
val promise = CompletableFuture<T>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls)
* Copyright (c) 2022-2024 kotlin-mbedtls contributors (https://github.com/open-coap/kotlin-mbedtls)
* SPDX-License-Identifier: Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -162,7 +162,6 @@ class DtlsTransmitter private constructor(
}

@JvmStatic
@JvmOverloads
fun create(dest: InetSocketAddress, sslSession: SslSession, cnnTransmitter: Transport<ByteBuffer>): DtlsTransmitter {
return DtlsTransmitter(dest, cnnTransmitter, sslSession, newSingleExecutor())
}
Expand Down

0 comments on commit b1558de

Please sign in to comment.