Fix java short type ID for pointers
authorMatt Corallo <git@bluematt.me>
Tue, 6 Oct 2020 00:02:26 +0000 (20:02 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 6 Oct 2020 00:02:26 +0000 (20:02 -0400)
genbindings.py
src/main/jni/bindings.c

index 441c045e738142a225956d959fbb244b563d2381..07de75e8edf56784477264a42e3c5d24f58bef5b 100755 (executable)
@@ -122,6 +122,7 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg
             is_ptr = True
             c_ty = "jlong"
             java_ty = "long"
+            fn_ty_arg = "J"
 
         var_is_arr = var_is_arr_regex.match(fn_arg)
         if var_is_arr is not None or ret_arr_len is not None:
index d80311a7213edb4db36584366a418a709bbb4fa9..b06a370ff77491e940208345e780de33969506c3 100644 (file)
@@ -1247,7 +1247,7 @@ static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass
        assert(calls->send_data_meth != NULL);
        calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
        assert(calls->disconnect_socket_meth != NULL);
-       calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(V)Z");
+       calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
        assert(calls->eq_meth != NULL);
        calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
        assert(calls->hash_meth != NULL);