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
0f2783cb
Kaydet (Commit)
0f2783cb
authored
Haz 19, 2006
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use Py_ssize_t
üst
ccff7852
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
setobject.h
Include/setobject.h
+3
-3
setobject.c
Objects/setobject.c
+22
-22
No files found.
Include/setobject.h
Dosyayı görüntüle @
0f2783cb
...
...
@@ -35,14 +35,14 @@ typedef struct _setobject PySetObject;
struct
_setobject
{
PyObject_HEAD
in
t
fill
;
/* # Active + # Dummy */
in
t
used
;
/* # Active */
Py_ssize_
t
fill
;
/* # Active + # Dummy */
Py_ssize_
t
used
;
/* # Active */
/* The table contains mask + 1 slots, and that's a power of 2.
* We store the mask instead of the size because the mask is more
* frequently needed.
*/
in
t
mask
;
Py_ssize_
t
mask
;
/* table points to smalltable for small tables, else to
* additional malloc'ed memory. table is never NULL! This rule
...
...
Objects/setobject.c
Dosyayı görüntüle @
0f2783cb
...
...
@@ -62,7 +62,7 @@ set_lookkey(PySetObject *so, PyObject *key, register long hash)
register
Py_ssize_t
i
;
register
size_t
perturb
;
register
setentry
*
freeslot
;
register
unsigned
in
t
mask
=
so
->
mask
;
register
size_
t
mask
=
so
->
mask
;
setentry
*
table
=
so
->
table
;
register
setentry
*
entry
;
register
int
cmp
;
...
...
@@ -140,7 +140,7 @@ set_lookkey_string(PySetObject *so, PyObject *key, register long hash)
register
Py_ssize_t
i
;
register
size_t
perturb
;
register
setentry
*
freeslot
;
register
unsigned
in
t
mask
=
so
->
mask
;
register
size_
t
mask
=
so
->
mask
;
setentry
*
table
=
so
->
table
;
register
setentry
*
entry
;
...
...
@@ -221,11 +221,11 @@ keys again. When entries have been deleted, the new table may
actually be smaller than the old one.
*/
static
int
set_table_resize
(
PySetObject
*
so
,
in
t
minused
)
set_table_resize
(
PySetObject
*
so
,
Py_ssize_
t
minused
)
{
in
t
newsize
;
Py_ssize_
t
newsize
;
setentry
*
oldtable
,
*
newtable
,
*
entry
;
in
t
i
;
Py_ssize_
t
i
;
int
is_oldtable_malloced
;
setentry
small_copy
[
PySet_MINSIZE
];
...
...
@@ -314,7 +314,7 @@ set_table_resize(PySetObject *so, int minused)
static
int
set_add_entry
(
register
PySetObject
*
so
,
setentry
*
entry
)
{
register
in
t
n_used
;
register
Py_ssize_
t
n_used
;
assert
(
so
->
fill
<=
so
->
mask
);
/* at least one empty slot */
n_used
=
so
->
used
;
...
...
@@ -330,7 +330,7 @@ static int
set_add_key
(
register
PySetObject
*
so
,
PyObject
*
key
)
{
register
long
hash
;
register
in
t
n_used
;
register
Py_ssize_
t
n_used
;
if
(
!
PyString_CheckExact
(
key
)
||
(
hash
=
((
PyStringObject
*
)
key
)
->
ob_shash
)
==
-
1
)
{
...
...
@@ -403,10 +403,10 @@ set_clear_internal(PySetObject *so)
{
setentry
*
entry
,
*
table
;
int
table_is_malloced
;
in
t
fill
;
Py_ssize_
t
fill
;
setentry
small_copy
[
PySet_MINSIZE
];
#ifdef Py_DEBUG
in
t
i
,
n
;
Py_ssize_
t
i
,
n
;
assert
(
PyAnySet_Check
(
so
));
n
=
so
->
mask
+
1
;
...
...
@@ -465,7 +465,7 @@ set_clear_internal(PySetObject *so)
/*
* Iterate over a set table. Use like so:
*
*
in
t pos;
*
Py_ssize_
t pos;
* setentry *entry;
* pos = 0; # important! pos should not otherwise be changed by you
* while (set_next(yourset, &pos, &entry)) {
...
...
@@ -479,7 +479,7 @@ static int
set_next
(
PySetObject
*
so
,
Py_ssize_t
*
pos_ptr
,
setentry
**
entry_ptr
)
{
Py_ssize_t
i
;
in
t
mask
;
Py_ssize_
t
mask
;
register
setentry
*
table
;
assert
(
PyAnySet_Check
(
so
));
...
...
@@ -501,7 +501,7 @@ static void
set_dealloc
(
PySetObject
*
so
)
{
register
setentry
*
entry
;
in
t
fill
=
so
->
fill
;
Py_ssize_
t
fill
=
so
->
fill
;
PyObject_GC_UnTrack
(
so
);
Py_TRASHCAN_SAFE_BEGIN
(
so
)
if
(
so
->
weakreflist
!=
NULL
)
...
...
@@ -570,7 +570,7 @@ static int
set_merge
(
PySetObject
*
so
,
PyObject
*
otherset
)
{
PySetObject
*
other
;
register
in
t
i
;
register
Py_ssize_
t
i
;
register
setentry
*
entry
;
assert
(
PyAnySet_Check
(
so
));
...
...
@@ -637,7 +637,7 @@ set_contains_entry(PySetObject *so, setentry *entry)
static
PyObject
*
set_pop
(
PySetObject
*
so
)
{
register
in
t
i
=
0
;
register
Py_ssize_
t
i
=
0
;
register
setentry
*
entry
;
PyObject
*
key
;
...
...
@@ -655,7 +655,7 @@ set_pop(PySetObject *so)
*/
entry
=
&
so
->
table
[
0
];
if
(
entry
->
key
==
NULL
||
entry
->
key
==
dummy
)
{
i
=
(
int
)
entry
->
hash
;
i
=
entry
->
hash
;
/* The hash field may be a real hash value, or it may be a
* legit search finger, or it may be a once-legit search
* finger that's out of bounds now because it wrapped around
...
...
@@ -730,9 +730,9 @@ set_nohash(PyObject *self)
typedef
struct
{
PyObject_HEAD
PySetObject
*
si_set
;
/* Set to NULL when iterator is exhausted */
in
t
si_used
;
in
t
si_pos
;
long
len
;
Py_ssize_
t
si_used
;
Py_ssize_
t
si_pos
;
Py_ssize_t
len
;
}
setiterobject
;
static
void
...
...
@@ -745,7 +745,7 @@ setiter_dealloc(setiterobject *si)
static
PyObject
*
setiter_len
(
setiterobject
*
si
)
{
long
len
=
0
;
Py_ssize_t
len
=
0
;
if
(
si
->
si_set
!=
NULL
&&
si
->
si_used
==
si
->
si_set
->
used
)
len
=
si
->
len
;
return
PyInt_FromLong
(
len
);
...
...
@@ -761,7 +761,7 @@ static PyMethodDef setiter_methods[] = {
static
PyObject
*
setiter_iternext
(
setiterobject
*
si
)
{
PyObject
*
key
;
register
in
t
i
,
mask
;
register
Py_ssize_
t
i
,
mask
;
register
setentry
*
entry
;
PySetObject
*
so
=
si
->
si_set
;
...
...
@@ -1007,7 +1007,7 @@ set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static
void
set_swap_bodies
(
PySetObject
*
a
,
PySetObject
*
b
)
{
in
t
t
;
Py_ssize_
t
t
;
setentry
*
u
;
setentry
*
(
*
f
)(
PySetObject
*
so
,
PyObject
*
key
,
long
hash
);
setentry
tab
[
PySet_MINSIZE
];
...
...
@@ -2064,7 +2064,7 @@ _PySet_Update(PyObject *set, PyObject *iterable)
static
PyObject
*
test_c_api
(
PySetObject
*
so
)
{
in
t
count
;
Py_ssize_
t
count
;
char
*
s
;
Py_ssize_t
i
;
PyObject
*
elem
,
*
dup
,
*
t
,
*
f
,
*
dup2
;
...
...
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