diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2022-01-03 13:59:36 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2022-01-03 13:59:36 +0100 |
commit | 9adade648eacc354cc6f4cf55f00e537a58d136f (patch) | |
tree | c4f919f7fda8250a3151b781707cf156260452b0 /tests/structs | |
parent | 29470dbcfc149d241886dcecb7fd6f4207dc7917 (diff) | |
download | vala-9adade648eacc354cc6f4cf55f00e537a58d136f.tar.gz |
codegen: Initialize "result" variable on declaration for abstract methods only
Diffstat (limited to 'tests/structs')
-rw-r--r-- | tests/structs/bug657378.c-expected | 2 | ||||
-rw-r--r-- | tests/structs/cast-struct-boxed.c-expected | 8 | ||||
-rw-r--r-- | tests/structs/gvalue-implicit-comparison.c-expected | 2 | ||||
-rw-r--r-- | tests/structs/gvalue.c-expected | 2 | ||||
-rw-r--r-- | tests/structs/simple-type-default-value.c-expected | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/tests/structs/bug657378.c-expected b/tests/structs/bug657378.c-expected index 43d1af6f2..2ab07075a 100644 --- a/tests/structs/bug657378.c-expected +++ b/tests/structs/bug657378.c-expected @@ -33,7 +33,7 @@ foo (const gchar* format, va_list _tmp0_ = {0}; gchar* _tmp1_; gchar* _tmp2_; - gchar* result = NULL; + gchar* result; g_return_val_if_fail (format != NULL, NULL); va_start (_tmp0_, format); _tmp1_ = g_strdup_vprintf (format, _tmp0_); diff --git a/tests/structs/cast-struct-boxed.c-expected b/tests/structs/cast-struct-boxed.c-expected index 049ad5bba..27102f8c1 100644 --- a/tests/structs/cast-struct-boxed.c-expected +++ b/tests/structs/cast-struct-boxed.c-expected @@ -107,7 +107,7 @@ foo_heap_owned (void) Foo* _tmp1_; Foo* _tmp2_; Foo* _tmp3_; - Foo* result = NULL; + Foo* result; _tmp0_.i = 23; _tmp1_ = _foo_dup0 (&_tmp0_); _foo_free0 (foo); @@ -124,7 +124,7 @@ foo_heap_unowned (void) Foo _tmp0_ = {0}; Foo* _tmp1_; Foo* _tmp2_; - Foo* result = NULL; + Foo* result; _tmp0_.i = 42; _tmp1_ = _foo_dup0 (&_tmp0_); _foo_free0 (foo); @@ -267,7 +267,7 @@ bar_heap_owned (void) Bar* _tmp3_; Bar* _tmp4_; Bar* _tmp5_; - Bar* result = NULL; + Bar* result; _tmp0_ = g_strdup ("bar"); _g_free0 (_tmp1_.s); _tmp1_.s = _tmp0_; @@ -290,7 +290,7 @@ bar_heap_unowned (void) Bar _tmp2_; Bar* _tmp3_; Bar* _tmp4_; - Bar* result = NULL; + Bar* result; _tmp0_ = g_strdup ("manam"); _g_free0 (_tmp1_.s); _tmp1_.s = _tmp0_; diff --git a/tests/structs/gvalue-implicit-comparison.c-expected b/tests/structs/gvalue-implicit-comparison.c-expected index 2d8605953..21d2e91bb 100644 --- a/tests/structs/gvalue-implicit-comparison.c-expected +++ b/tests/structs/gvalue-implicit-comparison.c-expected @@ -61,7 +61,7 @@ GValue* get_nullable_value (GValue* v) { GValue* _tmp0_; - GValue* result = NULL; + GValue* result; _tmp0_ = __g_value_dup0 (v); result = _tmp0_; return result; diff --git a/tests/structs/gvalue.c-expected b/tests/structs/gvalue.c-expected index 0caf6e916..b6139ec2d 100644 --- a/tests/structs/gvalue.c-expected +++ b/tests/structs/gvalue.c-expected @@ -1016,7 +1016,7 @@ take_value (GValue* v) gboolean make_bool (void) { - gboolean result = FALSE; + gboolean result; result = TRUE; return result; } diff --git a/tests/structs/simple-type-default-value.c-expected b/tests/structs/simple-type-default-value.c-expected index a9a58bbab..c7bc26b22 100644 --- a/tests/structs/simple-type-default-value.c-expected +++ b/tests/structs/simple-type-default-value.c-expected @@ -31,7 +31,7 @@ Foo bar (GObject* o) { Foo _tmp0_ = (Foo) { .i = 23 }; - Foo result = (Foo) { .i = 23 }; + Foo result; g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (o, G_TYPE_OBJECT), (Foo) { .i = 23 }); result = _tmp0_; return result; |