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
a811c38d
Commit
a811c38d
authored
Oct 19, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix various minor errors in passing arguments to
PyArg_ParseTuple.
parent
aac13162
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
16 deletions
+27
-16
Modules/_ctypes/callproc.c
Modules/_ctypes/callproc.c
+9
-9
Modules/_ssl.c
Modules/_ssl.c
+1
-1
Modules/audioop.c
Modules/audioop.c
+8
-3
Modules/dbmmodule.c
Modules/dbmmodule.c
+9
-3
No files found.
Modules/_ctypes/callproc.c
View file @
a811c38d
...
...
@@ -1247,11 +1247,11 @@ static PyObject *py_dl_open(PyObject *self, PyObject *args)
static
PyObject
*
py_dl_close
(
PyObject
*
self
,
PyObject
*
args
)
{
void
*
handle
;
int
handle
;
if
(
!
PyArg_ParseTuple
(
args
,
"i:dlclose"
,
&
handle
))
return
NULL
;
if
(
dlclose
(
handle
))
{
if
(
dlclose
(
(
void
*
)
handle
))
{
PyErr_SetString
(
PyExc_OSError
,
ctypes_dlerror
());
return
NULL
;
...
...
@@ -1263,12 +1263,12 @@ static PyObject *py_dl_close(PyObject *self, PyObject *args)
static
PyObject
*
py_dl_sym
(
PyObject
*
self
,
PyObject
*
args
)
{
char
*
name
;
void
*
handle
;
int
handle
;
void
*
ptr
;
if
(
!
PyArg_ParseTuple
(
args
,
"is:dlsym"
,
&
handle
,
&
name
))
return
NULL
;
ptr
=
ctypes_dlsym
(
handle
,
name
);
ptr
=
ctypes_dlsym
(
(
void
*
)
handle
,
name
);
if
(
!
ptr
)
{
PyErr_SetString
(
PyExc_OSError
,
ctypes_dlerror
());
...
...
@@ -1286,7 +1286,7 @@ static PyObject *py_dl_sym(PyObject *self, PyObject *args)
static
PyObject
*
call_function
(
PyObject
*
self
,
PyObject
*
args
)
{
PPROC
func
;
int
func
;
PyObject
*
arguments
;
PyObject
*
result
;
...
...
@@ -1296,7 +1296,7 @@ call_function(PyObject *self, PyObject *args)
&
PyTuple_Type
,
&
arguments
))
return
NULL
;
result
=
_CallProc
(
func
,
result
=
_CallProc
(
(
PPROC
)
func
,
arguments
,
#ifdef MS_WIN32
NULL
,
...
...
@@ -1317,7 +1317,7 @@ call_function(PyObject *self, PyObject *args)
static
PyObject
*
call_cdeclfunction
(
PyObject
*
self
,
PyObject
*
args
)
{
PPROC
func
;
int
func
;
PyObject
*
arguments
;
PyObject
*
result
;
...
...
@@ -1327,7 +1327,7 @@ call_cdeclfunction(PyObject *self, PyObject *args)
&
PyTuple_Type
,
&
arguments
))
return
NULL
;
result
=
_CallProc
(
func
,
result
=
_CallProc
(
(
PPROC
)
func
,
arguments
,
#ifdef MS_WIN32
NULL
,
...
...
@@ -1510,7 +1510,7 @@ resize(PyObject *self, PyObject *args)
#else
"On:resize"
,
#endif
(
PyObject
*
)
&
obj
,
&
size
))
&
obj
,
&
size
))
return
NULL
;
dict
=
PyObject_stgdict
((
PyObject
*
)
obj
);
...
...
Modules/_ssl.c
View file @
a811c38d
...
...
@@ -317,7 +317,7 @@ PySocket_ssl(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"O!|zz:ssl"
,
PySocketModule
.
Sock_Type
,
(
PyObject
*
)
&
Sock
,
&
Sock
,
&
key_file
,
&
cert_file
))
return
NULL
;
...
...
Modules/audioop.c
View file @
a811c38d
...
...
@@ -472,8 +472,12 @@ audioop_findfit(PyObject *self, PyObject *args)
double
aj_m1
,
aj_lm1
;
double
sum_ri_2
,
sum_aij_2
,
sum_aij_ri
,
result
,
best_result
,
factor
;
/* Passing a short** for an 's' argument is correct only
if the string contents is aligned for interpretation
as short[]. Due to the definition of PyStringObject,
this is currently (Python 2.6) the case. */
if
(
!
PyArg_ParseTuple
(
args
,
"s#s#:findfit"
,
&
cp1
,
&
len1
,
&
cp2
,
&
len2
)
)
(
char
**
)
&
cp1
,
&
len1
,
(
char
**
)
&
cp2
,
&
len2
)
)
return
0
;
if
(
len1
&
1
||
len2
&
1
)
{
PyErr_SetString
(
AudioopError
,
"Strings should be even-sized"
);
...
...
@@ -530,7 +534,7 @@ audioop_findfactor(PyObject *self, PyObject *args)
double
sum_ri_2
,
sum_aij_ri
,
result
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#s#:findfactor"
,
&
cp1
,
&
len1
,
&
cp2
,
&
len2
)
)
(
char
**
)
&
cp1
,
&
len1
,
(
char
**
)
&
cp2
,
&
len2
)
)
return
0
;
if
(
len1
&
1
||
len2
&
1
)
{
PyErr_SetString
(
AudioopError
,
"Strings should be even-sized"
);
...
...
@@ -562,7 +566,8 @@ audioop_findmax(PyObject *self, PyObject *args)
double
aj_m1
,
aj_lm1
;
double
result
,
best_result
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#i:findmax"
,
&
cp1
,
&
len1
,
&
len2
)
)
if
(
!
PyArg_ParseTuple
(
args
,
"s#i:findmax"
,
(
char
**
)
&
cp1
,
&
len1
,
&
len2
)
)
return
0
;
if
(
len1
&
1
)
{
PyErr_SetString
(
AudioopError
,
"Strings should be even-sized"
);
...
...
Modules/dbmmodule.c
View file @
a811c38d
...
...
@@ -208,11 +208,13 @@ dbm_keys(register dbmobject *dp, PyObject *unused)
static
PyObject
*
dbm_has_key
(
register
dbmobject
*
dp
,
PyObject
*
args
)
{
char
*
tmp_ptr
;
datum
key
,
val
;
int
tmp_size
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:has_key"
,
&
key
.
d
ptr
,
&
tmp_size
))
if
(
!
PyArg_ParseTuple
(
args
,
"s#:has_key"
,
&
tmp_
ptr
,
&
tmp_size
))
return
NULL
;
key
.
dptr
=
tmp_ptr
;
key
.
dsize
=
tmp_size
;
check_dbmobject_open
(
dp
);
val
=
dbm_fetch
(
dp
->
di_dbm
,
key
);
...
...
@@ -224,11 +226,13 @@ dbm_get(register dbmobject *dp, PyObject *args)
{
datum
key
,
val
;
PyObject
*
defvalue
=
Py_None
;
char
*
tmp_ptr
;
int
tmp_size
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#|O:get"
,
&
key
.
d
ptr
,
&
tmp_size
,
&
defvalue
))
&
tmp_
ptr
,
&
tmp_size
,
&
defvalue
))
return
NULL
;
key
.
dptr
=
tmp_ptr
;
key
.
dsize
=
tmp_size
;
check_dbmobject_open
(
dp
);
val
=
dbm_fetch
(
dp
->
di_dbm
,
key
);
...
...
@@ -245,11 +249,13 @@ dbm_setdefault(register dbmobject *dp, PyObject *args)
{
datum
key
,
val
;
PyObject
*
defvalue
=
NULL
;
char
*
tmp_ptr
;
int
tmp_size
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#|S:setdefault"
,
&
key
.
d
ptr
,
&
tmp_size
,
&
defvalue
))
&
tmp_
ptr
,
&
tmp_size
,
&
defvalue
))
return
NULL
;
key
.
dptr
=
tmp_ptr
;
key
.
dsize
=
tmp_size
;
check_dbmobject_open
(
dp
);
val
=
dbm_fetch
(
dp
->
di_dbm
,
key
);
...
...
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