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
5ef4be7b
Commit
5ef4be7b
authored
Jul 10, 2000
by
Peter Schneider-Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ANSI-fication
parent
00fb0316
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
105 deletions
+35
-105
Modules/audioop.c
Modules/audioop.c
+24
-72
Modules/fcntlmodule.c
Modules/fcntlmodule.c
+6
-18
Modules/gcmodule.c
Modules/gcmodule.c
+5
-15
No files found.
Modules/audioop.c
View file @
5ef4be7b
...
...
@@ -26,7 +26,6 @@ typedef unsigned long Py_UInt32;
#if defined(__CHAR_UNSIGNED__)
#if defined(signed)
!
ERROR
!
;
READ
THE
SOURCE
FILE
!
;
/* This module currently does not work on systems where only unsigned
characters are available. Take it out of Setup. Sorry. */
#endif
...
...
@@ -95,8 +94,7 @@ static int ulaw_table[256] = {
#define CLIP 32635
static
unsigned
char
st_linear_to_ulaw
(
sample
)
int
sample
;
st_linear_to_ulaw
(
int
sample
)
{
static
int
exp_lut
[
256
]
=
{
0
,
0
,
1
,
1
,
2
,
2
,
2
,
2
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
...
...
@@ -162,9 +160,7 @@ static int stepsizeTable[89] = {
static
PyObject
*
AudioopError
;
static
PyObject
*
audioop_getsample
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_getsample
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -187,9 +183,7 @@ audioop_getsample(self, args)
}
static
PyObject
*
audioop_max
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_max
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -213,9 +207,7 @@ audioop_max(self, args)
}
static
PyObject
*
audioop_minmax
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_minmax
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -239,9 +231,7 @@ audioop_minmax(self, args)
}
static
PyObject
*
audioop_avg
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_avg
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -268,9 +258,7 @@ audioop_avg(self, args)
}
static
PyObject
*
audioop_rms
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_rms
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -343,9 +331,7 @@ static double _sum2(a, b, len)
** is completely recalculated each step.
*/
static
PyObject
*
audioop_findfit
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_findfit
(
PyObject
*
self
,
PyObject
*
args
)
{
short
*
cp1
,
*
cp2
;
int
len1
,
len2
;
...
...
@@ -403,9 +389,7 @@ audioop_findfit(self, args)
** See the comment for findfit for details.
*/
static
PyObject
*
audioop_findfactor
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_findfactor
(
PyObject
*
self
,
PyObject
*
args
)
{
short
*
cp1
,
*
cp2
;
int
len1
,
len2
;
...
...
@@ -435,9 +419,7 @@ audioop_findfactor(self, args)
** that contains the most energy.
*/
static
PyObject
*
audioop_findmax
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_findmax
(
PyObject
*
self
,
PyObject
*
args
)
{
short
*
cp1
;
int
len1
,
len2
;
...
...
@@ -481,9 +463,7 @@ audioop_findmax(self, args)
}
static
PyObject
*
audioop_avgpp
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_avgpp
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
,
prevval
=
0
,
prevextremevalid
=
0
,
...
...
@@ -540,9 +520,7 @@ audioop_avgpp(self, args)
}
static
PyObject
*
audioop_maxpp
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_maxpp
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
,
prevval
=
0
,
prevextremevalid
=
0
,
...
...
@@ -595,9 +573,7 @@ audioop_maxpp(self, args)
}
static
PyObject
*
audioop_cross
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_cross
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -624,9 +600,7 @@ audioop_cross(self, args)
}
static
PyObject
*
audioop_mul
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_mul
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
,
*
ncp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -667,9 +641,7 @@ audioop_mul(self, args)
}
static
PyObject
*
audioop_tomono
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_tomono
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
,
*
ncp
;
int
len
,
size
,
val1
=
0
,
val2
=
0
;
...
...
@@ -713,9 +685,7 @@ audioop_tomono(self, args)
}
static
PyObject
*
audioop_tostereo
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_tostereo
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
,
*
ncp
;
int
len
,
size
,
val1
,
val2
,
val
=
0
;
...
...
@@ -767,9 +737,7 @@ audioop_tostereo(self, args)
}
static
PyObject
*
audioop_add
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_add
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp1
,
*
cp2
,
*
ncp
;
int
len1
,
len2
,
size
,
val1
=
0
,
val2
=
0
,
maxval
,
newval
;
...
...
@@ -822,9 +790,7 @@ audioop_add(self, args)
}
static
PyObject
*
audioop_bias
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_bias
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
,
*
ncp
;
int
len
,
size
,
val
=
0
;
...
...
@@ -860,9 +826,7 @@ audioop_bias(self, args)
}
static
PyObject
*
audioop_reverse
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_reverse
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
unsigned
char
*
ncp
;
...
...
@@ -899,9 +863,7 @@ audioop_reverse(self, args)
}
static
PyObject
*
audioop_lin2lin
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_lin2lin
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
unsigned
char
*
ncp
;
...
...
@@ -949,9 +911,7 @@ gcd(a, b)
}
static
PyObject
*
audioop_ratecv
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_ratecv
(
PyObject
*
self
,
PyObject
*
args
)
{
char
*
cp
,
*
ncp
;
int
len
,
size
,
nchannels
,
inrate
,
outrate
,
weightA
,
weightB
;
...
...
@@ -1090,9 +1050,7 @@ audioop_ratecv(self, args)
}
static
PyObject
*
audioop_lin2ulaw
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_lin2ulaw
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
unsigned
char
*
ncp
;
...
...
@@ -1125,9 +1083,7 @@ audioop_lin2ulaw(self, args)
}
static
PyObject
*
audioop_ulaw2lin
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_ulaw2lin
(
PyObject
*
self
,
PyObject
*
args
)
{
unsigned
char
*
cp
;
unsigned
char
cval
;
...
...
@@ -1162,9 +1118,7 @@ audioop_ulaw2lin(self, args)
}
static
PyObject
*
audioop_lin2adpcm
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_lin2adpcm
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
signed
char
*
ncp
;
...
...
@@ -1273,9 +1227,7 @@ audioop_lin2adpcm(self, args)
}
static
PyObject
*
audioop_adpcm2lin
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
audioop_adpcm2lin
(
PyObject
*
self
,
PyObject
*
args
)
{
signed
char
*
cp
;
signed
char
*
ncp
;
...
...
Modules/fcntlmodule.c
View file @
5ef4be7b
...
...
@@ -27,9 +27,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* fcntl(fd, opt, [arg]) */
static
PyObject
*
fcntl_fcntl
(
self
,
args
)
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
fcntl_fcntl
(
PyObject
*
self
,
PyObject
*
args
)
{
int
fd
;
int
code
;
...
...
@@ -87,9 +85,7 @@ is optional, and defaults to 0; it may be an int or a string.";
/* ioctl(fd, opt, [arg]) */
static
PyObject
*
fcntl_ioctl
(
self
,
args
)
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
fcntl_ioctl
(
PyObject
*
self
,
PyObject
*
args
)
{
int
fd
;
int
code
;
...
...
@@ -146,9 +142,7 @@ is optional, and defaults to 0; it may be an int or a string.";
/* flock(fd, operation) */
static
PyObject
*
fcntl_flock
(
self
,
args
)
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
fcntl_flock
(
PyObject
*
self
,
PyObject
*
args
)
{
int
fd
;
int
code
;
...
...
@@ -206,9 +200,7 @@ emulated using fcntl().)";
/* lockf(fd, operation) */
static
PyObject
*
fcntl_lockf
(
self
,
args
)
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
fcntl_lockf
(
PyObject
*
self
,
PyObject
*
args
)
{
int
fd
,
code
,
ret
,
whence
=
0
;
PyObject
*
lenobj
=
NULL
,
*
startobj
=
NULL
;
...
...
@@ -299,10 +291,7 @@ a file or socket object.";
/* Module initialisation */
static
int
ins
(
d
,
symbol
,
value
)
PyObject
*
d
;
char
*
symbol
;
long
value
;
ins
(
PyObject
*
d
,
char
*
symbol
,
long
value
)
{
PyObject
*
v
=
PyInt_FromLong
(
value
);
if
(
!
v
||
PyDict_SetItemString
(
d
,
symbol
,
v
)
<
0
)
...
...
@@ -313,8 +302,7 @@ ins(d, symbol, value)
}
static
int
all_ins
(
d
)
PyObject
*
d
;
all_ins
(
PyObject
*
d
)
{
if
(
ins
(
d
,
"LOCK_SH"
,
(
long
)
LOCK_SH
))
return
-
1
;
if
(
ins
(
d
,
"LOCK_EX"
,
(
long
)
LOCK_EX
))
return
-
1
;
...
...
Modules/gcmodule.c
View file @
5ef4be7b
...
...
@@ -527,9 +527,7 @@ static char collect__doc__[] =
;
static
PyObject
*
Py_collect
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
Py_collect
(
PyObject
*
self
,
PyObject
*
args
)
{
long
n
;
...
...
@@ -561,9 +559,7 @@ static char set_debug__doc__[] =
;
static
PyObject
*
Py_set_debug
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
Py_set_debug
(
PyObject
*
self
,
PyObject
*
args
)
{
if
(
!
PyArg_ParseTuple
(
args
,
"l"
,
&
debug
))
return
NULL
;
...
...
@@ -579,9 +575,7 @@ static char get_debug__doc__[] =
;
static
PyObject
*
Py_get_debug
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
Py_get_debug
(
PyObject
*
self
,
PyObject
*
args
)
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
/* no args */
return
NULL
;
...
...
@@ -597,9 +591,7 @@ static char set_thresh__doc__[] =
;
static
PyObject
*
Py_set_thresh
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
Py_set_thresh
(
PyObject
*
self
,
PyObject
*
args
)
{
if
(
!
PyArg_ParseTuple
(
args
,
"i|ii"
,
&
threshold0
,
&
threshold1
,
&
threshold2
))
...
...
@@ -616,9 +608,7 @@ static char get_thresh__doc__[] =
;
static
PyObject
*
Py_get_thresh
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
Py_get_thresh
(
PyObject
*
self
,
PyObject
*
args
)
{
if
(
!
PyArg_ParseTuple
(
args
,
""
))
/* no args */
return
NULL
;
...
...
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