Update for Visual C++ 6.0

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401432
This commit is contained in:
Sam Lantinga 2006-02-24 18:24:57 +00:00
parent 90e0097344
commit bb11c757f7
12 changed files with 91 additions and 98 deletions

View file

@ -47,7 +47,7 @@ void SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format)
if ( sample > 255 ) {
*dst = 255;
} else {
*dst = sample;
*dst = (Uint8)sample;
}
src += 2;
dst += 1;
@ -68,7 +68,7 @@ void SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format)
if ( sample < -128 ) {
*dst = -128;
} else {
*dst = sample;
*dst = (Sint8)sample;
}
src += 2;
dst += 1;
@ -185,10 +185,8 @@ void SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format)
src = cvt->buf;
dst = cvt->buf;
for ( i=cvt->len_cvt/6; i; --i ) {
lsample = src[0];
rsample = src[1];
dst[0] = lsample;
dst[1] = rsample;
dst[0] = src[0];
dst[1] = src[1];
src += 6;
dst += 2;
}
@ -201,10 +199,8 @@ void SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format)
src = (Sint8 *)cvt->buf;
dst = (Sint8 *)cvt->buf;
for ( i=cvt->len_cvt/6; i; --i ) {
lsample = src[0];
rsample = src[1];
dst[0] = lsample;
dst[1] = rsample;
dst[0] = src[0];
dst[1] = src[1];
src += 6;
dst += 2;
}
@ -305,10 +301,8 @@ void SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format)
src = cvt->buf;
dst = cvt->buf;
for ( i=cvt->len_cvt/4; i; --i ) {
lsample = src[0];
rsample = src[1];
dst[0] = lsample;
dst[1] = rsample;
dst[0] = src[0];
dst[1] = src[1];
src += 4;
dst += 2;
}
@ -321,10 +315,8 @@ void SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format)
src = (Sint8 *)cvt->buf;
dst = (Sint8 *)cvt->buf;
for ( i=cvt->len_cvt/4; i; --i ) {
lsample = src[0];
rsample = src[1];
dst[0] = lsample;
dst[1] = rsample;
dst[0] = src[0];
dst[1] = src[1];
src += 4;
dst += 2;
}

View file

@ -108,9 +108,9 @@ static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state,
if ( delta < 16 ) {
delta = 16;
}
state->iDelta = delta;
state->iDelta = (Uint16)delta;
state->iSamp2 = state->iSamp1;
state->iSamp1 = new_sample;
state->iSamp1 = (Sint16)new_sample;
return(new_sample);
}
@ -371,8 +371,8 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
}
/* Store the initial sample we start with */
decoded[0] = state[c].sample&0xFF;
decoded[1] = state[c].sample>>8;
decoded[0] = (Uint8)(state[c].sample&0xFF);
decoded[1] = (Uint8)(state[c].sample>>8);
decoded += 2;
}