#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and… · techplayer/cpython@90aa764 · GitHub
Skip to content

Commit 90aa764

Browse files
committed
python#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
1 parent 99170a5 commit 90aa764

144 files changed

Lines changed: 1306 additions & 1153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/whatsnew/2.6.rst

Lines changed: 157 additions & 4 deletions

Include/abstract.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
10701070
*/
10711071

10721072
#define PySequence_ITEM(o, i)\
1073-
( Py_Type(o)->tp_as_sequence->sq_item(o, i) )
1073+
( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
10741074
/* Assume tp_as_sequence and sq_item exist and that i does not
10751075
need to be corrected for a negative index
10761076
*/

Include/boolobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern "C" {
99

1010
PyAPI_DATA(PyTypeObject) PyBool_Type;
1111

12-
#define PyBool_Check(x) (Py_Type(x) == &PyBool_Type)
12+
#define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type)
1313

1414
/* Py_False and Py_True are the only two bools in existence.
1515
Don't forget to apply Py_INCREF() when returning either!!! */

Include/bytesobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PyAPI_DATA(PyTypeObject) PyBytesIter_Type;
3333

3434
/* Type check macros */
3535
#define PyBytes_Check(self) PyObject_TypeCheck(self, &PyBytes_Type)
36-
#define PyBytes_CheckExact(self) (Py_Type(self) == &PyBytes_Type)
36+
#define PyBytes_CheckExact(self) (Py_TYPE(self) == &PyBytes_Type)
3737

3838
/* Direct API functions */
3939
PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);
@@ -45,7 +45,7 @@ PyAPI_FUNC(int) PyBytes_Resize(PyObject *, Py_ssize_t);
4545

4646
/* Macros, trading safety for speed */
4747
#define PyBytes_AS_STRING(self) (assert(PyBytes_Check(self)),((PyBytesObject *)(self))->ob_bytes)
48-
#define PyBytes_GET_SIZE(self) (assert(PyBytes_Check(self)),Py_Size(self))
48+
#define PyBytes_GET_SIZE(self) (assert(PyBytes_Check(self)),Py_SIZE(self))
4949

5050
#ifdef __cplusplus
5151
}

Include/cStringIO.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ static struct PycStringIO_CAPI {
6060

6161
/* These can be used to test if you have one */
6262
#define PycStringIO_InputCheck(O) \
63-
(Py_Type(O)==PycStringIO->InputType)
63+
(Py_TYPE(O)==PycStringIO->InputType)
6464
#define PycStringIO_OutputCheck(O) \
65-
(Py_Type(O)==PycStringIO->OutputType)
65+
(Py_TYPE(O)==PycStringIO->OutputType)
6666

6767
#ifdef __cplusplus
6868
}

Include/cellobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ typedef struct {
1313

1414
PyAPI_DATA(PyTypeObject) PyCell_Type;
1515

16-
#define PyCell_Check(op) (Py_Type(op) == &PyCell_Type)
16+
#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type)
1717

1818
PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
1919
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);

Include/cobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extern "C" {
1616

1717
PyAPI_DATA(PyTypeObject) PyCObject_Type;
1818

19-
#define PyCObject_Check(op) (Py_Type(op) == &PyCObject_Type)
19+
#define PyCObject_Check(op) (Py_TYPE(op) == &PyCObject_Type)
2020

2121
/* Create a PyCObject from a pointer to a C object and an optional
2222
destructor function. If the second argument is non-null, then it

Include/code.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct {
5959

6060
PyAPI_DATA(PyTypeObject) PyCode_Type;
6161

62-
#define PyCode_Check(op) (Py_Type(op) == &PyCode_Type)
62+
#define PyCode_Check(op) (Py_TYPE(op) == &PyCode_Type)
6363
#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
6464

6565
/* Public interface */
@@ -72,7 +72,7 @@ PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
7272

7373
/* for internal use only */
7474
#define _PyCode_GETCODEPTR(co, pp) \
75-
((*Py_Type((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \
75+
((*Py_TYPE((co)->co_code)->tp_as_buffer->bf_getreadbuffer) \
7676
((co)->co_code, 0, (void **)(pp)))
7777

7878
typedef struct _addr_pair {

Include/complexobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef struct {
4343
PyAPI_DATA(PyTypeObject) PyComplex_Type;
4444

4545
#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
46-
#define PyComplex_CheckExact(op) (Py_Type(op) == &PyComplex_Type)
46+
#define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type)
4747

4848
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
4949
PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);

Include/datetime.h

Lines changed: 10 additions & 10 deletions

0 commit comments

Comments
 (0)