src: remove use of 'volatile' from enum type decl

This avoids warnings with latest glib/gcc

src/virt-viewer-enums.c: In function ‘virt_viewer_display_show_hint_flags_get_type’:
/usr/include/glib-2.0/glib/gatomic.h:112:5: error: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Werror=incompatible-pointer-types]
  112 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ^~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \
      |       ^~~~~~~~~~~~~~~~~~~~
src/virt-viewer-enums.c:34:7: note: in expansion of macro ‘g_once_init_enter’
   34 |   if (g_once_init_enter (&g_define_type_id__volatile))
      |       ^~~~~~~~~~~~~~~~~

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-01-13 13:02:57 +00:00
parent 041857e677
commit 0dab000823

View File

@ -35,9 +35,9 @@
GType
@enum_name@_get_type (void)
{
static volatile gsize g_define_type_id__volatile = 0;
static gsize g_define_type_id__cache = 0;
if (g_once_init_enter (&g_define_type_id__volatile))
if (g_once_init_enter (&g_define_type_id__cache))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
@ -51,10 +51,10 @@ GType
};
GType g_define_type_id =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
g_once_init_leave (&g_define_type_id__cache, g_define_type_id);
}
return g_define_type_id__volatile;
return g_define_type_id__cache;
}
/*** END value-tail ***/