diff options
author | Max Kellermann <max@duempel.org> | 2009-01-15 19:57:57 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-15 19:57:57 +0100 |
commit | 15435b09affcd362cc047c54f6a3b052aa965889 (patch) | |
tree | bd38be4a2311c4f75ba2067abf677bb82db7d9c5 /src/decoder/_flac_common.c | |
parent | 8307dd3e873e7ed7c72ae26ee7d2a8ea505c3336 (diff) | |
download | mpd-15435b09affcd362cc047c54f6a3b052aa965889.tar.gz mpd-15435b09affcd362cc047c54f6a3b052aa965889.tar.xz mpd-15435b09affcd362cc047c54f6a3b052aa965889.zip |
flac: use bool instead of int
Diffstat (limited to 'src/decoder/_flac_common.c')
-rw-r--r-- | src/decoder/_flac_common.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/decoder/_flac_common.c b/src/decoder/_flac_common.c index 459c4606d..ddce994de 100644 --- a/src/decoder/_flac_common.c +++ b/src/decoder/_flac_common.c @@ -39,7 +39,7 @@ flac_data_init(struct flac_data *data, struct decoder * decoder, data->tag = NULL; } -static int +static bool flac_find_float_comment(const FLAC__StreamMetadata *block, const char *cmnt, float *fl) { @@ -59,11 +59,11 @@ flac_find_float_comment(const FLAC__StreamMetadata *block, *fl = (float)atof((char *)p); p[len] = tmp; - return 1; + return true; } } - return 0; + return false; } /* replaygain stuff by AliasMrJones */ @@ -71,21 +71,21 @@ static void flac_parse_replay_gain(const FLAC__StreamMetadata *block, struct flac_data *data) { - int found = 0; + bool found; if (data->replay_gain_info) replay_gain_info_free(data->replay_gain_info); data->replay_gain_info = replay_gain_info_new(); - found |= flac_find_float_comment(block, "replaygain_album_gain", - &data->replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain); - found |= flac_find_float_comment(block, "replaygain_album_peak", - &data->replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak); - found |= flac_find_float_comment(block, "replaygain_track_gain", - &data->replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain); - found |= flac_find_float_comment(block, "replaygain_track_peak", - &data->replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak); + found = flac_find_float_comment(block, "replaygain_album_gain", + &data->replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain) || + flac_find_float_comment(block, "replaygain_album_peak", + &data->replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak) || + flac_find_float_comment(block, "replaygain_track_gain", + &data->replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain) || + flac_find_float_comment(block, "replaygain_track_peak", + &data->replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak); if (!found) { replay_gain_info_free(data->replay_gain_info); @@ -98,7 +98,7 @@ flac_parse_replay_gain(const FLAC__StreamMetadata *block, static const char *VORBIS_COMMENT_TRACK_KEY = "tracknumber"; static const char *VORBIS_COMMENT_DISC_KEY = "discnumber"; -static unsigned int +static bool flac_copy_vorbis_comment(const FLAC__StreamMetadata_VorbisComment_Entry * entry, enum tag_type type, @@ -129,10 +129,10 @@ flac_copy_vorbis_comment(const tag_add_item_n(*tag, type, (char *)(entry->entry + slen + 1), vlen); - return 1; + return true; } - return 0; + return false; } struct tag * |