Commit fb84f25b authored by Josh Coalson's avatar Josh Coalson
Browse files

minor syntax

parent 85aaed8f
......@@ -473,7 +473,7 @@ int DecoderSession_finish_ok(DecoderSession *d)
int DecoderSession_finish_error(DecoderSession *d)
{
if(d->decoder) {
FLAC__stream_decoder_finish(d->decoder);
(void)FLAC__stream_decoder_finish(d->decoder);
FLAC__stream_decoder_delete(d->decoder);
}
if(d->analysis_mode)
......
......@@ -54,7 +54,7 @@ namespace FLAC {
Stream::~Stream()
{
if(0 != encoder_) {
::FLAC__stream_encoder_finish(encoder_);
(void)::FLAC__stream_encoder_finish(encoder_);
::FLAC__stream_encoder_delete(encoder_);
}
}
......@@ -347,10 +347,10 @@ namespace FLAC {
return ::FLAC__stream_encoder_init_ogg_stream(encoder_, read_callback_, write_callback_, seek_callback_, tell_callback_, metadata_callback_, /*client_data=*/(void*)this);
}
void Stream::finish()
bool Stream::finish()
{
FLAC__ASSERT(is_valid());
::FLAC__stream_encoder_finish(encoder_);
return (bool)::FLAC__stream_encoder_finish(encoder_);
}
bool Stream::process(const FLAC__int32 * const buffer[], unsigned samples)
......
......@@ -187,20 +187,20 @@ static FLAC__StreamMetadata *get_one_metadata_block_(const char *filename, FLAC_
FLAC__stream_decoder_set_metadata_respond(decoder, type);
if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, &cd) != FLAC__STREAM_DECODER_INIT_STATUS_OK || cd.got_error) {
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
FLAC__stream_decoder_delete(decoder);
return 0;
}
if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder) || cd.got_error) {
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
FLAC__stream_decoder_delete(decoder);
if(0 != cd.object)
FLAC__metadata_object_delete(cd.object);
return 0;
}
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
FLAC__stream_decoder_delete(decoder);
return cd.object;
......
......@@ -345,7 +345,7 @@ FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder)
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->private_->input);
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
if(0 != decoder->private_->metadata_filter_ids)
free(decoder->private_->metadata_filter_ids);
......@@ -1013,7 +1013,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder)
/* We initialize the FLAC__MD5Context even though we may never use it. This
* is because md5 checking may be turned on to start and then turned off if
* a seek occurs. So we init the context here and finalize it in
* FLAC__seekable_stream_decoder_finish() to make sure things are always
* FLAC__stream_decoder_finish() to make sure things are always
* cleaned up properly.
*/
FLAC__MD5Init(&decoder->private_->md5context);
......
......@@ -165,7 +165,7 @@ FLAC__bool FLAC_plugin__decoder_init(FLAC__StreamDecoder *decoder, const char *f
void FLAC_plugin__decoder_finish(FLAC__StreamDecoder *decoder)
{
if (decoder && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED)
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
}
void FLAC_plugin__decoder_delete(FLAC__StreamDecoder *decoder)
......
......@@ -564,7 +564,7 @@ FLAC__bool safe_decoder_init_(const char *filename, FLAC__StreamDecoder *decoder
void safe_decoder_finish_(FLAC__StreamDecoder *decoder)
{
if(decoder && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED)
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
if(stream_data_.is_http_source)
flac_http_close();
}
......
......@@ -619,15 +619,15 @@ static bool test_file_(const char *filename, bool ignore_metadata)
decoder.set_md5_checking(true);
decoder.set_metadata_respond_all();
if(decoder.init(filename) != ::FLAC__STREAM_DECODER_INIT_STATUS_OK) {
decoder.finish();
(void)decoder.finish();
return die_("initializing decoder\n");
}
if(!decoder.process_until_end_of_stream()) {
decoder.finish();
(void)decoder.finish();
return die_("decoding file\n");
}
decoder.finish();
(void)decoder.finish();
if(decoder.error_occurred_)
return false;
......
......@@ -623,17 +623,17 @@ static FLAC__bool test_file_(const char *filename, FLAC__StreamDecoderMetadataCa
FLAC__stream_decoder_set_md5_checking(decoder, true);
FLAC__stream_decoder_set_metadata_respond_all(decoder);
if(FLAC__stream_decoder_init_file(decoder, filename, decoder_write_callback_, metadata_callback, decoder_error_callback_, &decoder_client_data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
FLAC__stream_decoder_delete(decoder);
return die_("initializing decoder\n");
}
if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) {
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
FLAC__stream_decoder_delete(decoder);
return die_("decoding file\n");
}
FLAC__stream_decoder_finish(decoder);
(void)FLAC__stream_decoder_finish(decoder);
FLAC__stream_decoder_delete(decoder);
if(decoder_client_data.error_occurred)
......
......@@ -134,7 +134,7 @@ FLAC__bool file_utils__generate_flacfile(FLAC__bool is_ogg, const char *output_f
length -= n;
}
FLAC__stream_encoder_finish(encoder);
(void)FLAC__stream_encoder_finish(encoder);
fclose(encoder_client_data.file);
......
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