Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ad56aac6
Commit
ad56aac6
authored
Mar 20, 2006
by
Anthony Baxter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace use of int16_t with a (typedef'd) short, to fix Windows buildbots.
expand tabs.
parent
0ca521fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1201 additions
and
1199 deletions
+1201
-1199
Modules/audioop.c
Modules/audioop.c
+1201
-1199
No files found.
Modules/audioop.c
View file @
ad56aac6
...
@@ -15,6 +15,8 @@ typedef unsigned long Py_UInt32;
...
@@ -15,6 +15,8 @@ typedef unsigned long Py_UInt32;
#endif
#endif
#endif
#endif
typedef
short
PyInt16
;
#if defined(__CHAR_UNSIGNED__)
#if defined(__CHAR_UNSIGNED__)
#if defined(signed)
#if defined(signed)
/* This module currently does not work on systems where only unsigned
/* This module currently does not work on systems where only unsigned
...
@@ -43,12 +45,12 @@ typedef unsigned long Py_UInt32;
...
@@ -43,12 +45,12 @@ typedef unsigned long Py_UInt32;
#define SEG_SHIFT (4)
/* Left shift for segment number. */
#define SEG_SHIFT (4)
/* Left shift for segment number. */
#define SEG_MASK (0x70)
/* Segment field mask. */
#define SEG_MASK (0x70)
/* Segment field mask. */
static
int16_t
seg_aend
[
8
]
=
{
0x1F
,
0x3F
,
0x7F
,
0xFF
,
static
PyInt16
seg_aend
[
8
]
=
{
0x1F
,
0x3F
,
0x7F
,
0xFF
,
0x1FF
,
0x3FF
,
0x7FF
,
0xFFF
};
0x1FF
,
0x3FF
,
0x7FF
,
0xFFF
};
static
int16_t
seg_uend
[
8
]
=
{
0x3F
,
0x7F
,
0xFF
,
0x1FF
,
static
PyInt16
seg_uend
[
8
]
=
{
0x3F
,
0x7F
,
0xFF
,
0x1FF
,
0x3FF
,
0x7FF
,
0xFFF
,
0x1FFF
};
0x3FF
,
0x7FF
,
0xFFF
,
0x1FFF
};
static
int16_t
search
(
int16_t
val
,
int16_t
*
table
,
int
size
)
static
PyInt16
search
(
PyInt16
val
,
PyInt16
*
table
,
int
size
)
{
{
int
i
;
int
i
;
...
@@ -61,7 +63,7 @@ static int16_t search(int16_t val, int16_t *table, int size)
...
@@ -61,7 +63,7 @@ static int16_t search(int16_t val, int16_t *table, int size)
#define st_ulaw2linear16(uc) (_st_ulaw2linear16[uc])
#define st_ulaw2linear16(uc) (_st_ulaw2linear16[uc])
#define st_alaw2linear16(uc) (_st_alaw2linear16[uc])
#define st_alaw2linear16(uc) (_st_alaw2linear16[uc])
int16_t
_st_ulaw2linear16
[
256
]
=
{
PyInt16
_st_ulaw2linear16
[
256
]
=
{
-
32124
,
-
31100
,
-
30076
,
-
29052
,
-
28028
,
-
27004
,
-
25980
,
-
32124
,
-
31100
,
-
30076
,
-
29052
,
-
28028
,
-
27004
,
-
25980
,
-
24956
,
-
23932
,
-
22908
,
-
21884
,
-
20860
,
-
19836
,
-
18812
,
-
24956
,
-
23932
,
-
22908
,
-
21884
,
-
20860
,
-
19836
,
-
18812
,
-
17788
,
-
16764
,
-
15996
,
-
15484
,
-
14972
,
-
14460
,
-
13948
,
-
17788
,
-
16764
,
-
15996
,
-
15484
,
-
14972
,
-
14460
,
-
13948
,
...
@@ -134,10 +136,10 @@ int16_t _st_ulaw2linear16[256] = {
...
@@ -134,10 +136,10 @@ int16_t _st_ulaw2linear16[256] = {
* John Wiley & Sons, pps 98-111 and 472-476.
* John Wiley & Sons, pps 98-111 and 472-476.
*/
*/
unsigned
char
st_14linear2ulaw
(
unsigned
char
st_14linear2ulaw
(
int16_t
pcm_val
)
/* 2's complement (14-bit range) */
PyInt16
pcm_val
)
/* 2's complement (14-bit range) */
{
{
int16_t
mask
;
PyInt16
mask
;
int16_t
seg
;
PyInt16
seg
;
unsigned
char
uval
;
unsigned
char
uval
;
/* The original sox code does this in the calling function, not here */
/* The original sox code does this in the calling function, not here */
...
@@ -170,7 +172,7 @@ unsigned char st_14linear2ulaw(
...
@@ -170,7 +172,7 @@ unsigned char st_14linear2ulaw(
}
}
int16_t
_st_alaw2linear16
[
256
]
=
{
PyInt16
_st_alaw2linear16
[
256
]
=
{
-
5504
,
-
5248
,
-
6016
,
-
5760
,
-
4480
,
-
4224
,
-
4992
,
-
5504
,
-
5248
,
-
6016
,
-
5760
,
-
4480
,
-
4224
,
-
4992
,
-
4736
,
-
7552
,
-
7296
,
-
8064
,
-
7808
,
-
6528
,
-
6272
,
-
4736
,
-
7552
,
-
7296
,
-
8064
,
-
7808
,
-
6528
,
-
6272
,
-
7040
,
-
6784
,
-
2752
,
-
2624
,
-
3008
,
-
2880
,
-
2240
,
-
7040
,
-
6784
,
-
2752
,
-
2624
,
-
3008
,
-
2880
,
-
2240
,
...
@@ -231,9 +233,9 @@ int16_t _st_alaw2linear16[256] = {
...
@@ -231,9 +233,9 @@ int16_t _st_alaw2linear16[256] = {
* John Wiley & Sons, pps 98-111 and 472-476.
* John Wiley & Sons, pps 98-111 and 472-476.
*/
*/
unsigned
char
st_linear2alaw
(
unsigned
char
st_linear2alaw
(
int16_t
pcm_val
)
/* 2's complement (13-bit range) */
PyInt16
pcm_val
)
/* 2's complement (13-bit range) */
{
{
int16_t
mask
;
PyInt16
mask
;
short
seg
;
short
seg
;
unsigned
char
aval
;
unsigned
char
aval
;
...
...
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