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
3ba3a3ee
Kaydet (Commit)
3ba3a3ee
authored
Ara 25, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #15422: get rid of PyCFunction_New macro
üst
914ab842
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
23 deletions
+20
-23
methodobject.h
Include/methodobject.h
+1
-1
NEWS
Misc/NEWS
+3
-0
_threadmodule.c
Modules/_threadmodule.c
+1
-1
descrobject.c
Objects/descrobject.c
+4
-4
methodobject.c
Objects/methodobject.c
+6
-14
typeobject.c
Objects/typeobject.c
+2
-2
python3.def
PC/python3.def
+1
-0
python34stub.def
PC/python34stub.def
+1
-0
codecs.c
Python/codecs.c
+1
-1
No files found.
Include/methodobject.h
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -46,7 +46,7 @@ struct PyMethodDef {
};
typedef
struct
PyMethodDef
PyMethodDef
;
#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL)
PyAPI_FUNC
(
PyObject
*
)
PyCFunction_New
(
PyMethodDef
*
,
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyCFunction_NewEx
(
PyMethodDef
*
,
PyObject
*
,
PyObject
*
);
...
...
Misc/NEWS
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
-----------------
- Issue #15422: Get rid of PyCFunction_New macro. Use PyCFunction_NewEx
function (PyCFunction_New func is still present for backward compatibility).
- Issue #16672: Improve performance tracing performance
- Issue #14470: Remove w9xpopen support per PEP 11.
...
...
Modules/_threadmodule.c
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -741,7 +741,7 @@ local_new(PyTypeObject *type, PyObject *args, PyObject *kw)
wr
=
PyWeakref_NewRef
((
PyObject
*
)
self
,
NULL
);
if
(
wr
==
NULL
)
goto
err
;
self
->
wr_callback
=
PyCFunction_New
(
&
wr_callback_def
,
wr
);
self
->
wr_callback
=
PyCFunction_New
Ex
(
&
wr_callback_def
,
wr
,
NULL
);
Py_DECREF
(
wr
);
if
(
self
->
wr_callback
==
NULL
)
goto
err
;
...
...
Objects/descrobject.c
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -115,7 +115,7 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
((
PyTypeObject
*
)
type
)
->
tp_name
);
return
NULL
;
}
return
PyCFunction_New
(
descr
->
d_method
,
type
);
return
PyCFunction_New
Ex
(
descr
->
d_method
,
type
,
NULL
);
}
static
PyObject
*
...
...
@@ -125,7 +125,7 @@ method_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
if
(
descr_check
((
PyDescrObject
*
)
descr
,
obj
,
&
res
))
return
res
;
return
PyCFunction_New
(
descr
->
d_method
,
obj
);
return
PyCFunction_New
Ex
(
descr
->
d_method
,
obj
,
NULL
);
}
static
PyObject
*
...
...
@@ -239,7 +239,7 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwds)
return
NULL
;
}
func
=
PyCFunction_New
(
descr
->
d_method
,
self
);
func
=
PyCFunction_New
Ex
(
descr
->
d_method
,
self
,
NULL
);
if
(
func
==
NULL
)
return
NULL
;
args
=
PyTuple_GetSlice
(
args
,
1
,
argc
);
...
...
@@ -292,7 +292,7 @@ classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args,
return
NULL
;
}
func
=
PyCFunction_New
(
descr
->
d_method
,
self
);
func
=
PyCFunction_New
Ex
(
descr
->
d_method
,
self
,
NULL
);
if
(
func
==
NULL
)
return
NULL
;
args
=
PyTuple_GetSlice
(
args
,
1
,
argc
);
...
...
Objects/methodobject.c
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -13,6 +13,12 @@ static int numfree = 0;
#define PyCFunction_MAXFREELIST 256
#endif
PyObject
*
PyCFunction_New
(
PyMethodDef
*
ml
,
PyObject
*
self
)
{
return
PyCFunction_NewEx
(
ml
,
self
,
NULL
);
}
PyObject
*
PyCFunction_NewEx
(
PyMethodDef
*
ml
,
PyObject
*
self
,
PyObject
*
module
)
{
...
...
@@ -346,17 +352,3 @@ _PyCFunction_DebugMallocStats(FILE *out)
"free PyCFunction"
,
numfree
,
sizeof
(
PyCFunction
));
}
/* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
but it's part of the API so we need to keep a function around that
existing C extensions can call.
*/
#undef PyCFunction_New
PyAPI_FUNC
(
PyObject
*
)
PyCFunction_New
(
PyMethodDef
*
,
PyObject
*
);
PyObject
*
PyCFunction_New
(
PyMethodDef
*
ml
,
PyObject
*
self
)
{
return
PyCFunction_NewEx
(
ml
,
self
,
NULL
);
}
Objects/typeobject.c
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -3811,7 +3811,7 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
descr
=
PyDescr_NewClassMethod
(
type
,
meth
);
}
else
if
(
meth
->
ml_flags
&
METH_STATIC
)
{
PyObject
*
cfunc
=
PyCFunction_New
(
meth
,
(
PyObject
*
)
type
);
PyObject
*
cfunc
=
PyCFunction_NewEx
(
meth
,
(
PyObject
*
)
type
,
NULL
);
if
(
cfunc
==
NULL
)
return
-
1
;
descr
=
PyStaticMethod_New
(
cfunc
);
...
...
@@ -4879,7 +4879,7 @@ add_tp_new_wrapper(PyTypeObject *type)
if
(
_PyDict_GetItemId
(
type
->
tp_dict
,
&
PyId___new__
)
!=
NULL
)
return
0
;
func
=
PyCFunction_New
(
tp_new_methoddef
,
(
PyObject
*
)
type
);
func
=
PyCFunction_New
Ex
(
tp_new_methoddef
,
(
PyObject
*
)
type
,
NULL
);
if
(
func
==
NULL
)
return
-
1
;
if
(
_PyDict_SetItemId
(
type
->
tp_dict
,
&
PyId___new__
,
func
))
{
...
...
PC/python3.def
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -38,6 +38,7 @@ EXPORTS
PyCFunction_GetFlags=python34.PyCFunction_GetFlags
PyCFunction_GetFunction=python34.PyCFunction_GetFunction
PyCFunction_GetSelf=python34.PyCFunction_GetSelf
PyCFunction_New=python34.PyCFunction_New
PyCFunction_NewEx=python34.PyCFunction_NewEx
PyCFunction_Type=python34.PyCFunction_Type DATA
PyCallIter_New=python34.PyCallIter_New
...
...
PC/python34stub.def
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -37,6 +37,7 @@ PyCFunction_ClearFreeList
PyCFunction_GetFlags
PyCFunction_GetFunction
PyCFunction_GetSelf
PyCFunction_New
PyCFunction_NewEx
PyCFunction_Type
PyCallIter_New
...
...
Python/codecs.c
Dosyayı görüntüle @
3ba3a3ee
...
...
@@ -1026,7 +1026,7 @@ static int _PyCodecRegistry_Init(void)
if
(
interp
->
codec_error_registry
)
{
for
(
i
=
0
;
i
<
Py_ARRAY_LENGTH
(
methods
);
++
i
)
{
PyObject
*
func
=
PyCFunction_New
(
&
methods
[
i
].
def
,
NULL
);
PyObject
*
func
=
PyCFunction_New
Ex
(
&
methods
[
i
].
def
,
NULL
,
NULL
);
int
res
;
if
(
!
func
)
Py_FatalError
(
"can't initialize codec error registry"
);
...
...
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