From 6af7be4a45a59b8f366228b5efea8e32c46db07a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 31 May 2021 13:21:57 -0700 Subject: add constexpr Found with cppcoreguidelines-interfaces-global-init Signed-off-by: Rosen Penev --- src/mixer/plugins/OssMixerPlugin.cxx | 2 +- src/mixer/plugins/SndioMixerPlugin.cxx | 2 +- src/output/plugins/OssOutputPlugin.cxx | 2 +- src/output/plugins/SndioOutputPlugin.cxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mixer/plugins/OssMixerPlugin.cxx b/src/mixer/plugins/OssMixerPlugin.cxx index 52d1795ad..a84188d03 100644 --- a/src/mixer/plugins/OssMixerPlugin.cxx +++ b/src/mixer/plugins/OssMixerPlugin.cxx @@ -175,7 +175,7 @@ OssMixer::SetVolume(unsigned volume) throw MakeErrno("failed to set OSS volume"); } -const MixerPlugin oss_mixer_plugin = { +constexpr MixerPlugin oss_mixer_plugin = { oss_mixer_init, true, }; diff --git a/src/mixer/plugins/SndioMixerPlugin.cxx b/src/mixer/plugins/SndioMixerPlugin.cxx index d9776c02d..f55691833 100644 --- a/src/mixer/plugins/SndioMixerPlugin.cxx +++ b/src/mixer/plugins/SndioMixerPlugin.cxx @@ -53,7 +53,7 @@ sndio_mixer_init([[maybe_unused]] EventLoop &event_loop, return new SndioMixer((SndioOutput &)ao, listener); } -const MixerPlugin sndio_mixer_plugin = { +constexpr MixerPlugin sndio_mixer_plugin = { sndio_mixer_init, false, }; diff --git a/src/output/plugins/OssOutputPlugin.cxx b/src/output/plugins/OssOutputPlugin.cxx index 13dbcbcbe..4ed79e52f 100644 --- a/src/output/plugins/OssOutputPlugin.cxx +++ b/src/output/plugins/OssOutputPlugin.cxx @@ -634,7 +634,7 @@ OssOutput::Play(const void *chunk, size_t size) } } -const struct AudioOutputPlugin oss_output_plugin = { +constexpr struct AudioOutputPlugin oss_output_plugin = { "oss", oss_output_test_default_device, OssOutput::Create, diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index 4221099fc..cd284d401 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -185,7 +185,7 @@ SndioOutput::RegisterMixerListener(Mixer *_mixer, MixerListener *_listener) { listener = _listener; } -const struct AudioOutputPlugin sndio_output_plugin = { +constexpr struct AudioOutputPlugin sndio_output_plugin = { "sndio", sndio_test_default_device, SndioOutput::Create, -- cgit v1.2.3