sp->data = new_data;
sp->sample_rate = new_rate;
- sp->data_length = new_data_length << FRACTION_BITS;
+ sp->data_length = (splen_t)new_data_length << FRACTION_BITS;
sp->loop_start = loop_start * (1 << FRACTION_BITS);
sp->loop_end = loop_end * (1 << FRACTION_BITS);
}
if(!special_patch[j]){
vp->reserve_offset = 0;
}else{
- vp->reserve_offset = special_patch[j]->sample_offset << FRACTION_BITS;
+ vp->reserve_offset = (splen_t)special_patch[j]->sample_offset << FRACTION_BITS;
if(vp->sample->modes & MODES_LOOPING) {
if(vp->reserve_offset > vp->sample->loop_end)
vp->reserve_offset = vp->sample->loop_start;
/* Let the caller know how much data we had left */
count2 = (int32)((vp->sample->data_length >> FRACTION_BITS) - ofs);
}else
- vp->resrc.offset += (count2 << FRACTION_BITS);
+ vp->resrc.offset += ((splen_t)count2 << FRACTION_BITS);
switch(vp->sample->data_type){
case SAMPLE_TYPE_INT16:
{
uint8 modes;
int32 sample_rate, root_freq;
- uint32 loopStart = 0, loopEnd = 0;
+ splen_t loopStart = 0, loopEnd = 0;
sample_rate = samplerc.dwSamplePeriod == 0 ? 0 : 1000000000L / samplerc.dwSamplePeriod;
root_freq = freq_table[samplerc.dwMIDIUnityNote];
const uint8 loopModes[] = { MODES_LOOPING, MODES_LOOPING | MODES_PINGPONG, MODES_LOOPING | MODES_REVERSE };
modes = loopModes[samplerc.loopType];
- loopStart = samplerc.loop_dwStart << FRACTION_BITS;
- loopEnd = samplerc.loop_dwEnd << FRACTION_BITS;
+ loopStart = (splen_t)samplerc.loop_dwStart << FRACTION_BITS;
+ loopEnd = (splen_t)samplerc.loop_dwEnd << FRACTION_BITS;
}
else
modes = 0;
sample = &inst->sample[i];
sample->data_alloced = 0;
sample->loop_start = 0;
- sample->loop_end = sample->data_length = frames << FRACTION_BITS;
+ sample->loop_end = sample->data_length = (splen_t)frames << FRACTION_BITS;
sample->sample_rate = sample_rate;
sample->low_key = 0;
sample->high_key = 127;