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
ba09633e
Kaydet (Commit)
ba09633e
authored
Tem 09, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ANSI-fication of the sources.
üst
45cfbccc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
65 deletions
+26
-65
stringobject.c
Objects/stringobject.c
+0
-0
tupleobject.c
Objects/tupleobject.c
+18
-48
xxobject.c
Objects/xxobject.c
+8
-17
No files found.
Objects/stringobject.c
Dosyayı görüntüle @
ba09633e
This diff is collapsed.
Click to expand it.
Objects/tupleobject.c
Dosyayı görüntüle @
ba09633e
...
...
@@ -33,8 +33,7 @@ int tuple_zero_allocs;
#endif
PyObject
*
PyTuple_New
(
size
)
register
int
size
;
PyTuple_New
(
register
int
size
)
{
register
int
i
;
register
PyTupleObject
*
op
;
...
...
@@ -99,8 +98,7 @@ PyTuple_New(size)
}
int
PyTuple_Size
(
op
)
register
PyObject
*
op
;
PyTuple_Size
(
register
PyObject
*
op
)
{
if
(
!
PyTuple_Check
(
op
))
{
PyErr_BadInternalCall
();
...
...
@@ -111,9 +109,7 @@ PyTuple_Size(op)
}
PyObject
*
PyTuple_GetItem
(
op
,
i
)
register
PyObject
*
op
;
register
int
i
;
PyTuple_GetItem
(
register
PyObject
*
op
,
register
int
i
)
{
if
(
!
PyTuple_Check
(
op
))
{
PyErr_BadInternalCall
();
...
...
@@ -127,10 +123,7 @@ PyTuple_GetItem(op, i)
}
int
PyTuple_SetItem
(
op
,
i
,
newitem
)
register
PyObject
*
op
;
register
int
i
;
PyObject
*
newitem
;
PyTuple_SetItem
(
register
PyObject
*
op
,
register
int
i
,
PyObject
*
newitem
)
{
register
PyObject
*
olditem
;
register
PyObject
**
p
;
...
...
@@ -155,8 +148,7 @@ PyTuple_SetItem(op, i, newitem)
/* Methods */
static
void
tupledealloc
(
op
)
register
PyTupleObject
*
op
;
tupledealloc
(
register
PyTupleObject
*
op
)
{
register
int
i
;
register
int
len
=
op
->
ob_size
;
...
...
@@ -182,10 +174,7 @@ done:
}
static
int
tupleprint
(
op
,
fp
,
flags
)
PyTupleObject
*
op
;
FILE
*
fp
;
int
flags
;
tupleprint
(
PyTupleObject
*
op
,
FILE
*
fp
,
int
flags
)
{
int
i
;
fprintf
(
fp
,
"("
);
...
...
@@ -202,8 +191,7 @@ tupleprint(op, fp, flags)
}
static
PyObject
*
tuplerepr
(
v
)
PyTupleObject
*
v
;
tuplerepr
(
PyTupleObject
*
v
)
{
PyObject
*
s
,
*
comma
;
int
i
;
...
...
@@ -222,8 +210,7 @@ tuplerepr(v)
}
static
int
tuplecompare
(
v
,
w
)
register
PyTupleObject
*
v
,
*
w
;
tuplecompare
(
register
PyTupleObject
*
v
,
register
PyTupleObject
*
w
)
{
register
int
len
=
(
v
->
ob_size
<
w
->
ob_size
)
?
v
->
ob_size
:
w
->
ob_size
;
...
...
@@ -237,8 +224,7 @@ tuplecompare(v, w)
}
static
long
tuplehash
(
v
)
PyTupleObject
*
v
;
tuplehash
(
PyTupleObject
*
v
)
{
register
long
x
,
y
;
register
int
len
=
v
->
ob_size
;
...
...
@@ -258,16 +244,13 @@ tuplehash(v)
}
static
int
tuplelength
(
a
)
PyTupleObject
*
a
;
tuplelength
(
PyTupleObject
*
a
)
{
return
a
->
ob_size
;
}
static
int
tuplecontains
(
a
,
el
)
PyTupleObject
*
a
;
PyObject
*
el
;
tuplecontains
(
PyTupleObject
*
a
,
PyObject
*
el
)
{
int
i
,
cmp
;
...
...
@@ -282,9 +265,7 @@ tuplecontains(a, el)
}
static
PyObject
*
tupleitem
(
a
,
i
)
register
PyTupleObject
*
a
;
register
int
i
;
tupleitem
(
register
PyTupleObject
*
a
,
register
int
i
)
{
if
(
i
<
0
||
i
>=
a
->
ob_size
)
{
PyErr_SetString
(
PyExc_IndexError
,
"tuple index out of range"
);
...
...
@@ -295,9 +276,7 @@ tupleitem(a, i)
}
static
PyObject
*
tupleslice
(
a
,
ilow
,
ihigh
)
register
PyTupleObject
*
a
;
register
int
ilow
,
ihigh
;
tupleslice
(
register
PyTupleObject
*
a
,
register
int
ilow
,
register
int
ihigh
)
{
register
PyTupleObject
*
np
;
register
int
i
;
...
...
@@ -324,9 +303,7 @@ tupleslice(a, ilow, ihigh)
}
PyObject
*
PyTuple_GetSlice
(
op
,
i
,
j
)
PyObject
*
op
;
int
i
,
j
;
PyTuple_GetSlice
(
PyObject
*
op
,
int
i
,
int
j
)
{
if
(
op
==
NULL
||
!
PyTuple_Check
(
op
))
{
PyErr_BadInternalCall
();
...
...
@@ -336,9 +313,7 @@ PyTuple_GetSlice(op, i, j)
}
static
PyObject
*
tupleconcat
(
a
,
bb
)
register
PyTupleObject
*
a
;
register
PyObject
*
bb
;
tupleconcat
(
register
PyTupleObject
*
a
,
register
PyObject
*
bb
)
{
register
int
size
;
register
int
i
;
...
...
@@ -370,9 +345,7 @@ tupleconcat(a, bb)
}
static
PyObject
*
tuplerepeat
(
a
,
n
)
PyTupleObject
*
a
;
int
n
;
tuplerepeat
(
PyTupleObject
*
a
,
int
n
)
{
int
i
,
j
;
int
size
;
...
...
@@ -467,10 +440,7 @@ PyTypeObject PyTuple_Type = {
front, otherwise it will grow or shrink at the end. */
int
_PyTuple_Resize
(
pv
,
newsize
,
last_is_sticky
)
PyObject
**
pv
;
int
newsize
;
int
last_is_sticky
;
_PyTuple_Resize
(
PyObject
**
pv
,
int
newsize
,
int
last_is_sticky
)
{
register
PyTupleObject
*
v
;
register
PyTupleObject
*
sv
;
...
...
@@ -582,7 +552,7 @@ _PyTuple_Resize(pv, newsize, last_is_sticky)
}
void
PyTuple_Fini
()
PyTuple_Fini
(
void
)
{
#if MAXSAVESIZE > 0
int
i
;
...
...
Objects/xxobject.c
Dosyayı görüntüle @
ba09633e
...
...
@@ -32,8 +32,7 @@ staticforward PyTypeObject Xxtype;
#define is_xxobject(v) ((v)->ob_type == &Xxtype)
static
xxobject
*
newxxobject
(
arg
)
PyObject
*
arg
;
newxxobject
(
PyObject
*
arg
)
{
xxobject
*
xp
;
xp
=
PyObject_NEW
(
xxobject
,
&
Xxtype
);
...
...
@@ -46,33 +45,28 @@ newxxobject(arg)
/* Xx methods */
static
void
xx_dealloc
(
xp
)
xxobject
*
xp
;
xx_dealloc
(
xxobject
*
xp
)
{
Py_XDECREF
(
xp
->
x_attr
);
PyObject_DEL
(
xp
);
}
static
PyObject
*
xx_demo
(
self
,
args
)
xxobject
*
self
;
PyObject
*
args
;
xx_demo
(
xxobject
*
self
,
PyObject
*
args
)
{
if
(
!
PyArg_
NoArgs
(
args
))
if
(
!
PyArg_
ParseTuple
(
args
,
":demo"
))
return
NULL
;
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyMethodDef
xx_methods
[]
=
{
{
"demo"
,
(
PyCFunction
)
xx_demo
},
{
"demo"
,
(
PyCFunction
)
xx_demo
,
METH_VARARGS
},
{
NULL
,
NULL
}
/* sentinel */
};
static
PyObject
*
xx_getattr
(
xp
,
name
)
xxobject
*
xp
;
char
*
name
;
xx_getattr
(
xxobject
*
xp
,
char
*
name
)
{
if
(
xp
->
x_attr
!=
NULL
)
{
PyObject
*
v
=
PyDict_GetItemString
(
xp
->
x_attr
,
name
);
...
...
@@ -85,10 +79,7 @@ xx_getattr(xp, name)
}
static
int
xx_setattr
(
xp
,
name
,
v
)
xxobject
*
xp
;
char
*
name
;
PyObject
*
v
;
xx_setattr
(
xxobject
*
xp
,
char
*
name
,
PyObject
*
v
)
{
if
(
xp
->
x_attr
==
NULL
)
{
xp
->
x_attr
=
PyDict_New
();
...
...
@@ -99,7 +90,7 @@ xx_setattr(xp, name, v)
int
rv
=
PyDict_DelItemString
(
xp
->
x_attr
,
name
);
if
(
rv
<
0
)
PyErr_SetString
(
PyExc_AttributeError
,
"delete non-existing xx attribute"
);
"delete non-existing xx attribute"
);
return
rv
;
}
else
...
...
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