diff --git a/kotlin-satlib-jni/src/main/cpp/JCadical.cpp b/kotlin-satlib-jni/src/main/cpp/JCadical.cpp index e3ebb18..1a18fac 100644 --- a/kotlin-satlib-jni/src/main/cpp/JCadical.cpp +++ b/kotlin-satlib-jni/src/main/cpp/JCadical.cpp @@ -119,6 +119,7 @@ JNI_METHOD(void, cadical_1add_1assumption) jsize array_length = env->GetArrayLength(literals); CaDiCaL::Solver* solver = decode(p); + // TODO: use GetPrimitiveArrayCritical jint* array = env->GetIntArrayElements(literals, 0); for (int i = 0; i < array_length; i++) { solver->assume(array[i]); diff --git a/kotlin-satlib-jni/src/main/kotlin/com/github/lipen/satlib/solver/jni/JCadical.kt b/kotlin-satlib-jni/src/main/kotlin/com/github/lipen/satlib/solver/jni/JCadical.kt index e4c09f6..6611ffc 100644 --- a/kotlin-satlib-jni/src/main/kotlin/com/github/lipen/satlib/solver/jni/JCadical.kt +++ b/kotlin-satlib-jni/src/main/kotlin/com/github/lipen/satlib/solver/jni/JCadical.kt @@ -7,7 +7,7 @@ package com.github.lipen.satlib.solver.jni import com.github.lipen.satlib.utils.useWith import java.io.File -@Suppress("FunctionName", "MemberVisibilityCanBePrivate", "unused") +@Suppress("FunctionName", "MemberVisibilityCanBePrivate") class JCadical : AutoCloseable { private var handle: Long = 0 @@ -153,6 +153,7 @@ class JCadical : AutoCloseable { cadical_add_assumption(handle, literals) } + // TODO: Return enum SolveResult fun solve(): Boolean { return when (val result = cadical_solve(handle)) { 0 -> false // UNSOLVED