 
 [ 1.0 2.0 ] [
     1.0 2.0 callback-10 callback-10-test
-    [ test_struct_14-x1 ] [ test_struct_14-x2 ] bi
+    [ x1>> ] [ x2>> ] bi
 ] unit-test
 
 FUNCTION: test-struct-12 ffi_test_41 ( int a, double x ) ;
 
 [ 1 2.0 ] [
     1 2.0 ffi_test_41
-    [ test-struct-12-a ] [ test-struct-12-x ] bi
+    [ a>> ] [ x>> ] bi
 ] unit-test
 
 : callback-11 ( -- callback )
     "test-struct-12" { "int" "double" } "cdecl"
     [
-        "test-struct-12" <c-object>
-        [ set-test-struct-12-x ] keep
-        [ set-test-struct-12-a ] keep
+        test-struct-12 <struct>
+            swap >>x
+            swap >>a
     ] alien-callback ;
 
 : callback-11-test ( x1 x2 callback -- result )


[ 1 2.0 ] [
    1 2.0 callback-11 callback-11-test
    [ test-struct-12-a ] [ test-struct-12-x ] bi
] unit-test

C-STRUCT: test_struct_15
{ "float" "x" }
{ "float" "y" } ;

FUNCTION: test_struct_15 ffi_test_42 ( float x, float y ) ;

[ 1.0 2.0 ] [ 1.0 2.0 ffi_test_42 [ test_struct_15-x ] [ test_struct_15-y ] bi ] unit-test

: callback-12 ( -- callback )
    "test_struct_15" { "float" "float" } "cdecl"
    [
        "test_struct_15" <c-object>
        [ set-test_struct_15-y ] keep
        [ set-test_struct_15-x ] keep
    ] alien-callback ;

: callback-12-test ( x1 x2 callback -- result )
    "test_struct_15" { "float" "float" } "cdecl" alien-indirect ;

[ 1.0 2.0 ] [
    1.0 2.0 callback-12 callback-12-test
    [ test_struct_15-x ] [ test_struct_15-y ] bi
] unit-test

C-STRUCT: test_struct_16
{ "float" "x" }
{ "int" "a" } ;

FUNCTION: test_struct_16 ffi_test_43 ( float x, int a ) ;

[ 1.0 2 ] [ 1.0 2 ffi_test_43 [ test_struct_16-x ] [ test_struct_16-a ] bi ] unit-test

: callback-13 ( -- callback )
    "test_struct_16" { "float" "int" } "cdecl"
    [
        "test_struct_16" <c-object>
        [ set-test_struct_16-a ] keep
        [ set-test_struct_16-x ] keep
    ] alien-callback ;

: callback-13-test ( x1 x2 callback -- result )

] unit-test

! Reported by jedahu
STRUCT: bool-field-test
    { name pinned-c-ptr }
    { on boolean }
    { parents short } ;

FUNCTION: short ffi_test_48 ( bool-field-test x ) ;

[ 123 ] [
    bool-field-test <struct>
        123 >>parents
    ffi_test_48
] unit-test
