diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 33d5392dffd..049b292418d 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -730,7 +730,7 @@ Tkapp_ExprDouble (self, args) return NULL; PyFPE_START_PROTECT("Tkapp_ExprDouble", return 0) retval = Tcl_ExprDouble (Tkapp_Interp (self), s, &v); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(retval) if (retval == TCL_ERROR) return Tkinter_Error(self); return Py_BuildValue("d", v); diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c index 438f010c578..4e08722bcca 100644 --- a/Modules/cmathmodule.c +++ b/Modules/cmathmodule.c @@ -249,7 +249,7 @@ math_1(args, func) errno = 0; PyFPE_START_PROTECT("complex function", return 0) x = (*func)(x); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(x) CHECK(x.real); CHECK(x.imag); if (errno != 0) diff --git a/Modules/fpetestmodule.c b/Modules/fpetestmodule.c index 475bd7e6282..b568b60eb0c 100644 --- a/Modules/fpetestmodule.c +++ b/Modules/fpetestmodule.c @@ -120,11 +120,11 @@ static double nest1(int i, double x) /* This (following) message is never seen. */ PyFPE_START_PROTECT("Division by zero, inner zone", return 3.1416) a = 1./(1. - x); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(a) }else if(i == 2){ a = 1./(2. - x); } - PyFPE_END_PROTECT + PyFPE_END_PROTECT(a) return a; } @@ -140,7 +140,7 @@ static double nest2(int i, double x) }else if(i == 2){ a = 1./(2. - x); } - PyFPE_END_PROTECT + PyFPE_END_PROTECT(a) return a; } @@ -150,7 +150,7 @@ static double nest3(double x) /* This (following) message is never seen. */ PyFPE_START_PROTECT("Division by zero, nest3 error", return 3.1416) result = 1./(1. - x); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(result) return result; } @@ -159,7 +159,7 @@ static double db0(double x) double a; PyFPE_START_PROTECT("Division by zero", return 3.1416) a = 1./x; - PyFPE_END_PROTECT + PyFPE_END_PROTECT(a) return a; } @@ -168,7 +168,7 @@ static double overflow(double b) double a; PyFPE_START_PROTECT("Overflow", return 3.1416) a = b*b; - PyFPE_END_PROTECT + PyFPE_END_PROTECT(a) return a; } diff --git a/Modules/imgfile.c b/Modules/imgfile.c index 779169d4bae..865ecab4122 100644 --- a/Modules/imgfile.c +++ b/Modules/imgfile.c @@ -390,7 +390,7 @@ PyObject *args; PyFPE_START_PROTECT("readscaled", return 0) xfac = (float)xsize/(float)xwtd; yfac = (float)ysize/(float)ywtd; - PyFPE_END_PROTECT + PyFPE_END_PROTECT(yfac) cdatap = PyString_AsString(rv); idatap = (long *)cdatap; diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index bb4f1e80bd1..0df3843ace1 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -82,7 +82,7 @@ math_1(args, func) errno = 0; PyFPE_START_PROTECT("in math_1", return 0) x = (*func)(x); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(x) CHECK(x); if (errno != 0) return math_error(); @@ -101,7 +101,7 @@ math_2(args, func) errno = 0; PyFPE_START_PROTECT("in math_2", return 0) x = (*func)(x, y); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(x) CHECK(x); if (errno != 0) return math_error(); @@ -179,7 +179,7 @@ math_ldexp(self, args) errno = 0; PyFPE_START_PROTECT("ldexp", return 0) x = ldexp(x, (int)y); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(x) CHECK(x); if (errno != 0) return math_error(); diff --git a/Modules/mpzmodule.c b/Modules/mpzmodule.c index bf83109480a..a2bcfed7b14 100644 --- a/Modules/mpzmodule.c +++ b/Modules/mpzmodule.c @@ -1497,7 +1497,7 @@ mpz_float(self) mulstate *= multiplier; mpz_div_2exp(&mpzscratch, &mpzscratch, BITS_PER_MP_LIMB); } - PyFPE_END_PROTECT + PyFPE_END_PROTECT(mulstate) assert(mpz_cmp_ui(&mpzscratch, (unsigned long int)0) == 0); mpz_clear(&mpzscratch); diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 212fd34e07e..b141f2fd481 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 e8d0d6857e0..72b68a983e4 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 e0255e94d64..8de54569436 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); } diff --git a/Python/compile.c b/Python/compile.c index 9f7d1f84019..3bdd994ea39 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -818,14 +818,14 @@ parsenumber(co, s) c.real = 0.; PyFPE_START_PROTECT("atof", return 0) c.imag = atof(s); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(c) return newcomplexobject(c); } else { #endif PyFPE_START_PROTECT("atof", return 0) dx = atof(s); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(dx) return newfloatobject(dx); } } diff --git a/Python/marshal.c b/Python/marshal.c index f4634f013b5..22d0242fed1 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -422,7 +422,7 @@ r_object(p) buf[n] = '\0'; PyFPE_START_PROTECT("atof", return 0) dx = atof(buf); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(dx) return newfloatobject(dx); } @@ -441,7 +441,7 @@ r_object(p) buf[n] = '\0'; PyFPE_START_PROTECT("atof", return 0) c.real = atof(buf); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(c) n = r_byte(p); if (r_string(buf, (int)n, p) != n) { err_setstr(EOFError, @@ -451,7 +451,7 @@ r_object(p) buf[n] = '\0'; PyFPE_START_PROTECT("atof", return 0) c.imag = atof(buf); - PyFPE_END_PROTECT + PyFPE_END_PROTECT(c) return newcomplexobject(c); } #endif diff --git a/Python/pyfpe.c b/Python/pyfpe.c index 0b38997e10f..a1de1af6f1a 100644 --- a/Python/pyfpe.c +++ b/Python/pyfpe.c @@ -12,5 +12,5 @@ #ifdef WANT_SIGFPE_HANDLER jmp_buf PyFPE_jbuf; int PyFPE_counter = 0; -double PyFPE_dummy(void){return(1.0);} +double PyFPE_dummy(){return(1.0);} #endif