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
6c433a91
Kaydet (Commit)
6c433a91
authored
May 26, 2006
tarafından
Jack Diederich
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use Py_ssize_t in places that may need it
üst
984b9713
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
itertoolsmodule.c
Modules/itertoolsmodule.c
+25
-25
No files found.
Modules/itertoolsmodule.c
Dosyayı görüntüle @
6c433a91
...
@@ -1093,10 +1093,10 @@ static PyTypeObject takewhile_type = {
...
@@ -1093,10 +1093,10 @@ static PyTypeObject takewhile_type = {
typedef
struct
{
typedef
struct
{
PyObject_HEAD
PyObject_HEAD
PyObject
*
it
;
PyObject
*
it
;
long
next
;
Py_ssize_t
next
;
long
stop
;
Py_ssize_t
stop
;
long
step
;
Py_ssize_t
step
;
long
cnt
;
Py_ssize_t
cnt
;
}
isliceobject
;
}
isliceobject
;
static
PyTypeObject
islice_type
;
static
PyTypeObject
islice_type
;
...
@@ -1105,7 +1105,7 @@ static PyObject *
...
@@ -1105,7 +1105,7 @@ static PyObject *
islice_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
)
islice_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
)
{
{
PyObject
*
seq
;
PyObject
*
seq
;
long
start
=
0
,
stop
=-
1
,
step
=
1
;
Py_ssize_t
start
=
0
,
stop
=-
1
,
step
=
1
;
PyObject
*
it
,
*
a1
=
NULL
,
*
a2
=
NULL
,
*
a3
=
NULL
;
PyObject
*
it
,
*
a1
=
NULL
,
*
a2
=
NULL
,
*
a3
=
NULL
;
Py_ssize_t
numargs
;
Py_ssize_t
numargs
;
isliceobject
*
lz
;
isliceobject
*
lz
;
...
@@ -1119,7 +1119,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -1119,7 +1119,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
numargs
=
PyTuple_Size
(
args
);
numargs
=
PyTuple_Size
(
args
);
if
(
numargs
==
2
)
{
if
(
numargs
==
2
)
{
if
(
a1
!=
Py_None
)
{
if
(
a1
!=
Py_None
)
{
stop
=
PyInt_As
Long
(
a1
);
stop
=
PyInt_As
Ssize_t
(
a1
);
if
(
stop
==
-
1
)
{
if
(
stop
==
-
1
)
{
if
(
PyErr_Occurred
())
if
(
PyErr_Occurred
())
PyErr_Clear
();
PyErr_Clear
();
...
@@ -1130,11 +1130,11 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -1130,11 +1130,11 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
}
}
else
{
}
else
{
if
(
a1
!=
Py_None
)
if
(
a1
!=
Py_None
)
start
=
PyInt_As
Long
(
a1
);
start
=
PyInt_As
Ssize_t
(
a1
);
if
(
start
==
-
1
&&
PyErr_Occurred
())
if
(
start
==
-
1
&&
PyErr_Occurred
())
PyErr_Clear
();
PyErr_Clear
();
if
(
a2
!=
Py_None
)
{
if
(
a2
!=
Py_None
)
{
stop
=
PyInt_As
Long
(
a2
);
stop
=
PyInt_As
Ssize_t
(
a2
);
if
(
stop
==
-
1
)
{
if
(
stop
==
-
1
)
{
if
(
PyErr_Occurred
())
if
(
PyErr_Occurred
())
PyErr_Clear
();
PyErr_Clear
();
...
@@ -1152,7 +1152,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -1152,7 +1152,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if
(
a3
!=
NULL
)
{
if
(
a3
!=
NULL
)
{
if
(
a3
!=
Py_None
)
if
(
a3
!=
Py_None
)
step
=
PyInt_As
Long
(
a3
);
step
=
PyInt_As
Ssize_t
(
a3
);
if
(
step
==
-
1
&&
PyErr_Occurred
())
if
(
step
==
-
1
&&
PyErr_Occurred
())
PyErr_Clear
();
PyErr_Clear
();
}
}
...
@@ -1202,7 +1202,7 @@ islice_next(isliceobject *lz)
...
@@ -1202,7 +1202,7 @@ islice_next(isliceobject *lz)
{
{
PyObject
*
item
;
PyObject
*
item
;
PyObject
*
it
=
lz
->
it
;
PyObject
*
it
=
lz
->
it
;
long
oldnext
;
Py_ssize_t
oldnext
;
PyObject
*
(
*
iternext
)(
PyObject
*
);
PyObject
*
(
*
iternext
)(
PyObject
*
);
assert
(
PyIter_Check
(
it
));
assert
(
PyIter_Check
(
it
));
...
@@ -1600,8 +1600,8 @@ static PyTypeObject imap_type = {
...
@@ -1600,8 +1600,8 @@ static PyTypeObject imap_type = {
typedef
struct
{
typedef
struct
{
PyObject_HEAD
PyObject_HEAD
Py_ssize_t
tuplesize
;
Py_ssize_t
tuplesize
;
long
iternum
;
/* which iterator is active */
Py_ssize_t
iternum
;
/* which iterator is active */
PyObject
*
ittuple
;
/* tuple of iterators */
PyObject
*
ittuple
;
/* tuple of iterators */
}
chainobject
;
}
chainobject
;
...
@@ -1612,7 +1612,7 @@ chain_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -1612,7 +1612,7 @@ chain_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
{
chainobject
*
lz
;
chainobject
*
lz
;
Py_ssize_t
tuplesize
=
PySequence_Length
(
args
);
Py_ssize_t
tuplesize
=
PySequence_Length
(
args
);
in
t
i
;
Py_ssize_
t
i
;
PyObject
*
ittuple
;
PyObject
*
ittuple
;
if
(
!
_PyArg_NoKeywords
(
"chain()"
,
kwds
))
if
(
!
_PyArg_NoKeywords
(
"chain()"
,
kwds
))
...
@@ -2033,7 +2033,7 @@ static PyTypeObject ifilterfalse_type = {
...
@@ -2033,7 +2033,7 @@ static PyTypeObject ifilterfalse_type = {
typedef
struct
{
typedef
struct
{
PyObject_HEAD
PyObject_HEAD
long
cnt
;
Py_ssize_t
cnt
;
}
countobject
;
}
countobject
;
static
PyTypeObject
count_type
;
static
PyTypeObject
count_type
;
...
@@ -2042,12 +2042,12 @@ static PyObject *
...
@@ -2042,12 +2042,12 @@ static PyObject *
count_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
)
count_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
)
{
{
countobject
*
lz
;
countobject
*
lz
;
long
cnt
=
0
;
Py_ssize_t
cnt
=
0
;
if
(
!
_PyArg_NoKeywords
(
"count()"
,
kwds
))
if
(
!
_PyArg_NoKeywords
(
"count()"
,
kwds
))
return
NULL
;
return
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
"|
l
:count"
,
&
cnt
))
if
(
!
PyArg_ParseTuple
(
args
,
"|
n
:count"
,
&
cnt
))
return
NULL
;
return
NULL
;
/* create countobject structure */
/* create countobject structure */
...
@@ -2062,13 +2062,13 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -2062,13 +2062,13 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static
PyObject
*
static
PyObject
*
count_next
(
countobject
*
lz
)
count_next
(
countobject
*
lz
)
{
{
return
PyInt_From
Long
(
lz
->
cnt
++
);
return
PyInt_From
Size_t
(
lz
->
cnt
++
);
}
}
static
PyObject
*
static
PyObject
*
count_repr
(
countobject
*
lz
)
count_repr
(
countobject
*
lz
)
{
{
return
PyString_FromFormat
(
"count(%
l
d)"
,
lz
->
cnt
);
return
PyString_FromFormat
(
"count(%
z
d)"
,
lz
->
cnt
);
}
}
PyDoc_STRVAR
(
count_doc
,
PyDoc_STRVAR
(
count_doc
,
...
@@ -2138,7 +2138,7 @@ static PyObject *
...
@@ -2138,7 +2138,7 @@ static PyObject *
izip_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
)
izip_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
)
{
{
izipobject
*
lz
;
izipobject
*
lz
;
in
t
i
;
Py_ssize_
t
i
;
PyObject
*
ittuple
;
/* tuple of iterators */
PyObject
*
ittuple
;
/* tuple of iterators */
PyObject
*
result
;
PyObject
*
result
;
Py_ssize_t
tuplesize
=
PySequence_Length
(
args
);
Py_ssize_t
tuplesize
=
PySequence_Length
(
args
);
...
@@ -2212,7 +2212,7 @@ izip_traverse(izipobject *lz, visitproc visit, void *arg)
...
@@ -2212,7 +2212,7 @@ izip_traverse(izipobject *lz, visitproc visit, void *arg)
static
PyObject
*
static
PyObject
*
izip_next
(
izipobject
*
lz
)
izip_next
(
izipobject
*
lz
)
{
{
in
t
i
;
Py_ssize_
t
i
;
Py_ssize_t
tuplesize
=
lz
->
tuplesize
;
Py_ssize_t
tuplesize
=
lz
->
tuplesize
;
PyObject
*
result
=
lz
->
result
;
PyObject
*
result
=
lz
->
result
;
PyObject
*
it
;
PyObject
*
it
;
...
@@ -2314,7 +2314,7 @@ static PyTypeObject izip_type = {
...
@@ -2314,7 +2314,7 @@ static PyTypeObject izip_type = {
typedef
struct
{
typedef
struct
{
PyObject_HEAD
PyObject_HEAD
PyObject
*
element
;
PyObject
*
element
;
long
cnt
;
Py_ssize_t
cnt
;
}
repeatobject
;
}
repeatobject
;
static
PyTypeObject
repeat_type
;
static
PyTypeObject
repeat_type
;
...
@@ -2324,12 +2324,12 @@ repeat_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -2324,12 +2324,12 @@ repeat_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
{
repeatobject
*
ro
;
repeatobject
*
ro
;
PyObject
*
element
;
PyObject
*
element
;
long
cnt
=
-
1
;
Py_ssize_t
cnt
=
-
1
;
if
(
!
_PyArg_NoKeywords
(
"repeat()"
,
kwds
))
if
(
!
_PyArg_NoKeywords
(
"repeat()"
,
kwds
))
return
NULL
;
return
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|
l
:repeat"
,
&
element
,
&
cnt
))
if
(
!
PyArg_ParseTuple
(
args
,
"O|
n
:repeat"
,
&
element
,
&
cnt
))
return
NULL
;
return
NULL
;
if
(
PyTuple_Size
(
args
)
==
2
&&
cnt
<
0
)
if
(
PyTuple_Size
(
args
)
==
2
&&
cnt
<
0
)
...
@@ -2383,7 +2383,7 @@ repeat_repr(repeatobject *ro)
...
@@ -2383,7 +2383,7 @@ repeat_repr(repeatobject *ro)
result
=
PyString_FromFormat
(
"repeat(%s)"
,
result
=
PyString_FromFormat
(
"repeat(%s)"
,
PyString_AS_STRING
(
objrepr
));
PyString_AS_STRING
(
objrepr
));
else
else
result
=
PyString_FromFormat
(
"repeat(%s, %
l
d)"
,
result
=
PyString_FromFormat
(
"repeat(%s, %
z
d)"
,
PyString_AS_STRING
(
objrepr
),
ro
->
cnt
);
PyString_AS_STRING
(
objrepr
),
ro
->
cnt
);
Py_DECREF
(
objrepr
);
Py_DECREF
(
objrepr
);
return
result
;
return
result
;
...
@@ -2396,7 +2396,7 @@ repeat_len(repeatobject *ro)
...
@@ -2396,7 +2396,7 @@ repeat_len(repeatobject *ro)
PyErr_SetString
(
PyExc_TypeError
,
"len() of unsized object"
);
PyErr_SetString
(
PyExc_TypeError
,
"len() of unsized object"
);
return
NULL
;
return
NULL
;
}
}
return
PyInt_From
Long
(
ro
->
cnt
);
return
PyInt_From
Size_t
(
ro
->
cnt
);
}
}
PyDoc_STRVAR
(
length_hint_doc
,
"Private method returning an estimate of len(list(it))."
);
PyDoc_STRVAR
(
length_hint_doc
,
"Private method returning an estimate of len(list(it))."
);
...
...
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