Commit bc6eca21 authored by Max Kellermann's avatar Max Kellermann

*: add `explicit`

parent 72ec641f
...@@ -62,7 +62,7 @@ class Iso9660ArchiveFile final : public ArchiveFile { ...@@ -62,7 +62,7 @@ class Iso9660ArchiveFile final : public ArchiveFile {
std::shared_ptr<Iso9660> iso; std::shared_ptr<Iso9660> iso;
public: public:
Iso9660ArchiveFile(std::shared_ptr<Iso9660> &&_iso) explicit Iso9660ArchiveFile(std::shared_ptr<Iso9660> &&_iso)
:iso(std::move(_iso)) {} :iso(std::move(_iso)) {}
/** /**
......
...@@ -54,7 +54,7 @@ class ZzipArchiveFile final : public ArchiveFile { ...@@ -54,7 +54,7 @@ class ZzipArchiveFile final : public ArchiveFile {
std::shared_ptr<ZzipDir> dir; std::shared_ptr<ZzipDir> dir;
public: public:
ZzipArchiveFile(std::shared_ptr<ZzipDir> &&_dir) explicit ZzipArchiveFile(std::shared_ptr<ZzipDir> &&_dir)
:dir(std::move(_dir)) {} :dir(std::move(_dir)) {}
void Visit(ArchiveVisitor &visitor) override; void Visit(ArchiveVisitor &visitor) override;
......
...@@ -111,7 +111,7 @@ class UPnPDirParser final : public CommonExpatParser { ...@@ -111,7 +111,7 @@ class UPnPDirParser final : public CommonExpatParser {
TagBuilder tag; TagBuilder tag;
public: public:
UPnPDirParser(UPnPDirContent &_directory) explicit UPnPDirParser(UPnPDirContent &_directory)
:directory(_directory), :directory(_directory),
state(NONE), state(NONE),
tag_type(TAG_NUM_OF_ITEM_TYPES) tag_type(TAG_NUM_OF_ITEM_TYPES)
......
...@@ -82,7 +82,7 @@ class PreparedFlacEncoder final : public PreparedEncoder { ...@@ -82,7 +82,7 @@ class PreparedFlacEncoder final : public PreparedEncoder {
const unsigned compression; const unsigned compression;
public: public:
PreparedFlacEncoder(const ConfigBlock &block); explicit PreparedFlacEncoder(const ConfigBlock &block);
/* virtual methods from class PreparedEncoder */ /* virtual methods from class PreparedEncoder */
Encoder *Open(AudioFormat &audio_format) override; Encoder *Open(AudioFormat &audio_format) override;
......
...@@ -57,7 +57,7 @@ class PreparedLameEncoder final : public PreparedEncoder { ...@@ -57,7 +57,7 @@ class PreparedLameEncoder final : public PreparedEncoder {
int bitrate; int bitrate;
public: public:
PreparedLameEncoder(const ConfigBlock &block); explicit PreparedLameEncoder(const ConfigBlock &block);
/* virtual methods from class PreparedEncoder */ /* virtual methods from class PreparedEncoder */
Encoder *Open(AudioFormat &audio_format) override; Encoder *Open(AudioFormat &audio_format) override;
......
...@@ -79,7 +79,7 @@ class PreparedOpusEncoder final : public PreparedEncoder { ...@@ -79,7 +79,7 @@ class PreparedOpusEncoder final : public PreparedEncoder {
const bool chaining; const bool chaining;
public: public:
PreparedOpusEncoder(const ConfigBlock &block); explicit PreparedOpusEncoder(const ConfigBlock &block);
/* virtual methods from class PreparedEncoder */ /* virtual methods from class PreparedEncoder */
Encoder *Open(AudioFormat &audio_format) override; Encoder *Open(AudioFormat &audio_format) override;
......
...@@ -86,7 +86,7 @@ class PreparedShineEncoder final : public PreparedEncoder { ...@@ -86,7 +86,7 @@ class PreparedShineEncoder final : public PreparedEncoder {
shine_config_t config; shine_config_t config;
public: public:
PreparedShineEncoder(const ConfigBlock &block); explicit PreparedShineEncoder(const ConfigBlock &block);
/* virtual methods from class PreparedEncoder */ /* virtual methods from class PreparedEncoder */
Encoder *Open(AudioFormat &audio_format) override; Encoder *Open(AudioFormat &audio_format) override;
......
...@@ -73,7 +73,7 @@ class PreparedTwolameEncoder final : public PreparedEncoder { ...@@ -73,7 +73,7 @@ class PreparedTwolameEncoder final : public PreparedEncoder {
int bitrate; int bitrate;
public: public:
PreparedTwolameEncoder(const ConfigBlock &block); explicit PreparedTwolameEncoder(const ConfigBlock &block);
/* virtual methods from class PreparedEncoder */ /* virtual methods from class PreparedEncoder */
Encoder *Open(AudioFormat &audio_format) override; Encoder *Open(AudioFormat &audio_format) override;
......
...@@ -65,7 +65,7 @@ class PreparedVorbisEncoder final : public PreparedEncoder { ...@@ -65,7 +65,7 @@ class PreparedVorbisEncoder final : public PreparedEncoder {
int bitrate; int bitrate;
public: public:
PreparedVorbisEncoder(const ConfigBlock &block); explicit PreparedVorbisEncoder(const ConfigBlock &block);
/* virtual methods from class PreparedEncoder */ /* virtual methods from class PreparedEncoder */
Encoder *Open(AudioFormat &audio_format) override; Encoder *Open(AudioFormat &audio_format) override;
......
...@@ -33,7 +33,7 @@ class WaveEncoder final : public Encoder { ...@@ -33,7 +33,7 @@ class WaveEncoder final : public Encoder {
DynamicFifoBuffer<uint8_t> buffer; DynamicFifoBuffer<uint8_t> buffer;
public: public:
WaveEncoder(AudioFormat &audio_format) noexcept; explicit WaveEncoder(AudioFormat &audio_format) noexcept;
/* virtual methods from class Encoder */ /* virtual methods from class Encoder */
void Write(const void *data, size_t length) override; void Write(const void *data, size_t length) override;
......
...@@ -53,7 +53,7 @@ class SignalMonitor final : private SocketMonitor { ...@@ -53,7 +53,7 @@ class SignalMonitor final : private SocketMonitor {
#endif #endif
public: public:
SignalMonitor(EventLoop &_loop) explicit SignalMonitor(EventLoop &_loop)
:SocketMonitor(_loop) { :SocketMonitor(_loop) {
#ifndef USE_SIGNALFD #ifndef USE_SIGNALFD
SocketMonitor::Open(SocketDescriptor(fd.Get())); SocketMonitor::Open(SocketDescriptor(fd.Get()));
......
...@@ -64,7 +64,7 @@ class PreparedAutoConvertFilter final : public PreparedFilter { ...@@ -64,7 +64,7 @@ class PreparedAutoConvertFilter final : public PreparedFilter {
std::unique_ptr<PreparedFilter> filter; std::unique_ptr<PreparedFilter> filter;
public: public:
PreparedAutoConvertFilter(std::unique_ptr<PreparedFilter> _filter) noexcept explicit PreparedAutoConvertFilter(std::unique_ptr<PreparedFilter> _filter) noexcept
:filter(std::move(_filter)) {} :filter(std::move(_filter)) {}
std::unique_ptr<Filter> Open(AudioFormat &af) override; std::unique_ptr<Filter> Open(AudioFormat &af) override;
......
...@@ -42,7 +42,7 @@ class ConvertFilter final : public Filter { ...@@ -42,7 +42,7 @@ class ConvertFilter final : public Filter {
std::unique_ptr<PcmConvert> state; std::unique_ptr<PcmConvert> state;
public: public:
ConvertFilter(const AudioFormat &audio_format); explicit ConvertFilter(const AudioFormat &audio_format);
void Set(const AudioFormat &_out_audio_format); void Set(const AudioFormat &_out_audio_format);
......
...@@ -34,7 +34,7 @@ class NormalizeFilter final : public Filter { ...@@ -34,7 +34,7 @@ class NormalizeFilter final : public Filter {
PcmBuffer buffer; PcmBuffer buffer;
public: public:
NormalizeFilter(const AudioFormat &audio_format) explicit NormalizeFilter(const AudioFormat &audio_format)
:Filter(audio_format), compressor(Compressor_new(0)) { :Filter(audio_format), compressor(Compressor_new(0)) {
} }
......
...@@ -130,7 +130,7 @@ public: ...@@ -130,7 +130,7 @@ public:
* @param block the configuration block to read * @param block the configuration block to read
* @param filter a route_filter whose min_channels and sources[] to set * @param filter a route_filter whose min_channels and sources[] to set
*/ */
PreparedRouteFilter(const ConfigBlock &block); explicit PreparedRouteFilter(const ConfigBlock &block);
/* virtual methods from class PreparedFilter */ /* virtual methods from class PreparedFilter */
std::unique_ptr<Filter> Open(AudioFormat &af) override; std::unique_ptr<Filter> Open(AudioFormat &af) override;
......
...@@ -139,7 +139,7 @@ class AlsaInputStream::SourceSpec { ...@@ -139,7 +139,7 @@ class AlsaInputStream::SourceSpec {
DivideString components; DivideString components;
public: public:
SourceSpec(const char *_uri) explicit SourceSpec(const char *_uri)
: uri(_uri) : uri(_uri)
, components(uri, '?') , components(uri, '?')
{ {
......
...@@ -40,7 +40,7 @@ class UPnPDeviceParser final : public CommonExpatParser { ...@@ -40,7 +40,7 @@ class UPnPDeviceParser final : public CommonExpatParser {
UPnPService m_tservice; UPnPService m_tservice;
public: public:
UPnPDeviceParser(UPnPDevice& device) explicit UPnPDeviceParser(UPnPDevice& device)
:m_device(device), :m_device(device),
value(nullptr) {} value(nullptr) {}
......
...@@ -26,7 +26,7 @@ class NullMixer final : public Mixer { ...@@ -26,7 +26,7 @@ class NullMixer final : public Mixer {
unsigned volume; unsigned volume;
public: public:
NullMixer(MixerListener &_listener) explicit NullMixer(MixerListener &_listener)
:Mixer(null_mixer_plugin, _listener), :Mixer(null_mixer_plugin, _listener),
volume(100) volume(100)
{ {
......
...@@ -34,7 +34,7 @@ class SoftwareMixer final : public Mixer { ...@@ -34,7 +34,7 @@ class SoftwareMixer final : public Mixer {
unsigned volume = 100; unsigned volume = 100;
public: public:
SoftwareMixer(MixerListener &_listener) explicit SoftwareMixer(MixerListener &_listener)
:Mixer(software_mixer_plugin, _listener) :Mixer(software_mixer_plugin, _listener)
{ {
} }
......
...@@ -66,7 +66,7 @@ class SmbclientNeighborExplorer final : public NeighborExplorer { ...@@ -66,7 +66,7 @@ class SmbclientNeighborExplorer final : public NeighborExplorer {
bool quit; bool quit;
public: public:
SmbclientNeighborExplorer(NeighborListener &_listener) noexcept explicit SmbclientNeighborExplorer(NeighborListener &_listener) noexcept
:NeighborExplorer(_listener), :NeighborExplorer(_listener),
thread(BIND_THIS_METHOD(ThreadFunc)) {} thread(BIND_THIS_METHOD(ThreadFunc)) {}
......
...@@ -52,7 +52,7 @@ class AoOutput final : AudioOutput, SafeSingleton<AoInit> { ...@@ -52,7 +52,7 @@ class AoOutput final : AudioOutput, SafeSingleton<AoInit> {
size_t frame_size; size_t frame_size;
AoOutput(const ConfigBlock &block); explicit AoOutput(const ConfigBlock &block);
~AoOutput() override; ~AoOutput() override;
public: public:
......
...@@ -42,7 +42,7 @@ class FifoOutput final : AudioOutput { ...@@ -42,7 +42,7 @@ class FifoOutput final : AudioOutput {
Timer *timer; Timer *timer;
public: public:
FifoOutput(const ConfigBlock &block); explicit FifoOutput(const ConfigBlock &block);
~FifoOutput() override { ~FifoOutput() override {
CloseFifo(); CloseFifo();
......
...@@ -27,7 +27,7 @@ class NullOutput final : AudioOutput { ...@@ -27,7 +27,7 @@ class NullOutput final : AudioOutput {
Timer *timer; Timer *timer;
public: public:
NullOutput(const ConfigBlock &block) explicit NullOutput(const ConfigBlock &block)
:AudioOutput(0), :AudioOutput(0),
sync(block.GetBlockValue("sync", true)) {} sync(block.GetBlockValue("sync", true)) {}
......
...@@ -44,7 +44,7 @@ class OpenALOutput final : AudioOutput { ...@@ -44,7 +44,7 @@ class OpenALOutput final : AudioOutput {
ALenum format; ALenum format;
ALuint frequency; ALuint frequency;
OpenALOutput(const ConfigBlock &block); explicit OpenALOutput(const ConfigBlock &block);
public: public:
static AudioOutput *Create(EventLoop &, static AudioOutput *Create(EventLoop &,
......
...@@ -30,7 +30,7 @@ class PipeOutput final : AudioOutput { ...@@ -30,7 +30,7 @@ class PipeOutput final : AudioOutput {
const std::string cmd; const std::string cmd;
FILE *fh; FILE *fh;
PipeOutput(const ConfigBlock &block); explicit PipeOutput(const ConfigBlock &block);
public: public:
static AudioOutput *Create(EventLoop &, static AudioOutput *Create(EventLoop &,
......
...@@ -67,7 +67,7 @@ class RecorderOutput final : AudioOutput { ...@@ -67,7 +67,7 @@ class RecorderOutput final : AudioOutput {
*/ */
FileOutputStream *file; FileOutputStream *file;
RecorderOutput(const ConfigBlock &block); explicit RecorderOutput(const ConfigBlock &block);
public: public:
static AudioOutput *Create(EventLoop &, const ConfigBlock &block) { static AudioOutput *Create(EventLoop &, const ConfigBlock &block) {
......
...@@ -53,7 +53,7 @@ struct Convert24To16 { ...@@ -53,7 +53,7 @@ struct Convert24To16 {
PcmDither &dither; PcmDither &dither;
Convert24To16(PcmDither &_dither):dither(_dither) {} explicit Convert24To16(PcmDither &_dither):dither(_dither) {}
void Convert(int16_t *out, const int32_t *in, size_t n) { void Convert(int16_t *out, const int32_t *in, size_t n) {
dither.Dither24To16(out, in, in + n); dither.Dither24To16(out, in, in + n);
...@@ -66,7 +66,7 @@ struct Convert32To16 { ...@@ -66,7 +66,7 @@ struct Convert32To16 {
PcmDither &dither; PcmDither &dither;
Convert32To16(PcmDither &_dither):dither(_dither) {} explicit Convert32To16(PcmDither &_dither):dither(_dither) {}
void Convert(int16_t *out, const int32_t *in, size_t n) { void Convert(int16_t *out, const int32_t *in, size_t n) {
dither.Dither32To16(out, in, in + n); dither.Dither32To16(out, in, in + n);
......
...@@ -28,7 +28,7 @@ class CuePlaylist final : public SongEnumerator { ...@@ -28,7 +28,7 @@ class CuePlaylist final : public SongEnumerator {
CueParser parser; CueParser parser;
public: public:
CuePlaylist(InputStreamPtr &&is) explicit CuePlaylist(InputStreamPtr &&is)
:tis(std::move(is)) { :tis(std::move(is)) {
} }
......
...@@ -35,7 +35,7 @@ class ExtM3uPlaylist final : public SongEnumerator { ...@@ -35,7 +35,7 @@ class ExtM3uPlaylist final : public SongEnumerator {
TextInputStream tis; TextInputStream tis;
public: public:
ExtM3uPlaylist(InputStreamPtr &&is) explicit ExtM3uPlaylist(InputStreamPtr &&is)
:tis(std::move(is)) { :tis(std::move(is)) {
} }
......
...@@ -28,7 +28,7 @@ class M3uPlaylist final : public SongEnumerator { ...@@ -28,7 +28,7 @@ class M3uPlaylist final : public SongEnumerator {
TextInputStream tis; TextInputStream tis;
public: public:
M3uPlaylist(InputStreamPtr &&is) explicit M3uPlaylist(InputStreamPtr &&is)
:tis(std::move(is)) { :tis(std::move(is)) {
} }
......
...@@ -36,7 +36,7 @@ class LocalDirectoryReader final : public StorageDirectoryReader { ...@@ -36,7 +36,7 @@ class LocalDirectoryReader final : public StorageDirectoryReader {
std::string name_utf8; std::string name_utf8;
public: public:
LocalDirectoryReader(AllocatedPath &&_base_fs) explicit LocalDirectoryReader(AllocatedPath &&_base_fs)
:base_fs(std::move(_base_fs)), reader(base_fs) {} :base_fs(std::move(_base_fs)), reader(base_fs) {}
/* virtual methods from class StorageDirectoryReader */ /* virtual methods from class StorageDirectoryReader */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment