diff options
author | Max Kellermann <max@duempel.org> | 2008-03-26 10:37:17 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-03-26 10:37:17 +0000 |
commit | 66fe58064295f838f894758d92b087100ce022aa (patch) | |
tree | b0f967f7e55bccb9d1390c23c0333d047384eaf3 /src/inputPlugins/_flac_common.c | |
parent | 13c17c3d942f1074d76caeaf39ebe0d5017593e9 (diff) | |
download | mpd-66fe58064295f838f894758d92b087100ce022aa.tar.gz mpd-66fe58064295f838f894758d92b087100ce022aa.tar.xz mpd-66fe58064295f838f894758d92b087100ce022aa.zip |
explicitly downcast
Tools like "sparse" check for missing downcasts, since implicit cast
may be dangerous. Although that does not change the compiler result,
it may make the code more readable (IMHO), because you always see when
there may be data cut off.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7196 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins/_flac_common.c')
-rw-r--r-- | src/inputPlugins/_flac_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c index 0a2adf6b7..3b351d3a7 100644 --- a/src/inputPlugins/_flac_common.c +++ b/src/inputPlugins/_flac_common.c @@ -66,7 +66,7 @@ static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block, comments[offset].entry[pos]); tmp = p[len]; p[len] = '\0'; - *fl = atof((char *)p); + *fl = (float)atof((char *)p); p[len] = tmp; return 1; @@ -170,9 +170,9 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block, switch (block->type) { case FLAC__METADATA_TYPE_STREAMINFO: - dc->audioFormat.bits = si->bits_per_sample; + dc->audioFormat.bits = (mpd_sint8)si->bits_per_sample; dc->audioFormat.sampleRate = si->sample_rate; - dc->audioFormat.channels = si->channels; + dc->audioFormat.channels = (mpd_sint8)si->channels; dc->totalTime = ((float)si->total_samples) / (si->sample_rate); getOutputAudioFormat(&(dc->audioFormat), &(data->cb->audioFormat)); |