diff Modules/mathmodule.c @ 4780:abef5006f84b legacy-trunk

Removed references to getdoublearg and get2doublearg rename macros and substituted the appropriate PyArg_Parse calls. Retested. All appears well.
author Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
date Wed, 18 Dec 1996 21:59:01 +0000
parents 9604d6784675
children a48f3678f9e1
line wrap: on
line diff
--- a/Modules/mathmodule.c	Wed Dec 18 20:07:39 1996 +0000
+++ b/Modules/mathmodule.c	Wed Dec 18 21:59:01 1996 +0000
@@ -33,9 +33,6 @@
 
 #include "Python.h"
 
-#define getdoublearg(v, a) PyArg_Parse(v, "d", a)
-#define get2doublearg(v, a, b) PyArg_Parse(v, "(dd)", a, b)
-
 #include "mymath.h"
 
 #ifndef _MSC_VER
@@ -80,7 +77,7 @@
 	double (*func) Py_FPROTO((double));
 {
 	double x;
-	if (!getdoublearg(args, &x))
+	if (!  PyArg_Parse(args, "d", &x))
 		return NULL;
 	errno = 0;
 	x = (*func)(x);
@@ -97,7 +94,7 @@
 	double (*func) Py_FPROTO((double, double));
 {
 	double x, y;
-	if (!get2doublearg(args, &x, &y))
+	if (! PyArg_Parse(args, "(dd)", &x, &y))
 		return NULL;
 	errno = 0;
 	x = (*func)(x, y);
@@ -156,7 +153,7 @@
 {
 	double x;
 	int i;
-	if (!getdoublearg(args, &x))
+	if (! PyArg_Parse(args, "d", &x))
 		return NULL;
 	errno = 0;
 	x = frexp(x, &i);
@@ -173,7 +170,7 @@
 {
 	double x, y;
 	/* Cheat -- allow float as second argument */
-	if (!get2doublearg(args, &x, &y))
+        if (! PyArg_Parse(args, "(dd)", &x, &y))
 		return NULL;
 	errno = 0;
 	x = ldexp(x, (int)y);
@@ -190,7 +187,7 @@
 	PyObject *args;
 {
 	double x, y;
-	if (!getdoublearg(args, &x))
+	if (! PyArg_Parse(args, "d", &x))
 		return NULL;
 	errno = 0;
 #ifdef MPW /* MPW C modf expects pointer to extended as second argument */