Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
179990ac
Commit
179990ac
authored
Aug 18, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Aug 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Remove int24_struct from conversion routines.
parent
3995627d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
38 deletions
+37
-38
dsound_convert.c
dlls/dsound/dsound_convert.c
+37
-38
No files found.
dlls/dsound/dsound_convert.c
View file @
179990ac
...
...
@@ -52,10 +52,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dsound
);
typedef
struct
{
uint8_t
byte
[
3
];
}
int24_struct
;
#ifdef WORDS_BIGENDIAN
#define le16(x) RtlUshortByteSwap((x))
#define le32(x) RtlUlongByteSwap((x))
...
...
@@ -79,10 +75,10 @@ static void convert_8_to_16 (const void *src, void *dst)
static
void
convert_8_to_24
(
const
void
*
src
,
void
*
dst
)
{
uint8_t
dest
=
*
(
uint8_t
*
)
src
;
int24_struc
t
*
dest24
=
dst
;
dest24
->
byte
[
0
]
=
dest
;
dest24
->
byte
[
1
]
=
dest
;
dest24
->
byte
[
2
]
=
dest
-
0x80
;
uint8_
t
*
dest24
=
dst
;
dest24
[
0
]
=
dest
;
dest24
[
1
]
=
dest
;
dest24
[
2
]
=
dest
-
0x80
;
}
static
void
convert_8_to_32
(
const
void
*
src
,
void
*
dst
)
...
...
@@ -107,11 +103,11 @@ static void convert_16_to_16 (const void *src, void *dst)
static
void
convert_16_to_24
(
const
void
*
src
,
void
*
dst
)
{
uint16_t
dest
=
le16
(
*
(
uint16_t
*
)
src
);
int24_struc
t
*
dest24
=
dst
;
uint8_
t
*
dest24
=
dst
;
dest24
->
byte
[
0
]
=
dest
/
256
;
dest24
->
byte
[
1
]
=
dest
;
dest24
->
byte
[
2
]
=
dest
/
256
;
dest24
[
0
]
=
dest
/
256
;
dest24
[
1
]
=
dest
;
dest24
[
2
]
=
dest
/
256
;
}
static
void
convert_16_to_32
(
const
void
*
src
,
void
*
dst
)
...
...
@@ -123,34 +119,37 @@ static void convert_16_to_32 (const void *src, void *dst)
static
void
convert_24_to_8
(
const
void
*
src
,
void
*
dst
)
{
uint8_t
*
dst8
=
dst
;
*
dst8
=
((
int24_struct
*
)
src
)
->
byte
[
2
];
*
dst8
=
((
uint8_t
*
)
src
)
[
2
];
}
static
void
convert_24_to_16
(
const
void
*
src
,
void
*
dst
)
{
uint16_t
*
dest16
=
dst
;
const
int24_struc
t
*
source
=
src
;
*
dest16
=
le16
(
source
->
byte
[
2
]
*
256
+
source
->
byt
e
[
1
]);
const
uint8_
t
*
source
=
src
;
*
dest16
=
le16
(
source
[
2
]
*
256
+
sourc
e
[
1
]);
}
static
void
convert_24_to_24
(
const
void
*
src
,
void
*
dst
)
{
int24_struct
*
dest24
=
dst
;
const
int24_struct
*
src24
=
src
;
*
dest24
=
*
src24
;
uint8_t
*
dest24
=
dst
;
const
uint8_t
*
src24
=
src
;
dest24
[
0
]
=
src24
[
0
];
dest24
[
1
]
=
src24
[
1
];
dest24
[
2
]
=
src24
[
2
];
}
static
void
convert_24_to_32
(
const
void
*
src
,
void
*
dst
)
{
uint32_t
*
dest32
=
dst
;
const
int24_struc
t
*
source
=
src
;
*
dest32
=
le32
(
source
->
byte
[
2
]
*
16777217
+
source
->
byte
[
1
]
*
65536
+
source
->
byt
e
[
0
]
*
256
);
const
uint8_
t
*
source
=
src
;
*
dest32
=
le32
(
source
[
2
]
*
16777217
+
source
[
1
]
*
65536
+
sourc
e
[
0
]
*
256
);
}
static
void
convert_32_to_8
(
const
void
*
src
,
void
*
dst
)
{
uint8_t
*
dst8
=
dst
;
*
dst8
=
(
le32
(
*
(
uint32_t
*
)
src
)
/
16777216
);
*
dst8
=
(
le32
(
*
(
uint32_t
*
)
src
)
/
16777216
);
*
dst8
-=
0x80
;
}
...
...
@@ -163,11 +162,11 @@ static void convert_32_to_16 (const void *src, void *dst)
static
void
convert_32_to_24
(
const
void
*
src
,
void
*
dst
)
{
uint32_t
dest
=
le32
(
*
(
uint32_t
*
)
dst
);
int24_struc
t
*
dest24
=
dst
;
uint8_
t
*
dest24
=
dst
;
dest24
->
byte
[
0
]
=
dest
/
256
;
dest24
->
byte
[
1
]
=
dest
/
65536
;
dest24
->
byte
[
2
]
=
dest
/
16777216
;
dest24
[
0
]
=
dest
/
256
;
dest24
[
1
]
=
dest
/
65536
;
dest24
[
2
]
=
dest
/
16777216
;
}
static
void
convert_32_to_32
(
const
void
*
src
,
void
*
dst
)
...
...
@@ -202,15 +201,15 @@ static void mix16(int16_t *src, int32_t *dst, unsigned len)
}
}
static
void
mix24
(
int24_struc
t
*
src
,
int32_t
*
dst
,
unsigned
len
)
static
void
mix24
(
uint8_
t
*
src
,
int32_t
*
dst
,
unsigned
len
)
{
TRACE
(
"%p - %p %d
\n
"
,
src
,
dst
,
len
);
len
/=
3
;
while
(
len
--
)
{
uint32_t
field
;
field
=
((
unsigned
)
src
->
byte
[
2
]
<<
16
)
+
((
unsigned
)
src
->
byte
[
1
]
<<
8
)
+
(
unsigned
)
src
->
byte
[
0
];
if
(
src
->
byte
[
2
]
&
0x80
)
field
=
((
unsigned
)
src
[
2
]
<<
16
)
+
((
unsigned
)
src
[
1
]
<<
8
)
+
(
unsigned
)
src
[
0
];
if
(
src
[
2
]
&
0x80
)
field
|=
0xFF000000U
;
*
(
dst
++
)
+=
field
;
++
src
;
...
...
@@ -263,7 +262,7 @@ static void norm16(int32_t *src, int16_t *dst, unsigned len)
}
}
static
void
norm24
(
int32_t
*
src
,
int24_struc
t
*
dst
,
unsigned
len
)
static
void
norm24
(
int32_t
*
src
,
uint8_
t
*
dst
,
unsigned
len
)
{
TRACE
(
"%p - %p %d
\n
"
,
src
,
dst
,
len
);
len
/=
3
;
...
...
@@ -271,21 +270,21 @@ static void norm24(int32_t *src, int24_struct *dst, unsigned len)
{
if
(
*
src
<=
-
0x800000
)
{
dst
->
byte
[
0
]
=
0
;
dst
->
byte
[
1
]
=
0
;
dst
->
byte
[
2
]
=
0x80
;
dst
[
0
]
=
0
;
dst
[
1
]
=
0
;
dst
[
2
]
=
0x80
;
}
else
if
(
*
src
>
0x7fffff
)
{
dst
->
byte
[
0
]
=
0xff
;
dst
->
byte
[
1
]
=
0xff
;
dst
->
byte
[
2
]
=
0x7f
;
dst
[
0
]
=
0xff
;
dst
[
1
]
=
0xff
;
dst
[
2
]
=
0x7f
;
}
else
{
dst
->
byte
[
0
]
=
*
src
;
dst
->
byte
[
1
]
=
*
src
>>
8
;
dst
->
byte
[
2
]
=
*
src
>>
16
;
dst
[
0
]
=
*
src
;
dst
[
1
]
=
*
src
>>
8
;
dst
[
2
]
=
*
src
>>
16
;
}
++
dst
;
++
src
;
...
...
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