aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_Site.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-07-17 23:35:32 +0200
committerMattias Andrée <maandree@kth.se>2024-07-17 23:35:32 +0200
commit11d850fb5faa6fd130912dfea9eef4336acc7649 (patch)
treee0e9adfbbaefbbca7ad4cf3dfa6e49fab2e1e5c0 /libgamma_Site.c
parentEmpty signed commit (diff)
downloadjlibgamma-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_Site.c')
-rw-r--r--libgamma_Site.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgamma_Site.c b/libgamma_Site.c
index b28244a..f6293db 100644
--- a/libgamma_Site.c
+++ b/libgamma_Site.c
@@ -37,7 +37,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);
@@ -58,7 +58,7 @@ ok(JNIEnv *env, void *state, size_t count)
jlongArray
Java_libgamma_Site_libgamma_1site_1create(JNIEnv *env, jclass class, jint method, jstring site)
{
- libgamma_site_state_t *state = malloc(sizeof(libgamma_site_state_t));
+ struct libgamma_site_state *state = malloc(sizeof(*state));
const char *site_chars;
char *site_;
int r;
@@ -96,7 +96,7 @@ Java_libgamma_Site_libgamma_1site_1create(JNIEnv *env, jclass class, jint method
void
Java_libgamma_Site_libgamma_1site_1free(JNIEnv *env, jclass class, jlong address)
{
- void *this = (void *)(size_t)address;
+ void *this = (void *)(uintptr_t)address;
libgamma_site_free(this);
(void) env;
(void) class;
@@ -111,7 +111,7 @@ Java_libgamma_Site_libgamma_1site_1free(JNIEnv *env, jclass class, jlong address
jint
Java_libgamma_Site_libgamma_1site_1restore(JNIEnv *env, jclass class, jlong address)
{
- void *this = (void *)(size_t)address;
+ void *this = (void *)(uintptr_t)address;
int r = libgamma_site_restore(this);
if (r)
return r == LIBGAMMA_ERRNO_SET ? errno : r;