summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-12-04 18:51:36 (GMT)
committerGuido van Rossum <guido@python.org>1998-12-04 18:51:36 (GMT)
commitcf183acf15f7486978c2f37ad5864b50b7aafda2 (patch)
tree9fd64d356a468658c7831ab8d400d90f3dafce6d /Python/ceval.c
parentd5516bc45fdd55b920838806e59a3089ac17ca93 (diff)
downloadcpython-cf183acf15f7486978c2f37ad5864b50b7aafda2.zip
cpython-cf183acf15f7486978c2f37ad5864b50b7aafda2.tar.gz
cpython-cf183acf15f7486978c2f37ad5864b50b7aafda2.tar.bz2
Use PyInt_AS_LONG macro instead of explicit inlining.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index bcc2288..3625473 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -799,8 +799,8 @@ eval_code2(co, globals, locals,
if (PyInt_Check(v) && PyInt_Check(w)) {
/* INLINE: int + int */
register long a, b, i;
- a = ((PyIntObject*) v)->ob_ival;
- b = ((PyIntObject*) w)->ob_ival;
+ a = PyInt_AS_LONG(v);
+ b = PyInt_AS_LONG(w);
i = a + b;
if ((i^a) < 0 && (i^b) < 0) {
PyErr_SetString(PyExc_OverflowError,
@@ -824,8 +824,8 @@ eval_code2(co, globals, locals,
if (PyInt_Check(v) && PyInt_Check(w)) {
/* INLINE: int - int */
register long a, b, i;
- a = ((PyIntObject*) v)->ob_ival;
- b = ((PyIntObject*) w)->ob_ival;
+ a = PyInt_AS_LONG(v);
+ b = PyInt_AS_LONG(w);
i = a - b;
if ((i^a) < 0 && (i^~b) < 0) {
PyErr_SetString(PyExc_OverflowError,
@@ -1390,8 +1390,8 @@ eval_code2(co, globals, locals,
/* INLINE: cmp(int, int) */
register long a, b;
register int res;
- a = ((PyIntObject*) v)->ob_ival;
- b = ((PyIntObject*) w)->ob_ival;
+ a = PyInt_AS_LONG(v);
+ b = PyInt_AS_LONG(w);
switch (oparg) {
case LT: res = a < b; break;
case LE: res = a <= b; break;