summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-03-14 04:32:50 (GMT)
committerGuido van Rossum <guido@python.org>1997-03-14 04:32:50 (GMT)
commit45b83915f8d5974045d374c981531d9b98570df1 (patch)
treef7212bc9be87ae8c5464633e0701cbf9a2f15b15 /Objects
parent1aeb1047baa41af14e720f74f30d288417f1122e (diff)
downloadcpython-45b83915f8d5974045d374c981531d9b98570df1.zip
cpython-45b83915f8d5974045d374c981531d9b98570df1.tar.gz
cpython-45b83915f8d5974045d374c981531d9b98570df1.tar.bz2
New form of PyFPE_END_PROTECT macro.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/complexobject.c12
-rw-r--r--Objects/floatobject.c20
-rw-r--r--Objects/longobject.c2
3 files changed, 17 insertions, 17 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 212fd34..b141f2f 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -367,7 +367,7 @@ complex_add(v, w)
Py_complex result;
PyFPE_START_PROTECT("complex_add", return 0)
result = c_sum(v->cval,w->cval);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newcomplexobject(result);
}
@@ -379,7 +379,7 @@ complex_sub(v, w)
Py_complex result;
PyFPE_START_PROTECT("complex_sub", return 0)
result = c_diff(v->cval,w->cval);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newcomplexobject(result);
}
@@ -391,7 +391,7 @@ complex_mul(v, w)
Py_complex result;
PyFPE_START_PROTECT("complex_mul", return 0)
result = c_prod(v->cval,w->cval);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newcomplexobject(result);
}
@@ -404,7 +404,7 @@ complex_div(v, w)
PyFPE_START_PROTECT("complex_div", return 0)
c_error = 0;
quot = c_quot(v->cval,w->cval);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(quot)
if (c_error == 1) {
err_setstr(ZeroDivisionError, "complex division");
return NULL;
@@ -480,7 +480,7 @@ complex_pow(v, w, z)
else
p = c_pow(v->cval,exponent);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(p)
if (c_error == 2) {
err_setstr(ValueError, "0.0 to a negative or complex power");
return NULL;
@@ -514,7 +514,7 @@ complex_abs(v)
double result;
PyFPE_START_PROTECT("complex_abs", return 0)
result = hypot(v->cval.real,v->cval.imag);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newfloatobject(result);
}
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index e8d0d68..72b68a9 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -260,7 +260,7 @@ float_add(v, w)
double result;
PyFPE_START_PROTECT("add", return 0)
result = v->ob_fval + w->ob_fval;
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newfloatobject(result);
}
@@ -272,7 +272,7 @@ float_sub(v, w)
double result;
PyFPE_START_PROTECT("subtract", return 0)
result = v->ob_fval - w->ob_fval;
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newfloatobject(result);
}
@@ -285,7 +285,7 @@ float_mul(v, w)
PyFPE_START_PROTECT("multiply", return 0)
result = v->ob_fval * w->ob_fval;
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newfloatobject(result);
}
@@ -301,7 +301,7 @@ float_div(v, w)
}
PyFPE_START_PROTECT("divide", return 0)
result = v->ob_fval / w->ob_fval;
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newfloatobject(result);
}
@@ -325,7 +325,7 @@ float_rem(v, w)
mod += wx;
/* div -= 1.0; */
}
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(mod)
return newfloatobject(mod);
}
@@ -349,7 +349,7 @@ float_divmod(v, w)
mod += wx;
div -= 1.0;
}
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(div)
return mkvalue("(dd)", div, mod);
}
@@ -394,7 +394,7 @@ float_pow(v, w, z)
if (ix!=0 && z->ob_fval<0) ix+=z->ob_fval;
}
else ix=1.0;
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(ix)
return newfloatobject(ix);
}
errno = 0;
@@ -403,7 +403,7 @@ float_pow(v, w, z)
ix = powu(iv, intw);
else
ix = 1./powu(iv, -intw);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(ix)
}
else {
/* Sort out special cases here instead of relying on pow() */
@@ -423,7 +423,7 @@ float_pow(v, w, z)
errno = 0;
PyFPE_START_PROTECT("pow", return 0)
ix = pow(iv, iw);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(ix)
}
CHECK(ix);
if (errno != 0) {
@@ -438,7 +438,7 @@ float_pow(v, w, z)
((iv<0 && z->ob_fval>0) || (iv>0 && z->ob_fval<0) )) {
ix+=z->ob_fval;
}
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(ix)
}
return newfloatobject(ix);
}
diff --git a/Objects/longobject.c b/Objects/longobject.c
index e0255e9..8de5456 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -1421,7 +1421,7 @@ long_float(v)
double result;
PyFPE_START_PROTECT("long_float", return 0)
result = dgetlongvalue(v);
- PyFPE_END_PROTECT
+ PyFPE_END_PROTECT(result)
return newfloatobject(result);
}