X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fmiscplay.c;h=22576342d4053e9f2b7951c1db7dac872a76c6a3;hp=723981da8ed15dc421a9fa8d338d5c635d43fb67;hb=414b512c0774e67ba8e160b605447d862d3be166;hpb=2fd9701a4f902054649dde9143a3f77809afee8f diff --git a/src/miscplay.c b/src/miscplay.c index 723981d..2257634 100644 --- a/src/miscplay.c +++ b/src/miscplay.c @@ -360,8 +360,11 @@ size_t sndcnv8U_2mono(void **data,size_t *sz,void **outbuf) *outbuf = dest = miscplay_sndbuf; while (count--) - *dest++ = (unsigned char)(((int)*(src)++ + - (int)*(src)++) / 2); + { + *dest++ = (unsigned char)(((int)*(src) + + (int)*(src+1)) / 2); + src += 2; + } *data = src; return(rc); } @@ -381,8 +384,11 @@ size_t sndcnv8S_2mono(void **data,size_t *sz,void **outbuf) *outbuf = dest = miscplay_sndbuf; while (count--) - *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + - (int)*((signed char *)(src++))) / 2); + { + *dest++ = (unsigned char)(((int)*((signed char *)(src)) + + (int)*((signed char *)(src+1))) / 2); + src += 2; + } *data = src; return(rc); } @@ -402,8 +408,11 @@ size_t sndcnv2monounsigned(void **data,size_t *sz,void **outbuf) *outbuf = dest = miscplay_sndbuf; while (count--) - *dest++ = (unsigned char)(((int)*((signed char *)(src++)) + - (int)*((signed char *)(src++))) / 2) ^ 0x80; + { + *dest++ = (unsigned char)(((int)*((signed char *)(src)) + + (int)*((signed char *)(src+1))) / 2) ^ 0x80; + src += 2; + } *data = src; return(rc); } @@ -493,7 +502,10 @@ size_t sndcnvULaw_2linear(void **data,size_t *sz,void **outbuf) *outbuf = *data; while ((*sz)--) - *p++ = ulaw_dsp[*p]; + { + *p = ulaw_dsp[*p]; + p++; + } *sz = 0; *data = p; return p - (unsigned char *)*outbuf; @@ -550,11 +562,14 @@ size_t sndcnvULaw_2mono(void **data,size_t *sz,void **outbuf) *outbuf = dest = miscplay_sndbuf; while (count--) - /* it is not possible to directly interpolate between two ulaw encoded - data bytes, thus we need to convert to linear format first and later - we convert back to ulaw format */ - *dest++ = int2ulaw(ulaw2int[*(src)++] + - ulaw2int[*(src)++]); + { + /* it is not possible to directly interpolate between two ulaw encoded + data bytes, thus we need to convert to linear format first and later + we convert back to ulaw format */ + *dest++ = int2ulaw(ulaw2int[*src] + + ulaw2int[*(src+1)]); + src += 2; + } *data = src; return(rc); } @@ -566,9 +581,11 @@ size_t sndcnv16swap(void **data,size_t *sz,void **outbuf) *outbuf = *data; p = (unsigned short *) *outbuf; - while (cnt--) { - *p++ = ((*p & 0x00ff) << 8) | (*p >> 8); - } + while (cnt--) + { + *p = ((*p & 0x00ff) << 8) | (*p >> 8); + p++; + } *data = p; cnt = *sz; *sz = 0;