From 23b6c31c751dfe45998144fe3528e6348a29cbbb Mon Sep 17 00:00:00 2001 From: akash-akya Date: Mon, 11 Dec 2023 18:49:53 +0530 Subject: [PATCH] Correct long int types to be compatible with 32bit --- c_src/g_object/g_value.c | 8 ++++---- c_src/vips_operation.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/c_src/g_object/g_value.c b/c_src/g_object/g_value.c index 1869681..0a924ef 100644 --- a/c_src/g_object/g_value.c +++ b/c_src/g_object/g_value.c @@ -89,7 +89,7 @@ static VixResult set_uint(ErlNifEnv *env, ERL_NIF_TERM term, GValue *gvalue) { } static VixResult set_int64(ErlNifEnv *env, ERL_NIF_TERM term, GValue *gvalue) { - long int64_value; + ErlNifSInt64 int64_value; VixResult res; if (!enif_get_int64(env, term, &int64_value)) { @@ -118,7 +118,7 @@ static VixResult set_string(ErlNifEnv *env, ERL_NIF_TERM term, GValue *gvalue) { } static VixResult set_uint64(ErlNifEnv *env, ERL_NIF_TERM term, GValue *gvalue) { - unsigned long uint64_value; + ErlNifUInt64 uint64_value; VixResult res; if (!enif_get_uint64(env, term, &uint64_value)) { @@ -297,7 +297,7 @@ static VixResult get_uint(ErlNifEnv *env, GValue *gvalue) { } static VixResult get_int64(ErlNifEnv *env, GValue *gvalue) { - long int64_value; + ErlNifSInt64 int64_value; int64_value = g_value_get_int64(gvalue); return vix_result(enif_make_int(env, int64_value)); @@ -326,7 +326,7 @@ static VixResult get_string_as_binary(ErlNifEnv *env, GValue *gvalue) { } static VixResult get_uint64(ErlNifEnv *env, GValue *gvalue) { - unsigned long uint64_value; + ErlNifUInt64 uint64_value; uint64_value = g_value_get_uint64(gvalue); return vix_result(enif_make_int(env, uint64_value)); diff --git a/c_src/vips_operation.c b/c_src/vips_operation.c index 3748161..37f9404 100644 --- a/c_src/vips_operation.c +++ b/c_src/vips_operation.c @@ -540,7 +540,7 @@ ERL_NIF_TERM nif_vips_cache_set_max_mem(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) { ASSERT_ARGC(argc, 1); - unsigned long max_mem; + ErlNifUInt64 max_mem; if (!enif_get_uint64(env, argv[0], &max_mem)) { return raise_badarg(env, "Failed to integer value");