Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4045575d
Kaydet (Commit)
4045575d
authored
Agu 15, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix more 64-bit warnings.
üst
22e41557
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
_csv.c
Modules/_csv.c
+10
-14
binascii.c
Modules/binascii.c
+1
-1
No files found.
Modules/_csv.c
Dosyayı görüntüle @
4045575d
...
@@ -6,10 +6,6 @@ This module provides the low-level underpinnings of a CSV reading/writing
...
@@ -6,10 +6,6 @@ This module provides the low-level underpinnings of a CSV reading/writing
module. Users should not use this module directly, but import the csv.py
module. Users should not use this module directly, but import the csv.py
module instead.
module instead.
**** For people modifying this code, please note that as of this writing
**** (2003-03-23), it is intended that this code should work with Python
**** 2.2.
*/
*/
#define MODULE_VERSION "1.0"
#define MODULE_VERSION "1.0"
...
@@ -73,7 +69,7 @@ typedef struct {
...
@@ -73,7 +69,7 @@ typedef struct {
PyObject
*
fields
;
/* field list for current record */
PyObject
*
fields
;
/* field list for current record */
ParserState
state
;
/* current CSV parse state */
ParserState
state
;
/* current CSV parse state */
Py_UNICODE
*
field
;
/* build current field in here */
Py_UNICODE
*
field
;
/* build current field in here */
int
field_size
;
/* size of allocated buffer */
Py_ssize_t
field_size
;
/* size of allocated buffer */
Py_ssize_t
field_len
;
/* length of current field */
Py_ssize_t
field_len
;
/* length of current field */
int
numeric_field
;
/* treat field as numeric */
int
numeric_field
;
/* treat field as numeric */
unsigned
long
line_num
;
/* Source-file line number */
unsigned
long
line_num
;
/* Source-file line number */
...
@@ -91,7 +87,7 @@ typedef struct {
...
@@ -91,7 +87,7 @@ typedef struct {
DialectObj
*
dialect
;
/* parsing dialect */
DialectObj
*
dialect
;
/* parsing dialect */
Py_UNICODE
*
rec
;
/* buffer for parser.join */
Py_UNICODE
*
rec
;
/* buffer for parser.join */
int
rec_size
;
/* size of allocated record */
Py_ssize_t
rec_size
;
/* size of allocated record */
Py_ssize_t
rec_len
;
/* length of record */
Py_ssize_t
rec_len
;
/* length of record */
int
num_fields
;
/* number of fields in record */
int
num_fields
;
/* number of fields in record */
}
WriterObj
;
}
WriterObj
;
...
@@ -533,7 +529,7 @@ parse_grow_buff(ReaderObj *self)
...
@@ -533,7 +529,7 @@ parse_grow_buff(ReaderObj *self)
self
->
field
=
PyMem_New
(
Py_UNICODE
,
self
->
field_size
);
self
->
field
=
PyMem_New
(
Py_UNICODE
,
self
->
field_size
);
}
}
else
{
else
{
if
(
self
->
field_size
>
IN
T_MAX
/
2
)
{
if
(
self
->
field_size
>
PY_SSIZE_
T_MAX
/
2
)
{
PyErr_NoMemory
();
PyErr_NoMemory
();
return
0
;
return
0
;
}
}
...
@@ -948,13 +944,13 @@ join_reset(WriterObj *self)
...
@@ -948,13 +944,13 @@ join_reset(WriterObj *self)
/* Calculate new record length or append field to record. Return new
/* Calculate new record length or append field to record. Return new
* record length.
* record length.
*/
*/
static
in
t
static
Py_ssize_
t
join_append_data
(
WriterObj
*
self
,
Py_UNICODE
*
field
,
int
quote_empty
,
join_append_data
(
WriterObj
*
self
,
Py_UNICODE
*
field
,
int
quote_empty
,
int
*
quoted
,
int
copy_phase
)
int
*
quoted
,
int
copy_phase
)
{
{
DialectObj
*
dialect
=
self
->
dialect
;
DialectObj
*
dialect
=
self
->
dialect
;
int
i
;
int
i
;
in
t
rec_len
;
Py_ssize_
t
rec_len
;
Py_UNICODE
*
lineterm
;
Py_UNICODE
*
lineterm
;
#define ADDCH(c) \
#define ADDCH(c) \
...
@@ -1040,10 +1036,10 @@ join_append_data(WriterObj *self, Py_UNICODE *field, int quote_empty,
...
@@ -1040,10 +1036,10 @@ join_append_data(WriterObj *self, Py_UNICODE *field, int quote_empty,
}
}
static
int
static
int
join_check_rec_size
(
WriterObj
*
self
,
in
t
rec_len
)
join_check_rec_size
(
WriterObj
*
self
,
Py_ssize_
t
rec_len
)
{
{
if
(
rec_len
<
0
||
rec_len
>
IN
T_MAX
-
MEM_INCR
)
{
if
(
rec_len
<
0
||
rec_len
>
PY_SSIZE_
T_MAX
-
MEM_INCR
)
{
PyErr_NoMemory
();
PyErr_NoMemory
();
return
0
;
return
0
;
}
}
...
@@ -1075,7 +1071,7 @@ join_check_rec_size(WriterObj *self, int rec_len)
...
@@ -1075,7 +1071,7 @@ join_check_rec_size(WriterObj *self, int rec_len)
static
int
static
int
join_append
(
WriterObj
*
self
,
Py_UNICODE
*
field
,
int
*
quoted
,
int
quote_empty
)
join_append
(
WriterObj
*
self
,
Py_UNICODE
*
field
,
int
*
quoted
,
int
quote_empty
)
{
{
in
t
rec_len
;
Py_ssize_
t
rec_len
;
rec_len
=
join_append_data
(
self
,
field
,
quote_empty
,
quoted
,
0
);
rec_len
=
join_append_data
(
self
,
field
,
quote_empty
,
quoted
,
0
);
if
(
rec_len
<
0
)
if
(
rec_len
<
0
)
...
@@ -1094,7 +1090,7 @@ join_append(WriterObj *self, Py_UNICODE *field, int *quoted, int quote_empty)
...
@@ -1094,7 +1090,7 @@ join_append(WriterObj *self, Py_UNICODE *field, int *quoted, int quote_empty)
static
int
static
int
join_append_lineterminator
(
WriterObj
*
self
)
join_append_lineterminator
(
WriterObj
*
self
)
{
{
in
t
terminator_len
;
Py_ssize_
t
terminator_len
;
Py_UNICODE
*
terminator
;
Py_UNICODE
*
terminator
;
terminator_len
=
PyUnicode_GetSize
(
self
->
dialect
->
lineterminator
);
terminator_len
=
PyUnicode_GetSize
(
self
->
dialect
->
lineterminator
);
...
@@ -1125,7 +1121,7 @@ static PyObject *
...
@@ -1125,7 +1121,7 @@ static PyObject *
csv_writerow
(
WriterObj
*
self
,
PyObject
*
seq
)
csv_writerow
(
WriterObj
*
self
,
PyObject
*
seq
)
{
{
DialectObj
*
dialect
=
self
->
dialect
;
DialectObj
*
dialect
=
self
->
dialect
;
in
t
len
,
i
;
Py_ssize_
t
len
,
i
;
if
(
!
PySequence_Check
(
seq
))
if
(
!
PySequence_Check
(
seq
))
return
PyErr_Format
(
error_obj
,
"sequence expected"
);
return
PyErr_Format
(
error_obj
,
"sequence expected"
);
...
...
Modules/binascii.c
Dosyayı görüntüle @
4045575d
...
@@ -664,7 +664,7 @@ binascii_rlecode_hqx(PyObject *self, PyObject *args)
...
@@ -664,7 +664,7 @@ binascii_rlecode_hqx(PyObject *self, PyObject *args)
/* More than 3 in a row. Output RLE. */
/* More than 3 in a row. Output RLE. */
*
out_data
++
=
ch
;
*
out_data
++
=
ch
;
*
out_data
++
=
RUNCHAR
;
*
out_data
++
=
RUNCHAR
;
*
out_data
++
=
(
unsigned
char
)
inend
-
in
;
*
out_data
++
=
(
unsigned
char
)
(
inend
-
in
)
;
in
=
inend
-
1
;
in
=
inend
-
1
;
}
else
{
}
else
{
/* Less than 3. Output the byte itself */
/* Less than 3. Output the byte itself */
...
...
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