Mercurial > cpython-lru_cache-weakref
diff Modules/parsermodule.c @ 44099:f324631462a2
Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Sun, 02 Dec 2007 14:31:20 +0000 |
| parents | d4f9706cb46b |
| children | 86a2679dca46 |
line wrap: on
line diff
--- a/Modules/parsermodule.c Sun Dec 02 09:40:06 2007 +0000 +++ b/Modules/parsermodule.c Sun Dec 02 14:31:20 2007 +0000 @@ -89,7 +89,7 @@ v = mkseq(1 + NCH(n) + (TYPE(n) == encoding_decl)); if (v == NULL) return (v); - w = PyInt_FromLong(TYPE(n)); + w = PyLong_FromLong(TYPE(n)); if (w == NULL) { Py_DECREF(v); return ((PyObject*) NULL); @@ -111,12 +111,12 @@ else if (ISTERMINAL(TYPE(n))) { PyObject *result = mkseq(2 + lineno + col_offset); if (result != NULL) { - (void) addelem(result, 0, PyInt_FromLong(TYPE(n))); + (void) addelem(result, 0, PyLong_FromLong(TYPE(n))); (void) addelem(result, 1, PyUnicode_FromString(STR(n))); if (lineno == 1) - (void) addelem(result, 2, PyInt_FromLong(n->n_lineno)); + (void) addelem(result, 2, PyLong_FromLong(n->n_lineno)); if (col_offset == 1) - (void) addelem(result, 3, PyInt_FromLong(n->n_col_offset)); + (void) addelem(result, 3, PyLong_FromLong(n->n_col_offset)); } return (result); } @@ -664,9 +664,9 @@ if (temp == NULL) ok = 0; else { - ok = PyInt_Check(temp); + ok = PyLong_Check(temp); if (ok) - type = PyInt_AS_LONG(temp); + type = PyLong_AS_LONG(temp); Py_DECREF(temp); } } @@ -702,8 +702,8 @@ if (len == 3) { PyObject *o = PySequence_GetItem(elem, 2); if (o != NULL) { - if (PyInt_Check(o)) - *line_num = PyInt_AS_LONG(o); + if (PyLong_Check(o)) + *line_num = PyLong_AS_LONG(o); else { PyErr_Format(parser_error, "third item in terminal node must be an" @@ -774,7 +774,7 @@ long num = -1; if (temp != NULL) - num = PyInt_AsLong(temp); + num = PyLong_AsLong(temp); Py_XDECREF(temp); if (ISTERMINAL(num)) { /*
