gobject: Drop use of volatile from get_type() macros

http://isvolatileusefulwiththreads.in/c/

It’s possible that the variables here are only marked as volatile
because they’re arguments to `g_once_*()`. Those arguments will be
modified in a subsequent commit.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #600
This commit is contained in:
Philip Withnall
2020-11-11 18:12:22 +00:00
parent 066e68001e
commit fab561f8d0
10 changed files with 56 additions and 56 deletions

View File

@@ -480,9 +480,9 @@ A C source template file will typically look like this:
GType
@enum_name@_get_type (void)
{
static volatile gsize g_@type@_type_id__volatile;
static gsize static_g_@type@_type_id;
if (g_once_init_enter (&amp;g_define_type_id__volatile))
if (g_once_init_enter (&amp;static_g_@type@_type_id))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
@@ -498,9 +498,9 @@ GType
GType g_@type@_type_id =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
g_once_init_leave (&amp;g_@type@_type_id__volatile, g_@type@_type_id);
g_once_init_leave (&amp;static_g_@type@_type_id, g_@type@_type_id);
}
return g_@type@_type_id__volatile;
return static_g_@type@_type_id;
}
/*** END value-tail ***/

View File

@@ -852,7 +852,7 @@ viewer_editable_default_init (ViewerEditableInterface *iface)
GType
viewer_editable_get_type (void)
{
static volatile gsize type_id = 0;
static gsize type_id = 0;
if (g_once_init_enter (&amp;type_id)) {
const GTypeInfo info = {
sizeof (ViewerEditableInterface),