Eric Wong
2006-Jul-23 19:42 UTC
[Flac-dev] [PATCH] Fix a compile bug with gcc 2.95 in src/plugin_common/replaygain.c
Declaring variables in the middle of a block isn't supported by older (pre-C99?) compilers, and gcc 2.95 is one of them. --- a/src/plugin_common/replaygain.c +++ b/src/plugin_common/replaygain.c @@ -28,10 +28,11 @@ void FLAC_plugin__replaygain_get_from_fi double *track_peak, FLAC__bool *track_peak_set, double *album_peak, FLAC__bool *album_peak_set) { - *track_gain_set = *album_gain_set = *track_peak_set = *album_peak_set = false; - /* Largely stolen from vorbiscomment.c and the other replaygain.c */ FLAC__Metadata_SimpleIterator *iterator = FLAC__metadata_simple_iterator_new(); + + *track_gain_set = *album_gain_set = *track_peak_set = *album_peak_set = false; + if(0 != iterator) { if(FLAC__metadata_simple_iterator_init(iterator, filename, /*read_only=*/true, /*preserve_file_stats=*/true)) { FLAC__bool got_vorbis_comments = false; -- Eric Wong
Josh Coalson
2006-Nov-16 16:11 UTC
[Flac-dev] [PATCH] Fix a compile bug with gcc 2.95 in src/plugin_common/replaygain.c
fixed in CVS, thanks. Josh --- Eric Wong <normalperson@yhbt.net> wrote:> Declaring variables in the middle of a block isn't supported by > older (pre-C99?) compilers, and gcc 2.95 is one of them. > > --- a/src/plugin_common/replaygain.c > +++ b/src/plugin_common/replaygain.c > @@ -28,10 +28,11 @@ void FLAC_plugin__replaygain_get_from_fi > double *track_peak, > FLAC__bool *track_peak_set, > double *album_peak, > FLAC__bool *album_peak_set) > { > - *track_gain_set = *album_gain_set = *track_peak_set > *album_peak_set = false; > - > /* Largely stolen from vorbiscomment.c and the other replaygain.c > */ > FLAC__Metadata_SimpleIterator *iterator > FLAC__metadata_simple_iterator_new(); > + > + *track_gain_set = *album_gain_set = *track_peak_set > *album_peak_set = false; > + > if(0 != iterator) { > if(FLAC__metadata_simple_iterator_init(iterator, filename, > /*read_only=*/true, /*preserve_file_stats=*/true)) { > FLAC__bool got_vorbis_comments = false; > > -- > Eric Wong____________________________________________________________________________________ Sponsored Link Compare mortgage rates for today. Get up to 5 free quotes. Www2.nextag.com