diff options
author | Christian Heimes <christian@cheimes.de> | 2007-12-19 02:45:37 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-12-19 02:45:37 (GMT) |
commit | 90aa7646affbaee9628ca6ea6a702aec17b3b550 (patch) | |
tree | e820962e9658a92c7147b686f8aa88c7658c5949 /Python | |
parent | 99170a5dbf4cfee78b578672b6821e855f92594b (diff) | |
download | cpython-90aa7646affbaee9628ca6ea6a702aec17b3b550.zip cpython-90aa7646affbaee9628ca6ea6a702aec17b3b550.tar.gz cpython-90aa7646affbaee9628ca6ea6a702aec17b3b550.tar.bz2 |
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 2 | ||||
-rw-r--r-- | Python/bltinmodule.c | 24 | ||||
-rw-r--r-- | Python/ceval.c | 4 | ||||
-rw-r--r-- | Python/codecs.c | 2 | ||||
-rw-r--r-- | Python/marshal.c | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/Python/ast.c b/Python/ast.c index f32f587..3169de9 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3156,7 +3156,7 @@ decode_unicode(const char *s, size_t len, int rawmode, const char *encoding) return NULL; } r = PyString_AS_STRING(w); - rn = Py_Size(w); + rn = Py_SIZE(w); assert(rn % 2 == 0); for (i = 0; i < rn; i += 2) { sprintf(p, "\\u%02x%02x", diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d1e6680..3e2f2a1 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -309,16 +309,16 @@ builtin_format(PyObject *self, PyObject *args) } /* Make sure the type is initialized. float gets initialized late */ - if (Py_Type(value)->tp_dict == NULL) - if (PyType_Ready(Py_Type(value)) < 0) + if (Py_TYPE(value)->tp_dict == NULL) + if (PyType_Ready(Py_TYPE(value)) < 0) goto done; /* Find the (unbound!) __format__ method (a borrowed reference) */ - meth = _PyType_Lookup(Py_Type(value), format_str); + meth = _PyType_Lookup(Py_TYPE(value), format_str); if (meth == NULL) { PyErr_Format(PyExc_TypeError, "Type %.100s doesn't define __format__", - Py_Type(value)->tp_name); + Py_TYPE(value)->tp_name); goto done; } @@ -1433,8 +1433,8 @@ builtin_round(PyObject *self, PyObject *args, PyObject *kwds) kwlist, &number, &ndigits)) return NULL; - if (Py_Type(number)->tp_dict == NULL) { - if (PyType_Ready(Py_Type(number)) < 0) + if (Py_TYPE(number)->tp_dict == NULL) { + if (PyType_Ready(Py_TYPE(number)) < 0) return NULL; } @@ -1444,11 +1444,11 @@ builtin_round(PyObject *self, PyObject *args, PyObject *kwds) return NULL; } - round = _PyType_Lookup(Py_Type(number), round_str); + round = _PyType_Lookup(Py_TYPE(number), round_str); if (round == NULL) { PyErr_Format(PyExc_TypeError, "type %.100s doesn't define __round__ method", - Py_Type(number)->tp_name); + Py_TYPE(number)->tp_name); return NULL; } @@ -1552,8 +1552,8 @@ builtin_trunc(PyObject *self, PyObject *number) static PyObject *trunc_str = NULL; PyObject *trunc; - if (Py_Type(number)->tp_dict == NULL) { - if (PyType_Ready(Py_Type(number)) < 0) + if (Py_TYPE(number)->tp_dict == NULL) { + if (PyType_Ready(Py_TYPE(number)) < 0) return NULL; } @@ -1563,11 +1563,11 @@ builtin_trunc(PyObject *self, PyObject *number) return NULL; } - trunc = _PyType_Lookup(Py_Type(number), trunc_str); + trunc = _PyType_Lookup(Py_TYPE(number), trunc_str); if (trunc == NULL) { PyErr_Format(PyExc_TypeError, "type %.100s doesn't define __trunc__ method", - Py_Type(number)->tp_name); + Py_TYPE(number)->tp_name); return NULL; } return PyObject_CallFunction(trunc, "O", number); diff --git a/Python/ceval.c b/Python/ceval.c index 57e6cd5..778bbe0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3006,7 +3006,7 @@ unpack_iterable(PyObject *v, int argcnt, int argcntafter, PyObject **sp) *--sp = PyList_GET_ITEM(l, ll - j); } /* Resize the list. */ - Py_Size(l) = ll - argcntafter; + Py_SIZE(l) = ll - argcntafter; Py_DECREF(it); return 1; @@ -3496,7 +3496,7 @@ fast_function(PyObject *func, PyObject ***pp_stack, int n, int na, int nk) } if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_Size(argdefs); + nd = Py_SIZE(argdefs); } return PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, (*pp_stack)-n, na, diff --git a/Python/codecs.c b/Python/codecs.c index c8926fc..5a0e488 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -354,7 +354,7 @@ PyObject *PyCodec_Encode(PyObject *object, v = NULL; goto onError; } - v = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_Size(v)); + v = PyString_FromStringAndSize(PyBytes_AS_STRING(v), Py_SIZE(v)); } else if (PyString_Check(v)) Py_INCREF(v); diff --git a/Python/marshal.c b/Python/marshal.c index c06ef8b..4ea43da 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -153,7 +153,7 @@ w_object(PyObject *v, WFILE *p) PyLongObject *ob = (PyLongObject *)v; PyErr_Clear(); w_byte(TYPE_LONG, p); - n = Py_Size(ob); + n = Py_SIZE(ob); w_long((long)n, p); if (n < 0) n = -n; @@ -557,7 +557,7 @@ r_object(RFILE *p) retval = NULL; break; } - Py_Size(ob) = n; + Py_SIZE(ob) = n; for (i = 0; i < size; i++) { int digit = r_short(p); if (digit < 0) { |