diff --git a/client/Makefile b/client/Makefile index 1a482d0b..0d21206a 100644 --- a/client/Makefile +++ b/client/Makefile @@ -34,7 +34,7 @@ endif DEBUG=-O3 -CXXFLAGS += $(ADD_CFLAGS) -std=c++0x -Wall -Wpedantic -Wno-unused-function $(DEBUG) -DHAS_FLAC -DHAS_OGG -DVERSION=\"$(VERSION)\" -I. -I.. -I../common +CXXFLAGS += $(ADD_CFLAGS) -std=c++0x -Wall -Wextra -Wpedantic -Wno-unused-function $(DEBUG) -DHAS_FLAC -DHAS_OGG -DVERSION=\"$(VERSION)\" -I. -I.. -I../common LDFLAGS = $(ADD_LDFLAGS) -logg -lFLAC OBJ = snapclient.o stream.o client_connection.o time_provider.o player/player.o decoder/pcm_decoder.o decoder/ogg_decoder.o decoder/flac_decoder.o controller.o ../common/sample_format.o diff --git a/client/controller.cpp b/client/controller.cpp index 943bc1b0..5d58b15e 100644 --- a/client/controller.cpp +++ b/client/controller.cpp @@ -43,14 +43,14 @@ Controller::Controller(const std::string& hostId, size_t instance, std::shared_p } -void Controller::onException(ClientConnection* connection, shared_exception_ptr exception) +void Controller::onException(ClientConnection* /*connection*/, shared_exception_ptr exception) { LOG(ERROR) << "Controller::onException: " << exception->what() << "\n"; async_exception_ = exception; } -void Controller::onMessageReceived(ClientConnection* connection, const msg::BaseMessage& baseMessage, char* buffer) +void Controller::onMessageReceived(ClientConnection* /*connection*/, const msg::BaseMessage& baseMessage, char* buffer) { std::lock_guard lock(receiveMutex_); if (baseMessage.type == message_type::kWireChunk) diff --git a/client/decoder/flac_decoder.cpp b/client/decoder/flac_decoder.cpp index f62a2f13..ff939686 100644 --- a/client/decoder/flac_decoder.cpp +++ b/client/decoder/flac_decoder.cpp @@ -119,7 +119,7 @@ SampleFormat FlacDecoder::setHeader(msg::CodecHeader* chunk) } -FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder* decoder, FLAC__byte buffer[], size_t* bytes, void* client_data) +FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder* /*decoder*/, FLAC__byte buffer[], size_t* bytes, void* client_data) { if (flacHeader != nullptr) { diff --git a/client/decoder/pcm_decoder.cpp b/client/decoder/pcm_decoder.cpp index 89aaa67a..3cc508bf 100644 --- a/client/decoder/pcm_decoder.cpp +++ b/client/decoder/pcm_decoder.cpp @@ -58,7 +58,7 @@ PcmDecoder::PcmDecoder() : Decoder() } -bool PcmDecoder::decode(msg::PcmChunk* chunk) +bool PcmDecoder::decode(msg::PcmChunk* /*chunk*/) { return true; } diff --git a/common/message/message.hpp b/common/message/message.hpp index dee11afc..9174ee6c 100644 --- a/common/message/message.hpp +++ b/common/message/message.hpp @@ -288,7 +288,7 @@ protected: } - virtual void doserialize(std::ostream& stream) const {}; + virtual void doserialize(std::ostream& /*stream*/) const {}; }; diff --git a/common/popl.hpp b/common/popl.hpp index a7bfe6f9..cc53c8f6 100644 --- a/common/popl.hpp +++ b/common/popl.hpp @@ -713,7 +713,7 @@ inline void Value::parse(OptionName what_name, const char* value) template <> -inline void Value::parse(OptionName what_name, const char* value) +inline void Value::parse(OptionName /*what_name*/, const char* value) { bool val = ((value != nullptr) && ((strcmp(value, "1") == 0) || (strcmp(value, "true") == 0) || (strcmp(value, "True") == 0) || (strcmp(value, "TRUE") == 0))); @@ -819,7 +819,7 @@ inline Switch::Switch(const std::string& short_name, const std::string& long_nam } -inline void Switch::parse(OptionName /*what_name*/, const char* value) +inline void Switch::parse(OptionName /*what_name*/, const char* /*value*/) { add_value(true); } diff --git a/server/Makefile b/server/Makefile index 57a6521c..eba95e90 100644 --- a/server/Makefile +++ b/server/Makefile @@ -35,7 +35,7 @@ DEBUG=-g SANITIZE= #-fsanitize=thread -CXXFLAGS += $(ADD_CFLAGS) $(SANITIZE) -std=c++14 -Wall -Wpedantic -Wno-unused-function $(DEBUG) -DHAS_FLAC -DHAS_OGG -DHAS_VORBIS -DHAS_VORBIS_ENC -DVERSION=\"$(VERSION)\" -I. -I.. -I../common +CXXFLAGS += $(ADD_CFLAGS) $(SANITIZE) -std=c++14 -Wall -Wextra -Wpedantic -Wno-unused-function $(DEBUG) -DHAS_FLAC -DHAS_OGG -DHAS_VORBIS -DHAS_VORBIS_ENC -DVERSION=\"$(VERSION)\" -I. -I.. -I../common LDFLAGS = $(ADD_LDFLAGS) $(SANITIZE) -lvorbis -lvorbisenc -logg -lFLAC OBJ = snapserver.o config.o control_server.o control_session_tcp.o control_session_http.o stream_server.o stream_session.o streamreader/stream_uri.o streamreader/base64.o streamreader/stream_manager.o streamreader/pcm_stream.o streamreader/pipe_stream.o streamreader/file_stream.o streamreader/process_stream.o streamreader/airplay_stream.o streamreader/librespot_stream.o streamreader/watchdog.o encoder/encoder_factory.o encoder/flac_encoder.o encoder/pcm_encoder.o encoder/ogg_encoder.o ../common/sample_format.o diff --git a/server/control_session_http.cpp b/server/control_session_http.cpp index 3d7b250c..774bfbd4 100644 --- a/server/control_session_http.cpp +++ b/server/control_session_http.cpp @@ -245,8 +245,8 @@ void ControlSessionHttp::on_read(beast::error_code ec, std::size_t bytes_transfe return; } - LOG(DEBUG) << "method: " << req_.method_string() << ", content type: " << req_[beast::http::field::content_type] << ", target: " << req_.target() - << ", body: " << req_.body() << "\n"; + LOG(DEBUG) << "read: " << bytes_transferred << ", method: " << req_.method_string() << ", content type: " << req_[beast::http::field::content_type] + << ", target: " << req_.target() << ", body: " << req_.body() << "\n"; // See if it is a WebSocket Upgrade if (websocket::is_upgrade(req_) && (req_.target() == "/jsonrpc")) @@ -297,7 +297,7 @@ void ControlSessionHttp::on_write(beast::error_code ec, std::size_t, bool close) req_ = {}; // Read another request - http::async_read(socket_, buffer_, req_, [ this, self = shared_from_this() ](beast::error_code ec, std::size_t bytes) { on_read(ec, bytes); }); + http::async_read(socket_, buffer_, req_, [this, self = shared_from_this()](beast::error_code ec, std::size_t bytes) { on_read(ec, bytes); }); } diff --git a/server/encoder/flac_encoder.cpp b/server/encoder/flac_encoder.cpp index e0f16dc6..ff6e30de 100644 --- a/server/encoder/flac_encoder.cpp +++ b/server/encoder/flac_encoder.cpp @@ -113,7 +113,7 @@ void FlacEncoder::encode(const msg::PcmChunk* chunk) } -FLAC__StreamEncoderWriteStatus FlacEncoder::write_callback(const FLAC__StreamEncoder* encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, +FLAC__StreamEncoderWriteStatus FlacEncoder::write_callback(const FLAC__StreamEncoder* /*encoder*/, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame) { // LOG(INFO) << "write_callback: " << bytes << ", " << samples << ", " << current_frame << "\n"; diff --git a/server/stream_server.cpp b/server/stream_server.cpp index 15787081..5a52f6e7 100644 --- a/server/stream_server.cpp +++ b/server/stream_server.cpp @@ -71,7 +71,7 @@ void StreamServer::onStateChanged(const PcmStream* pcmStream, const ReaderState& } -void StreamServer::onChunkRead(const PcmStream* pcmStream, msg::PcmChunk* chunk, double duration) +void StreamServer::onChunkRead(const PcmStream* pcmStream, msg::PcmChunk* chunk, double /*duration*/) { // LOG(INFO) << "onChunkRead (" << pcmStream->getName() << "): " << duration << "ms\n"; bool isDefaultStream(pcmStream == streamManager_->getDefaultStream().get()); diff --git a/server/streamreader/librespot_stream.cpp b/server/streamreader/librespot_stream.cpp index 241f8ba7..32570e50 100644 --- a/server/streamreader/librespot_stream.cpp +++ b/server/streamreader/librespot_stream.cpp @@ -162,7 +162,7 @@ void SpotifyStream::stderrReader() } -void SpotifyStream::onTimeout(const Watchdog* watchdog, size_t ms) +void SpotifyStream::onTimeout(const Watchdog* /*watchdog*/, size_t ms) { LOG(ERROR) << "Spotify timeout: " << ms / 1000 << "\n"; if (process_) diff --git a/server/streamreader/pcm_stream.cpp b/server/streamreader/pcm_stream.cpp index 8d104f26..1e38a92d 100644 --- a/server/streamreader/pcm_stream.cpp +++ b/server/streamreader/pcm_stream.cpp @@ -144,7 +144,7 @@ void PcmStream::setState(const ReaderState& newState) } -void PcmStream::onChunkEncoded(const Encoder* encoder, msg::PcmChunk* chunk, double duration) +void PcmStream::onChunkEncoded(const Encoder* /*encoder*/, msg::PcmChunk* chunk, double duration) { // LOG(INFO) << "onChunkEncoded: " << duration << " us\n"; if (duration <= 0)