diff options
author | Matthew Waters <matthew@centricular.com> | 2021-03-18 19:52:53 +1100 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-06-17 15:58:03 -0400 |
commit | 954af37bc9a31db13e7b2206c3a976177cf6c7b4 (patch) | |
tree | dfdaa0e8b6f3fac9901694a05f736d31f72687c7 | |
parent | 9efd93e20dd7789e4172ad6c8f4108271b3fb1ee (diff) |
gst: don't use volatile to mean atomic1.16
volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead. GCC 11 has started warning about using volatile
with atomic operations.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1012>
-rw-r--r-- | ext/jack/gstjack.c | 6 | ||||
-rw-r--r-- | ext/jack/gstjackaudiosink.c | 2 | ||||
-rw-r--r-- | ext/jack/gstjackaudiosrc.c | 2 | ||||
-rw-r--r-- | ext/pulse/pulsesink.h | 2 | ||||
-rw-r--r-- | ext/qt/gstqsgtexture.cc | 2 | ||||
-rw-r--r-- | ext/qt/gstqtglutility.cc | 2 | ||||
-rw-r--r-- | ext/qt/qtitem.cc | 2 | ||||
-rw-r--r-- | ext/qt/qtwindow.cc | 4 | ||||
-rw-r--r-- | ext/vpx/gstvpxdec.c | 2 | ||||
-rw-r--r-- | ext/vpx/gstvpxenc.c | 14 | ||||
-rw-r--r-- | gst/audioparsers/gstac3parse.h | 2 | ||||
-rw-r--r-- | sys/ximage/ximageutil.c | 2 |
12 files changed, 21 insertions, 21 deletions
diff --git a/ext/jack/gstjack.c b/ext/jack/gstjack.c index ca98dc405..fdd507d87 100644 --- a/ext/jack/gstjack.c +++ b/ext/jack/gstjack.c @@ -28,7 +28,7 @@ GType gst_jack_connect_get_type (void) { - static volatile gsize jack_connect_type = 0; + static gsize jack_connect_type = 0; if (g_once_init_enter (&jack_connect_type)) { static const GEnumValue jack_connect_enums[] = { @@ -50,7 +50,7 @@ gst_jack_connect_get_type (void) GType gst_jack_transport_get_type (void) { - static volatile gsize type = 0; + static gsize type = 0; if (g_once_init_enter (&type)) { static const GFlagsValue flag_values[] = { @@ -84,7 +84,7 @@ gst_jack_client_free (gpointer jclient) GType gst_jack_client_get_type (void) { - static volatile gsize jack_client_type = 0; + static gsize jack_client_type = 0; if (g_once_init_enter (&jack_client_type)) { /* hackish, but makes it show up nicely in gst-inspect */ diff --git a/ext/jack/gstjackaudiosink.c b/ext/jack/gstjackaudiosink.c index 701d25a84..1868c3867 100644 --- a/ext/jack/gstjackaudiosink.c +++ b/ext/jack/gstjackaudiosink.c @@ -131,7 +131,7 @@ gst_jack_audio_sink_free_channels (GstJackAudioSink * sink) static GType gst_jack_ring_buffer_get_type (void) { - static volatile gsize ringbuffer_type = 0; + static gsize ringbuffer_type = 0; if (g_once_init_enter (&ringbuffer_type)) { static const GTypeInfo ringbuffer_info = { diff --git a/ext/jack/gstjackaudiosrc.c b/ext/jack/gstjackaudiosrc.c index 931f4dddb..f72cff4f2 100644 --- a/ext/jack/gstjackaudiosrc.c +++ b/ext/jack/gstjackaudiosrc.c @@ -151,7 +151,7 @@ gst_jack_audio_src_free_channels (GstJackAudioSrc * src) static GType gst_jack_ring_buffer_get_type (void) { - static volatile gsize ringbuffer_type = 0; + static gsize ringbuffer_type = 0; if (g_once_init_enter (&ringbuffer_type)) { static const GTypeInfo ringbuffer_info = { sizeof (GstJackRingBufferClass), diff --git a/ext/pulse/pulsesink.h b/ext/pulse/pulsesink.h index de3b93281..b2285896c 100644 --- a/ext/pulse/pulsesink.h +++ b/ext/pulse/pulsesink.h @@ -83,7 +83,7 @@ struct _GstPulseSink GstStructure *properties; pa_proplist *proplist; - volatile gint format_lost; + gint format_lost; GstClockTime format_lost_time; }; diff --git a/ext/qt/gstqsgtexture.cc b/ext/qt/gstqsgtexture.cc index 2b314e0ee..ad1425e07 100644 --- a/ext/qt/gstqsgtexture.cc +++ b/ext/qt/gstqsgtexture.cc @@ -35,7 +35,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); GstQSGTexture::GstQSGTexture () { - static volatile gsize _debug; + static gsize _debug; initializeOpenGLFunctions(); diff --git a/ext/qt/gstqtglutility.cc b/ext/qt/gstqtglutility.cc index 20e8eaddf..5e8138857 100644 --- a/ext/qt/gstqtglutility.cc +++ b/ext/qt/gstqtglutility.cc @@ -58,7 +58,7 @@ gst_qt_get_gl_display () { GstGLDisplay *display = NULL; QGuiApplication *app = static_cast<QGuiApplication *> (QCoreApplication::instance ()); - static volatile gsize _debug; + static gsize _debug; g_assert (app != NULL); diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index 65b883eab..479017cd2 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -102,7 +102,7 @@ void InitializeSceneGraph::run() QtGLVideoItem::QtGLVideoItem() { - static volatile gsize _debug; + static gsize _debug; if (g_once_init_enter (&_debug)) { GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "qtglwidget", 0, "Qt GL Widget"); diff --git a/ext/qt/qtwindow.cc b/ext/qt/qtwindow.cc index 62d26b647..c6db392c3 100644 --- a/ext/qt/qtwindow.cc +++ b/ext/qt/qtwindow.cc @@ -103,7 +103,7 @@ QtGLWindow::QtGLWindow ( QWindow * parent, QQuickWindow *src ) : QQuickWindow( parent ), source (src) { QGuiApplication *app = static_cast<QGuiApplication *> (QCoreApplication::instance ()); - static volatile gsize _debug; + static gsize _debug; g_assert (app != NULL); @@ -152,7 +152,7 @@ QtGLWindow::beforeRendering() g_mutex_lock (&this->priv->lock); - static volatile gsize once = 0; + static gsize once = 0; if (g_once_init_enter(&once)) { this->priv->start = QDateTime::currentDateTime().toMSecsSinceEpoch(); g_once_init_leave(&once,1); diff --git a/ext/vpx/gstvpxdec.c b/ext/vpx/gstvpxdec.c index da4322513..899103991 100644 --- a/ext/vpx/gstvpxdec.c +++ b/ext/vpx/gstvpxdec.c @@ -79,7 +79,7 @@ gst_vpx_dec_post_processing_flags_get_type (void) {C_FLAGS (VP8_MFQE), "Multi-frame quality enhancement", "mfqe"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; diff --git a/ext/vpx/gstvpxenc.c b/ext/vpx/gstvpxenc.c index 4aa1bf047..95fcbb499 100644 --- a/ext/vpx/gstvpxenc.c +++ b/ext/vpx/gstvpxenc.c @@ -162,7 +162,7 @@ gst_vpx_enc_end_usage_get_type (void) {VPX_CQ, "Constant Quality Mode (CQ) mode", "cq"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; @@ -185,7 +185,7 @@ gst_vpx_enc_multipass_mode_get_type (void) {VPX_RC_LAST_PASS, "Last pass of multipass encoding", "last-pass"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; @@ -207,7 +207,7 @@ gst_vpx_enc_kf_mode_get_type (void) {VPX_KF_DISABLED, "Don't automatically place keyframes", "disabled"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; @@ -229,7 +229,7 @@ gst_vpx_enc_tuning_get_type (void) {VP8_TUNE_SSIM, "Tune for SSIM", "ssim"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; @@ -253,7 +253,7 @@ gst_vpx_enc_scaling_mode_get_type (void) {VP8E_ONETWO, "1:2", "1:2"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; @@ -277,7 +277,7 @@ gst_vpx_enc_token_partitions_get_type (void) {VP8_EIGHT_TOKENPARTITION, "Eight token partitions", "8"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; @@ -300,7 +300,7 @@ gst_vpx_enc_er_flags_get_type (void) "Allow partitions to be decoded independently", "partitions"}, {0, NULL, NULL} }; - static volatile GType id = 0; + static GType id = 0; if (g_once_init_enter ((gsize *) & id)) { GType _id; diff --git a/gst/audioparsers/gstac3parse.h b/gst/audioparsers/gstac3parse.h index 0e7af5acd..81e2104d5 100644 --- a/gst/audioparsers/gstac3parse.h +++ b/gst/audioparsers/gstac3parse.h @@ -62,7 +62,7 @@ struct _GstAc3Parse { gint blocks; gboolean eac; gboolean sent_codec_tag; - volatile gint align; + gint align; GstPadChainFunction baseparse_chainfunc; }; diff --git a/sys/ximage/ximageutil.c b/sys/ximage/ximageutil.c index 57c9392c7..018b60515 100644 --- a/sys/ximage/ximageutil.c +++ b/sys/ximage/ximageutil.c @@ -26,7 +26,7 @@ GType gst_meta_ximage_api_get_type (void) { - static volatile GType type; + static GType type; static const gchar *tags[] = { "memory", NULL }; if (g_once_init_enter (&type)) { |