Silenced some warnings

This commit is contained in:
Marco Antognini 2014-10-28 18:48:10 +01:00 committed by Mario Liebisch
parent e22bb627c7
commit 1d24b52220
3 changed files with 12 additions and 12 deletions

View File

@ -77,7 +77,7 @@ public :
/// \brief Write audio samples to the file /// \brief Write audio samples to the file
/// ///
/// \param samples Pointer to the sample array to write /// \param samples Pointer to the sample array to write
/// \param sampleCount Number of samples to write /// \param count Number of samples to write
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void write(const Int16* samples, Uint64 count); void write(const Int16* samples, Uint64 count);

View File

@ -33,7 +33,7 @@
namespace namespace
{ {
FLAC__StreamDecoderReadStatus read(const FLAC__StreamDecoder*, FLAC__byte buffer[], std::size_t* bytes, void* clientData) FLAC__StreamDecoderReadStatus streamRead(const FLAC__StreamDecoder*, FLAC__byte buffer[], std::size_t* bytes, void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
@ -53,7 +53,7 @@ namespace
} }
} }
FLAC__StreamDecoderSeekStatus seek(const FLAC__StreamDecoder*, FLAC__uint64 absoluteByteOffset, void* clientData) FLAC__StreamDecoderSeekStatus streamSeek(const FLAC__StreamDecoder*, FLAC__uint64 absoluteByteOffset, void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
@ -64,7 +64,7 @@ namespace
return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
} }
FLAC__StreamDecoderTellStatus tell(const FLAC__StreamDecoder*, FLAC__uint64* absoluteByteOffset, void* clientData) FLAC__StreamDecoderTellStatus streamTell(const FLAC__StreamDecoder*, FLAC__uint64* absoluteByteOffset, void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
@ -80,7 +80,7 @@ namespace
} }
} }
FLAC__StreamDecoderLengthStatus length(const FLAC__StreamDecoder*, FLAC__uint64* streamLength, void* clientData) FLAC__StreamDecoderLengthStatus streamLength(const FLAC__StreamDecoder*, FLAC__uint64* streamLength, void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
@ -96,14 +96,14 @@ namespace
} }
} }
FLAC__bool eof(const FLAC__StreamDecoder*, void* clientData) FLAC__bool streamEof(const FLAC__StreamDecoder*, void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
return data->stream->tell() == data->stream->getSize(); return data->stream->tell() == data->stream->getSize();
} }
FLAC__StreamDecoderWriteStatus write(const FLAC__StreamDecoder*, const FLAC__Frame* frame, const FLAC__int32* const buffer[], void* clientData) FLAC__StreamDecoderWriteStatus streamWrite(const FLAC__StreamDecoder*, const FLAC__Frame* frame, const FLAC__int32* const buffer[], void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
@ -159,7 +159,7 @@ namespace
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
} }
void metadata(const FLAC__StreamDecoder*, const FLAC__StreamMetadata* meta, void* clientData) void streamMetadata(const FLAC__StreamDecoder*, const FLAC__StreamMetadata* meta, void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
@ -171,7 +171,7 @@ namespace
} }
} }
void error(const FLAC__StreamDecoder*, FLAC__StreamDecoderErrorStatus status, void* clientData) void streamError(const FLAC__StreamDecoder*, FLAC__StreamDecoderErrorStatus, void* clientData)
{ {
sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData); sf::priv::SoundFileReaderFlac::ClientData* data = static_cast<sf::priv::SoundFileReaderFlac::ClientData*>(clientData);
data->error = true; data->error = true;
@ -194,7 +194,7 @@ bool SoundFileReaderFlac::check(InputStream& stream)
ClientData data; ClientData data;
data.stream = &stream; data.stream = &stream;
data.error = false; data.error = false;
FLAC__stream_decoder_init_stream(decoder, &::read, &::seek, &::tell, &::length, &::eof, &::write, NULL, &::error, &data); FLAC__stream_decoder_init_stream(decoder, &streamRead, &streamSeek, &streamTell, &streamLength, &streamEof, &streamWrite, NULL, &streamError, &data);
// Read the header // Read the header
bool valid = FLAC__stream_decoder_process_until_end_of_metadata(decoder) != 0; bool valid = FLAC__stream_decoder_process_until_end_of_metadata(decoder) != 0;
@ -234,7 +234,7 @@ bool SoundFileReaderFlac::open(InputStream& stream, Info& info)
// Initialize the decoder with our callbacks // Initialize the decoder with our callbacks
m_clientData.stream = &stream; m_clientData.stream = &stream;
FLAC__stream_decoder_init_stream(m_decoder, &::read, &::seek, &::tell, &::length, &::eof, &::write, &::metadata, &::error, &m_clientData); FLAC__stream_decoder_init_stream(m_decoder, &streamRead, &streamSeek, &streamTell, &streamLength, &streamEof, &streamWrite, &streamMetadata, &streamError, &m_clientData);
// Read the header // Read the header
if (!FLAC__stream_decoder_process_until_end_of_metadata(m_decoder)) if (!FLAC__stream_decoder_process_until_end_of_metadata(m_decoder))

View File

@ -87,7 +87,7 @@ namespace priv
bool SoundFileReaderWav::check(InputStream& stream) bool SoundFileReaderWav::check(InputStream& stream)
{ {
char header[mainChunkSize]; char header[mainChunkSize];
if (stream.read(header, sizeof(header)) < sizeof(header)) if (stream.read(header, sizeof(header)) < static_cast<Int64>(sizeof(header)))
return false; return false;
return (header[0] == 'R') && (header[1] == 'I') && (header[2] == 'F') && (header[3] == 'F') return (header[0] == 'R') && (header[1] == 'I') && (header[2] == 'F') && (header[3] == 'F')