Skip to content

Commit

Permalink
Merge pull request #139 from akash-akya/dev
Browse files Browse the repository at this point in the history
Correct long int types to be compatible with 32bit
  • Loading branch information
akash-akya authored Dec 11, 2023
2 parents dc26c0f + 23b6c31 commit 57a6793
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions c_src/g_object/g_value.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion c_src/vips_operation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 57a6793

Please sign in to comment.