From 11d850fb5faa6fd130912dfea9eef4336acc7649 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 17 Jul 2024 23:35:32 +0200 Subject: Update for libgamma 0.7.4 and fix bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libgamma_Partition.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libgamma_Partition.c') diff --git a/libgamma_Partition.c b/libgamma_Partition.c index 9b77ff1..b90396d 100644 --- a/libgamma_Partition.c +++ b/libgamma_Partition.c @@ -36,7 +36,7 @@ fail(JNIEnv *env, int error_code) static jlongArray ok(JNIEnv *env, void *state, size_t count) { - jlong a = (jlong)(size_t)state; + jlong a = (jlong)(uintptr_t)state; jlong b = (jlong)count, z = 0; jlongArray rc = (*env)->NewLongArray(env, 3); (*env)->SetLongArrayRegion(env, rc, 0, 1, &a); @@ -57,8 +57,8 @@ ok(JNIEnv *env, void *state, size_t count) jlongArray Java_libgamma_Partition_libgamma_1partition_1create(JNIEnv *env, jclass class, jlong site, jint partition) { - libgamma_partition_state_t *state = malloc(sizeof(libgamma_partition_state_t)); - void *super = (void *)(size_t)site; + struct libgamma_partition_state *state = malloc(sizeof(*state)); + void *super = (void *)(uintptr_t)site; int r; if (state == NULL) return fail(env, 0); @@ -78,7 +78,7 @@ Java_libgamma_Partition_libgamma_1partition_1create(JNIEnv *env, jclass class, j void Java_libgamma_Partition_libgamma_1partition_1free(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; libgamma_partition_free(this); (void) env; (void) class; @@ -93,7 +93,7 @@ Java_libgamma_Partition_libgamma_1partition_1free(JNIEnv *env, jclass class, jlo jint Java_libgamma_Partition_libgamma_1partition_1restore(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; int r = libgamma_partition_restore(this); if (r) return r == LIBGAMMA_ERRNO_SET ? errno : r; -- cgit v1.2.3-70-g09d2