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
f98db65e
Commit
f98db65e
authored
Mar 01, 2006
by
Thomas Wouters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Py_ssize_t-clean.
parent
0b300be8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
Modules/binascii.c
Modules/binascii.c
+18
-17
No files found.
Modules/binascii.c
View file @
f98db65e
...
...
@@ -53,6 +53,7 @@
** Brandon Long, September 2001.
*/
#include PY_SSIZE_T_CLEAN
#include "Python.h"
...
...
@@ -189,7 +190,7 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
unsigned
char
this_ch
;
unsigned
int
leftchar
=
0
;
PyObject
*
rv
;
in
t
ascii_len
,
bin_len
;
Py_ssize_
t
ascii_len
,
bin_len
;
if
(
!
PyArg_ParseTuple
(
args
,
"t#:a2b_uu"
,
&
ascii_data
,
&
ascii_len
)
)
return
NULL
;
...
...
@@ -265,7 +266,7 @@ binascii_b2a_uu(PyObject *self, PyObject *args)
unsigned
char
this_ch
;
unsigned
int
leftchar
=
0
;
PyObject
*
rv
;
in
t
bin_len
;
Py_ssize_
t
bin_len
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:b2a_uu"
,
&
bin_data
,
&
bin_len
)
)
return
NULL
;
...
...
@@ -307,7 +308,7 @@ binascii_b2a_uu(PyObject *self, PyObject *args)
static
int
binascii_find_valid
(
unsigned
char
*
s
,
in
t
slen
,
int
num
)
binascii_find_valid
(
unsigned
char
*
s
,
Py_ssize_
t
slen
,
int
num
)
{
/* Finds & returns the (num+1)th
** valid character for base64, or -1 if none.
...
...
@@ -341,7 +342,7 @@ binascii_a2b_base64(PyObject *self, PyObject *args)
unsigned
char
this_ch
;
unsigned
int
leftchar
=
0
;
PyObject
*
rv
;
in
t
ascii_len
,
bin_len
;
Py_ssize_
t
ascii_len
,
bin_len
;
int
quad_pos
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,
"t#:a2b_base64"
,
&
ascii_data
,
&
ascii_len
)
)
...
...
@@ -432,7 +433,7 @@ binascii_b2a_base64(PyObject *self, PyObject *args)
unsigned
char
this_ch
;
unsigned
int
leftchar
=
0
;
PyObject
*
rv
;
in
t
bin_len
;
Py_ssize_
t
bin_len
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:b2a_base64"
,
&
bin_data
,
&
bin_len
)
)
return
NULL
;
...
...
@@ -485,7 +486,7 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
unsigned
char
this_ch
;
unsigned
int
leftchar
=
0
;
PyObject
*
rv
;
in
t
len
;
Py_ssize_
t
len
;
int
done
=
0
;
if
(
!
PyArg_ParseTuple
(
args
,
"t#:a2b_hqx"
,
&
ascii_data
,
&
len
)
)
...
...
@@ -549,7 +550,7 @@ binascii_rlecode_hqx(PyObject *self, PyObject *args)
unsigned
char
*
in_data
,
*
out_data
;
PyObject
*
rv
;
unsigned
char
ch
;
in
t
in
,
inend
,
len
;
Py_ssize_
t
in
,
inend
,
len
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:rlecode_hqx"
,
&
in_data
,
&
len
)
)
return
NULL
;
...
...
@@ -598,7 +599,7 @@ binascii_b2a_hqx(PyObject *self, PyObject *args)
unsigned
char
this_ch
;
unsigned
int
leftchar
=
0
;
PyObject
*
rv
;
in
t
len
;
Py_ssize_
t
len
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:b2a_hqx"
,
&
bin_data
,
&
len
)
)
return
NULL
;
...
...
@@ -636,7 +637,7 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
unsigned
char
*
in_data
,
*
out_data
;
unsigned
char
in_byte
,
in_repeat
;
PyObject
*
rv
;
in
t
in_len
,
out_len
,
out_len_left
;
Py_ssize_
t
in_len
,
out_len
,
out_len_left
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:rledecode_hqx"
,
&
in_data
,
&
in_len
)
)
return
NULL
;
...
...
@@ -732,7 +733,7 @@ binascii_crc_hqx(PyObject *self, PyObject *args)
{
unsigned
char
*
bin_data
;
unsigned
int
crc
;
in
t
len
;
Py_ssize_
t
len
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#i:crc_hqx"
,
&
bin_data
,
&
len
,
&
crc
)
)
return
NULL
;
...
...
@@ -870,7 +871,7 @@ binascii_crc32(PyObject *self, PyObject *args)
{
/* By Jim Ahlstrom; All rights transferred to CNRI */
unsigned
char
*
bin_data
;
unsigned
long
crc
=
0UL
;
/* initial value of CRC */
in
t
len
;
Py_ssize_
t
len
;
long
result
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#|l:crc32"
,
&
bin_data
,
&
len
,
&
crc
)
)
...
...
@@ -903,10 +904,10 @@ static PyObject *
binascii_hexlify
(
PyObject
*
self
,
PyObject
*
args
)
{
char
*
argbuf
;
in
t
arglen
;
Py_ssize_
t
arglen
;
PyObject
*
retval
;
char
*
retbuf
;
in
t
i
,
j
;
Py_ssize_
t
i
,
j
;
if
(
!
PyArg_ParseTuple
(
args
,
"t#:b2a_hex"
,
&
argbuf
,
&
arglen
))
return
NULL
;
...
...
@@ -960,10 +961,10 @@ static PyObject *
binascii_unhexlify
(
PyObject
*
self
,
PyObject
*
args
)
{
char
*
argbuf
;
in
t
arglen
;
Py_ssize_
t
arglen
;
PyObject
*
retval
;
char
*
retbuf
;
in
t
i
,
j
;
Py_ssize_
t
i
,
j
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:a2b_hex"
,
&
argbuf
,
&
arglen
))
return
NULL
;
...
...
@@ -1030,7 +1031,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
unsigned
int
in
,
out
;
char
ch
;
unsigned
char
*
data
,
*
odata
;
unsigned
in
t
datalen
=
0
;
Py_ssize_
t
datalen
=
0
;
PyObject
*
rv
;
static
char
*
kwlist
[]
=
{
"data"
,
"header"
,
NULL
};
int
header
=
0
;
...
...
@@ -1130,7 +1131,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
{
unsigned
int
in
,
out
;
unsigned
char
*
data
,
*
odata
;
unsigned
in
t
datalen
=
0
,
odatalen
=
0
;
Py_ssize_
t
datalen
=
0
,
odatalen
=
0
;
PyObject
*
rv
;
unsigned
int
linelen
=
0
;
static
char
*
kwlist
[]
=
{
"data"
,
"quotetabs"
,
"istext"
,
...
...
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