Commit f7b88529 authored by Marco Trevisan's avatar Marco Trevisan 🎺 Committed by Philip Chimento

function: Use pointer as fallback argument value as we do it when setting

ffi_arg has a different definitions depending on the arch, and it may have a
definition that is not covered by the default arg types in some archs (like arm
or i386), however in gjs_value_to_g_argument() we always fallback to gpointer
types, so let's follow the same strategy when fetching those values.
parent cb62170b
......@@ -61,6 +61,7 @@
#include "gi/object.h"
#include "gi/param.h"
#include "gi/union.h"
#include "gi/utils-inl.h"
#include "gjs/context-private.h"
#include "gjs/context.h"
#include "gjs/jsapi-class.h"
......@@ -163,8 +164,8 @@ set_return_ffi_arg_from_giargument (GITypeInfo *ret_type,
*static_cast<ffi_sarg*>(result) =
gjs_arg_get<int, GI_TYPE_TAG_INTERFACE>(return_value);
else
*static_cast<ffi_arg*>(result) =
gjs_arg_get<ffi_arg>(return_value);
*static_cast<ffi_arg*>(result) = gjs_pointer_to_int<ffi_arg>(
gjs_arg_get<void*>(return_value));
g_base_info_unref(interface_info);
}
......@@ -182,7 +183,8 @@ set_return_ffi_arg_from_giargument (GITypeInfo *ret_type,
case GI_TYPE_TAG_GHASH:
case GI_TYPE_TAG_ERROR:
default:
*static_cast<ffi_arg*>(result) = gjs_arg_get<ffi_arg>(return_value);
*static_cast<ffi_arg*>(result) =
gjs_pointer_to_int<ffi_arg>(gjs_arg_get<void*>(return_value));
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment