summaryrefslogtreecommitdiff
path: root/tests/control-flow
diff options
context:
space:
mode:
authorVal Och <v19930312@gmail.com>2021-12-31 20:25:49 +0300
committerRico Tzschichholz <ricotz@ubuntu.com>2022-01-03 15:00:07 +0100
commitc46078fa430bfcc25c26f33da991410372d44d03 (patch)
treefbffcd3e6658663c205c1ee23ab9dc0d79ddd3cc /tests/control-flow
parent9adade648eacc354cc6f4cf55f00e537a58d136f (diff)
downloadvala-c46078fa430bfcc25c26f33da991410372d44d03.tar.gz
codegen: Use __once instead of __volatile in generated code
This better reflects purpose of relevant variables, especially given that they aren't volatile anymore on GLib 2.68+.
Diffstat (limited to 'tests/control-flow')
-rw-r--r--tests/control-flow/break.c-expected8
-rw-r--r--tests/control-flow/bug736774-1.c-expected8
-rw-r--r--tests/control-flow/bug761267-1.c-expected8
-rw-r--r--tests/control-flow/bug761267-2.c-expected8
-rw-r--r--tests/control-flow/coalesce-right-value.c-expected8
-rw-r--r--tests/control-flow/expressions-conditional.c-expected8
-rw-r--r--tests/control-flow/for-switch-continue.c-expected8
-rw-r--r--tests/control-flow/local-clash-with-implicit-this.c-expected8
-rw-r--r--tests/control-flow/null-conditional-bool.c-expected8
-rw-r--r--tests/control-flow/pre-post-increment-property.c-expected8
-rw-r--r--tests/control-flow/sideeffects.c-expected8
-rw-r--r--tests/control-flow/switch-enum.c-expected8
-rw-r--r--tests/control-flow/switch.c-expected16
13 files changed, 56 insertions, 56 deletions
diff --git a/tests/control-flow/break.c-expected b/tests/control-flow/break.c-expected
index 12b91b613..a806409b3 100644
--- a/tests/control-flow/break.c-expected
+++ b/tests/control-flow/break.c-expected
@@ -130,12 +130,12 @@ maman_bar_get_type_once (void)
GType
maman_bar_get_type (void)
{
- static volatile gsize maman_bar_type_id__volatile = 0;
- if (g_once_init_enter (&maman_bar_type_id__volatile)) {
+ static volatile gsize maman_bar_type_id__once = 0;
+ if (g_once_init_enter (&maman_bar_type_id__once)) {
GType maman_bar_type_id;
maman_bar_type_id = maman_bar_get_type_once ();
- g_once_init_leave (&maman_bar_type_id__volatile, maman_bar_type_id);
+ g_once_init_leave (&maman_bar_type_id__once, maman_bar_type_id);
}
- return maman_bar_type_id__volatile;
+ return maman_bar_type_id__once;
}
diff --git a/tests/control-flow/bug736774-1.c-expected b/tests/control-flow/bug736774-1.c-expected
index f0bb4f41d..f687209d9 100644
--- a/tests/control-flow/bug736774-1.c-expected
+++ b/tests/control-flow/bug736774-1.c-expected
@@ -109,13 +109,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
Foo*
diff --git a/tests/control-flow/bug761267-1.c-expected b/tests/control-flow/bug761267-1.c-expected
index 2bb072f2a..fdf7617e9 100644
--- a/tests/control-flow/bug761267-1.c-expected
+++ b/tests/control-flow/bug761267-1.c-expected
@@ -278,13 +278,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
gpointer
diff --git a/tests/control-flow/bug761267-2.c-expected b/tests/control-flow/bug761267-2.c-expected
index c3727b922..14476bde5 100644
--- a/tests/control-flow/bug761267-2.c-expected
+++ b/tests/control-flow/bug761267-2.c-expected
@@ -478,13 +478,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
gpointer
diff --git a/tests/control-flow/coalesce-right-value.c-expected b/tests/control-flow/coalesce-right-value.c-expected
index e02d16825..85fb39c40 100644
--- a/tests/control-flow/coalesce-right-value.c-expected
+++ b/tests/control-flow/coalesce-right-value.c-expected
@@ -60,13 +60,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
static gint*
diff --git a/tests/control-flow/expressions-conditional.c-expected b/tests/control-flow/expressions-conditional.c-expected
index 2e3b5bf48..0e026d864 100644
--- a/tests/control-flow/expressions-conditional.c-expected
+++ b/tests/control-flow/expressions-conditional.c-expected
@@ -149,12 +149,12 @@ maman_bar_get_type_once (void)
GType
maman_bar_get_type (void)
{
- static volatile gsize maman_bar_type_id__volatile = 0;
- if (g_once_init_enter (&maman_bar_type_id__volatile)) {
+ static volatile gsize maman_bar_type_id__once = 0;
+ if (g_once_init_enter (&maman_bar_type_id__once)) {
GType maman_bar_type_id;
maman_bar_type_id = maman_bar_get_type_once ();
- g_once_init_leave (&maman_bar_type_id__volatile, maman_bar_type_id);
+ g_once_init_leave (&maman_bar_type_id__once, maman_bar_type_id);
}
- return maman_bar_type_id__volatile;
+ return maman_bar_type_id__once;
}
diff --git a/tests/control-flow/for-switch-continue.c-expected b/tests/control-flow/for-switch-continue.c-expected
index afe3bf145..b6a5eeafe 100644
--- a/tests/control-flow/for-switch-continue.c-expected
+++ b/tests/control-flow/for-switch-continue.c-expected
@@ -106,13 +106,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
void
diff --git a/tests/control-flow/local-clash-with-implicit-this.c-expected b/tests/control-flow/local-clash-with-implicit-this.c-expected
index e648f1d2a..ea99a1cc2 100644
--- a/tests/control-flow/local-clash-with-implicit-this.c-expected
+++ b/tests/control-flow/local-clash-with-implicit-this.c-expected
@@ -271,13 +271,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
gpointer
diff --git a/tests/control-flow/null-conditional-bool.c-expected b/tests/control-flow/null-conditional-bool.c-expected
index 4881898d8..4ab15553a 100644
--- a/tests/control-flow/null-conditional-bool.c-expected
+++ b/tests/control-flow/null-conditional-bool.c-expected
@@ -256,13 +256,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
gpointer
diff --git a/tests/control-flow/pre-post-increment-property.c-expected b/tests/control-flow/pre-post-increment-property.c-expected
index f429d3212..96949d224 100644
--- a/tests/control-flow/pre-post-increment-property.c-expected
+++ b/tests/control-flow/pre-post-increment-property.c-expected
@@ -457,13 +457,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
gpointer
diff --git a/tests/control-flow/sideeffects.c-expected b/tests/control-flow/sideeffects.c-expected
index 0479213c8..81c928fd6 100644
--- a/tests/control-flow/sideeffects.c-expected
+++ b/tests/control-flow/sideeffects.c-expected
@@ -122,13 +122,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
static void
diff --git a/tests/control-flow/switch-enum.c-expected b/tests/control-flow/switch-enum.c-expected
index 42c32764a..fc8507bc4 100644
--- a/tests/control-flow/switch-enum.c-expected
+++ b/tests/control-flow/switch-enum.c-expected
@@ -42,13 +42,13 @@ foo_get_type_once (void)
GType
foo_get_type (void)
{
- static volatile gsize foo_type_id__volatile = 0;
- if (g_once_init_enter (&foo_type_id__volatile)) {
+ static volatile gsize foo_type_id__once = 0;
+ if (g_once_init_enter (&foo_type_id__once)) {
GType foo_type_id;
foo_type_id = foo_get_type_once ();
- g_once_init_leave (&foo_type_id__volatile, foo_type_id);
+ g_once_init_leave (&foo_type_id__once, foo_type_id);
}
- return foo_type_id__volatile;
+ return foo_type_id__once;
}
Foo
diff --git a/tests/control-flow/switch.c-expected b/tests/control-flow/switch.c-expected
index 1d35aad73..6e7834d96 100644
--- a/tests/control-flow/switch.c-expected
+++ b/tests/control-flow/switch.c-expected
@@ -203,13 +203,13 @@ maman_bar_get_type_once (void)
GType
maman_bar_get_type (void)
{
- static volatile gsize maman_bar_type_id__volatile = 0;
- if (g_once_init_enter (&maman_bar_type_id__volatile)) {
+ static volatile gsize maman_bar_type_id__once = 0;
+ if (g_once_init_enter (&maman_bar_type_id__once)) {
GType maman_bar_type_id;
maman_bar_type_id = maman_bar_get_type_once ();
- g_once_init_leave (&maman_bar_type_id__volatile, maman_bar_type_id);
+ g_once_init_leave (&maman_bar_type_id__once, maman_bar_type_id);
}
- return maman_bar_type_id__volatile;
+ return maman_bar_type_id__once;
}
static inline gpointer
@@ -356,12 +356,12 @@ maman_foo_get_type_once (void)
GType
maman_foo_get_type (void)
{
- static volatile gsize maman_foo_type_id__volatile = 0;
- if (g_once_init_enter (&maman_foo_type_id__volatile)) {
+ static volatile gsize maman_foo_type_id__once = 0;
+ if (g_once_init_enter (&maman_foo_type_id__once)) {
GType maman_foo_type_id;
maman_foo_type_id = maman_foo_get_type_once ();
- g_once_init_leave (&maman_foo_type_id__volatile, maman_foo_type_id);
+ g_once_init_leave (&maman_foo_type_id__once, maman_foo_type_id);
}
- return maman_foo_type_id__volatile;
+ return maman_foo_type_id__once;
}