clang-tidy: mark a bunch of variables constexpr
Found with cppcoreguidelines-interfaces-global-init Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
906e82f600
commit
594dfe572b
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const ArchivePlugin *const archive_plugins[] = {
|
constexpr const ArchivePlugin *archive_plugins[] = {
|
||||||
#ifdef ENABLE_BZ2
|
#ifdef ENABLE_BZ2
|
||||||
&bz2_archive_plugin,
|
&bz2_archive_plugin,
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const DatabasePlugin *const database_plugins[] = {
|
constexpr const DatabasePlugin *database_plugins[] = {
|
||||||
&simple_db_plugin,
|
&simple_db_plugin,
|
||||||
#ifdef ENABLE_LIBMPDCLIENT
|
#ifdef ENABLE_LIBMPDCLIENT
|
||||||
&proxy_db_plugin,
|
&proxy_db_plugin,
|
||||||
|
@ -479,7 +479,7 @@ SimpleDatabase::Unmount(const char *uri) noexcept
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DatabasePlugin simple_db_plugin = {
|
constexpr DatabasePlugin simple_db_plugin = {
|
||||||
"simple",
|
"simple",
|
||||||
DatabasePlugin::FLAG_REQUIRE_STORAGE,
|
DatabasePlugin::FLAG_REQUIRE_STORAGE,
|
||||||
SimpleDatabase::Create,
|
SimpleDatabase::Create,
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const struct DecoderPlugin *const decoder_plugins[] = {
|
constexpr const struct DecoderPlugin *decoder_plugins[] = {
|
||||||
#ifdef ENABLE_MAD
|
#ifdef ENABLE_MAD
|
||||||
&mad_decoder_plugin,
|
&mad_decoder_plugin,
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const EncoderPlugin *const encoder_plugins[] = {
|
constexpr const EncoderPlugin *encoder_plugins[] = {
|
||||||
&null_encoder_plugin,
|
&null_encoder_plugin,
|
||||||
#ifdef ENABLE_VORBISENC
|
#ifdef ENABLE_VORBISENC
|
||||||
&vorbis_encoder_plugin,
|
&vorbis_encoder_plugin,
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static const FilterPlugin *const filter_plugins[] = {
|
static constexpr const FilterPlugin *filter_plugins[] = {
|
||||||
&null_filter_plugin,
|
&null_filter_plugin,
|
||||||
&route_filter_plugin,
|
&route_filter_plugin,
|
||||||
&normalize_filter_plugin,
|
&normalize_filter_plugin,
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
#include "plugins/CdioParanoiaInputPlugin.hxx"
|
#include "plugins/CdioParanoiaInputPlugin.hxx"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const InputPlugin *const input_plugins[] = {
|
constexpr const InputPlugin *input_plugins[] = {
|
||||||
#ifdef ENABLE_ALSA
|
#ifdef ENABLE_ALSA
|
||||||
&input_plugin_alsa,
|
&input_plugin_alsa,
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const NeighborPlugin *const neighbor_plugins[] = {
|
constexpr const NeighborPlugin *neighbor_plugins[] = {
|
||||||
#ifdef ENABLE_SMBCLIENT
|
#ifdef ENABLE_SMBCLIENT
|
||||||
&smbclient_neighbor_plugin,
|
&smbclient_neighbor_plugin,
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "util/StringAPI.hxx"
|
#include "util/StringAPI.hxx"
|
||||||
|
|
||||||
const AudioOutputPlugin *const audio_output_plugins[] = {
|
constexpr const AudioOutputPlugin *audio_output_plugins[] = {
|
||||||
#ifdef HAVE_SHOUT
|
#ifdef HAVE_SHOUT
|
||||||
&shout_output_plugin,
|
&shout_output_plugin,
|
||||||
#endif
|
#endif
|
||||||
|
@ -1181,7 +1181,7 @@ try {
|
|||||||
LockCaughtError();
|
LockCaughtError();
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct AudioOutputPlugin alsa_output_plugin = {
|
constexpr struct AudioOutputPlugin alsa_output_plugin = {
|
||||||
"alsa",
|
"alsa",
|
||||||
alsa_test_default_device,
|
alsa_test_default_device,
|
||||||
&AlsaOutput::Create,
|
&AlsaOutput::Create,
|
||||||
|
@ -913,7 +913,7 @@ pulse_output_test_default_device()
|
|||||||
return PulseOutput::TestDefaultDevice();
|
return PulseOutput::TestDefaultDevice();
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct AudioOutputPlugin pulse_output_plugin = {
|
constexpr struct AudioOutputPlugin pulse_output_plugin = {
|
||||||
"pulse",
|
"pulse",
|
||||||
pulse_output_test_default_device,
|
pulse_output_test_default_device,
|
||||||
PulseOutput::Create,
|
PulseOutput::Create,
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
const PlaylistPlugin *const playlist_plugins[] = {
|
constexpr const PlaylistPlugin *playlist_plugins[] = {
|
||||||
&extm3u_playlist_plugin,
|
&extm3u_playlist_plugin,
|
||||||
&m3u_playlist_plugin,
|
&m3u_playlist_plugin,
|
||||||
&pls_playlist_plugin,
|
&pls_playlist_plugin,
|
||||||
|
@ -147,7 +147,7 @@ static const char *const extm3u_mime_types[] = {
|
|||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const PlaylistPlugin extm3u_playlist_plugin =
|
constexpr PlaylistPlugin extm3u_playlist_plugin =
|
||||||
PlaylistPlugin("extm3u", extm3u_open_stream)
|
PlaylistPlugin("extm3u", extm3u_open_stream)
|
||||||
.WithSuffixes(extm3u_suffixes)
|
.WithSuffixes(extm3u_suffixes)
|
||||||
.WithMimeTypes(extm3u_mime_types);
|
.WithMimeTypes(extm3u_mime_types);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const StoragePlugin *const storage_plugins[] = {
|
constexpr const StoragePlugin *storage_plugins[] = {
|
||||||
&local_storage_plugin,
|
&local_storage_plugin,
|
||||||
#ifdef ENABLE_SMBCLIENT
|
#ifdef ENABLE_SMBCLIENT
|
||||||
&smbclient_storage_plugin,
|
&smbclient_storage_plugin,
|
||||||
|
@ -170,7 +170,7 @@ CreateLocalStorage(Path base_fs)
|
|||||||
return std::make_unique<LocalStorage>(base_fs);
|
return std::make_unique<LocalStorage>(base_fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
const StoragePlugin local_storage_plugin = {
|
constexpr StoragePlugin local_storage_plugin = {
|
||||||
"local",
|
"local",
|
||||||
nullptr,
|
nullptr,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user