Hi,

On Thu, Jan 16, 2014 at 06:44:28PM +0100, intrigeri wrote:
> Hi,
> 
> is it imaginable that a s390x porter gives this issue a try?
> 
> Upstream wrote back in October [1] "I'll try to get to this soon, but
> I'd be more than happy to accept patches, too". Since then, a patch
> was proposed that apparently fixes the issue on 32-bit big endian
> architectures (attached both to the Debian and upstream bug reports).
> 
> This patch apparently needs some more work for 64-bit big endian
> architectures, so I thought you might be interested :)
> 
> [1] https://rt.cpan.org/Ticket/Display.html?id=89552
> 

Thanks a lot for working on that. The patch improves the things a bit on
s390x, but following the same principle with 32-bit types (see attached
patch), fixes even more issues. The testsuite looks like this
afterwards:

| t/arrays.t                  (Wstat: 9 Tests: 2 Failed: 1)
|   Failed test:  2
|   Non-zero wait status: 9
|   Parse errors: Bad plan.  You planned 29 tests but ran 2.
| t/callbacks.t               (Wstat: 1536 Tests: 25 Failed: 6)
|   Failed tests:  3, 6, 9, 14, 19, 25
|   Non-zero exit status: 6
| t/enums.t                   (Wstat: 11 Tests: 1 Failed: 0)
|   Non-zero wait status: 11
|   Parse errors: Bad plan.  You planned 4 tests but ran 1.
| t/structs.t                 (Wstat: 65280 Tests: 4 Failed: 0)
|   Non-zero exit status: 255
|   Parse errors: Bad plan.  You planned 6 tests but ran 4.

While it doesn't fix all the issues the patch looks correct and IMHO can
already be merged, as the other issue will need changes in other parts
of the code.

Aurelien

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurel...@aurel32.net                 http://www.aurel32.net
--- libglib-object-introspection-perl-0.019.orig/gperl-i11n-invoke-c.c
+++ libglib-object-introspection-perl-0.019/gperl-i11n-invoke-c.c
@@ -180,7 +180,44 @@ invoke_c_code (GICallableInfo *info,
 		ccroak ("Could not prepare a call interface");
 	}
 
-	ffi_call (&cif, func_pointer, &return_value, iinfo.args);
+	if(iinfo.return_type_ffi==&ffi_type_sint8)
+	{
+		ffi_sarg result;
+		ffi_call (&cif, func_pointer, &result, iinfo.args);
+		return_value.v_int8=result;
+	}
+	else if(iinfo.return_type_ffi==&ffi_type_uint8)
+	{
+		ffi_arg result;
+		ffi_call (&cif, func_pointer, &result, iinfo.args);
+		return_value.v_uint8=result;
+	}
+	else if(iinfo.return_type_ffi==&ffi_type_sint16)
+	{
+		ffi_sarg result;
+		ffi_call (&cif, func_pointer, &result, iinfo.args);
+		return_value.v_int16=result;
+	}
+	else if(iinfo.return_type_ffi==&ffi_type_uint16)
+	{
+		ffi_arg result;
+		ffi_call (&cif, func_pointer, &result, iinfo.args);
+		return_value.v_uint16=result;
+	}
+	else if(iinfo.return_type_ffi==&ffi_type_sint32)
+	{
+		ffi_sarg result;
+		ffi_call (&cif, func_pointer, &result, iinfo.args);
+		return_value.v_int32=result;
+	}
+	else if(iinfo.return_type_ffi==&ffi_type_uint32)
+	{
+		ffi_arg result;
+		ffi_call (&cif, func_pointer, &result, iinfo.args);
+		return_value.v_uint32=result;
+	}
+        else
+		ffi_call (&cif, func_pointer, &return_value, iinfo.args);
 
 	/* free call-scoped data */
 	_invoke_free_after_call_handlers (&iinfo);

Reply via email to