document GCC compiler bug that produces false warning
This commit is contained in:
parent
5c3d00c456
commit
eae4dde233
@ -287,6 +287,8 @@ int encode_wav(const char *infile, const char *outfile, bool verbose, uint64 ski
|
|||||||
else {
|
else {
|
||||||
unsigned wide_samples = bytes_read / bytes_per_wide_sample;
|
unsigned wide_samples = bytes_read / bytes_per_wide_sample;
|
||||||
format_input(wide_samples, false, is_unsigned_samples, channels, bps, &encoder_wrapper);
|
format_input(wide_samples, false, is_unsigned_samples, channels, bps, &encoder_wrapper);
|
||||||
|
|
||||||
|
/* NOTE: some versions of GCC can't figure out const-ness right and will give you an 'incompatible pointer type' warning on arg 2 here: */
|
||||||
if(!FLAC__encoder_process(encoder_wrapper.encoder, input, wide_samples)) {
|
if(!FLAC__encoder_process(encoder_wrapper.encoder, input, wide_samples)) {
|
||||||
fprintf(stderr, "ERROR during encoding, state = %d:%s\n", encoder_wrapper.encoder->state, FLAC__EncoderStateString[encoder_wrapper.encoder->state]);
|
fprintf(stderr, "ERROR during encoding, state = %d:%s\n", encoder_wrapper.encoder->state, FLAC__EncoderStateString[encoder_wrapper.encoder->state]);
|
||||||
goto wav_abort_;
|
goto wav_abort_;
|
||||||
@ -441,6 +443,8 @@ int encode_raw(const char *infile, const char *outfile, bool verbose, uint64 ski
|
|||||||
else {
|
else {
|
||||||
unsigned wide_samples = bytes_read / bytes_per_wide_sample;
|
unsigned wide_samples = bytes_read / bytes_per_wide_sample;
|
||||||
format_input(wide_samples, is_big_endian, is_unsigned_samples, channels, bps, &encoder_wrapper);
|
format_input(wide_samples, is_big_endian, is_unsigned_samples, channels, bps, &encoder_wrapper);
|
||||||
|
|
||||||
|
/* NOTE: some versions of GCC can't figure out const-ness right and will give you an 'incompatible pointer type' warning on arg 2 here: */
|
||||||
if(!FLAC__encoder_process(encoder_wrapper.encoder, input, wide_samples)) {
|
if(!FLAC__encoder_process(encoder_wrapper.encoder, input, wide_samples)) {
|
||||||
fprintf(stderr, "ERROR during encoding, state = %d:%s\n", encoder_wrapper.encoder->state, FLAC__EncoderStateString[encoder_wrapper.encoder->state]);
|
fprintf(stderr, "ERROR during encoding, state = %d:%s\n", encoder_wrapper.encoder->state, FLAC__EncoderStateString[encoder_wrapper.encoder->state]);
|
||||||
goto raw_abort_;
|
goto raw_abort_;
|
||||||
|
@ -614,6 +614,7 @@ bool encoder_process_frame_(FLAC__Encoder *encoder, bool is_last_frame)
|
|||||||
/*
|
/*
|
||||||
* Accumulate raw signal to the MD5 signature
|
* Accumulate raw signal to the MD5 signature
|
||||||
*/
|
*/
|
||||||
|
/* NOTE: some versions of GCC can't figure out const-ness right and will give you an 'incompatible pointer type' warning on arg 2 here: */
|
||||||
if(!FLAC__MD5Accumulate(&encoder->guts->md5context, encoder->guts->integer_signal, encoder->channels, encoder->blocksize, (encoder->bits_per_sample+7) / 8)) {
|
if(!FLAC__MD5Accumulate(&encoder->guts->md5context, encoder->guts->integer_signal, encoder->channels, encoder->blocksize, (encoder->bits_per_sample+7) / 8)) {
|
||||||
encoder->state = FLAC__ENCODER_MEMORY_ALLOCATION_ERROR;
|
encoder->state = FLAC__ENCODER_MEMORY_ALLOCATION_ERROR;
|
||||||
return false;
|
return false;
|
||||||
|
@ -782,6 +782,7 @@ bool stream_decoder_read_frame_(FLAC__StreamDecoder *decoder, bool *got_a_frame)
|
|||||||
decoder->guts->samples_decoded += decoder->guts->frame.header.blocksize;
|
decoder->guts->samples_decoded += decoder->guts->frame.header.blocksize;
|
||||||
|
|
||||||
/* write it */
|
/* write it */
|
||||||
|
/* NOTE: some versions of GCC can't figure out const-ness right and will give you an 'incompatible pointer type' warning on arg 3 here: */
|
||||||
if(decoder->guts->write_callback(decoder, &decoder->guts->frame, decoder->guts->output, decoder->guts->client_data) != FLAC__STREAM_DECODER_WRITE_CONTINUE)
|
if(decoder->guts->write_callback(decoder, &decoder->guts->frame, decoder->guts->output, decoder->guts->client_data) != FLAC__STREAM_DECODER_WRITE_CONTINUE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user