From 6bccf66d297232765a241414b49017d7980f8e2e Mon Sep 17 00:00:00 2001 From: Wodann Date: Sun, 1 Nov 2020 13:59:41 +0100 Subject: [PATCH] fix: resolve path types for 'both' style --- src/bindgen/library.rs | 2 +- tests/expectations/alias.both.c | 8 +-- tests/expectations/alias.both.compat.c | 8 +-- tests/expectations/annotation.both.c | 2 +- tests/expectations/annotation.both.compat.c | 2 +- tests/expectations/array.both.c | 2 +- tests/expectations/array.both.compat.c | 2 +- tests/expectations/asserted_cast.both.c | 2 +- .../expectations/asserted_cast.both.compat.c | 2 +- tests/expectations/assoc_constant.both.c | 2 +- .../expectations/assoc_constant.both.compat.c | 2 +- tests/expectations/associated_in_body.both.c | 2 +- .../associated_in_body.both.compat.c | 2 +- tests/expectations/bitfield.both.c | 2 +- tests/expectations/bitfield.both.compat.c | 2 +- tests/expectations/bitflags.both.c | 2 +- tests/expectations/bitflags.both.compat.c | 2 +- tests/expectations/body.both.c | 16 +++--- tests/expectations/body.both.compat.c | 16 +++--- tests/expectations/box.both.c | 4 +- tests/expectations/box.both.compat.c | 4 +- tests/expectations/cell.both.c | 4 +- tests/expectations/cell.both.compat.c | 4 +- tests/expectations/cfg.both.c | 4 +- tests/expectations/cfg.both.compat.c | 4 +- tests/expectations/cfg_2.both.c | 8 +-- tests/expectations/cfg_2.both.compat.c | 8 +-- tests/expectations/char.both.c | 2 +- tests/expectations/char.both.compat.c | 2 +- tests/expectations/constant.both.c | 2 +- tests/expectations/constant.both.compat.c | 2 +- tests/expectations/dep_v2.both.c | 2 +- tests/expectations/dep_v2.both.compat.c | 2 +- tests/expectations/derive_eq.both.c | 6 +-- tests/expectations/derive_eq.both.compat.c | 6 +-- tests/expectations/derive_ostream.both.c | 4 +- .../expectations/derive_ostream.both.compat.c | 4 +- .../destructor_and_copy_ctor.both.c | 40 +++++++------- .../destructor_and_copy_ctor.both.compat.c | 40 +++++++------- tests/expectations/display_list.both.c | 8 +-- tests/expectations/display_list.both.compat.c | 8 +-- tests/expectations/enum.both.c | 18 +++---- tests/expectations/enum.both.compat.c | 18 +++---- tests/expectations/enum_self.both.c | 6 +-- tests/expectations/enum_self.both.compat.c | 6 +-- tests/expectations/euclid.both.c | 52 +++++++++---------- tests/expectations/euclid.both.compat.c | 52 +++++++++---------- .../exclude_generic_monomorph.both.c | 2 +- .../exclude_generic_monomorph.both.compat.c | 2 +- tests/expectations/expand.both.c | 2 +- tests/expectations/expand.both.compat.c | 2 +- .../expand_default_features.both.c | 2 +- .../expand_default_features.both.compat.c | 2 +- tests/expectations/expand_dep.both.c | 2 +- tests/expectations/expand_dep.both.compat.c | 2 +- tests/expectations/expand_dep_v2.both.c | 2 +- .../expectations/expand_dep_v2.both.compat.c | 2 +- tests/expectations/expand_features.both.c | 2 +- .../expand_features.both.compat.c | 2 +- .../expand_no_default_features.both.c | 2 +- .../expand_no_default_features.both.compat.c | 2 +- tests/expectations/extern.both.c | 2 +- tests/expectations/extern.both.compat.c | 2 +- .../external_workspace_child.both.c | 2 +- .../external_workspace_child.both.compat.c | 2 +- tests/expectations/fns.both.c | 2 +- tests/expectations/fns.both.compat.c | 2 +- tests/expectations/generic_pointer.both.c | 2 +- .../generic_pointer.both.compat.c | 2 +- tests/expectations/include_item.both.compat.c | 2 +- tests/expectations/inner_mod.both.c | 2 +- tests/expectations/inner_mod.both.compat.c | 2 +- tests/expectations/lifetime_arg.both.c | 2 +- tests/expectations/lifetime_arg.both.compat.c | 2 +- tests/expectations/linestyle_cr.both.c | 2 +- tests/expectations/linestyle_cr.both.compat.c | 2 +- tests/expectations/linestyle_crlf.both.c | 2 +- .../expectations/linestyle_crlf.both.compat.c | 2 +- tests/expectations/linestyle_lf.both.c | 2 +- tests/expectations/linestyle_lf.both.compat.c | 2 +- tests/expectations/mangle.both.c | 2 +- tests/expectations/mangle.both.compat.c | 2 +- tests/expectations/manuallydrop.both.c | 8 +-- tests/expectations/manuallydrop.both.compat.c | 8 +-- tests/expectations/maybeuninit.both.c | 4 +- tests/expectations/maybeuninit.both.compat.c | 4 +- tests/expectations/mod_2015.both.c | 2 +- tests/expectations/mod_2015.both.compat.c | 2 +- tests/expectations/mod_2018.both.c | 2 +- tests/expectations/mod_2018.both.compat.c | 2 +- tests/expectations/mod_attr.both.c | 4 +- tests/expectations/mod_attr.both.compat.c | 4 +- tests/expectations/mod_path.both.c | 2 +- tests/expectations/mod_path.both.compat.c | 2 +- tests/expectations/monomorph_1.both.c | 20 +++---- tests/expectations/monomorph_1.both.compat.c | 20 +++---- tests/expectations/monomorph_2.both.c | 8 +-- tests/expectations/monomorph_2.both.compat.c | 8 +-- tests/expectations/monomorph_3.both.c | 20 +++---- tests/expectations/monomorph_3.both.compat.c | 20 +++---- tests/expectations/must_use.both.c | 2 +- tests/expectations/must_use.both.compat.c | 2 +- tests/expectations/namespace_constant.both.c | 2 +- .../namespace_constant.both.compat.c | 2 +- tests/expectations/namespaces_constant.both.c | 2 +- .../namespaces_constant.both.compat.c | 2 +- tests/expectations/nonnull.both.c | 6 +-- tests/expectations/nonnull.both.compat.c | 6 +-- tests/expectations/nonnull_attribute.both.c | 30 +++++------ .../nonnull_attribute.both.compat.c | 30 +++++------ tests/expectations/prefix.both.c | 2 +- tests/expectations/prefix.both.compat.c | 2 +- .../prefixed_struct_literal.both.c | 2 +- .../prefixed_struct_literal.both.compat.c | 2 +- .../prefixed_struct_literal_deep.both.c | 4 +- ...prefixed_struct_literal_deep.both.compat.c | 4 +- tests/expectations/rename.both.c | 4 +- tests/expectations/rename.both.compat.c | 4 +- tests/expectations/rename_crate.both.c | 8 +-- tests/expectations/rename_crate.both.compat.c | 8 +-- .../renaming_overrides_prefixing.both.c | 2 +- ...renaming_overrides_prefixing.both.compat.c | 2 +- tests/expectations/reserved.both.c | 8 ++- tests/expectations/reserved.both.compat.c | 8 ++- tests/expectations/sentinel.both.c | 2 +- tests/expectations/sentinel.both.compat.c | 2 +- tests/expectations/simplify_option_ptr.both.c | 10 ++-- .../simplify_option_ptr.both.compat.c | 10 ++-- tests/expectations/static.both.c | 4 +- tests/expectations/static.both.compat.c | 4 +- tests/expectations/struct.both.c | 6 ++- tests/expectations/struct.both.compat.c | 6 ++- tests/expectations/struct_literal.both.c | 2 +- .../expectations/struct_literal.both.compat.c | 2 +- .../expectations/struct_literal_order.both.c | 2 +- .../struct_literal_order.both.compat.c | 2 +- tests/expectations/struct_self.both.c | 4 +- tests/expectations/struct_self.both.compat.c | 4 +- tests/expectations/swift_name.both.c | 38 +++++++------- tests/expectations/swift_name.both.compat.c | 38 +++++++------- tests/expectations/transform_op.both.c | 34 ++++++------ tests/expectations/transform_op.both.compat.c | 34 ++++++------ tests/expectations/typedef.both.c | 2 +- tests/expectations/typedef.both.compat.c | 2 +- tests/expectations/union.both.c | 2 +- tests/expectations/union.both.compat.c | 2 +- tests/expectations/union_self.both.c | 4 +- tests/expectations/union_self.both.compat.c | 4 +- tests/expectations/workspace.both.c | 2 +- tests/expectations/workspace.both.compat.c | 2 +- 150 files changed, 498 insertions(+), 478 deletions(-) diff --git a/src/bindgen/library.rs b/src/bindgen/library.rs index fc0c44d0d..1ea195da1 100644 --- a/src/bindgen/library.rs +++ b/src/bindgen/library.rs @@ -308,7 +308,7 @@ impl Library { } fn resolve_declaration_types(&mut self) { - if self.config.style.generate_typedef() { + if !self.config.style.generate_tag() { return; } diff --git a/tests/expectations/alias.both.c b/tests/expectations/alias.both.c index f52aa8b93..1c537b5d9 100644 --- a/tests/expectations/alias.both.c +++ b/tests/expectations/alias.both.c @@ -17,18 +17,18 @@ typedef struct Dep { typedef struct Foo_i32 { int32_t a; int32_t b; - Dep c; + struct Dep c; } Foo_i32; -typedef Foo_i32 IntFoo; +typedef struct Foo_i32 IntFoo; typedef struct Foo_f64 { double a; double b; - Dep c; + struct Dep c; } Foo_f64; -typedef Foo_f64 DoubleFoo; +typedef struct Foo_f64 DoubleFoo; typedef int32_t Unit; diff --git a/tests/expectations/alias.both.compat.c b/tests/expectations/alias.both.compat.c index ebdf151bd..da9afc7f2 100644 --- a/tests/expectations/alias.both.compat.c +++ b/tests/expectations/alias.both.compat.c @@ -23,18 +23,18 @@ typedef struct Dep { typedef struct Foo_i32 { int32_t a; int32_t b; - Dep c; + struct Dep c; } Foo_i32; -typedef Foo_i32 IntFoo; +typedef struct Foo_i32 IntFoo; typedef struct Foo_f64 { double a; double b; - Dep c; + struct Dep c; } Foo_f64; -typedef Foo_f64 DoubleFoo; +typedef struct Foo_f64 DoubleFoo; typedef int32_t Unit; diff --git a/tests/expectations/annotation.both.c b/tests/expectations/annotation.both.c index 6b983247a..5d04a7971 100644 --- a/tests/expectations/annotation.both.c +++ b/tests/expectations/annotation.both.c @@ -66,4 +66,4 @@ typedef struct H { }; } H; -void root(A x, B y, C z, F f, H h); +void root(struct A x, struct B y, C z, union F f, struct H h); diff --git a/tests/expectations/annotation.both.compat.c b/tests/expectations/annotation.both.compat.c index f137b1a03..7f55381d6 100644 --- a/tests/expectations/annotation.both.compat.c +++ b/tests/expectations/annotation.both.compat.c @@ -88,7 +88,7 @@ typedef struct H { extern "C" { #endif // __cplusplus -void root(A x, B y, C z, F f, H h); +void root(struct A x, struct B y, C z, union F f, struct H h); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/array.both.c b/tests/expectations/array.both.c index 0ff4b997c..948df6875 100644 --- a/tests/expectations/array.both.c +++ b/tests/expectations/array.both.c @@ -18,4 +18,4 @@ typedef struct Foo { }; } Foo; -void root(Foo a); +void root(struct Foo a); diff --git a/tests/expectations/array.both.compat.c b/tests/expectations/array.both.compat.c index 50fc7c68e..3681d9a24 100644 --- a/tests/expectations/array.both.compat.c +++ b/tests/expectations/array.both.compat.c @@ -22,7 +22,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo a); +void root(struct Foo a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/asserted_cast.both.c b/tests/expectations/asserted_cast.both.c index a620bc01d..3391a38a5 100644 --- a/tests/expectations/asserted_cast.both.c +++ b/tests/expectations/asserted_cast.both.c @@ -81,4 +81,4 @@ typedef union K { K_Bar_Body bar; } K; -void foo(H h, I i, J j, K k); +void foo(struct H h, struct I i, struct J j, union K k); diff --git a/tests/expectations/asserted_cast.both.compat.c b/tests/expectations/asserted_cast.both.compat.c index d4382691d..dfa56b853 100644 --- a/tests/expectations/asserted_cast.both.compat.c +++ b/tests/expectations/asserted_cast.both.compat.c @@ -103,7 +103,7 @@ typedef union K { extern "C" { #endif // __cplusplus -void foo(H h, I i, J j, K k); +void foo(struct H h, struct I i, struct J j, union K k); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/assoc_constant.both.c b/tests/expectations/assoc_constant.both.c index ec55c7d3f..1aebafff4 100644 --- a/tests/expectations/assoc_constant.both.c +++ b/tests/expectations/assoc_constant.both.c @@ -9,4 +9,4 @@ typedef struct Foo { #define Foo_GA 10 #define Foo_ZO 3.14 -void root(Foo x); +void root(struct Foo x); diff --git a/tests/expectations/assoc_constant.both.compat.c b/tests/expectations/assoc_constant.both.compat.c index 7e2d75ef7..3edd13e43 100644 --- a/tests/expectations/assoc_constant.both.compat.c +++ b/tests/expectations/assoc_constant.both.compat.c @@ -13,7 +13,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo x); +void root(struct Foo x); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/associated_in_body.both.c b/tests/expectations/associated_in_body.both.c index 012f9859f..16035b18e 100644 --- a/tests/expectations/associated_in_body.both.c +++ b/tests/expectations/associated_in_body.both.c @@ -32,4 +32,4 @@ typedef struct StyleAlignFlags { */ #define StyleAlignFlags_FLEX_START (StyleAlignFlags){ .bits = (uint8_t)(1 << 3) } -void root(StyleAlignFlags flags); +void root(struct StyleAlignFlags flags); diff --git a/tests/expectations/associated_in_body.both.compat.c b/tests/expectations/associated_in_body.both.compat.c index 58ee56999..ad4e84172 100644 --- a/tests/expectations/associated_in_body.both.compat.c +++ b/tests/expectations/associated_in_body.both.compat.c @@ -36,7 +36,7 @@ typedef struct StyleAlignFlags { extern "C" { #endif // __cplusplus -void root(StyleAlignFlags flags); +void root(struct StyleAlignFlags flags); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/bitfield.both.c b/tests/expectations/bitfield.both.c index bd3e3dc9b..7505f464f 100644 --- a/tests/expectations/bitfield.both.c +++ b/tests/expectations/bitfield.both.c @@ -8,4 +8,4 @@ typedef struct HasBitfields { uint64_t bar: 56; } HasBitfields; -void root(const HasBitfields*); +void root(const struct HasBitfields*); diff --git a/tests/expectations/bitfield.both.compat.c b/tests/expectations/bitfield.both.compat.c index 49d87e16a..b4ad79701 100644 --- a/tests/expectations/bitfield.both.compat.c +++ b/tests/expectations/bitfield.both.compat.c @@ -12,7 +12,7 @@ typedef struct HasBitfields { extern "C" { #endif // __cplusplus -void root(const HasBitfields*); +void root(const struct HasBitfields*); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/bitflags.both.c b/tests/expectations/bitflags.both.c index 04db225b7..a4a86518a 100644 --- a/tests/expectations/bitflags.both.c +++ b/tests/expectations/bitflags.both.c @@ -40,4 +40,4 @@ typedef struct DebugFlags { */ #define DebugFlags_BIGGEST_ALLOWED (DebugFlags){ .bits = (uint32_t)(1 << 31) } -void root(AlignFlags flags, DebugFlags bigger_flags); +void root(struct AlignFlags flags, struct DebugFlags bigger_flags); diff --git a/tests/expectations/bitflags.both.compat.c b/tests/expectations/bitflags.both.compat.c index d6ba47c91..82d308e84 100644 --- a/tests/expectations/bitflags.both.compat.c +++ b/tests/expectations/bitflags.both.compat.c @@ -44,7 +44,7 @@ typedef struct DebugFlags { extern "C" { #endif // __cplusplus -void root(AlignFlags flags, DebugFlags bigger_flags); +void root(struct AlignFlags flags, struct DebugFlags bigger_flags); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/body.both.c b/tests/expectations/body.both.c index 743422be4..d358c6817 100644 --- a/tests/expectations/body.both.c +++ b/tests/expectations/body.both.c @@ -91,11 +91,11 @@ typedef union MyUnion_Prepended { uint32_t u; } MyUnion_Prepended; -void root(MyFancyStruct s, - MyFancyEnum e, - MyCLikeEnum c, - MyUnion u, - MyFancyStruct_Prepended sp, - MyFancyEnum_Prepended ep, - MyCLikeEnum_Prepended cp, - MyUnion_Prepended up); +void root(struct MyFancyStruct s, + struct MyFancyEnum e, + enum MyCLikeEnum c, + union MyUnion u, + struct MyFancyStruct_Prepended sp, + struct MyFancyEnum_Prepended ep, + enum MyCLikeEnum_Prepended cp, + union MyUnion_Prepended up); diff --git a/tests/expectations/body.both.compat.c b/tests/expectations/body.both.compat.c index 46b11c730..5f7cbdf8e 100644 --- a/tests/expectations/body.both.compat.c +++ b/tests/expectations/body.both.compat.c @@ -95,14 +95,14 @@ typedef union MyUnion_Prepended { extern "C" { #endif // __cplusplus -void root(MyFancyStruct s, - MyFancyEnum e, - MyCLikeEnum c, - MyUnion u, - MyFancyStruct_Prepended sp, - MyFancyEnum_Prepended ep, - MyCLikeEnum_Prepended cp, - MyUnion_Prepended up); +void root(struct MyFancyStruct s, + struct MyFancyEnum e, + enum MyCLikeEnum c, + union MyUnion u, + struct MyFancyStruct_Prepended sp, + struct MyFancyEnum_Prepended ep, + enum MyCLikeEnum_Prepended cp, + union MyUnion_Prepended up); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/box.both.c b/tests/expectations/box.both.c index e7f0edb88..3a21cedb0 100644 --- a/tests/expectations/box.both.c +++ b/tests/expectations/box.both.c @@ -11,13 +11,13 @@ using Box = T*; typedef struct NotReprC_Box_i32 NotReprC_Box_i32; -typedef NotReprC_Box_i32 Foo; +typedef struct NotReprC_Box_i32 Foo; typedef struct MyStruct { int32_t *number; } MyStruct; -void root(const Foo *a, const MyStruct *with_box); +void root(const Foo *a, const struct MyStruct *with_box); void drop_box(int32_t *x); diff --git a/tests/expectations/box.both.compat.c b/tests/expectations/box.both.compat.c index 024af3eb7..3ea447cbc 100644 --- a/tests/expectations/box.both.compat.c +++ b/tests/expectations/box.both.compat.c @@ -11,7 +11,7 @@ using Box = T*; typedef struct NotReprC_Box_i32 NotReprC_Box_i32; -typedef NotReprC_Box_i32 Foo; +typedef struct NotReprC_Box_i32 Foo; typedef struct MyStruct { int32_t *number; @@ -21,7 +21,7 @@ typedef struct MyStruct { extern "C" { #endif // __cplusplus -void root(const Foo *a, const MyStruct *with_box); +void root(const Foo *a, const struct MyStruct *with_box); void drop_box(int32_t *x); diff --git a/tests/expectations/cell.both.c b/tests/expectations/cell.both.c index 60c9ff742..444742237 100644 --- a/tests/expectations/cell.both.c +++ b/tests/expectations/cell.both.c @@ -5,10 +5,10 @@ typedef struct NotReprC_RefCell_i32 NotReprC_RefCell_i32; -typedef NotReprC_RefCell_i32 Foo; +typedef struct NotReprC_RefCell_i32 Foo; typedef struct MyStruct { int32_t number; } MyStruct; -void root(const Foo *a, const MyStruct *with_cell); +void root(const Foo *a, const struct MyStruct *with_cell); diff --git a/tests/expectations/cell.both.compat.c b/tests/expectations/cell.both.compat.c index 8a8264415..251669584 100644 --- a/tests/expectations/cell.both.compat.c +++ b/tests/expectations/cell.both.compat.c @@ -5,7 +5,7 @@ typedef struct NotReprC_RefCell_i32 NotReprC_RefCell_i32; -typedef NotReprC_RefCell_i32 Foo; +typedef struct NotReprC_RefCell_i32 Foo; typedef struct MyStruct { int32_t number; @@ -15,7 +15,7 @@ typedef struct MyStruct { extern "C" { #endif // __cplusplus -void root(const Foo *a, const MyStruct *with_cell); +void root(const Foo *a, const struct MyStruct *with_cell); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/cfg.both.c b/tests/expectations/cfg.both.c index a3242f9bc..cd7d503bd 100644 --- a/tests/expectations/cfg.both.c +++ b/tests/expectations/cfg.both.c @@ -64,9 +64,9 @@ typedef struct BarHandle { #endif #if (defined(PLATFORM_UNIX) && defined(X11)) -void root(FooHandle a, C c); +void root(struct FooHandle a, union C c); #endif #if (defined(PLATFORM_WIN) || defined(M_32)) -void root(BarHandle a, C c); +void root(struct BarHandle a, union C c); #endif diff --git a/tests/expectations/cfg.both.compat.c b/tests/expectations/cfg.both.compat.c index 63df735a5..4ffaa97e3 100644 --- a/tests/expectations/cfg.both.compat.c +++ b/tests/expectations/cfg.both.compat.c @@ -86,11 +86,11 @@ extern "C" { #endif // __cplusplus #if (defined(PLATFORM_UNIX) && defined(X11)) -void root(FooHandle a, C c); +void root(struct FooHandle a, union C c); #endif #if (defined(PLATFORM_WIN) || defined(M_32)) -void root(BarHandle a, C c); +void root(struct BarHandle a, union C c); #endif #ifdef __cplusplus diff --git a/tests/expectations/cfg_2.both.c b/tests/expectations/cfg_2.both.c index dcedc220f..b59fb95a5 100644 --- a/tests/expectations/cfg_2.both.c +++ b/tests/expectations/cfg_2.both.c @@ -19,18 +19,18 @@ typedef struct Foo { #if defined(NOT_DEFINED) typedef struct Bar { - Foo y; + struct Foo y; } Bar; #endif #if defined(DEFINED) typedef struct Bar { - Foo z; + struct Foo z; } Bar; #endif typedef struct Root { - Bar w; + struct Bar w; } Root; -void root(Root a); +void root(struct Root a); diff --git a/tests/expectations/cfg_2.both.compat.c b/tests/expectations/cfg_2.both.compat.c index 3516b73e7..dc2f9d2d0 100644 --- a/tests/expectations/cfg_2.both.compat.c +++ b/tests/expectations/cfg_2.both.compat.c @@ -19,25 +19,25 @@ typedef struct Foo { #if defined(NOT_DEFINED) typedef struct Bar { - Foo y; + struct Foo y; } Bar; #endif #if defined(DEFINED) typedef struct Bar { - Foo z; + struct Foo z; } Bar; #endif typedef struct Root { - Bar w; + struct Bar w; } Root; #ifdef __cplusplus extern "C" { #endif // __cplusplus -void root(Root a); +void root(struct Root a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/char.both.c b/tests/expectations/char.both.c index 670893392..f06ab8827 100644 --- a/tests/expectations/char.both.c +++ b/tests/expectations/char.both.c @@ -7,4 +7,4 @@ typedef struct Foo { uint32_t a; } Foo; -void root(Foo a); +void root(struct Foo a); diff --git a/tests/expectations/char.both.compat.c b/tests/expectations/char.both.compat.c index 302a2e392..bb69e531d 100644 --- a/tests/expectations/char.both.compat.c +++ b/tests/expectations/char.both.compat.c @@ -11,7 +11,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo a); +void root(struct Foo a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/constant.both.c b/tests/expectations/constant.both.c index 5528f4f6e..73ae53298 100644 --- a/tests/expectations/constant.both.c +++ b/tests/expectations/constant.both.c @@ -50,4 +50,4 @@ typedef struct Foo { int32_t x[FOO]; } Foo; -void root(Foo x); +void root(struct Foo x); diff --git a/tests/expectations/constant.both.compat.c b/tests/expectations/constant.both.compat.c index 941b77b45..08843c64d 100644 --- a/tests/expectations/constant.both.compat.c +++ b/tests/expectations/constant.both.compat.c @@ -54,7 +54,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo x); +void root(struct Foo x); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/dep_v2.both.c b/tests/expectations/dep_v2.both.c index 401228965..9a91a4fe4 100644 --- a/tests/expectations/dep_v2.both.c +++ b/tests/expectations/dep_v2.both.c @@ -8,4 +8,4 @@ typedef struct dep_struct { double y; } dep_struct; -uint32_t get_x(const dep_struct *dep_struct); +uint32_t get_x(const struct dep_struct *dep_struct); diff --git a/tests/expectations/dep_v2.both.compat.c b/tests/expectations/dep_v2.both.compat.c index 056089ef0..9cd14e491 100644 --- a/tests/expectations/dep_v2.both.compat.c +++ b/tests/expectations/dep_v2.both.compat.c @@ -12,7 +12,7 @@ typedef struct dep_struct { extern "C" { #endif // __cplusplus -uint32_t get_x(const dep_struct *dep_struct); +uint32_t get_x(const struct dep_struct *dep_struct); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/derive_eq.both.c b/tests/expectations/derive_eq.both.c index 9bc16a1ff..eab5b1c16 100644 --- a/tests/expectations/derive_eq.both.c +++ b/tests/expectations/derive_eq.both.c @@ -18,7 +18,7 @@ typedef uint8_t Bar_Tag; typedef struct Bazz_Body { Bar_Tag tag; - Foo named; + struct Foo named; } Bazz_Body; typedef struct FooNamed_Body { @@ -30,7 +30,7 @@ typedef struct FooNamed_Body { typedef struct FooParen_Body { Bar_Tag tag; int32_t _0; - Foo _1; + struct Foo _1; } FooParen_Body; typedef union Bar { @@ -40,4 +40,4 @@ typedef union Bar { FooParen_Body foo_paren; } Bar; -Foo root(Bar aBar); +struct Foo root(union Bar aBar); diff --git a/tests/expectations/derive_eq.both.compat.c b/tests/expectations/derive_eq.both.compat.c index 14ce281d5..f628dd7cf 100644 --- a/tests/expectations/derive_eq.both.compat.c +++ b/tests/expectations/derive_eq.both.compat.c @@ -24,7 +24,7 @@ typedef uint8_t Bar_Tag; typedef struct Bazz_Body { Bar_Tag tag; - Foo named; + struct Foo named; } Bazz_Body; typedef struct FooNamed_Body { @@ -36,7 +36,7 @@ typedef struct FooNamed_Body { typedef struct FooParen_Body { Bar_Tag tag; int32_t _0; - Foo _1; + struct Foo _1; } FooParen_Body; typedef union Bar { @@ -50,7 +50,7 @@ typedef union Bar { extern "C" { #endif // __cplusplus -Foo root(Bar aBar); +struct Foo root(union Bar aBar); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/derive_ostream.both.c b/tests/expectations/derive_ostream.both.c index f90d0a8de..0bcc7d7ba 100644 --- a/tests/expectations/derive_ostream.both.c +++ b/tests/expectations/derive_ostream.both.c @@ -21,7 +21,7 @@ typedef struct B { typedef struct D { uint8_t List; uintptr_t Of; - B Things; + struct B Things; } D; enum F_Tag { @@ -90,4 +90,4 @@ typedef struct I { }; } I; -void root(A a, B b, C c, D d, F f, H h, I i); +void root(struct A a, struct B b, C c, struct D d, union F f, struct H h, struct I i); diff --git a/tests/expectations/derive_ostream.both.compat.c b/tests/expectations/derive_ostream.both.compat.c index 35b89962c..3811891a3 100644 --- a/tests/expectations/derive_ostream.both.compat.c +++ b/tests/expectations/derive_ostream.both.compat.c @@ -27,7 +27,7 @@ typedef struct B { typedef struct D { uint8_t List; uintptr_t Of; - B Things; + struct B Things; } D; enum F_Tag @@ -118,7 +118,7 @@ typedef struct I { extern "C" { #endif // __cplusplus -void root(A a, B b, C c, D d, F f, H h, I i); +void root(struct A a, struct B b, C c, struct D d, union F f, struct H h, struct I i); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/destructor_and_copy_ctor.both.c b/tests/expectations/destructor_and_copy_ctor.both.c index 3b852f147..d2b5051b5 100644 --- a/tests/expectations/destructor_and_copy_ctor.both.c +++ b/tests/expectations/destructor_and_copy_ctor.both.c @@ -24,7 +24,7 @@ typedef struct OwnedSlice_u32 { typedef struct Polygon_u32 { FillRule fill; - OwnedSlice_u32 coordinates; + struct OwnedSlice_u32 coordinates; } Polygon_u32; /** @@ -47,25 +47,25 @@ enum Foo_u32_Tag { typedef uint8_t Foo_u32_Tag; typedef struct Polygon1_Body_u32 { - Polygon_u32 _0; + struct Polygon_u32 _0; } Polygon1_Body_u32; typedef struct Slice1_Body_u32 { - OwnedSlice_u32 _0; + struct OwnedSlice_u32 _0; } Slice1_Body_u32; typedef struct Slice2_Body_u32 { - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Slice2_Body_u32; typedef struct Slice3_Body_u32 { FillRule fill; - OwnedSlice_u32 coords; + struct OwnedSlice_u32 coords; } Slice3_Body_u32; typedef struct Slice4_Body_u32 { FillRule fill; - OwnedSlice_i32 coords; + struct OwnedSlice_i32 coords; } Slice4_Body_u32; typedef struct Foo_u32 { @@ -81,7 +81,7 @@ typedef struct Foo_u32 { typedef struct Polygon_i32 { FillRule fill; - OwnedSlice_i32 coordinates; + struct OwnedSlice_i32 coordinates; } Polygon_i32; enum Baz_i32_Tag { @@ -96,29 +96,29 @@ typedef uint8_t Baz_i32_Tag; typedef struct Polygon21_Body_i32 { Baz_i32_Tag tag; - Polygon_i32 _0; + struct Polygon_i32 _0; } Polygon21_Body_i32; typedef struct Slice21_Body_i32 { Baz_i32_Tag tag; - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Slice21_Body_i32; typedef struct Slice22_Body_i32 { Baz_i32_Tag tag; - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Slice22_Body_i32; typedef struct Slice23_Body_i32 { Baz_i32_Tag tag; FillRule fill; - OwnedSlice_i32 coords; + struct OwnedSlice_i32 coords; } Slice23_Body_i32; typedef struct Slice24_Body_i32 { Baz_i32_Tag tag; FillRule fill; - OwnedSlice_i32 coords; + struct OwnedSlice_i32 coords; } Slice24_Body_i32; typedef union Baz_i32 { @@ -144,7 +144,7 @@ typedef struct Taz1_Body { typedef struct Taz3_Body { Taz_Tag tag; - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Taz3_Body; typedef union Taz { @@ -229,10 +229,10 @@ typedef union Qux { Qux2_Body qux2; } Qux; -void root(const Foo_u32 *a, - const Baz_i32 *b, - const Taz *c, - Tazz d, - const Tazzz *e, - const Tazzzz *f, - const Qux *g); +void root(const struct Foo_u32 *a, + const union Baz_i32 *b, + const union Taz *c, + union Tazz d, + const union Tazzz *e, + const union Tazzzz *f, + const union Qux *g); diff --git a/tests/expectations/destructor_and_copy_ctor.both.compat.c b/tests/expectations/destructor_and_copy_ctor.both.compat.c index 5db576229..5e608c009 100644 --- a/tests/expectations/destructor_and_copy_ctor.both.compat.c +++ b/tests/expectations/destructor_and_copy_ctor.both.compat.c @@ -30,7 +30,7 @@ typedef struct OwnedSlice_u32 { typedef struct Polygon_u32 { FillRule fill; - OwnedSlice_u32 coordinates; + struct OwnedSlice_u32 coordinates; } Polygon_u32; /** @@ -59,25 +59,25 @@ typedef uint8_t Foo_u32_Tag; #endif // __cplusplus typedef struct Polygon1_Body_u32 { - Polygon_u32 _0; + struct Polygon_u32 _0; } Polygon1_Body_u32; typedef struct Slice1_Body_u32 { - OwnedSlice_u32 _0; + struct OwnedSlice_u32 _0; } Slice1_Body_u32; typedef struct Slice2_Body_u32 { - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Slice2_Body_u32; typedef struct Slice3_Body_u32 { FillRule fill; - OwnedSlice_u32 coords; + struct OwnedSlice_u32 coords; } Slice3_Body_u32; typedef struct Slice4_Body_u32 { FillRule fill; - OwnedSlice_i32 coords; + struct OwnedSlice_i32 coords; } Slice4_Body_u32; typedef struct Foo_u32 { @@ -93,7 +93,7 @@ typedef struct Foo_u32 { typedef struct Polygon_i32 { FillRule fill; - OwnedSlice_i32 coordinates; + struct OwnedSlice_i32 coordinates; } Polygon_i32; enum Baz_i32_Tag @@ -114,29 +114,29 @@ typedef uint8_t Baz_i32_Tag; typedef struct Polygon21_Body_i32 { Baz_i32_Tag tag; - Polygon_i32 _0; + struct Polygon_i32 _0; } Polygon21_Body_i32; typedef struct Slice21_Body_i32 { Baz_i32_Tag tag; - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Slice21_Body_i32; typedef struct Slice22_Body_i32 { Baz_i32_Tag tag; - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Slice22_Body_i32; typedef struct Slice23_Body_i32 { Baz_i32_Tag tag; FillRule fill; - OwnedSlice_i32 coords; + struct OwnedSlice_i32 coords; } Slice23_Body_i32; typedef struct Slice24_Body_i32 { Baz_i32_Tag tag; FillRule fill; - OwnedSlice_i32 coords; + struct OwnedSlice_i32 coords; } Slice24_Body_i32; typedef union Baz_i32 { @@ -168,7 +168,7 @@ typedef struct Taz1_Body { typedef struct Taz3_Body { Taz_Tag tag; - OwnedSlice_i32 _0; + struct OwnedSlice_i32 _0; } Taz3_Body; typedef union Taz { @@ -281,13 +281,13 @@ typedef union Qux { extern "C" { #endif // __cplusplus -void root(const Foo_u32 *a, - const Baz_i32 *b, - const Taz *c, - Tazz d, - const Tazzz *e, - const Tazzzz *f, - const Qux *g); +void root(const struct Foo_u32 *a, + const union Baz_i32 *b, + const union Taz *c, + union Tazz d, + const union Tazzz *e, + const union Tazzzz *f, + const union Qux *g); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/display_list.both.c b/tests/expectations/display_list.both.c index 5d0cfe1e5..451eab73e 100644 --- a/tests/expectations/display_list.both.c +++ b/tests/expectations/display_list.both.c @@ -26,14 +26,14 @@ typedef uint8_t DisplayItem_Tag; typedef struct Fill_Body { DisplayItem_Tag tag; - Rect _0; - Color _1; + struct Rect _0; + struct Color _1; } Fill_Body; typedef struct Image_Body { DisplayItem_Tag tag; uint32_t id; - Rect bounds; + struct Rect bounds; } Image_Body; typedef union DisplayItem { @@ -42,4 +42,4 @@ typedef union DisplayItem { Image_Body image; } DisplayItem; -bool push_item(DisplayItem item); +bool push_item(union DisplayItem item); diff --git a/tests/expectations/display_list.both.compat.c b/tests/expectations/display_list.both.compat.c index 9d290ebd7..2a2e1d3a4 100644 --- a/tests/expectations/display_list.both.compat.c +++ b/tests/expectations/display_list.both.compat.c @@ -32,14 +32,14 @@ typedef uint8_t DisplayItem_Tag; typedef struct Fill_Body { DisplayItem_Tag tag; - Rect _0; - Color _1; + struct Rect _0; + struct Color _1; } Fill_Body; typedef struct Image_Body { DisplayItem_Tag tag; uint32_t id; - Rect bounds; + struct Rect bounds; } Image_Body; typedef union DisplayItem { @@ -52,7 +52,7 @@ typedef union DisplayItem { extern "C" { #endif // __cplusplus -bool push_item(DisplayItem item); +bool push_item(union DisplayItem item); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/enum.both.c b/tests/expectations/enum.both.c index 0a2a20295..1b3b2c1dd 100644 --- a/tests/expectations/enum.both.c +++ b/tests/expectations/enum.both.c @@ -181,23 +181,23 @@ typedef struct P { }; } P; -void root(Opaque *opaque, +void root(struct Opaque *opaque, A a, B b, C c, D d, E e, F f, - G g, - H h, - I i, - J j, - K k, - L l, + union G g, + struct H h, + struct I i, + struct J j, + struct K k, + enum L l, M m, - N n, + enum N n, O o, - P p); + struct P p); #include #include "testing-helpers.h" diff --git a/tests/expectations/enum.both.compat.c b/tests/expectations/enum.both.compat.c index 5b93c7653..5529ad14e 100644 --- a/tests/expectations/enum.both.compat.c +++ b/tests/expectations/enum.both.compat.c @@ -251,23 +251,23 @@ typedef struct P { extern "C" { #endif // __cplusplus -void root(Opaque *opaque, +void root(struct Opaque *opaque, A a, B b, C c, D d, E e, F f, - G g, - H h, - I i, - J j, - K k, - L l, + union G g, + struct H h, + struct I i, + struct J j, + struct K k, + enum L l, M m, - N n, + enum N n, O o, - P p); + struct P p); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/enum_self.both.c b/tests/expectations/enum_self.both.c index fbee30113..073f5e35d 100644 --- a/tests/expectations/enum_self.both.c +++ b/tests/expectations/enum_self.both.c @@ -16,12 +16,12 @@ typedef uint8_t Bar_Tag; typedef struct Min_Body { Bar_Tag tag; - Foo_Bar _0; + struct Foo_Bar _0; } Min_Body; typedef struct Max_Body { Bar_Tag tag; - Foo_Bar _0; + struct Foo_Bar _0; } Max_Body; typedef union Bar { @@ -30,4 +30,4 @@ typedef union Bar { Max_Body max; } Bar; -void root(Bar b); +void root(union Bar b); diff --git a/tests/expectations/enum_self.both.compat.c b/tests/expectations/enum_self.both.compat.c index f7fa456f1..559861b91 100644 --- a/tests/expectations/enum_self.both.compat.c +++ b/tests/expectations/enum_self.both.compat.c @@ -22,12 +22,12 @@ typedef uint8_t Bar_Tag; typedef struct Min_Body { Bar_Tag tag; - Foo_Bar _0; + struct Foo_Bar _0; } Min_Body; typedef struct Max_Body { Bar_Tag tag; - Foo_Bar _0; + struct Foo_Bar _0; } Max_Body; typedef union Bar { @@ -40,7 +40,7 @@ typedef union Bar { extern "C" { #endif // __cplusplus -void root(Bar b); +void root(union Bar b); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/euclid.both.c b/tests/expectations/euclid.both.c index 4548b41d0..a99a9511f 100644 --- a/tests/expectations/euclid.both.c +++ b/tests/expectations/euclid.both.c @@ -11,9 +11,9 @@ typedef struct TypedLength_f32__LayoutUnit { float _0; } TypedLength_f32__LayoutUnit; -typedef TypedLength_f32__UnknownUnit Length_f32; +typedef struct TypedLength_f32__UnknownUnit Length_f32; -typedef TypedLength_f32__LayoutUnit LayoutLength; +typedef struct TypedLength_f32__LayoutUnit LayoutLength; typedef struct TypedSideOffsets2D_f32__UnknownUnit { float top; @@ -29,9 +29,9 @@ typedef struct TypedSideOffsets2D_f32__LayoutUnit { float left; } TypedSideOffsets2D_f32__LayoutUnit; -typedef TypedSideOffsets2D_f32__UnknownUnit SideOffsets2D_f32; +typedef struct TypedSideOffsets2D_f32__UnknownUnit SideOffsets2D_f32; -typedef TypedSideOffsets2D_f32__LayoutUnit LayoutSideOffsets2D; +typedef struct TypedSideOffsets2D_f32__LayoutUnit LayoutSideOffsets2D; typedef struct TypedSize2D_f32__UnknownUnit { float width; @@ -43,9 +43,9 @@ typedef struct TypedSize2D_f32__LayoutUnit { float height; } TypedSize2D_f32__LayoutUnit; -typedef TypedSize2D_f32__UnknownUnit Size2D_f32; +typedef struct TypedSize2D_f32__UnknownUnit Size2D_f32; -typedef TypedSize2D_f32__LayoutUnit LayoutSize2D; +typedef struct TypedSize2D_f32__LayoutUnit LayoutSize2D; typedef struct TypedPoint2D_f32__UnknownUnit { float x; @@ -57,23 +57,23 @@ typedef struct TypedPoint2D_f32__LayoutUnit { float y; } TypedPoint2D_f32__LayoutUnit; -typedef TypedPoint2D_f32__UnknownUnit Point2D_f32; +typedef struct TypedPoint2D_f32__UnknownUnit Point2D_f32; -typedef TypedPoint2D_f32__LayoutUnit LayoutPoint2D; +typedef struct TypedPoint2D_f32__LayoutUnit LayoutPoint2D; typedef struct TypedRect_f32__UnknownUnit { - TypedPoint2D_f32__UnknownUnit origin; - TypedSize2D_f32__UnknownUnit size; + struct TypedPoint2D_f32__UnknownUnit origin; + struct TypedSize2D_f32__UnknownUnit size; } TypedRect_f32__UnknownUnit; typedef struct TypedRect_f32__LayoutUnit { - TypedPoint2D_f32__LayoutUnit origin; - TypedSize2D_f32__LayoutUnit size; + struct TypedPoint2D_f32__LayoutUnit origin; + struct TypedSize2D_f32__LayoutUnit size; } TypedRect_f32__LayoutUnit; -typedef TypedRect_f32__UnknownUnit Rect_f32; +typedef struct TypedRect_f32__UnknownUnit Rect_f32; -typedef TypedRect_f32__LayoutUnit LayoutRect; +typedef struct TypedRect_f32__LayoutUnit LayoutRect; typedef struct TypedTransform2D_f32__UnknownUnit__LayoutUnit { float m11; @@ -93,25 +93,25 @@ typedef struct TypedTransform2D_f32__LayoutUnit__UnknownUnit { float m32; } TypedTransform2D_f32__LayoutUnit__UnknownUnit; -void root(TypedLength_f32__UnknownUnit length_a, - TypedLength_f32__LayoutUnit length_b, +void root(struct TypedLength_f32__UnknownUnit length_a, + struct TypedLength_f32__LayoutUnit length_b, Length_f32 length_c, LayoutLength length_d, - TypedSideOffsets2D_f32__UnknownUnit side_offsets_a, - TypedSideOffsets2D_f32__LayoutUnit side_offsets_b, + struct TypedSideOffsets2D_f32__UnknownUnit side_offsets_a, + struct TypedSideOffsets2D_f32__LayoutUnit side_offsets_b, SideOffsets2D_f32 side_offsets_c, LayoutSideOffsets2D side_offsets_d, - TypedSize2D_f32__UnknownUnit size_a, - TypedSize2D_f32__LayoutUnit size_b, + struct TypedSize2D_f32__UnknownUnit size_a, + struct TypedSize2D_f32__LayoutUnit size_b, Size2D_f32 size_c, LayoutSize2D size_d, - TypedPoint2D_f32__UnknownUnit point_a, - TypedPoint2D_f32__LayoutUnit point_b, + struct TypedPoint2D_f32__UnknownUnit point_a, + struct TypedPoint2D_f32__LayoutUnit point_b, Point2D_f32 point_c, LayoutPoint2D point_d, - TypedRect_f32__UnknownUnit rect_a, - TypedRect_f32__LayoutUnit rect_b, + struct TypedRect_f32__UnknownUnit rect_a, + struct TypedRect_f32__LayoutUnit rect_b, Rect_f32 rect_c, LayoutRect rect_d, - TypedTransform2D_f32__UnknownUnit__LayoutUnit transform_a, - TypedTransform2D_f32__LayoutUnit__UnknownUnit transform_b); + struct TypedTransform2D_f32__UnknownUnit__LayoutUnit transform_a, + struct TypedTransform2D_f32__LayoutUnit__UnknownUnit transform_b); diff --git a/tests/expectations/euclid.both.compat.c b/tests/expectations/euclid.both.compat.c index 338471b55..e4f9b902c 100644 --- a/tests/expectations/euclid.both.compat.c +++ b/tests/expectations/euclid.both.compat.c @@ -11,9 +11,9 @@ typedef struct TypedLength_f32__LayoutUnit { float _0; } TypedLength_f32__LayoutUnit; -typedef TypedLength_f32__UnknownUnit Length_f32; +typedef struct TypedLength_f32__UnknownUnit Length_f32; -typedef TypedLength_f32__LayoutUnit LayoutLength; +typedef struct TypedLength_f32__LayoutUnit LayoutLength; typedef struct TypedSideOffsets2D_f32__UnknownUnit { float top; @@ -29,9 +29,9 @@ typedef struct TypedSideOffsets2D_f32__LayoutUnit { float left; } TypedSideOffsets2D_f32__LayoutUnit; -typedef TypedSideOffsets2D_f32__UnknownUnit SideOffsets2D_f32; +typedef struct TypedSideOffsets2D_f32__UnknownUnit SideOffsets2D_f32; -typedef TypedSideOffsets2D_f32__LayoutUnit LayoutSideOffsets2D; +typedef struct TypedSideOffsets2D_f32__LayoutUnit LayoutSideOffsets2D; typedef struct TypedSize2D_f32__UnknownUnit { float width; @@ -43,9 +43,9 @@ typedef struct TypedSize2D_f32__LayoutUnit { float height; } TypedSize2D_f32__LayoutUnit; -typedef TypedSize2D_f32__UnknownUnit Size2D_f32; +typedef struct TypedSize2D_f32__UnknownUnit Size2D_f32; -typedef TypedSize2D_f32__LayoutUnit LayoutSize2D; +typedef struct TypedSize2D_f32__LayoutUnit LayoutSize2D; typedef struct TypedPoint2D_f32__UnknownUnit { float x; @@ -57,23 +57,23 @@ typedef struct TypedPoint2D_f32__LayoutUnit { float y; } TypedPoint2D_f32__LayoutUnit; -typedef TypedPoint2D_f32__UnknownUnit Point2D_f32; +typedef struct TypedPoint2D_f32__UnknownUnit Point2D_f32; -typedef TypedPoint2D_f32__LayoutUnit LayoutPoint2D; +typedef struct TypedPoint2D_f32__LayoutUnit LayoutPoint2D; typedef struct TypedRect_f32__UnknownUnit { - TypedPoint2D_f32__UnknownUnit origin; - TypedSize2D_f32__UnknownUnit size; + struct TypedPoint2D_f32__UnknownUnit origin; + struct TypedSize2D_f32__UnknownUnit size; } TypedRect_f32__UnknownUnit; typedef struct TypedRect_f32__LayoutUnit { - TypedPoint2D_f32__LayoutUnit origin; - TypedSize2D_f32__LayoutUnit size; + struct TypedPoint2D_f32__LayoutUnit origin; + struct TypedSize2D_f32__LayoutUnit size; } TypedRect_f32__LayoutUnit; -typedef TypedRect_f32__UnknownUnit Rect_f32; +typedef struct TypedRect_f32__UnknownUnit Rect_f32; -typedef TypedRect_f32__LayoutUnit LayoutRect; +typedef struct TypedRect_f32__LayoutUnit LayoutRect; typedef struct TypedTransform2D_f32__UnknownUnit__LayoutUnit { float m11; @@ -97,28 +97,28 @@ typedef struct TypedTransform2D_f32__LayoutUnit__UnknownUnit { extern "C" { #endif // __cplusplus -void root(TypedLength_f32__UnknownUnit length_a, - TypedLength_f32__LayoutUnit length_b, +void root(struct TypedLength_f32__UnknownUnit length_a, + struct TypedLength_f32__LayoutUnit length_b, Length_f32 length_c, LayoutLength length_d, - TypedSideOffsets2D_f32__UnknownUnit side_offsets_a, - TypedSideOffsets2D_f32__LayoutUnit side_offsets_b, + struct TypedSideOffsets2D_f32__UnknownUnit side_offsets_a, + struct TypedSideOffsets2D_f32__LayoutUnit side_offsets_b, SideOffsets2D_f32 side_offsets_c, LayoutSideOffsets2D side_offsets_d, - TypedSize2D_f32__UnknownUnit size_a, - TypedSize2D_f32__LayoutUnit size_b, + struct TypedSize2D_f32__UnknownUnit size_a, + struct TypedSize2D_f32__LayoutUnit size_b, Size2D_f32 size_c, LayoutSize2D size_d, - TypedPoint2D_f32__UnknownUnit point_a, - TypedPoint2D_f32__LayoutUnit point_b, + struct TypedPoint2D_f32__UnknownUnit point_a, + struct TypedPoint2D_f32__LayoutUnit point_b, Point2D_f32 point_c, LayoutPoint2D point_d, - TypedRect_f32__UnknownUnit rect_a, - TypedRect_f32__LayoutUnit rect_b, + struct TypedRect_f32__UnknownUnit rect_a, + struct TypedRect_f32__LayoutUnit rect_b, Rect_f32 rect_c, LayoutRect rect_d, - TypedTransform2D_f32__UnknownUnit__LayoutUnit transform_a, - TypedTransform2D_f32__LayoutUnit__UnknownUnit transform_b); + struct TypedTransform2D_f32__UnknownUnit__LayoutUnit transform_a, + struct TypedTransform2D_f32__LayoutUnit__UnknownUnit transform_b); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/exclude_generic_monomorph.both.c b/tests/expectations/exclude_generic_monomorph.both.c index 2d43ce156..e5157486f 100644 --- a/tests/expectations/exclude_generic_monomorph.both.c +++ b/tests/expectations/exclude_generic_monomorph.both.c @@ -12,4 +12,4 @@ typedef struct Bar { Option_Foo foo; } Bar; -void root(Bar f); +void root(struct Bar f); diff --git a/tests/expectations/exclude_generic_monomorph.both.compat.c b/tests/expectations/exclude_generic_monomorph.both.compat.c index 76a0a3bb2..477261ff5 100644 --- a/tests/expectations/exclude_generic_monomorph.both.compat.c +++ b/tests/expectations/exclude_generic_monomorph.both.compat.c @@ -16,7 +16,7 @@ typedef struct Bar { extern "C" { #endif // __cplusplus -void root(Bar f); +void root(struct Bar f); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/expand.both.c b/tests/expectations/expand.both.c index 8e7784311..7c7e0c9a0 100644 --- a/tests/expectations/expand.both.c +++ b/tests/expectations/expand.both.c @@ -7,4 +7,4 @@ typedef struct Foo { } Foo; -void root(Foo a); +void root(struct Foo a); diff --git a/tests/expectations/expand.both.compat.c b/tests/expectations/expand.both.compat.c index 19ae0b2c5..5a235ae56 100644 --- a/tests/expectations/expand.both.compat.c +++ b/tests/expectations/expand.both.compat.c @@ -11,7 +11,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo a); +void root(struct Foo a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/expand_default_features.both.c b/tests/expectations/expand_default_features.both.c index 1b18bde3e..7029413dd 100644 --- a/tests/expectations/expand_default_features.both.c +++ b/tests/expectations/expand_default_features.both.c @@ -9,4 +9,4 @@ typedef struct Foo { void extra_debug_fn(void); -void root(Foo a); +void root(struct Foo a); diff --git a/tests/expectations/expand_default_features.both.compat.c b/tests/expectations/expand_default_features.both.compat.c index 4433bdd86..ce7318cfb 100644 --- a/tests/expectations/expand_default_features.both.compat.c +++ b/tests/expectations/expand_default_features.both.compat.c @@ -13,7 +13,7 @@ extern "C" { void extra_debug_fn(void); -void root(Foo a); +void root(struct Foo a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/expand_dep.both.c b/tests/expectations/expand_dep.both.c index 401228965..9a91a4fe4 100644 --- a/tests/expectations/expand_dep.both.c +++ b/tests/expectations/expand_dep.both.c @@ -8,4 +8,4 @@ typedef struct dep_struct { double y; } dep_struct; -uint32_t get_x(const dep_struct *dep_struct); +uint32_t get_x(const struct dep_struct *dep_struct); diff --git a/tests/expectations/expand_dep.both.compat.c b/tests/expectations/expand_dep.both.compat.c index 056089ef0..9cd14e491 100644 --- a/tests/expectations/expand_dep.both.compat.c +++ b/tests/expectations/expand_dep.both.compat.c @@ -12,7 +12,7 @@ typedef struct dep_struct { extern "C" { #endif // __cplusplus -uint32_t get_x(const dep_struct *dep_struct); +uint32_t get_x(const struct dep_struct *dep_struct); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/expand_dep_v2.both.c b/tests/expectations/expand_dep_v2.both.c index 401228965..9a91a4fe4 100644 --- a/tests/expectations/expand_dep_v2.both.c +++ b/tests/expectations/expand_dep_v2.both.c @@ -8,4 +8,4 @@ typedef struct dep_struct { double y; } dep_struct; -uint32_t get_x(const dep_struct *dep_struct); +uint32_t get_x(const struct dep_struct *dep_struct); diff --git a/tests/expectations/expand_dep_v2.both.compat.c b/tests/expectations/expand_dep_v2.both.compat.c index 056089ef0..9cd14e491 100644 --- a/tests/expectations/expand_dep_v2.both.compat.c +++ b/tests/expectations/expand_dep_v2.both.compat.c @@ -12,7 +12,7 @@ typedef struct dep_struct { extern "C" { #endif // __cplusplus -uint32_t get_x(const dep_struct *dep_struct); +uint32_t get_x(const struct dep_struct *dep_struct); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/expand_features.both.c b/tests/expectations/expand_features.both.c index 04118cb80..210c89724 100644 --- a/tests/expectations/expand_features.both.c +++ b/tests/expectations/expand_features.both.c @@ -11,4 +11,4 @@ void extra_debug_fn(void); void cbindgen(void); -void root(Foo a); +void root(struct Foo a); diff --git a/tests/expectations/expand_features.both.compat.c b/tests/expectations/expand_features.both.compat.c index 8d5a336d6..e3ef2a636 100644 --- a/tests/expectations/expand_features.both.compat.c +++ b/tests/expectations/expand_features.both.compat.c @@ -15,7 +15,7 @@ void extra_debug_fn(void); void cbindgen(void); -void root(Foo a); +void root(struct Foo a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/expand_no_default_features.both.c b/tests/expectations/expand_no_default_features.both.c index 8e7784311..7c7e0c9a0 100644 --- a/tests/expectations/expand_no_default_features.both.c +++ b/tests/expectations/expand_no_default_features.both.c @@ -7,4 +7,4 @@ typedef struct Foo { } Foo; -void root(Foo a); +void root(struct Foo a); diff --git a/tests/expectations/expand_no_default_features.both.compat.c b/tests/expectations/expand_no_default_features.both.compat.c index 19ae0b2c5..5a235ae56 100644 --- a/tests/expectations/expand_no_default_features.both.compat.c +++ b/tests/expectations/expand_no_default_features.both.compat.c @@ -11,7 +11,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo a); +void root(struct Foo a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/extern.both.c b/tests/expectations/extern.both.c index d80d656e3..026661a64 100644 --- a/tests/expectations/extern.both.c +++ b/tests/expectations/extern.both.c @@ -10,4 +10,4 @@ typedef struct Normal { extern int32_t foo(void); -extern void bar(Normal a); +extern void bar(struct Normal a); diff --git a/tests/expectations/extern.both.compat.c b/tests/expectations/extern.both.compat.c index 5f772bccb..3c49da31e 100644 --- a/tests/expectations/extern.both.compat.c +++ b/tests/expectations/extern.both.compat.c @@ -14,7 +14,7 @@ extern "C" { extern int32_t foo(void); -extern void bar(Normal a); +extern void bar(struct Normal a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/external_workspace_child.both.c b/tests/expectations/external_workspace_child.both.c index cb37ff688..57bedaadd 100644 --- a/tests/expectations/external_workspace_child.both.c +++ b/tests/expectations/external_workspace_child.both.c @@ -7,4 +7,4 @@ typedef struct ExtType { uint32_t data; } ExtType; -void consume_ext(ExtType _ext); +void consume_ext(struct ExtType _ext); diff --git a/tests/expectations/external_workspace_child.both.compat.c b/tests/expectations/external_workspace_child.both.compat.c index d0d8d3be5..1bc8b1456 100644 --- a/tests/expectations/external_workspace_child.both.compat.c +++ b/tests/expectations/external_workspace_child.both.compat.c @@ -11,7 +11,7 @@ typedef struct ExtType { extern "C" { #endif // __cplusplus -void consume_ext(ExtType _ext); +void consume_ext(struct ExtType _ext); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/fns.both.c b/tests/expectations/fns.both.c index 747fadd86..fcd511647 100644 --- a/tests/expectations/fns.both.c +++ b/tests/expectations/fns.both.c @@ -11,6 +11,6 @@ typedef struct Fns { int8_t (*namedArgsWildcards)(int32_t _, int16_t named, int64_t _1); } Fns; -void root(Fns _fns); +void root(struct Fns _fns); void no_return(void); diff --git a/tests/expectations/fns.both.compat.c b/tests/expectations/fns.both.compat.c index 5a94182ad..16c9ee639 100644 --- a/tests/expectations/fns.both.compat.c +++ b/tests/expectations/fns.both.compat.c @@ -15,7 +15,7 @@ typedef struct Fns { extern "C" { #endif // __cplusplus -void root(Fns _fns); +void root(struct Fns _fns); void no_return(void); diff --git a/tests/expectations/generic_pointer.both.c b/tests/expectations/generic_pointer.both.c index 242745e8c..ac51021e7 100644 --- a/tests/expectations/generic_pointer.both.c +++ b/tests/expectations/generic_pointer.both.c @@ -7,6 +7,6 @@ typedef struct Foo_____u8 { uint8_t *a; } Foo_____u8; -typedef Foo_____u8 Boo; +typedef struct Foo_____u8 Boo; void root(Boo x); diff --git a/tests/expectations/generic_pointer.both.compat.c b/tests/expectations/generic_pointer.both.compat.c index 07bafe388..3288ece6c 100644 --- a/tests/expectations/generic_pointer.both.compat.c +++ b/tests/expectations/generic_pointer.both.compat.c @@ -7,7 +7,7 @@ typedef struct Foo_____u8 { uint8_t *a; } Foo_____u8; -typedef Foo_____u8 Boo; +typedef struct Foo_____u8 Boo; #ifdef __cplusplus extern "C" { diff --git a/tests/expectations/include_item.both.compat.c b/tests/expectations/include_item.both.compat.c index 12f1678a0..75ba4f494 100644 --- a/tests/expectations/include_item.both.compat.c +++ b/tests/expectations/include_item.both.compat.c @@ -9,5 +9,5 @@ typedef struct A { } A; typedef struct B { - A data; + struct A data; } B; diff --git a/tests/expectations/inner_mod.both.c b/tests/expectations/inner_mod.both.c index 6eda1874b..6035e3dcf 100644 --- a/tests/expectations/inner_mod.both.c +++ b/tests/expectations/inner_mod.both.c @@ -7,4 +7,4 @@ typedef struct Foo { float x; } Foo; -void root(Foo a); +void root(struct Foo a); diff --git a/tests/expectations/inner_mod.both.compat.c b/tests/expectations/inner_mod.both.compat.c index 75acb472a..d46bb80b5 100644 --- a/tests/expectations/inner_mod.both.compat.c +++ b/tests/expectations/inner_mod.both.compat.c @@ -11,7 +11,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo a); +void root(struct Foo a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/lifetime_arg.both.c b/tests/expectations/lifetime_arg.both.c index 241d3629e..8840409dc 100644 --- a/tests/expectations/lifetime_arg.both.c +++ b/tests/expectations/lifetime_arg.both.c @@ -23,4 +23,4 @@ typedef struct E { }; } E; -void root(A _a, E _e); +void root(struct A _a, struct E _e); diff --git a/tests/expectations/lifetime_arg.both.compat.c b/tests/expectations/lifetime_arg.both.compat.c index ba991078b..5397f50a8 100644 --- a/tests/expectations/lifetime_arg.both.compat.c +++ b/tests/expectations/lifetime_arg.both.compat.c @@ -27,7 +27,7 @@ typedef struct E { extern "C" { #endif // __cplusplus -void root(A _a, E _e); +void root(struct A _a, struct E _e); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/linestyle_cr.both.c b/tests/expectations/linestyle_cr.both.c index 2fa7d1711..b6e8e408d 100644 --- a/tests/expectations/linestyle_cr.both.c +++ b/tests/expectations/linestyle_cr.both.c @@ -1 +1 @@ -#include #include #include #include typedef struct Dummy { int32_t x; float y; } Dummy; void root(Dummy d); \ No newline at end of file +#include #include #include #include typedef struct Dummy { int32_t x; float y; } Dummy; void root(struct Dummy d); \ No newline at end of file diff --git a/tests/expectations/linestyle_cr.both.compat.c b/tests/expectations/linestyle_cr.both.compat.c index 2fc759a77..2af7888c5 100644 --- a/tests/expectations/linestyle_cr.both.compat.c +++ b/tests/expectations/linestyle_cr.both.compat.c @@ -1 +1 @@ -#include #include #include #include typedef struct Dummy { int32_t x; float y; } Dummy; #ifdef __cplusplus extern "C" { #endif // __cplusplus void root(Dummy d); #ifdef __cplusplus } // extern "C" #endif // __cplusplus \ No newline at end of file +#include #include #include #include typedef struct Dummy { int32_t x; float y; } Dummy; #ifdef __cplusplus extern "C" { #endif // __cplusplus void root(struct Dummy d); #ifdef __cplusplus } // extern "C" #endif // __cplusplus \ No newline at end of file diff --git a/tests/expectations/linestyle_crlf.both.c b/tests/expectations/linestyle_crlf.both.c index 2a67a869b..028d85ba3 100644 --- a/tests/expectations/linestyle_crlf.both.c +++ b/tests/expectations/linestyle_crlf.both.c @@ -8,4 +8,4 @@ typedef struct Dummy { float y; } Dummy; -void root(Dummy d); +void root(struct Dummy d); diff --git a/tests/expectations/linestyle_crlf.both.compat.c b/tests/expectations/linestyle_crlf.both.compat.c index f46efe837..fa16a155c 100644 --- a/tests/expectations/linestyle_crlf.both.compat.c +++ b/tests/expectations/linestyle_crlf.both.compat.c @@ -12,7 +12,7 @@ typedef struct Dummy { extern "C" { #endif // __cplusplus -void root(Dummy d); +void root(struct Dummy d); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/linestyle_lf.both.c b/tests/expectations/linestyle_lf.both.c index c624ea3c4..dc6b06f5c 100644 --- a/tests/expectations/linestyle_lf.both.c +++ b/tests/expectations/linestyle_lf.both.c @@ -8,4 +8,4 @@ typedef struct Dummy { float y; } Dummy; -void root(Dummy d); +void root(struct Dummy d); diff --git a/tests/expectations/linestyle_lf.both.compat.c b/tests/expectations/linestyle_lf.both.compat.c index b697b7c4d..715acd1cb 100644 --- a/tests/expectations/linestyle_lf.both.compat.c +++ b/tests/expectations/linestyle_lf.both.compat.c @@ -12,7 +12,7 @@ typedef struct Dummy { extern "C" { #endif // __cplusplus -void root(Dummy d); +void root(struct Dummy d); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/mangle.both.c b/tests/expectations/mangle.both.c index 6dd670edd..c0f77503e 100644 --- a/tests/expectations/mangle.both.c +++ b/tests/expectations/mangle.both.c @@ -7,6 +7,6 @@ typedef struct FooU8 { uint8_t a; } FooU8; -typedef FooU8 Boo; +typedef struct FooU8 Boo; void root(Boo x); diff --git a/tests/expectations/mangle.both.compat.c b/tests/expectations/mangle.both.compat.c index 841b1451a..b5766da57 100644 --- a/tests/expectations/mangle.both.compat.c +++ b/tests/expectations/mangle.both.compat.c @@ -7,7 +7,7 @@ typedef struct FooU8 { uint8_t a; } FooU8; -typedef FooU8 Boo; +typedef struct FooU8 Boo; #ifdef __cplusplus extern "C" { diff --git a/tests/expectations/manuallydrop.both.c b/tests/expectations/manuallydrop.both.c index c2f72a323..7909c16ed 100644 --- a/tests/expectations/manuallydrop.both.c +++ b/tests/expectations/manuallydrop.both.c @@ -11,7 +11,7 @@ using ManuallyDrop = T; typedef struct NotReprC_ManuallyDrop_Point NotReprC_ManuallyDrop_Point; -typedef NotReprC_ManuallyDrop_Point Foo; +typedef struct NotReprC_ManuallyDrop_Point Foo; typedef struct Point { int32_t x; @@ -19,9 +19,9 @@ typedef struct Point { } Point; typedef struct MyStruct { - Point point; + struct Point point; } MyStruct; -void root(const Foo *a, const MyStruct *with_manual_drop); +void root(const Foo *a, const struct MyStruct *with_manual_drop); -void take(Point with_manual_drop); +void take(struct Point with_manual_drop); diff --git a/tests/expectations/manuallydrop.both.compat.c b/tests/expectations/manuallydrop.both.compat.c index 551f9e789..436a9a99a 100644 --- a/tests/expectations/manuallydrop.both.compat.c +++ b/tests/expectations/manuallydrop.both.compat.c @@ -11,7 +11,7 @@ using ManuallyDrop = T; typedef struct NotReprC_ManuallyDrop_Point NotReprC_ManuallyDrop_Point; -typedef NotReprC_ManuallyDrop_Point Foo; +typedef struct NotReprC_ManuallyDrop_Point Foo; typedef struct Point { int32_t x; @@ -19,16 +19,16 @@ typedef struct Point { } Point; typedef struct MyStruct { - Point point; + struct Point point; } MyStruct; #ifdef __cplusplus extern "C" { #endif // __cplusplus -void root(const Foo *a, const MyStruct *with_manual_drop); +void root(const Foo *a, const struct MyStruct *with_manual_drop); -void take(Point with_manual_drop); +void take(struct Point with_manual_drop); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/maybeuninit.both.c b/tests/expectations/maybeuninit.both.c index 2eb4dd2ff..e6c543287 100644 --- a/tests/expectations/maybeuninit.both.c +++ b/tests/expectations/maybeuninit.both.c @@ -11,10 +11,10 @@ using MaybeUninit = T; typedef struct NotReprC_MaybeUninit______i32 NotReprC_MaybeUninit______i32; -typedef NotReprC_MaybeUninit______i32 Foo; +typedef struct NotReprC_MaybeUninit______i32 Foo; typedef struct MyStruct { const int32_t *number; } MyStruct; -void root(const Foo *a, const MyStruct *with_maybe_uninit); +void root(const Foo *a, const struct MyStruct *with_maybe_uninit); diff --git a/tests/expectations/maybeuninit.both.compat.c b/tests/expectations/maybeuninit.both.compat.c index b840faa8e..c9ccb96bc 100644 --- a/tests/expectations/maybeuninit.both.compat.c +++ b/tests/expectations/maybeuninit.both.compat.c @@ -11,7 +11,7 @@ using MaybeUninit = T; typedef struct NotReprC_MaybeUninit______i32 NotReprC_MaybeUninit______i32; -typedef NotReprC_MaybeUninit______i32 Foo; +typedef struct NotReprC_MaybeUninit______i32 Foo; typedef struct MyStruct { const int32_t *number; @@ -21,7 +21,7 @@ typedef struct MyStruct { extern "C" { #endif // __cplusplus -void root(const Foo *a, const MyStruct *with_maybe_uninit); +void root(const Foo *a, const struct MyStruct *with_maybe_uninit); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/mod_2015.both.c b/tests/expectations/mod_2015.both.c index 489223e52..387edf8e0 100644 --- a/tests/expectations/mod_2015.both.c +++ b/tests/expectations/mod_2015.both.c @@ -9,4 +9,4 @@ typedef struct ExportMe { uint64_t val; } ExportMe; -void export_me(ExportMe *val); +void export_me(struct ExportMe *val); diff --git a/tests/expectations/mod_2015.both.compat.c b/tests/expectations/mod_2015.both.compat.c index 3f4aa04bf..3d090e530 100644 --- a/tests/expectations/mod_2015.both.compat.c +++ b/tests/expectations/mod_2015.both.compat.c @@ -13,7 +13,7 @@ typedef struct ExportMe { extern "C" { #endif // __cplusplus -void export_me(ExportMe *val); +void export_me(struct ExportMe *val); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/mod_2018.both.c b/tests/expectations/mod_2018.both.c index 489223e52..387edf8e0 100644 --- a/tests/expectations/mod_2018.both.c +++ b/tests/expectations/mod_2018.both.c @@ -9,4 +9,4 @@ typedef struct ExportMe { uint64_t val; } ExportMe; -void export_me(ExportMe *val); +void export_me(struct ExportMe *val); diff --git a/tests/expectations/mod_2018.both.compat.c b/tests/expectations/mod_2018.both.compat.c index 3f4aa04bf..3d090e530 100644 --- a/tests/expectations/mod_2018.both.compat.c +++ b/tests/expectations/mod_2018.both.compat.c @@ -13,7 +13,7 @@ typedef struct ExportMe { extern "C" { #endif // __cplusplus -void export_me(ExportMe *val); +void export_me(struct ExportMe *val); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/mod_attr.both.c b/tests/expectations/mod_attr.both.c index c9815c0e3..9cddcf4cf 100644 --- a/tests/expectations/mod_attr.both.c +++ b/tests/expectations/mod_attr.both.c @@ -24,9 +24,9 @@ typedef struct Bar { #endif #if defined(FOO) -void foo(const Foo *foo); +void foo(const struct Foo *foo); #endif #if defined(BAR) -void bar(const Bar *bar); +void bar(const struct Bar *bar); #endif diff --git a/tests/expectations/mod_attr.both.compat.c b/tests/expectations/mod_attr.both.compat.c index fcf178f4e..907928092 100644 --- a/tests/expectations/mod_attr.both.compat.c +++ b/tests/expectations/mod_attr.both.compat.c @@ -28,11 +28,11 @@ extern "C" { #endif // __cplusplus #if defined(FOO) -void foo(const Foo *foo); +void foo(const struct Foo *foo); #endif #if defined(BAR) -void bar(const Bar *bar); +void bar(const struct Bar *bar); #endif #ifdef __cplusplus diff --git a/tests/expectations/mod_path.both.c b/tests/expectations/mod_path.both.c index 489223e52..387edf8e0 100644 --- a/tests/expectations/mod_path.both.c +++ b/tests/expectations/mod_path.both.c @@ -9,4 +9,4 @@ typedef struct ExportMe { uint64_t val; } ExportMe; -void export_me(ExportMe *val); +void export_me(struct ExportMe *val); diff --git a/tests/expectations/mod_path.both.compat.c b/tests/expectations/mod_path.both.compat.c index 3f4aa04bf..3d090e530 100644 --- a/tests/expectations/mod_path.both.compat.c +++ b/tests/expectations/mod_path.both.compat.c @@ -13,7 +13,7 @@ typedef struct ExportMe { extern "C" { #endif // __cplusplus -void export_me(ExportMe *val); +void export_me(struct ExportMe *val); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/monomorph_1.both.c b/tests/expectations/monomorph_1.both.c index 04c165442..8c3eda63b 100644 --- a/tests/expectations/monomorph_1.both.c +++ b/tests/expectations/monomorph_1.both.c @@ -18,11 +18,11 @@ typedef struct Foo_f32 { } Foo_f32; typedef struct Foo_Bar_f32 { - const Bar_f32 *data; + const struct Bar_f32 *data; } Foo_Bar_f32; typedef struct Tuple_Foo_f32_____f32 { - const Foo_f32 *a; + const struct Foo_f32 *a; const float *b; } Tuple_Foo_f32_____f32; @@ -31,13 +31,13 @@ typedef struct Tuple_f32__f32 { const float *b; } Tuple_f32__f32; -typedef Tuple_f32__f32 Indirection_f32; +typedef struct Tuple_f32__f32 Indirection_f32; -void root(Foo_i32 a, - Foo_f32 b, - Bar_f32 c, - Foo_Bar_f32 d, - Bar_Foo_f32 e, - Bar_Bar_f32 f, - Tuple_Foo_f32_____f32 g, +void root(struct Foo_i32 a, + struct Foo_f32 b, + struct Bar_f32 c, + struct Foo_Bar_f32 d, + struct Bar_Foo_f32 e, + struct Bar_Bar_f32 f, + struct Tuple_Foo_f32_____f32 g, Indirection_f32 h); diff --git a/tests/expectations/monomorph_1.both.compat.c b/tests/expectations/monomorph_1.both.compat.c index 2dfa30129..b7de1da0b 100644 --- a/tests/expectations/monomorph_1.both.compat.c +++ b/tests/expectations/monomorph_1.both.compat.c @@ -18,11 +18,11 @@ typedef struct Foo_f32 { } Foo_f32; typedef struct Foo_Bar_f32 { - const Bar_f32 *data; + const struct Bar_f32 *data; } Foo_Bar_f32; typedef struct Tuple_Foo_f32_____f32 { - const Foo_f32 *a; + const struct Foo_f32 *a; const float *b; } Tuple_Foo_f32_____f32; @@ -31,19 +31,19 @@ typedef struct Tuple_f32__f32 { const float *b; } Tuple_f32__f32; -typedef Tuple_f32__f32 Indirection_f32; +typedef struct Tuple_f32__f32 Indirection_f32; #ifdef __cplusplus extern "C" { #endif // __cplusplus -void root(Foo_i32 a, - Foo_f32 b, - Bar_f32 c, - Foo_Bar_f32 d, - Bar_Foo_f32 e, - Bar_Bar_f32 f, - Tuple_Foo_f32_____f32 g, +void root(struct Foo_i32 a, + struct Foo_f32 b, + struct Bar_f32 c, + struct Foo_Bar_f32 d, + struct Bar_Foo_f32 e, + struct Bar_Bar_f32 f, + struct Tuple_Foo_f32_____f32 g, Indirection_f32 h); #ifdef __cplusplus diff --git a/tests/expectations/monomorph_2.both.c b/tests/expectations/monomorph_2.both.c index 4803e9b9f..b104c5841 100644 --- a/tests/expectations/monomorph_2.both.c +++ b/tests/expectations/monomorph_2.both.c @@ -8,15 +8,15 @@ typedef struct A A; typedef struct B B; typedef struct List_A { - A *members; + struct A *members; uintptr_t count; } List_A; typedef struct List_B { - B *members; + struct B *members; uintptr_t count; } List_B; -void foo(List_A a); +void foo(struct List_A a); -void bar(List_B b); +void bar(struct List_B b); diff --git a/tests/expectations/monomorph_2.both.compat.c b/tests/expectations/monomorph_2.both.compat.c index 1a8e5ea9c..8f2b0be73 100644 --- a/tests/expectations/monomorph_2.both.compat.c +++ b/tests/expectations/monomorph_2.both.compat.c @@ -8,12 +8,12 @@ typedef struct A A; typedef struct B B; typedef struct List_A { - A *members; + struct A *members; uintptr_t count; } List_A; typedef struct List_B { - B *members; + struct B *members; uintptr_t count; } List_B; @@ -21,9 +21,9 @@ typedef struct List_B { extern "C" { #endif // __cplusplus -void foo(List_A a); +void foo(struct List_A a); -void bar(List_B b); +void bar(struct List_B b); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/monomorph_3.both.c b/tests/expectations/monomorph_3.both.c index b7b572737..28d50137b 100644 --- a/tests/expectations/monomorph_3.both.c +++ b/tests/expectations/monomorph_3.both.c @@ -18,11 +18,11 @@ typedef union Foo_f32 { } Foo_f32; typedef union Foo_Bar_f32 { - const Bar_f32 *data; + const struct Bar_f32 *data; } Foo_Bar_f32; typedef union Tuple_Foo_f32_____f32 { - const Foo_f32 *a; + const union Foo_f32 *a; const float *b; } Tuple_Foo_f32_____f32; @@ -31,13 +31,13 @@ typedef union Tuple_f32__f32 { const float *b; } Tuple_f32__f32; -typedef Tuple_f32__f32 Indirection_f32; +typedef union Tuple_f32__f32 Indirection_f32; -void root(Foo_i32 a, - Foo_f32 b, - Bar_f32 c, - Foo_Bar_f32 d, - Bar_Foo_f32 e, - Bar_Bar_f32 f, - Tuple_Foo_f32_____f32 g, +void root(union Foo_i32 a, + union Foo_f32 b, + struct Bar_f32 c, + union Foo_Bar_f32 d, + struct Bar_Foo_f32 e, + struct Bar_Bar_f32 f, + union Tuple_Foo_f32_____f32 g, Indirection_f32 h); diff --git a/tests/expectations/monomorph_3.both.compat.c b/tests/expectations/monomorph_3.both.compat.c index 16ddb0095..0ff0be201 100644 --- a/tests/expectations/monomorph_3.both.compat.c +++ b/tests/expectations/monomorph_3.both.compat.c @@ -18,11 +18,11 @@ typedef union Foo_f32 { } Foo_f32; typedef union Foo_Bar_f32 { - const Bar_f32 *data; + const struct Bar_f32 *data; } Foo_Bar_f32; typedef union Tuple_Foo_f32_____f32 { - const Foo_f32 *a; + const union Foo_f32 *a; const float *b; } Tuple_Foo_f32_____f32; @@ -31,19 +31,19 @@ typedef union Tuple_f32__f32 { const float *b; } Tuple_f32__f32; -typedef Tuple_f32__f32 Indirection_f32; +typedef union Tuple_f32__f32 Indirection_f32; #ifdef __cplusplus extern "C" { #endif // __cplusplus -void root(Foo_i32 a, - Foo_f32 b, - Bar_f32 c, - Foo_Bar_f32 d, - Bar_Foo_f32 e, - Bar_Bar_f32 f, - Tuple_Foo_f32_____f32 g, +void root(union Foo_i32 a, + union Foo_f32 b, + struct Bar_f32 c, + union Foo_Bar_f32 d, + struct Bar_Foo_f32 e, + struct Bar_Bar_f32 f, + union Tuple_Foo_f32_____f32 g, Indirection_f32 h); #ifdef __cplusplus diff --git a/tests/expectations/must_use.both.c b/tests/expectations/must_use.both.c index fb88cdca1..b388e4cb5 100644 --- a/tests/expectations/must_use.both.c +++ b/tests/expectations/must_use.both.c @@ -29,4 +29,4 @@ typedef struct MUST_USE_STRUCT OwnedPtr_i32 { int32_t *ptr; } OwnedPtr_i32; -MUST_USE_FUNC MaybeOwnedPtr_i32 maybe_consume(OwnedPtr_i32 input); +MUST_USE_FUNC struct MaybeOwnedPtr_i32 maybe_consume(struct OwnedPtr_i32 input); diff --git a/tests/expectations/must_use.both.compat.c b/tests/expectations/must_use.both.compat.c index bd043cc38..a6259f292 100644 --- a/tests/expectations/must_use.both.compat.c +++ b/tests/expectations/must_use.both.compat.c @@ -39,7 +39,7 @@ typedef struct MUST_USE_STRUCT OwnedPtr_i32 { extern "C" { #endif // __cplusplus -MUST_USE_FUNC MaybeOwnedPtr_i32 maybe_consume(OwnedPtr_i32 input); +MUST_USE_FUNC struct MaybeOwnedPtr_i32 maybe_consume(struct OwnedPtr_i32 input); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/namespace_constant.both.c b/tests/expectations/namespace_constant.both.c index e2f8cfdd7..853713a50 100644 --- a/tests/expectations/namespace_constant.both.c +++ b/tests/expectations/namespace_constant.both.c @@ -11,4 +11,4 @@ typedef struct Foo { int32_t x[FOO]; } Foo; -void root(Foo x); +void root(struct Foo x); diff --git a/tests/expectations/namespace_constant.both.compat.c b/tests/expectations/namespace_constant.both.compat.c index 1b0b8d448..ca8ddbca5 100644 --- a/tests/expectations/namespace_constant.both.compat.c +++ b/tests/expectations/namespace_constant.both.compat.c @@ -19,7 +19,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo x); +void root(struct Foo x); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/namespaces_constant.both.c b/tests/expectations/namespaces_constant.both.c index e2f8cfdd7..853713a50 100644 --- a/tests/expectations/namespaces_constant.both.c +++ b/tests/expectations/namespaces_constant.both.c @@ -11,4 +11,4 @@ typedef struct Foo { int32_t x[FOO]; } Foo; -void root(Foo x); +void root(struct Foo x); diff --git a/tests/expectations/namespaces_constant.both.compat.c b/tests/expectations/namespaces_constant.both.compat.c index f1edd725c..c253d741b 100644 --- a/tests/expectations/namespaces_constant.both.compat.c +++ b/tests/expectations/namespaces_constant.both.compat.c @@ -20,7 +20,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo x); +void root(struct Foo x); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/nonnull.both.c b/tests/expectations/nonnull.both.c index 41fc021dd..c4048d30a 100644 --- a/tests/expectations/nonnull.both.c +++ b/tests/expectations/nonnull.both.c @@ -8,13 +8,13 @@ typedef struct Opaque Opaque; typedef struct Foo_u64 { float *a; uint64_t *b; - Opaque *c; + struct Opaque *c; uint64_t **d; float **e; - Opaque **f; + struct Opaque **f; uint64_t *g; int32_t *h; int32_t **i; } Foo_u64; -void root(int32_t *arg, Foo_u64 *foo, Opaque **d); +void root(int32_t *arg, struct Foo_u64 *foo, struct Opaque **d); diff --git a/tests/expectations/nonnull.both.compat.c b/tests/expectations/nonnull.both.compat.c index d057878fb..018743b68 100644 --- a/tests/expectations/nonnull.both.compat.c +++ b/tests/expectations/nonnull.both.compat.c @@ -8,10 +8,10 @@ typedef struct Opaque Opaque; typedef struct Foo_u64 { float *a; uint64_t *b; - Opaque *c; + struct Opaque *c; uint64_t **d; float **e; - Opaque **f; + struct Opaque **f; uint64_t *g; int32_t *h; int32_t **i; @@ -21,7 +21,7 @@ typedef struct Foo_u64 { extern "C" { #endif // __cplusplus -void root(int32_t *arg, Foo_u64 *foo, Opaque **d); +void root(int32_t *arg, struct Foo_u64 *foo, struct Opaque **d); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/nonnull_attribute.both.c b/tests/expectations/nonnull_attribute.both.c index 34409c084..2520f31c3 100644 --- a/tests/expectations/nonnull_attribute.both.c +++ b/tests/expectations/nonnull_attribute.both.c @@ -13,19 +13,19 @@ typedef struct Opaque Opaque; typedef struct References { - const Opaque *CBINDGEN_NONNULL a; - Opaque *CBINDGEN_NONNULL b; - const Opaque *c; - Opaque *d; + const struct Opaque *CBINDGEN_NONNULL a; + struct Opaque *CBINDGEN_NONNULL b; + const struct Opaque *c; + struct Opaque *d; } References; typedef struct Pointers_u64 { float *CBINDGEN_NONNULL a; uint64_t *CBINDGEN_NONNULL b; - Opaque *CBINDGEN_NONNULL c; + struct Opaque *CBINDGEN_NONNULL c; uint64_t *CBINDGEN_NONNULL *CBINDGEN_NONNULL d; float *CBINDGEN_NONNULL *CBINDGEN_NONNULL e; - Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL f; + struct Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL f; uint64_t *g; int32_t *h; int32_t *CBINDGEN_NONNULL *i; @@ -33,20 +33,20 @@ typedef struct Pointers_u64 { uint64_t *k; } Pointers_u64; -void value_arg(References arg); +void value_arg(struct References arg); void mutltiple_args(int32_t *CBINDGEN_NONNULL arg, - Pointers_u64 *foo, - Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL d); + struct Pointers_u64 *foo, + struct Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL d); -void ref_arg(const Pointers_u64 *CBINDGEN_NONNULL arg); +void ref_arg(const struct Pointers_u64 *CBINDGEN_NONNULL arg); -void mut_ref_arg(Pointers_u64 *CBINDGEN_NONNULL arg); +void mut_ref_arg(struct Pointers_u64 *CBINDGEN_NONNULL arg); -void optional_ref_arg(const Pointers_u64 *arg); +void optional_ref_arg(const struct Pointers_u64 *arg); -void optional_mut_ref_arg(Pointers_u64 *arg); +void optional_mut_ref_arg(struct Pointers_u64 *arg); -void nullable_const_ptr(const Pointers_u64 *arg); +void nullable_const_ptr(const struct Pointers_u64 *arg); -void nullable_mut_ptr(Pointers_u64 *arg); +void nullable_mut_ptr(struct Pointers_u64 *arg); diff --git a/tests/expectations/nonnull_attribute.both.compat.c b/tests/expectations/nonnull_attribute.both.compat.c index 1eb452d72..4ba725440 100644 --- a/tests/expectations/nonnull_attribute.both.compat.c +++ b/tests/expectations/nonnull_attribute.both.compat.c @@ -13,19 +13,19 @@ typedef struct Opaque Opaque; typedef struct References { - const Opaque *CBINDGEN_NONNULL a; - Opaque *CBINDGEN_NONNULL b; - const Opaque *c; - Opaque *d; + const struct Opaque *CBINDGEN_NONNULL a; + struct Opaque *CBINDGEN_NONNULL b; + const struct Opaque *c; + struct Opaque *d; } References; typedef struct Pointers_u64 { float *CBINDGEN_NONNULL a; uint64_t *CBINDGEN_NONNULL b; - Opaque *CBINDGEN_NONNULL c; + struct Opaque *CBINDGEN_NONNULL c; uint64_t *CBINDGEN_NONNULL *CBINDGEN_NONNULL d; float *CBINDGEN_NONNULL *CBINDGEN_NONNULL e; - Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL f; + struct Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL f; uint64_t *g; int32_t *h; int32_t *CBINDGEN_NONNULL *i; @@ -37,23 +37,23 @@ typedef struct Pointers_u64 { extern "C" { #endif // __cplusplus -void value_arg(References arg); +void value_arg(struct References arg); void mutltiple_args(int32_t *CBINDGEN_NONNULL arg, - Pointers_u64 *foo, - Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL d); + struct Pointers_u64 *foo, + struct Opaque *CBINDGEN_NONNULL *CBINDGEN_NONNULL d); -void ref_arg(const Pointers_u64 *CBINDGEN_NONNULL arg); +void ref_arg(const struct Pointers_u64 *CBINDGEN_NONNULL arg); -void mut_ref_arg(Pointers_u64 *CBINDGEN_NONNULL arg); +void mut_ref_arg(struct Pointers_u64 *CBINDGEN_NONNULL arg); -void optional_ref_arg(const Pointers_u64 *arg); +void optional_ref_arg(const struct Pointers_u64 *arg); -void optional_mut_ref_arg(Pointers_u64 *arg); +void optional_mut_ref_arg(struct Pointers_u64 *arg); -void nullable_const_ptr(const Pointers_u64 *arg); +void nullable_const_ptr(const struct Pointers_u64 *arg); -void nullable_mut_ptr(Pointers_u64 *arg); +void nullable_mut_ptr(struct Pointers_u64 *arg); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/prefix.both.c b/tests/expectations/prefix.both.c index 3d891e223..2c6e0ce03 100644 --- a/tests/expectations/prefix.both.c +++ b/tests/expectations/prefix.both.c @@ -30,4 +30,4 @@ typedef union PREFIX_AbsoluteFontWeight { PREFIX_Weight_Body weight; } PREFIX_AbsoluteFontWeight; -void root(PREFIX_NamedLenArray x, PREFIX_ValuedLenArray y, PREFIX_AbsoluteFontWeight z); +void root(PREFIX_NamedLenArray x, PREFIX_ValuedLenArray y, union PREFIX_AbsoluteFontWeight z); diff --git a/tests/expectations/prefix.both.compat.c b/tests/expectations/prefix.both.compat.c index 311304d89..ed9924b41 100644 --- a/tests/expectations/prefix.both.compat.c +++ b/tests/expectations/prefix.both.compat.c @@ -40,7 +40,7 @@ typedef union PREFIX_AbsoluteFontWeight { extern "C" { #endif // __cplusplus -void root(PREFIX_NamedLenArray x, PREFIX_ValuedLenArray y, PREFIX_AbsoluteFontWeight z); +void root(PREFIX_NamedLenArray x, PREFIX_ValuedLenArray y, union PREFIX_AbsoluteFontWeight z); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/prefixed_struct_literal.both.c b/tests/expectations/prefixed_struct_literal.both.c index 32adf9e0c..099d60405 100644 --- a/tests/expectations/prefixed_struct_literal.both.c +++ b/tests/expectations/prefixed_struct_literal.both.c @@ -11,4 +11,4 @@ typedef struct PREFIXFoo { #define PREFIXBAR (PREFIXFoo){ .a = 42, .b = 1337 } -void root(PREFIXFoo x); +void root(struct PREFIXFoo x); diff --git a/tests/expectations/prefixed_struct_literal.both.compat.c b/tests/expectations/prefixed_struct_literal.both.compat.c index a70148982..71168b536 100644 --- a/tests/expectations/prefixed_struct_literal.both.compat.c +++ b/tests/expectations/prefixed_struct_literal.both.compat.c @@ -15,7 +15,7 @@ typedef struct PREFIXFoo { extern "C" { #endif // __cplusplus -void root(PREFIXFoo x); +void root(struct PREFIXFoo x); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/prefixed_struct_literal_deep.both.c b/tests/expectations/prefixed_struct_literal_deep.both.c index c1e753813..942df26e0 100644 --- a/tests/expectations/prefixed_struct_literal_deep.both.c +++ b/tests/expectations/prefixed_struct_literal_deep.both.c @@ -10,9 +10,9 @@ typedef struct PREFIXBar { typedef struct PREFIXFoo { int32_t a; uint32_t b; - PREFIXBar bar; + struct PREFIXBar bar; } PREFIXFoo; #define PREFIXVAL (PREFIXFoo){ .a = 42, .b = 1337, .bar = (PREFIXBar){ .a = 323 } } -void root(PREFIXFoo x); +void root(struct PREFIXFoo x); diff --git a/tests/expectations/prefixed_struct_literal_deep.both.compat.c b/tests/expectations/prefixed_struct_literal_deep.both.compat.c index 6dac0e94f..f5c0156ec 100644 --- a/tests/expectations/prefixed_struct_literal_deep.both.compat.c +++ b/tests/expectations/prefixed_struct_literal_deep.both.compat.c @@ -10,7 +10,7 @@ typedef struct PREFIXBar { typedef struct PREFIXFoo { int32_t a; uint32_t b; - PREFIXBar bar; + struct PREFIXBar bar; } PREFIXFoo; #define PREFIXVAL (PREFIXFoo){ .a = 42, .b = 1337, .bar = (PREFIXBar){ .a = 323 } } @@ -19,7 +19,7 @@ typedef struct PREFIXFoo { extern "C" { #endif // __cplusplus -void root(PREFIXFoo x); +void root(struct PREFIXFoo x); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/rename.both.c b/tests/expectations/rename.both.c index d6e6fd001..6c6e9a5ab 100644 --- a/tests/expectations/rename.both.c +++ b/tests/expectations/rename.both.c @@ -25,10 +25,10 @@ typedef union C_D { float y; } C_D; -typedef C_A C_F; +typedef struct C_A C_F; #define C_I (intptr_t)(C_F*)10 extern const int32_t G; -void root(const C_A *a, C_AwesomeB b, C_C c, C_D d, C_E e, C_F f); +void root(const struct C_A *a, struct C_AwesomeB b, struct C_C c, union C_D d, C_E e, C_F f); diff --git a/tests/expectations/rename.both.compat.c b/tests/expectations/rename.both.compat.c index f0a087fce..bc4404791 100644 --- a/tests/expectations/rename.both.compat.c +++ b/tests/expectations/rename.both.compat.c @@ -31,7 +31,7 @@ typedef union C_D { float y; } C_D; -typedef C_A C_F; +typedef struct C_A C_F; #define C_I (intptr_t)(C_F*)10 @@ -41,7 +41,7 @@ extern "C" { extern const int32_t G; -void root(const C_A *a, C_AwesomeB b, C_C c, C_D d, C_E e, C_F f); +void root(const struct C_A *a, struct C_AwesomeB b, struct C_C c, union C_D d, C_E e, C_F f); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/rename_crate.both.c b/tests/expectations/rename_crate.both.c index 0e23f846f..6beb8292a 100644 --- a/tests/expectations/rename_crate.both.c +++ b/tests/expectations/rename_crate.both.c @@ -19,7 +19,7 @@ typedef struct NoExternTy { #if !defined(DEFINE_FREEBSD) typedef struct ContainsNoExternTy { - NoExternTy field; + struct NoExternTy field; } ContainsNoExternTy; #endif @@ -29,8 +29,8 @@ typedef struct ContainsNoExternTy { } ContainsNoExternTy; #endif -void root(Foo a); +void root(struct Foo a); -void renamed_func(RenamedTy a); +void renamed_func(struct RenamedTy a); -void no_extern_func(ContainsNoExternTy a); +void no_extern_func(struct ContainsNoExternTy a); diff --git a/tests/expectations/rename_crate.both.compat.c b/tests/expectations/rename_crate.both.compat.c index ba818bfd7..228174aaa 100644 --- a/tests/expectations/rename_crate.both.compat.c +++ b/tests/expectations/rename_crate.both.compat.c @@ -19,7 +19,7 @@ typedef struct NoExternTy { #if !defined(DEFINE_FREEBSD) typedef struct ContainsNoExternTy { - NoExternTy field; + struct NoExternTy field; } ContainsNoExternTy; #endif @@ -33,11 +33,11 @@ typedef struct ContainsNoExternTy { extern "C" { #endif // __cplusplus -void root(Foo a); +void root(struct Foo a); -void renamed_func(RenamedTy a); +void renamed_func(struct RenamedTy a); -void no_extern_func(ContainsNoExternTy a); +void no_extern_func(struct ContainsNoExternTy a); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/renaming_overrides_prefixing.both.c b/tests/expectations/renaming_overrides_prefixing.both.c index b2be7e3a1..e112efa21 100644 --- a/tests/expectations/renaming_overrides_prefixing.both.c +++ b/tests/expectations/renaming_overrides_prefixing.both.c @@ -10,4 +10,4 @@ typedef struct B { float y; } B; -void root(const StyleA *a, B b); +void root(const struct StyleA *a, struct B b); diff --git a/tests/expectations/renaming_overrides_prefixing.both.compat.c b/tests/expectations/renaming_overrides_prefixing.both.compat.c index 1e50fecbc..1fa7b8bf0 100644 --- a/tests/expectations/renaming_overrides_prefixing.both.compat.c +++ b/tests/expectations/renaming_overrides_prefixing.both.compat.c @@ -14,7 +14,7 @@ typedef struct B { extern "C" { #endif // __cplusplus -void root(const StyleA *a, B b); +void root(const struct StyleA *a, struct B b); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/reserved.both.c b/tests/expectations/reserved.both.c index 3909b0edd..09b45b1f6 100644 --- a/tests/expectations/reserved.both.c +++ b/tests/expectations/reserved.both.c @@ -74,4 +74,10 @@ typedef struct F { }; } F; -void root(A a, B b, C c, E e, F f, int32_t namespace_, float float_); +void root(struct A a, + struct B b, + struct C c, + struct E e, + struct F f, + int32_t namespace_, + float float_); diff --git a/tests/expectations/reserved.both.compat.c b/tests/expectations/reserved.both.compat.c index 59f5c0460..d6cc90362 100644 --- a/tests/expectations/reserved.both.compat.c +++ b/tests/expectations/reserved.both.compat.c @@ -96,7 +96,13 @@ typedef struct F { extern "C" { #endif // __cplusplus -void root(A a, B b, C c, E e, F f, int32_t namespace_, float float_); +void root(struct A a, + struct B b, + struct C c, + struct E e, + struct F f, + int32_t namespace_, + float float_); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/sentinel.both.c b/tests/expectations/sentinel.both.c index f7a45c938..0ffb5afe6 100644 --- a/tests/expectations/sentinel.both.c +++ b/tests/expectations/sentinel.both.c @@ -52,4 +52,4 @@ typedef union C { C_C2_Body c2; } C; -void root(A a, B b, C c); +void root(A a, B b, union C c); diff --git a/tests/expectations/sentinel.both.compat.c b/tests/expectations/sentinel.both.compat.c index 95b1e0697..f03f998b7 100644 --- a/tests/expectations/sentinel.both.compat.c +++ b/tests/expectations/sentinel.both.compat.c @@ -74,7 +74,7 @@ typedef union C { extern "C" { #endif // __cplusplus -void root(A a, B b, C c); +void root(A a, B b, union C c); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/simplify_option_ptr.both.c b/tests/expectations/simplify_option_ptr.both.c index e4e15e842..402e5fe5a 100644 --- a/tests/expectations/simplify_option_ptr.both.c +++ b/tests/expectations/simplify_option_ptr.both.c @@ -6,15 +6,15 @@ typedef struct Opaque Opaque; typedef struct Foo { - const Opaque *x; - Opaque *y; + const struct Opaque *x; + struct Opaque *y; void (*z)(void); } Foo; typedef union Bar { - const Opaque *x; - Opaque *y; + const struct Opaque *x; + struct Opaque *y; void (*z)(void); } Bar; -void root(const Opaque *a, Opaque *b, Foo c, Bar d); +void root(const struct Opaque *a, struct Opaque *b, struct Foo c, union Bar d); diff --git a/tests/expectations/simplify_option_ptr.both.compat.c b/tests/expectations/simplify_option_ptr.both.compat.c index 1f5d16962..d03e4bc14 100644 --- a/tests/expectations/simplify_option_ptr.both.compat.c +++ b/tests/expectations/simplify_option_ptr.both.compat.c @@ -6,14 +6,14 @@ typedef struct Opaque Opaque; typedef struct Foo { - const Opaque *x; - Opaque *y; + const struct Opaque *x; + struct Opaque *y; void (*z)(void); } Foo; typedef union Bar { - const Opaque *x; - Opaque *y; + const struct Opaque *x; + struct Opaque *y; void (*z)(void); } Bar; @@ -21,7 +21,7 @@ typedef union Bar { extern "C" { #endif // __cplusplus -void root(const Opaque *a, Opaque *b, Foo c, Bar d); +void root(const struct Opaque *a, struct Opaque *b, struct Foo c, union Bar d); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/static.both.c b/tests/expectations/static.both.c index 98910fbb8..404b18023 100644 --- a/tests/expectations/static.both.c +++ b/tests/expectations/static.both.c @@ -11,8 +11,8 @@ typedef struct Foo { extern const int32_t NUMBER; -extern Foo FOO; +extern struct Foo FOO; -extern const Bar BAR; +extern const struct Bar BAR; void root(void); diff --git a/tests/expectations/static.both.compat.c b/tests/expectations/static.both.compat.c index d861cd3b3..b06525e5f 100644 --- a/tests/expectations/static.both.compat.c +++ b/tests/expectations/static.both.compat.c @@ -15,9 +15,9 @@ extern "C" { extern const int32_t NUMBER; -extern Foo FOO; +extern struct Foo FOO; -extern const Bar BAR; +extern const struct Bar BAR; void root(void); diff --git a/tests/expectations/struct.both.c b/tests/expectations/struct.both.c index 4bfbd6e40..5664185f9 100644 --- a/tests/expectations/struct.both.c +++ b/tests/expectations/struct.both.c @@ -25,4 +25,8 @@ typedef struct TupleNamed { float y; } TupleNamed; -void root(Opaque *a, Normal b, NormalWithZST c, TupleRenamed d, TupleNamed e); +void root(struct Opaque *a, + struct Normal b, + struct NormalWithZST c, + struct TupleRenamed d, + struct TupleNamed e); diff --git a/tests/expectations/struct.both.compat.c b/tests/expectations/struct.both.compat.c index 84eb29d7e..5f080d9ed 100644 --- a/tests/expectations/struct.both.compat.c +++ b/tests/expectations/struct.both.compat.c @@ -29,7 +29,11 @@ typedef struct TupleNamed { extern "C" { #endif // __cplusplus -void root(Opaque *a, Normal b, NormalWithZST c, TupleRenamed d, TupleNamed e); +void root(struct Opaque *a, + struct Normal b, + struct NormalWithZST c, + struct TupleRenamed d, + struct TupleNamed e); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/struct_literal.both.c b/tests/expectations/struct_literal.both.c index 69e9b90ec..7c5cde3a7 100644 --- a/tests/expectations/struct_literal.both.c +++ b/tests/expectations/struct_literal.both.c @@ -18,4 +18,4 @@ typedef struct Foo { -void root(Foo x, Bar bar); +void root(struct Foo x, struct Bar bar); diff --git a/tests/expectations/struct_literal.both.compat.c b/tests/expectations/struct_literal.both.compat.c index e0434e40e..bfc403d20 100644 --- a/tests/expectations/struct_literal.both.compat.c +++ b/tests/expectations/struct_literal.both.compat.c @@ -22,7 +22,7 @@ typedef struct Foo { extern "C" { #endif // __cplusplus -void root(Foo x, Bar bar); +void root(struct Foo x, struct Bar bar); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/struct_literal_order.both.c b/tests/expectations/struct_literal_order.both.c index 23213ba52..e1e87ba8b 100644 --- a/tests/expectations/struct_literal_order.both.c +++ b/tests/expectations/struct_literal_order.both.c @@ -21,4 +21,4 @@ typedef struct BAC { #define BAC_bac (BAC){ .b = 1, .a = 2.0, .c = 3 } #define BAC_cba (BAC){ .b = 1, .a = 2.0, .c = 3 } -void root(ABC a1, BAC a2); +void root(struct ABC a1, struct BAC a2); diff --git a/tests/expectations/struct_literal_order.both.compat.c b/tests/expectations/struct_literal_order.both.compat.c index ad78b026e..849532d1b 100644 --- a/tests/expectations/struct_literal_order.both.compat.c +++ b/tests/expectations/struct_literal_order.both.compat.c @@ -25,7 +25,7 @@ typedef struct BAC { extern "C" { #endif // __cplusplus -void root(ABC a1, BAC a2); +void root(struct ABC a1, struct BAC a2); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/struct_self.both.c b/tests/expectations/struct_self.both.c index b7e7097a5..6440e8fa1 100644 --- a/tests/expectations/struct_self.both.c +++ b/tests/expectations/struct_self.both.c @@ -9,7 +9,7 @@ typedef struct Foo_Bar { typedef struct Bar { int32_t something; - Foo_Bar subexpressions; + struct Foo_Bar subexpressions; } Bar; -void root(Bar b); +void root(struct Bar b); diff --git a/tests/expectations/struct_self.both.compat.c b/tests/expectations/struct_self.both.compat.c index a28a9ce55..473f8492c 100644 --- a/tests/expectations/struct_self.both.compat.c +++ b/tests/expectations/struct_self.both.compat.c @@ -9,14 +9,14 @@ typedef struct Foo_Bar { typedef struct Bar { int32_t something; - Foo_Bar subexpressions; + struct Foo_Bar subexpressions; } Bar; #ifdef __cplusplus extern "C" { #endif // __cplusplus -void root(Bar b); +void root(struct Bar b); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/swift_name.both.c b/tests/expectations/swift_name.both.c index dca90ac14..e926b2d3f 100644 --- a/tests/expectations/swift_name.both.c +++ b/tests/expectations/swift_name.both.c @@ -12,44 +12,44 @@ typedef struct SelfTypeTestStruct { } SelfTypeTestStruct; typedef struct PointerToOpaque { - Opaque *ptr; + struct Opaque *ptr; } PointerToOpaque; void rust_print_hello_world(void) CF_SWIFT_NAME(rust_print_hello_world()); -void SelfTypeTestStruct_should_exist_ref(const SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref(self:)); +void SelfTypeTestStruct_should_exist_ref(const struct SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref(self:)); -void SelfTypeTestStruct_should_exist_ref_mut(SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref_mut(self:)); +void SelfTypeTestStruct_should_exist_ref_mut(struct SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref_mut(self:)); -void SelfTypeTestStruct_should_not_exist_box(SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_box(self:)); +void SelfTypeTestStruct_should_not_exist_box(struct SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_box(self:)); -SelfTypeTestStruct *SelfTypeTestStruct_should_not_exist_return_box(void) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_return_box()); +struct SelfTypeTestStruct *SelfTypeTestStruct_should_not_exist_return_box(void) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_return_box()); -void SelfTypeTestStruct_should_exist_annotated_self(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_self(self:)); +void SelfTypeTestStruct_should_exist_annotated_self(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_self(self:)); -void SelfTypeTestStruct_should_exist_annotated_mut_self(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_self(self:)); +void SelfTypeTestStruct_should_exist_annotated_mut_self(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_self(self:)); -void SelfTypeTestStruct_should_exist_annotated_by_name(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_by_name(self:)); +void SelfTypeTestStruct_should_exist_annotated_by_name(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_by_name(self:)); -void SelfTypeTestStruct_should_exist_annotated_mut_by_name(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_by_name(self:)); +void SelfTypeTestStruct_should_exist_annotated_mut_by_name(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_by_name(self:)); -void SelfTypeTestStruct_should_exist_unannotated(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_unannotated(self:)); +void SelfTypeTestStruct_should_exist_unannotated(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_unannotated(self:)); -void SelfTypeTestStruct_should_exist_mut_unannotated(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_mut_unannotated(self:)); +void SelfTypeTestStruct_should_exist_mut_unannotated(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_mut_unannotated(self:)); -void free_function_should_exist_ref(const SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref(test_struct:)); +void free_function_should_exist_ref(const struct SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref(test_struct:)); -void free_function_should_exist_ref_mut(SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref_mut(test_struct:)); +void free_function_should_exist_ref_mut(struct SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref_mut(test_struct:)); -void unnamed_argument(SelfTypeTestStruct*); +void unnamed_argument(struct SelfTypeTestStruct*); -void free_function_should_not_exist_box(SelfTypeTestStruct *boxed) CF_SWIFT_NAME(free_function_should_not_exist_box(boxed:)); +void free_function_should_not_exist_box(struct SelfTypeTestStruct *boxed) CF_SWIFT_NAME(free_function_should_not_exist_box(boxed:)); -void free_function_should_exist_annotated_by_name(SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_by_name(test_struct:)); +void free_function_should_exist_annotated_by_name(struct SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_by_name(test_struct:)); -void free_function_should_exist_annotated_mut_by_name(SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_mut_by_name(test_struct:)); +void free_function_should_exist_annotated_mut_by_name(struct SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_mut_by_name(test_struct:)); -PointerToOpaque PointerToOpaque_create(uint8_t times) CF_SWIFT_NAME(PointerToOpaque.create(times:)); +struct PointerToOpaque PointerToOpaque_create(uint8_t times) CF_SWIFT_NAME(PointerToOpaque.create(times:)); -void PointerToOpaque_sayHello(PointerToOpaque self) +void PointerToOpaque_sayHello(struct PointerToOpaque self) /*a comment!*/ CF_SWIFT_NAME(PointerToOpaque.sayHello(self:)); diff --git a/tests/expectations/swift_name.both.compat.c b/tests/expectations/swift_name.both.compat.c index 99caec255..7d78406a2 100644 --- a/tests/expectations/swift_name.both.compat.c +++ b/tests/expectations/swift_name.both.compat.c @@ -12,7 +12,7 @@ typedef struct SelfTypeTestStruct { } SelfTypeTestStruct; typedef struct PointerToOpaque { - Opaque *ptr; + struct Opaque *ptr; } PointerToOpaque; #ifdef __cplusplus @@ -21,41 +21,41 @@ extern "C" { void rust_print_hello_world(void) CF_SWIFT_NAME(rust_print_hello_world()); -void SelfTypeTestStruct_should_exist_ref(const SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref(self:)); +void SelfTypeTestStruct_should_exist_ref(const struct SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref(self:)); -void SelfTypeTestStruct_should_exist_ref_mut(SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref_mut(self:)); +void SelfTypeTestStruct_should_exist_ref_mut(struct SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_ref_mut(self:)); -void SelfTypeTestStruct_should_not_exist_box(SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_box(self:)); +void SelfTypeTestStruct_should_not_exist_box(struct SelfTypeTestStruct *self) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_box(self:)); -SelfTypeTestStruct *SelfTypeTestStruct_should_not_exist_return_box(void) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_return_box()); +struct SelfTypeTestStruct *SelfTypeTestStruct_should_not_exist_return_box(void) CF_SWIFT_NAME(SelfTypeTestStruct.should_not_exist_return_box()); -void SelfTypeTestStruct_should_exist_annotated_self(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_self(self:)); +void SelfTypeTestStruct_should_exist_annotated_self(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_self(self:)); -void SelfTypeTestStruct_should_exist_annotated_mut_self(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_self(self:)); +void SelfTypeTestStruct_should_exist_annotated_mut_self(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_self(self:)); -void SelfTypeTestStruct_should_exist_annotated_by_name(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_by_name(self:)); +void SelfTypeTestStruct_should_exist_annotated_by_name(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_by_name(self:)); -void SelfTypeTestStruct_should_exist_annotated_mut_by_name(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_by_name(self:)); +void SelfTypeTestStruct_should_exist_annotated_mut_by_name(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_annotated_mut_by_name(self:)); -void SelfTypeTestStruct_should_exist_unannotated(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_unannotated(self:)); +void SelfTypeTestStruct_should_exist_unannotated(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_unannotated(self:)); -void SelfTypeTestStruct_should_exist_mut_unannotated(SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_mut_unannotated(self:)); +void SelfTypeTestStruct_should_exist_mut_unannotated(struct SelfTypeTestStruct self) CF_SWIFT_NAME(SelfTypeTestStruct.should_exist_mut_unannotated(self:)); -void free_function_should_exist_ref(const SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref(test_struct:)); +void free_function_should_exist_ref(const struct SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref(test_struct:)); -void free_function_should_exist_ref_mut(SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref_mut(test_struct:)); +void free_function_should_exist_ref_mut(struct SelfTypeTestStruct *test_struct) CF_SWIFT_NAME(free_function_should_exist_ref_mut(test_struct:)); -void unnamed_argument(SelfTypeTestStruct*); +void unnamed_argument(struct SelfTypeTestStruct*); -void free_function_should_not_exist_box(SelfTypeTestStruct *boxed) CF_SWIFT_NAME(free_function_should_not_exist_box(boxed:)); +void free_function_should_not_exist_box(struct SelfTypeTestStruct *boxed) CF_SWIFT_NAME(free_function_should_not_exist_box(boxed:)); -void free_function_should_exist_annotated_by_name(SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_by_name(test_struct:)); +void free_function_should_exist_annotated_by_name(struct SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_by_name(test_struct:)); -void free_function_should_exist_annotated_mut_by_name(SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_mut_by_name(test_struct:)); +void free_function_should_exist_annotated_mut_by_name(struct SelfTypeTestStruct test_struct) CF_SWIFT_NAME(free_function_should_exist_annotated_mut_by_name(test_struct:)); -PointerToOpaque PointerToOpaque_create(uint8_t times) CF_SWIFT_NAME(PointerToOpaque.create(times:)); +struct PointerToOpaque PointerToOpaque_create(uint8_t times) CF_SWIFT_NAME(PointerToOpaque.create(times:)); -void PointerToOpaque_sayHello(PointerToOpaque self) +void PointerToOpaque_sayHello(struct PointerToOpaque self) /*a comment!*/ CF_SWIFT_NAME(PointerToOpaque.sayHello(self:)); #ifdef __cplusplus diff --git a/tests/expectations/transform_op.both.c b/tests/expectations/transform_op.both.c index 86c7df0e4..715c0da98 100644 --- a/tests/expectations/transform_op.both.c +++ b/tests/expectations/transform_op.both.c @@ -24,8 +24,8 @@ typedef uint8_t StyleFoo_i32_Tag; typedef struct StyleFoo_Body_i32 { StyleFoo_i32_Tag tag; int32_t x; - StylePoint_i32 y; - StylePoint_f32 z; + struct StylePoint_i32 y; + struct StylePoint_f32 z; } StyleFoo_Body_i32; typedef struct StyleBar_Body_i32 { @@ -35,7 +35,7 @@ typedef struct StyleBar_Body_i32 { typedef struct StyleBaz_Body_i32 { StyleFoo_i32_Tag tag; - StylePoint_i32 _0; + struct StylePoint_i32 _0; } StyleBaz_Body_i32; typedef union StyleFoo_i32 { @@ -54,8 +54,8 @@ typedef enum StyleBar_i32_Tag { typedef struct StyleBar1_Body_i32 { int32_t x; - StylePoint_i32 y; - StylePoint_f32 z; + struct StylePoint_i32 y; + struct StylePoint_f32 z; int32_t (*u)(int32_t); } StyleBar1_Body_i32; @@ -64,7 +64,7 @@ typedef struct StyleBar2_Body_i32 { } StyleBar2_Body_i32; typedef struct StyleBar3_Body_i32 { - StylePoint_i32 _0; + struct StylePoint_i32 _0; } StyleBar3_Body_i32; typedef struct StyleBar_i32 { @@ -90,8 +90,8 @@ typedef enum StyleBar_u32_Tag { typedef struct StyleBar1_Body_u32 { int32_t x; - StylePoint_u32 y; - StylePoint_f32 z; + struct StylePoint_u32 y; + struct StylePoint_f32 z; int32_t (*u)(int32_t); } StyleBar1_Body_u32; @@ -100,7 +100,7 @@ typedef struct StyleBar2_Body_u32 { } StyleBar2_Body_u32; typedef struct StyleBar3_Body_u32 { - StylePoint_u32 _0; + struct StylePoint_u32 _0; } StyleBar3_Body_u32; typedef struct StyleBar_u32 { @@ -121,12 +121,12 @@ typedef uint8_t StyleBaz_Tag; typedef struct StyleBaz1_Body { StyleBaz_Tag tag; - StyleBar_u32 _0; + struct StyleBar_u32 _0; } StyleBaz1_Body; typedef struct StyleBaz2_Body { StyleBaz_Tag tag; - StylePoint_i32 _0; + struct StylePoint_i32 _0; } StyleBaz2_Body; typedef union StyleBaz { @@ -143,11 +143,11 @@ enum StyleTaz_Tag { typedef uint8_t StyleTaz_Tag; typedef struct StyleTaz1_Body { - StyleBar_u32 _0; + struct StyleBar_u32 _0; } StyleTaz1_Body; typedef struct StyleTaz2_Body { - StyleBaz _0; + union StyleBaz _0; } StyleTaz2_Body; typedef struct StyleTaz { @@ -158,7 +158,7 @@ typedef struct StyleTaz { }; } StyleTaz; -void foo(const StyleFoo_i32 *foo, - const StyleBar_i32 *bar, - const StyleBaz *baz, - const StyleTaz *taz); +void foo(const union StyleFoo_i32 *foo, + const struct StyleBar_i32 *bar, + const union StyleBaz *baz, + const struct StyleTaz *taz); diff --git a/tests/expectations/transform_op.both.compat.c b/tests/expectations/transform_op.both.compat.c index 1190ac9ab..044ca16d1 100644 --- a/tests/expectations/transform_op.both.compat.c +++ b/tests/expectations/transform_op.both.compat.c @@ -30,8 +30,8 @@ typedef uint8_t StyleFoo_i32_Tag; typedef struct StyleFoo_Body_i32 { StyleFoo_i32_Tag tag; int32_t x; - StylePoint_i32 y; - StylePoint_f32 z; + struct StylePoint_i32 y; + struct StylePoint_f32 z; } StyleFoo_Body_i32; typedef struct StyleBar_Body_i32 { @@ -41,7 +41,7 @@ typedef struct StyleBar_Body_i32 { typedef struct StyleBaz_Body_i32 { StyleFoo_i32_Tag tag; - StylePoint_i32 _0; + struct StylePoint_i32 _0; } StyleBaz_Body_i32; typedef union StyleFoo_i32 { @@ -60,8 +60,8 @@ typedef enum StyleBar_i32_Tag { typedef struct StyleBar1_Body_i32 { int32_t x; - StylePoint_i32 y; - StylePoint_f32 z; + struct StylePoint_i32 y; + struct StylePoint_f32 z; int32_t (*u)(int32_t); } StyleBar1_Body_i32; @@ -70,7 +70,7 @@ typedef struct StyleBar2_Body_i32 { } StyleBar2_Body_i32; typedef struct StyleBar3_Body_i32 { - StylePoint_i32 _0; + struct StylePoint_i32 _0; } StyleBar3_Body_i32; typedef struct StyleBar_i32 { @@ -96,8 +96,8 @@ typedef enum StyleBar_u32_Tag { typedef struct StyleBar1_Body_u32 { int32_t x; - StylePoint_u32 y; - StylePoint_f32 z; + struct StylePoint_u32 y; + struct StylePoint_f32 z; int32_t (*u)(int32_t); } StyleBar1_Body_u32; @@ -106,7 +106,7 @@ typedef struct StyleBar2_Body_u32 { } StyleBar2_Body_u32; typedef struct StyleBar3_Body_u32 { - StylePoint_u32 _0; + struct StylePoint_u32 _0; } StyleBar3_Body_u32; typedef struct StyleBar_u32 { @@ -133,12 +133,12 @@ typedef uint8_t StyleBaz_Tag; typedef struct StyleBaz1_Body { StyleBaz_Tag tag; - StyleBar_u32 _0; + struct StyleBar_u32 _0; } StyleBaz1_Body; typedef struct StyleBaz2_Body { StyleBaz_Tag tag; - StylePoint_i32 _0; + struct StylePoint_i32 _0; } StyleBaz2_Body; typedef union StyleBaz { @@ -161,11 +161,11 @@ typedef uint8_t StyleTaz_Tag; #endif // __cplusplus typedef struct StyleTaz1_Body { - StyleBar_u32 _0; + struct StyleBar_u32 _0; } StyleTaz1_Body; typedef struct StyleTaz2_Body { - StyleBaz _0; + union StyleBaz _0; } StyleTaz2_Body; typedef struct StyleTaz { @@ -180,10 +180,10 @@ typedef struct StyleTaz { extern "C" { #endif // __cplusplus -void foo(const StyleFoo_i32 *foo, - const StyleBar_i32 *bar, - const StyleBaz *baz, - const StyleTaz *taz); +void foo(const union StyleFoo_i32 *foo, + const struct StyleBar_i32 *bar, + const union StyleBaz *baz, + const struct StyleTaz *taz); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/typedef.both.c b/tests/expectations/typedef.both.c index c660e5386..efdebc8b7 100644 --- a/tests/expectations/typedef.both.c +++ b/tests/expectations/typedef.both.c @@ -8,6 +8,6 @@ typedef struct Foo_i32__i32 { int32_t y; } Foo_i32__i32; -typedef Foo_i32__i32 IntFoo_i32; +typedef struct Foo_i32__i32 IntFoo_i32; void root(IntFoo_i32 a); diff --git a/tests/expectations/typedef.both.compat.c b/tests/expectations/typedef.both.compat.c index ff07381b2..ebb0d566d 100644 --- a/tests/expectations/typedef.both.compat.c +++ b/tests/expectations/typedef.both.compat.c @@ -8,7 +8,7 @@ typedef struct Foo_i32__i32 { int32_t y; } Foo_i32__i32; -typedef Foo_i32__i32 IntFoo_i32; +typedef struct Foo_i32__i32 IntFoo_i32; #ifdef __cplusplus extern "C" { diff --git a/tests/expectations/union.both.c b/tests/expectations/union.both.c index 328a1301a..acef11da5 100644 --- a/tests/expectations/union.both.c +++ b/tests/expectations/union.both.c @@ -15,4 +15,4 @@ typedef union NormalWithZST { float y; } NormalWithZST; -void root(Opaque *a, Normal b, NormalWithZST c); +void root(struct Opaque *a, union Normal b, union NormalWithZST c); diff --git a/tests/expectations/union.both.compat.c b/tests/expectations/union.both.compat.c index c3f864171..9c33a507a 100644 --- a/tests/expectations/union.both.compat.c +++ b/tests/expectations/union.both.compat.c @@ -19,7 +19,7 @@ typedef union NormalWithZST { extern "C" { #endif // __cplusplus -void root(Opaque *a, Normal b, NormalWithZST c); +void root(struct Opaque *a, union Normal b, union NormalWithZST c); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/union_self.both.c b/tests/expectations/union_self.both.c index 4a17aa8ff..0eef193d1 100644 --- a/tests/expectations/union_self.both.c +++ b/tests/expectations/union_self.both.c @@ -9,7 +9,7 @@ typedef struct Foo_Bar { typedef union Bar { int32_t something; - Foo_Bar subexpressions; + struct Foo_Bar subexpressions; } Bar; -void root(Bar b); +void root(union Bar b); diff --git a/tests/expectations/union_self.both.compat.c b/tests/expectations/union_self.both.compat.c index ef287f5e3..be9ed8ed9 100644 --- a/tests/expectations/union_self.both.compat.c +++ b/tests/expectations/union_self.both.compat.c @@ -9,14 +9,14 @@ typedef struct Foo_Bar { typedef union Bar { int32_t something; - Foo_Bar subexpressions; + struct Foo_Bar subexpressions; } Bar; #ifdef __cplusplus extern "C" { #endif // __cplusplus -void root(Bar b); +void root(union Bar b); #ifdef __cplusplus } // extern "C" diff --git a/tests/expectations/workspace.both.c b/tests/expectations/workspace.both.c index d048da989..3aa658394 100644 --- a/tests/expectations/workspace.both.c +++ b/tests/expectations/workspace.both.c @@ -9,4 +9,4 @@ typedef struct ExtType { uint32_t data; } ExtType; -void consume_ext(ExtType _ext); +void consume_ext(struct ExtType _ext); diff --git a/tests/expectations/workspace.both.compat.c b/tests/expectations/workspace.both.compat.c index 3e5182f99..d830fb1b9 100644 --- a/tests/expectations/workspace.both.compat.c +++ b/tests/expectations/workspace.both.compat.c @@ -13,7 +13,7 @@ typedef struct ExtType { extern "C" { #endif // __cplusplus -void consume_ext(ExtType _ext); +void consume_ext(struct ExtType _ext); #ifdef __cplusplus } // extern "C"