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
ac5685eb
Kaydet (Commit)
ac5685eb
authored
Şub 14, 2010
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Silence some 'comparison between signed and unsigned' compiler warnings.
üst
4a670c55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
listobject.c
Objects/listobject.c
+8
-7
No files found.
Objects/listobject.c
Dosyayı görüntüle @
ac5685eb
...
@@ -126,11 +126,11 @@ PyList_New(Py_ssize_t size)
...
@@ -126,11 +126,11 @@ PyList_New(Py_ssize_t size)
PyErr_BadInternalCall
();
PyErr_BadInternalCall
();
return
NULL
;
return
NULL
;
}
}
nbytes
=
size
*
sizeof
(
PyObject
*
);
/* Check for overflow without an actual overflow,
/* Check for overflow without an actual overflow,
* which can cause compiler to optimise out */
* which can cause compiler to optimise out */
if
(
size
>
PY_SIZE_MAX
/
sizeof
(
PyObject
*
))
if
(
(
size_t
)
size
>
PY_SIZE_MAX
/
sizeof
(
PyObject
*
))
return
PyErr_NoMemory
();
return
PyErr_NoMemory
();
nbytes
=
size
*
sizeof
(
PyObject
*
);
if
(
numfree
)
{
if
(
numfree
)
{
numfree
--
;
numfree
--
;
op
=
free_list
[
numfree
];
op
=
free_list
[
numfree
];
...
@@ -1432,7 +1432,7 @@ merge_getmem(MergeState *ms, Py_ssize_t need)
...
@@ -1432,7 +1432,7 @@ merge_getmem(MergeState *ms, Py_ssize_t need)
* we don't care what's in the block.
* we don't care what's in the block.
*/
*/
merge_freemem
(
ms
);
merge_freemem
(
ms
);
if
(
need
>
PY_SSIZE_T_MAX
/
sizeof
(
PyObject
*
))
{
if
(
(
size_t
)
need
>
PY_SSIZE_T_MAX
/
sizeof
(
PyObject
*
))
{
PyErr_NoMemory
();
PyErr_NoMemory
();
return
-
1
;
return
-
1
;
}
}
...
@@ -2636,7 +2636,8 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
...
@@ -2636,7 +2636,8 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
step
=
-
step
;
step
=
-
step
;
}
}
assert
(
slicelength
<=
PY_SIZE_MAX
/
sizeof
(
PyObject
*
));
assert
((
size_t
)
slicelength
<=
PY_SIZE_MAX
/
sizeof
(
PyObject
*
));
garbage
=
(
PyObject
**
)
garbage
=
(
PyObject
**
)
PyMem_MALLOC
(
slicelength
*
sizeof
(
PyObject
*
));
PyMem_MALLOC
(
slicelength
*
sizeof
(
PyObject
*
));
...
@@ -2652,13 +2653,13 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
...
@@ -2652,13 +2653,13 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
and then tail end of the list that was not
and then tail end of the list that was not
covered by the slice */
covered by the slice */
for
(
cur
=
start
,
i
=
0
;
for
(
cur
=
start
,
i
=
0
;
cur
<
stop
;
cur
<
(
size_t
)
stop
;
cur
+=
step
,
i
++
)
{
cur
+=
step
,
i
++
)
{
Py_ssize_t
lim
=
step
-
1
;
Py_ssize_t
lim
=
step
-
1
;
garbage
[
i
]
=
PyList_GET_ITEM
(
self
,
cur
);
garbage
[
i
]
=
PyList_GET_ITEM
(
self
,
cur
);
if
(
cur
+
step
>=
Py_SIZE
(
self
))
{
if
(
cur
+
step
>=
(
size_t
)
Py_SIZE
(
self
))
{
lim
=
Py_SIZE
(
self
)
-
cur
-
1
;
lim
=
Py_SIZE
(
self
)
-
cur
-
1
;
}
}
...
@@ -2667,7 +2668,7 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
...
@@ -2667,7 +2668,7 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
lim
*
sizeof
(
PyObject
*
));
lim
*
sizeof
(
PyObject
*
));
}
}
cur
=
start
+
slicelength
*
step
;
cur
=
start
+
slicelength
*
step
;
if
(
cur
<
Py_SIZE
(
self
))
{
if
(
cur
<
(
size_t
)
Py_SIZE
(
self
))
{
memmove
(
self
->
ob_item
+
cur
-
slicelength
,
memmove
(
self
->
ob_item
+
cur
-
slicelength
,
self
->
ob_item
+
cur
,
self
->
ob_item
+
cur
,
(
Py_SIZE
(
self
)
-
cur
)
*
(
Py_SIZE
(
self
)
-
cur
)
*
...
...
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