dsound: Constify some variables.

This commit is contained in:
Andrew Talbot 2007-04-28 15:39:28 +01:00 committed by Alexandre Julliard
parent ff19b2f25a
commit 824c9c8ee6
2 changed files with 12 additions and 11 deletions

View file

@ -175,7 +175,7 @@ static inline BYTE cvtS16toU8(INT16 s)
* Copy a single frame from the given input buffer to the given output buffer.
* Translate 8 <-> 16 bits and mono <-> stereo
*/
static inline void cp_fields(const IDirectSoundBufferImpl *dsb, BYTE *ibuf, BYTE *obuf )
static inline void cp_fields(const IDirectSoundBufferImpl *dsb, const BYTE *ibuf, BYTE *obuf )
{
DirectSoundDevice * device = dsb->device;
INT fl,fr;
@ -192,8 +192,8 @@ static inline void cp_fields(const IDirectSoundBufferImpl *dsb, BYTE *ibuf, BYTE
fl = cvtU8toS16(*ibuf);
fr = (dsb->pwfx->nChannels==2 ? cvtU8toS16(*(ibuf + 1)) : fl);
} else {
fl = *((INT16 *)ibuf);
fr = (dsb->pwfx->nChannels==2 ? *(((INT16 *)ibuf) + 1) : fl);
fl = *((const INT16 *)ibuf);
fr = (dsb->pwfx->nChannels==2 ? *(((const INT16 *)ibuf) + 1) : fl);
}
if (device->pwfx->nChannels == 2) {
@ -910,7 +910,8 @@ post_mix:
*
* Returns: the length beyond the writepos that was mixed to.
*/
static DWORD DSOUND_MixToPrimary(DirectSoundDevice *device, DWORD playpos, DWORD writepos, DWORD mixlen, BOOL recover)
static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD playpos, DWORD writepos,
DWORD mixlen, BOOL recover)
{
INT i, len, maxlen = 0;
IDirectSoundBufferImpl *dsb;

View file

@ -66,7 +66,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound3d);
*/
/* scalar product (i believe it's called dot product in english) */
static inline D3DVALUE ScalarProduct (LPD3DVECTOR a, LPD3DVECTOR b)
static inline D3DVALUE ScalarProduct (const D3DVECTOR *a, const D3DVECTOR *b)
{
D3DVALUE c;
c = (a->x*b->x) + (a->y*b->y) + (a->z*b->z);
@ -76,7 +76,7 @@ static inline D3DVALUE ScalarProduct (LPD3DVECTOR a, LPD3DVECTOR b)
}
/* vector product (i believe it's called cross product in english */
static inline D3DVECTOR VectorProduct (LPD3DVECTOR a, LPD3DVECTOR b)
static inline D3DVECTOR VectorProduct (const D3DVECTOR *a, const D3DVECTOR *b)
{
D3DVECTOR c;
c.x = (a->y*b->z) - (a->z*b->y);
@ -88,7 +88,7 @@ static inline D3DVECTOR VectorProduct (LPD3DVECTOR a, LPD3DVECTOR b)
}
/* magnitude (length) of vector */
static inline D3DVALUE VectorMagnitude (LPD3DVECTOR a)
static inline D3DVALUE VectorMagnitude (const D3DVECTOR *a)
{
D3DVALUE l;
l = sqrt (ScalarProduct (a, a));
@ -106,7 +106,7 @@ static inline D3DVALUE RadToDeg (D3DVALUE angle)
}
/* angle between vectors - deg version */
static inline D3DVALUE AngleBetweenVectorsDeg (LPD3DVECTOR a, LPD3DVECTOR b)
static inline D3DVALUE AngleBetweenVectorsDeg (const D3DVECTOR *a, const D3DVECTOR *b)
{
D3DVALUE la, lb, product, angle, cos;
/* definition of scalar product: a*b = |a|*|b|*cos...therefore: */
@ -123,7 +123,7 @@ static inline D3DVALUE AngleBetweenVectorsDeg (LPD3DVECTOR a, LPD3DVECTOR b)
}
/* angle between vectors - rad version */
static inline D3DVALUE AngleBetweenVectorsRad (LPD3DVECTOR a, LPD3DVECTOR b)
static inline D3DVALUE AngleBetweenVectorsRad (const D3DVECTOR *a, const D3DVECTOR *b)
{
D3DVALUE la, lb, product, angle, cos;
/* definition of scalar product: a*b = |a|*|b|*cos...therefore: */
@ -138,7 +138,7 @@ static inline D3DVALUE AngleBetweenVectorsRad (LPD3DVECTOR a, LPD3DVECTOR b)
}
/* calculates vector between two points */
static inline D3DVECTOR VectorBetweenTwoPoints (LPD3DVECTOR a, LPD3DVECTOR b)
static inline D3DVECTOR VectorBetweenTwoPoints (const D3DVECTOR *a, const D3DVECTOR *b)
{
D3DVECTOR c;
c.x = b->x - a->x;
@ -150,7 +150,7 @@ static inline D3DVECTOR VectorBetweenTwoPoints (LPD3DVECTOR a, LPD3DVECTOR b)
}
/* calculates the length of vector's projection on another vector */
static inline D3DVALUE ProjectVector (LPD3DVECTOR a, LPD3DVECTOR p)
static inline D3DVALUE ProjectVector (const D3DVECTOR *a, const D3DVECTOR *p)
{
D3DVALUE prod, result;
prod = ScalarProduct(a, p);