diff --git a/client/decoder/flac_decoder.cpp b/client/decoder/flac_decoder.cpp index 9a757afd..db057608 100644 --- a/client/decoder/flac_decoder.cpp +++ b/client/decoder/flac_decoder.cpp @@ -153,11 +153,9 @@ FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder* /*decoder } -FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder* decoder, const FLAC__Frame* frame, const FLAC__int32* const buffer[], +FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder* /*decoder*/, const FLAC__Frame* frame, const FLAC__int32* const buffer[], void* client_data) { - (void)decoder; - if (pcmChunk != nullptr) { size_t bytes = frame->header.blocksize * sampleFormat.frameSize; @@ -202,9 +200,8 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder* decoder } -void metadata_callback(const FLAC__StreamDecoder* decoder, const FLAC__StreamMetadata* metadata, void* client_data) +void metadata_callback(const FLAC__StreamDecoder* /*decoder*/, const FLAC__StreamMetadata* metadata, void* client_data) { - (void)decoder; /* print some stats */ if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { @@ -214,9 +211,8 @@ void metadata_callback(const FLAC__StreamDecoder* decoder, const FLAC__StreamMet } -void error_callback(const FLAC__StreamDecoder* decoder, FLAC__StreamDecoderErrorStatus status, void* client_data) +void error_callback(const FLAC__StreamDecoder* /*decoder*/, FLAC__StreamDecoderErrorStatus status, void* client_data) { - (void)decoder, (void)client_data; SLOG(ERROR) << "Got error callback: " << FLAC__StreamDecoderErrorStatusString[status] << "\n"; static_cast(client_data)->lastError_ = std::unique_ptr(new FLAC__StreamDecoderErrorStatus(status)); } diff --git a/common/message/pcm_chunk.hpp b/common/message/pcm_chunk.hpp index f1bdebc8..37f629b3 100644 --- a/common/message/pcm_chunk.hpp +++ b/common/message/pcm_chunk.hpp @@ -40,10 +40,6 @@ public: { } - PcmChunk(const PcmChunk& pcmChunk) : WireChunk(pcmChunk), format(pcmChunk.format), idx_(0) - { - } - PcmChunk() : WireChunk(), idx_(0) { } diff --git a/common/snap_exception.hpp b/common/snap_exception.hpp index 5cf153fb..543b3241 100644 --- a/common/snap_exception.hpp +++ b/common/snap_exception.hpp @@ -26,31 +26,22 @@ // text_exception uses a dynamically-allocated internal c-string for what(): class SnapException : public std::exception { - char* text_; + std::string text_; public: - SnapException(const char* text) + SnapException(const char* text) : text_(text) { - text_ = new char[std::strlen(text) + 1]; - std::strcpy(text_, text); } SnapException(const std::string& text) : SnapException(text.c_str()) { } - SnapException(const SnapException& e) : SnapException(e.what()) - { - } - - ~SnapException() throw() override - { - delete[] text_; - } + ~SnapException() throw() override = default; const char* what() const noexcept override { - return text_; + return text_.c_str(); } }; @@ -67,11 +58,6 @@ public: { } - AsyncSnapException(const AsyncSnapException& e) : SnapException(e.what()) - { - } - - ~AsyncSnapException() throw() override = default; }; diff --git a/control/control.py b/control/control.py index f8946801..d98d6fe6 100755 --- a/control/control.py +++ b/control/control.py @@ -20,7 +20,6 @@ def doRequest( j, requestId ): if jResponse['id'] == requestId: print("recv: " + response) return jResponse; - return; def setVolume(client, volume): global requestId diff --git a/control/setVolume.py b/control/setVolume.py index 1eea6d40..f006487a 100755 --- a/control/setVolume.py +++ b/control/setVolume.py @@ -16,7 +16,6 @@ def doRequest( j, requestId ): if jResponse['id'] == requestId: # print("recv: " + response) return jResponse; - return; def setVolume(client, volume): global requestId diff --git a/server/jsonrpcpp.hpp b/server/jsonrpcpp.hpp index 97d74f3d..e47181dc 100644 --- a/server/jsonrpcpp.hpp +++ b/server/jsonrpcpp.hpp @@ -3,7 +3,7 @@ _( )/ ___) / \ ( ( \( _ \( _ \ / __)( ) ( ) / \) \\___ \( O )/ / ) / ) __/( (__(_ _)(_ _) \____/(____/ \__/ \_)__)(__\_)(__) \___)(_) (_) - version 1.3.0 + version 1.3.1 https://github.com/badaix/jsonrpcpp This file is part of jsonrpc++ @@ -336,7 +336,6 @@ class RequestException : public RpcEntityException { public: RequestException(const Error& error, const Id& requestId = Id()); - RequestException(const RequestException& e) = default; Json to_json() const override; const Id& id() const diff --git a/server/snapserver.cpp b/server/snapserver.cpp index 95433698..f1d78276 100644 --- a/server/snapserver.cpp +++ b/server/snapserver.cpp @@ -266,7 +266,7 @@ int main(int argc, char* argv[]) settings.stream.bufferMs = 400; } - std::unique_ptr streamServer(new StreamServer(io_context, settings)); + auto streamServer = std::make_unique(io_context, settings); streamServer->start(); if (num_threads < 0)