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
6e255330
Commit
6e255330
authored
Jan 26, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup after custom buffer converter
parent
b450f0ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
Modules/binascii.c
Modules/binascii.c
+5
-0
Modules/clinic/binascii.c.h
Modules/clinic/binascii.c.h
+26
-6
No files found.
Modules/binascii.c
View file @
6e255330
...
...
@@ -195,6 +195,11 @@ class ascii_buffer_converter(CConverter):
type = 'Py_buffer'
converter = 'ascii_buffer_converter'
impl_by_reference = True
c_default = "{NULL, NULL}"
def cleanup(self):
name = self.name
return "".join(["if (", name, ".obj)\n PyBuffer_Release(&", name, ");\n"])
[python start generated code]*/
/*[python end generated code: checksum=da39a3ee5e6b4b0d3255bfef95601890afd80709]*/
...
...
Modules/clinic/binascii.c.h
View file @
6e255330
...
...
@@ -16,7 +16,7 @@ static PyObject *
binascii_a2b_uu
(
PyModuleDef
*
module
,
PyObject
*
args
)
{
PyObject
*
return_value
=
NULL
;
Py_buffer
data
;
Py_buffer
data
=
{
NULL
,
NULL
}
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&:a2b_uu"
,
...
...
@@ -25,6 +25,10 @@ binascii_a2b_uu(PyModuleDef *module, PyObject *args)
return_value
=
binascii_a2b_uu_impl
(
module
,
&
data
);
exit:
/* Cleanup for data */
if
(
data
.
obj
)
PyBuffer_Release
(
&
data
);
return
return_value
;
}
...
...
@@ -72,7 +76,7 @@ static PyObject *
binascii_a2b_base64
(
PyModuleDef
*
module
,
PyObject
*
args
)
{
PyObject
*
return_value
=
NULL
;
Py_buffer
data
;
Py_buffer
data
=
{
NULL
,
NULL
}
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&:a2b_base64"
,
...
...
@@ -81,6 +85,10 @@ binascii_a2b_base64(PyModuleDef *module, PyObject *args)
return_value
=
binascii_a2b_base64_impl
(
module
,
&
data
);
exit:
/* Cleanup for data */
if
(
data
.
obj
)
PyBuffer_Release
(
&
data
);
return
return_value
;
}
...
...
@@ -128,7 +136,7 @@ static PyObject *
binascii_a2b_hqx
(
PyModuleDef
*
module
,
PyObject
*
args
)
{
PyObject
*
return_value
=
NULL
;
Py_buffer
data
;
Py_buffer
data
=
{
NULL
,
NULL
}
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&:a2b_hqx"
,
...
...
@@ -137,6 +145,10 @@ binascii_a2b_hqx(PyModuleDef *module, PyObject *args)
return_value
=
binascii_a2b_hqx_impl
(
module
,
&
data
);
exit:
/* Cleanup for data */
if
(
data
.
obj
)
PyBuffer_Release
(
&
data
);
return
return_value
;
}
...
...
@@ -350,7 +362,7 @@ static PyObject *
binascii_a2b_hex
(
PyModuleDef
*
module
,
PyObject
*
args
)
{
PyObject
*
return_value
=
NULL
;
Py_buffer
hexstr
;
Py_buffer
hexstr
=
{
NULL
,
NULL
}
;
if
(
!
PyArg_ParseTuple
(
args
,
"O&:a2b_hex"
,
...
...
@@ -359,6 +371,10 @@ binascii_a2b_hex(PyModuleDef *module, PyObject *args)
return_value
=
binascii_a2b_hex_impl
(
module
,
&
hexstr
);
exit:
/* Cleanup for hexstr */
if
(
hexstr
.
obj
)
PyBuffer_Release
(
&
hexstr
);
return
return_value
;
}
...
...
@@ -377,7 +393,7 @@ binascii_a2b_qp(PyModuleDef *module, PyObject *args, PyObject *kwargs)
{
PyObject
*
return_value
=
NULL
;
static
char
*
_keywords
[]
=
{
"data"
,
"header"
,
NULL
};
Py_buffer
data
;
Py_buffer
data
=
{
NULL
,
NULL
}
;
int
header
=
0
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
...
...
@@ -387,6 +403,10 @@ binascii_a2b_qp(PyModuleDef *module, PyObject *args, PyObject *kwargs)
return_value
=
binascii_a2b_qp_impl
(
module
,
&
data
,
header
);
exit:
/* Cleanup for data */
if
(
data
.
obj
)
PyBuffer_Release
(
&
data
);
return
return_value
;
}
...
...
@@ -427,4 +447,4 @@ exit:
return
return_value
;
}
/*[clinic end generated code: checksum=
abe48ca8020fa3ec25e13bd9fa7414f6b3ee2946
]*/
/*[clinic end generated code: checksum=
8180e5be47a110ae8c89263a7c12a91d80754f60
]*/
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