diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index 7f3a96e9e1..108a87625a 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,5 +1,8 @@ + + @@ -12,6 +15,6 @@ \ No newline at end of file diff --git a/.idea/libraries/KotlinRuntime.xml b/.idea/libraries/KotlinRuntime.xml index 2be11653fa..d620efb737 100644 --- a/.idea/libraries/KotlinRuntime.xml +++ b/.idea/libraries/KotlinRuntime.xml @@ -3,15 +3,11 @@ - - - - \ No newline at end of file diff --git a/build.xml b/build.xml index 21501de9da..9dab0e62dd 100644 --- a/build.xml +++ b/build.xml @@ -148,6 +148,8 @@ + + @@ -214,6 +216,8 @@ + + @@ -591,7 +595,6 @@ - @@ -621,7 +624,6 @@ - diff --git a/modules/generator/src/main/kotlin/org/lwjgl/generator/Constants.kt b/modules/generator/src/main/kotlin/org/lwjgl/generator/Constants.kt index 699d2c6f0c..a1558bc9b3 100644 --- a/modules/generator/src/main/kotlin/org/lwjgl/generator/Constants.kt +++ b/modules/generator/src/main/kotlin/org/lwjgl/generator/Constants.kt @@ -123,11 +123,10 @@ class ConstantBlock( try { value = Integer.parseInt(ev.expression) + 1 // decimal formatType = 1 // next values will be decimal - } catch(e: NumberFormatException) { + } catch(_: NumberFormatException) { try { value = Integer.parseInt(ev.expression, 16) + 1 // hex - } catch(e: Exception) { - // ignore + } catch(_: Exception) { } formatType = 0 // next values will be hex } @@ -165,11 +164,10 @@ class ConstantBlock( try { value = java.lang.Byte.parseByte(ev.expression) + 1L // decimal formatType = 1 // next values will be decimal - } catch(e: NumberFormatException) { + } catch(_: NumberFormatException) { try { value = java.lang.Byte.parseByte(ev.expression, 16) + 1L // hex - } catch(e: Exception) { - // ignore + } catch(_: Exception) { } formatType = 0 // next values will be hex } @@ -207,11 +205,10 @@ class ConstantBlock( try { value = java.lang.Long.parseLong(ev.expression) + 1L // decimal formatType = 1 // next values will be decimal - } catch(e: NumberFormatException) { + } catch(_: NumberFormatException) { try { value = java.lang.Long.parseLong(ev.expression, 16) + 1L // hex - } catch(e: Exception) { - // ignore + } catch(_: Exception) { } formatType = 0 // next values will be hex } @@ -325,8 +322,9 @@ class ConstantBlock( private fun PrintWriter.printConstant(constant: Constant, indent: String, alignment: Int) { print("$indent${getConstantName(constant.name)}") - for (i in 0 until alignment - constant.name.length) + (0 until alignment - constant.name.length).forEach { print(' ') + } print(" = ") if (constant is ConstantExpression) { diff --git a/modules/generator/src/main/kotlin/org/lwjgl/generator/FunctionTransforms.kt b/modules/generator/src/main/kotlin/org/lwjgl/generator/FunctionTransforms.kt index 0a6f8f3bfa..2486c6ea4e 100644 --- a/modules/generator/src/main/kotlin/org/lwjgl/generator/FunctionTransforms.kt +++ b/modules/generator/src/main/kotlin/org/lwjgl/generator/FunctionTransforms.kt @@ -106,7 +106,7 @@ private class AutoSizeBytesTransform( else "$expression >> $s" } - } catch(e: NumberFormatException) { + } catch(_: NumberFormatException) { // non-numeric expressions expression = if (type.mapping.let { it === PrimitiveMapping.POINTER || it === PrimitiveMapping.LONG }) "($expression << $byteShift) ${factor.operator} ${if (factor.expression.contains(' ')) "(${factor.expression})" else factor.expression}" diff --git a/modules/generator/src/main/kotlin/org/lwjgl/generator/JNI.kt b/modules/generator/src/main/kotlin/org/lwjgl/generator/JNI.kt index 8c398a300c..a1d5429501 100644 --- a/modules/generator/src/main/kotlin/org/lwjgl/generator/JNI.kt +++ b/modules/generator/src/main/kotlin/org/lwjgl/generator/JNI.kt @@ -132,7 +132,7 @@ object JNI : GeneratorTargetNative(Module.CORE, "JNI") { print("return ") val resultType = it.returnType.jniFunctionType if (it.returnType.abiType != resultType) - print("($resultType)"); + print("($resultType)") } print("((${it.returnType.abiType} (${if (it.callingConvention === CallingConvention.STDCALL) "APIENTRY " else ""}*) ") print(if (it.arguments.isEmpty()) @@ -174,7 +174,7 @@ object JNI : GeneratorTargetNative(Module.CORE, "JNI") { val resultType = it.returnType.jniFunctionType print("$resultType $RESULT = ") if (it.returnType.abiType != resultType) - print("($resultType)"); + print("($resultType)") } print("((${it.returnType.abiType} (${if (it.callingConvention === CallingConvention.STDCALL) "APIENTRY " else ""}*) ") print(it.arguments.asSequence() diff --git a/modules/generator/src/main/kotlin/org/lwjgl/generator/JavaDoc.kt b/modules/generator/src/main/kotlin/org/lwjgl/generator/JavaDoc.kt index a820fce61f..29b663661d 100644 --- a/modules/generator/src/main/kotlin/org/lwjgl/generator/JavaDoc.kt +++ b/modules/generator/src/main/kotlin/org/lwjgl/generator/JavaDoc.kt @@ -228,8 +228,9 @@ private fun paramMultilineAligment(alignment: Int): String { val whitespace = " @param ".length + alignment + 1 return StringBuilder("$t *".length + whitespace).apply { append("$t *") - for (i in 0 until whitespace) + (0 until whitespace).forEach { append(' ') + } }.toString() } @@ -238,8 +239,9 @@ private fun StringBuilder.printParam(name: String, documentation: String, indent append("@param $name") // Align - for (i in 0..(alignment - name.length)) + (0..(alignment - name.length)).forEach { append(' ') + } append(documentation.cleanup(multilineAligment)) } diff --git a/modules/generator/src/main/kotlin/org/lwjgl/generator/Modifiers.kt b/modules/generator/src/main/kotlin/org/lwjgl/generator/Modifiers.kt index a2be93e4d3..1c03636f8b 100644 --- a/modules/generator/src/main/kotlin/org/lwjgl/generator/Modifiers.kt +++ b/modules/generator/src/main/kotlin/org/lwjgl/generator/Modifiers.kt @@ -79,7 +79,7 @@ abstract class ModifierTarget { inline infix fun has(modifier: M) = modifiers[M::class] === modifier inline fun has() = modifiers.containsKey(M::class) - inline fun has(predicate: M.() -> Boolean) = (modifiers[M::class] as M?)?.predicate() ?: false + inline fun has(predicate: M.() -> Boolean) = (modifiers[M::class] as M?)?.predicate() == true inline fun get() = modifiers[M::class] as M } diff --git a/modules/generator/src/main/kotlin/org/lwjgl/generator/Types.kt b/modules/generator/src/main/kotlin/org/lwjgl/generator/Types.kt index 33ab863484..7b813b2544 100644 --- a/modules/generator/src/main/kotlin/org/lwjgl/generator/Types.kt +++ b/modules/generator/src/main/kotlin/org/lwjgl/generator/Types.kt @@ -368,7 +368,7 @@ class FunctionType internal constructor( } // typedefs -fun typedef(@Suppress("UNUSED_PARAMETER") typedef: OpaqueType, name: String) = OpaqueType(name) +fun typedef(@Suppress("unused") typedef: OpaqueType, name: String) = OpaqueType(name) fun typedef(typedef: PrimitiveType, name: String) = PrimitiveType(name, typedef.mapping) fun typedef(typedef: CharType, name: String) = CharType(name, typedef.mapping) fun typedef(typedef: IntegerType, name: String) = IntegerType(name, typedef.mapping, typedef.unsigned) diff --git a/pom.xml b/pom.xml index d43dc8e9be..c312cef30c 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.lwjgl lwjgl - 3.2.3 + 3.3.3 LWJGL The LWJGL core library. diff --git a/update-dependencies.xml b/update-dependencies.xml index 92be22ef90..28982ff9b0 100644 --- a/update-dependencies.xml +++ b/update-dependencies.xml @@ -16,8 +16,8 @@ - - + +