Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
824c9c8e
Commit
824c9c8e
authored
Apr 28, 2007
by
Andrew Talbot
Committed by
Alexandre Julliard
Apr 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Constify some variables.
parent
ff19b2f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
mixer.c
dlls/dsound/mixer.c
+5
-4
sound3d.c
dlls/dsound/sound3d.c
+7
-7
No files found.
dlls/dsound/mixer.c
View file @
824c9c8e
...
...
@@ -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
;
...
...
dlls/dsound/sound3d.c
View file @
824c9c8e
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment