enable extra warnings

This commit is contained in:
badaix 2019-10-13 19:01:56 +02:00
parent 0b21a5daee
commit 7fda592d13
12 changed files with 16 additions and 16 deletions

View file

@ -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

View file

@ -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<std::mutex> lock(receiveMutex_);
if (baseMessage.type == message_type::kWireChunk)

View file

@ -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)
{

View file

@ -58,7 +58,7 @@ PcmDecoder::PcmDecoder() : Decoder()
}
bool PcmDecoder::decode(msg::PcmChunk* chunk)
bool PcmDecoder::decode(msg::PcmChunk* /*chunk*/)
{
return true;
}

View file

@ -288,7 +288,7 @@ protected:
}
virtual void doserialize(std::ostream& stream) const {};
virtual void doserialize(std::ostream& /*stream*/) const {};
};

View file

@ -713,7 +713,7 @@ inline void Value<std::string>::parse(OptionName what_name, const char* value)
template <>
inline void Value<bool>::parse(OptionName what_name, const char* value)
inline void Value<bool>::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);
}

View file

@ -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

View file

@ -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); });
}

View file

@ -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";

View file

@ -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());

View file

@ -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_)

View file

@ -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)