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

fix MSVC warning with explicit casts

parent 80be2823
......@@ -1144,7 +1144,7 @@ FLAC__bool read_metadata_cuesheet_(FLAC__StreamDecoder *decoder, FLAC__StreamMet
if(!FLAC__bitbuffer_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
track->number = x;
track->number = (FLAC__byte)x;
FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN % 8 == 0);
if(!FLAC__bitbuffer_read_byte_block_aligned_no_crc(decoder->private_->input, track->isrc, FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN/8, read_callback_, decoder))
......@@ -1163,7 +1163,7 @@ FLAC__bool read_metadata_cuesheet_(FLAC__StreamDecoder *decoder, FLAC__StreamMet
if(!FLAC__bitbuffer_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
track->num_indices = x;
track->num_indices = (FLAC__byte)x;
if(track->num_indices > 0) {
if(0 == (track->indices = (FLAC__StreamMetadata_CueSheet_Index*)calloc(track->num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index)))) {
......@@ -1177,7 +1177,7 @@ FLAC__bool read_metadata_cuesheet_(FLAC__StreamDecoder *decoder, FLAC__StreamMet
if(!FLAC__bitbuffer_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
index->number = x;
index->number = (FLAC__byte)x;
if(!FLAC__bitbuffer_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN, read_callback_, decoder))
return false; /* the read_callback_ sets the state for us */
......
......@@ -356,7 +356,7 @@ PLUGIN_COMMON_API int FLAC__plugin_common__apply_gain(FLAC__byte *data_out, FLAC
-268435456, /* 29 bits-per-sample */
-536870912, /* 30 bits-per-sample */
-1073741824, /* 31 bits-per-sample */
-2147483648ll /* 32 bits-per-sample */
(FLAC__int64)(-1073741824) * 2 /* 32 bits-per-sample */
};
const FLAC__int32 conv_factor = conv_factors_[source_bps];
const FLAC__int64 hard_clip_factor = hard_clip_factors_[source_bps];
......
......@@ -60,7 +60,12 @@ GRABBAG_API FLAC__bool grabbag__seektable_convert_specification_to_template(cons
if(!only_explicit_placeholders) {
double sec = atof(pt);
if(sec > 0.0) {
#if defined _MSC_VER || defined __MINGW32__
/* with VC++ you have to spoon feed it the casting */
unsigned n = (unsigned)((double)(FLAC__int64)total_samples_to_encode / (sec * (double)sample_rate));
#else
unsigned n = (unsigned)((double)total_samples_to_encode / (sec * (double)sample_rate));
#endif
if(!FLAC__metadata_object_seektable_template_append_spaced_points(seektable_template, n, total_samples_to_encode))
return false;
}
......
Supports Markdown
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