diff options
author | Mattias Andrée <maandree@kth.se> | 2024-07-17 23:35:32 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-07-17 23:35:32 +0200 |
commit | 11d850fb5faa6fd130912dfea9eef4336acc7649 (patch) | |
tree | e0e9adfbbaefbbca7ad4cf3dfa6e49fab2e1e5c0 /libgamma_GammaRamps.c | |
parent | Empty signed commit (diff) | |
download | jlibgamma-11d850fb5faa6fd130912dfea9eef4336acc7649.tar.gz jlibgamma-11d850fb5faa6fd130912dfea9eef4336acc7649.tar.bz2 jlibgamma-11d850fb5faa6fd130912dfea9eef4336acc7649.tar.xz |
Update for libgamma 0.7.4 and fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libgamma_GammaRamps.c')
-rw-r--r-- | libgamma_GammaRamps.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libgamma_GammaRamps.c b/libgamma_GammaRamps.c index ebb2e98..ba3776a 100644 --- a/libgamma_GammaRamps.c +++ b/libgamma_GammaRamps.c @@ -40,10 +40,10 @@ fail(JNIEnv *env, int error_code) static jlongArray ok(JNIEnv *env, void *ramps, void *red, void *green, void *blue) { - jlong a = (jlong)(size_t)ramps; - jlong b = (jlong)(size_t)red; - jlong c = (jlong)(size_t)green; - jlong d = (jlong)(size_t)blue, z = 0; + jlong a = (jlong)(uintptr_t)ramps; + jlong b = (jlong)(uintptr_t)red; + jlong c = (jlong)(uintptr_t)green; + jlong d = (jlong)(uintptr_t)blue, z = 0; jlongArray rc = (*env)->NewLongArray(env, 5); (*env)->SetLongArrayRegion(env, rc, 0, 1, &a); (*env)->SetLongArrayRegion(env, rc, 1, 1, &b); @@ -69,7 +69,7 @@ ok(JNIEnv *env, void *ramps, void *red, void *green, void *blue) jlongArray Java_libgamma_GammaRamps_libgamma_1gamma_1ramps8_1create(JNIEnv *env, jclass class, jint red_size, jint green_size, jint blue_size) { - libgamma_gamma_ramps8_t *ramps = malloc(sizeof(libgamma_gamma_ramps8_t)); + struct libgamma_gamma_ramps8 *ramps = malloc(sizeof(*ramps)); int r; if (!ramps) return fail(env, 0); @@ -99,7 +99,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps8_1create(JNIEnv *env, jclass cla jlongArray Java_libgamma_GammaRamps_libgamma_1gamma_1ramps16_1create(JNIEnv *env, jclass class, jint red_size, jint green_size, jint blue_size) { - libgamma_gamma_ramps16_t *ramps = malloc(sizeof(libgamma_gamma_ramps16_t)); + struct libgamma_gamma_ramps16 *ramps = malloc(sizeof(*ramps)); int r; if (!ramps) return fail(env, 0); @@ -129,7 +129,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps16_1create(JNIEnv *env, jclass cl jlongArray Java_libgamma_GammaRamps_libgamma_1gamma_1ramps32_1create(JNIEnv *env, jclass class, jint red_size, jint green_size, jint blue_size) { - libgamma_gamma_ramps32_t *ramps = malloc(sizeof(libgamma_gamma_ramps32_t)); + struct libgamma_gamma_ramps32 *ramps = malloc(sizeof(*ramps)); int r; if (!ramps) return fail(env, 0); @@ -159,7 +159,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps32_1create(JNIEnv *env, jclass cl jlongArray Java_libgamma_GammaRamps_libgamma_1gamma_1ramps64_1create(JNIEnv *env, jclass class, jint red_size, jint green_size, jint blue_size) { - libgamma_gamma_ramps64_t *ramps = malloc(sizeof(libgamma_gamma_ramps64_t)); + struct libgamma_gamma_ramps64 *ramps = malloc(sizeof(*ramps)); int r; if (!ramps) return fail(env, 0); @@ -189,7 +189,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps64_1create(JNIEnv *env, jclass cl jlongArray Java_libgamma_GammaRamps_libgamma_1gamma_1rampsf_1create(JNIEnv *env, jclass class, jint red_size, jint green_size, jint blue_size) { - libgamma_gamma_rampsf_t *ramps = malloc(sizeof(libgamma_gamma_rampsf_t)); + struct libgamma_gamma_rampsf *ramps = malloc(sizeof(*ramps)); int r; if (!ramps) return fail(env, 0); @@ -219,7 +219,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1rampsf_1create(JNIEnv *env, jclass cla jlongArray Java_libgamma_GammaRamps_libgamma_1gamma_1rampsd_1create(JNIEnv *env, jclass class, jint red_size, jint green_size, jint blue_size) { - libgamma_gamma_rampsd_t *ramps = malloc(sizeof(libgamma_gamma_rampsd_t)); + struct libgamma_gamma_rampsd *ramps = malloc(sizeof(*ramps)); int r; if (!ramps) return fail(env, 0); @@ -244,7 +244,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1rampsd_1create(JNIEnv *env, jclass cla void Java_libgamma_GammaRamps_libgamma_1gamma_1ramps8_1free(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; libgamma_gamma_ramps8_free(this); (void) env; (void) class; @@ -261,7 +261,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps8_1free(JNIEnv *env, jclass class void Java_libgamma_GammaRamps_libgamma_1gamma_1ramps16_1free(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; libgamma_gamma_ramps16_free(this); (void) env; (void) class; @@ -278,7 +278,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps16_1free(JNIEnv *env, jclass clas void Java_libgamma_GammaRamps_libgamma_1gamma_1ramps32_1free(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; libgamma_gamma_ramps32_free(this); (void) env; (void) class; @@ -295,7 +295,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps32_1free(JNIEnv *env, jclass clas void Java_libgamma_GammaRamps_libgamma_1gamma_1ramps64_1free(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; libgamma_gamma_ramps64_free(this); (void) env; (void) class; @@ -312,7 +312,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1ramps64_1free(JNIEnv *env, jclass clas void Java_libgamma_GammaRamps_libgamma_1gamma_1rampsf_1free(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; libgamma_gamma_rampsf_free(this); (void) env; (void) class; @@ -329,7 +329,7 @@ Java_libgamma_GammaRamps_libgamma_1gamma_1rampsf_1free(JNIEnv *env, jclass class void Java_libgamma_GammaRamps_libgamma_1gamma_1rampsd_1free(JNIEnv *env, jclass class, jlong address) { - void *this = (void *)(size_t)address; + void *this = (void *)(uintptr_t)address; libgamma_gamma_rampsd_free(this); (void) env; (void) class; |