[Python-checkins] r64439 - python/trunk/Objects/floatobject.c

hyeshik.chang python-checkins at python.org
Sat Jun 21 13:15:30 CEST 2008


Author: hyeshik.chang
Date: Sat Jun 21 13:15:30 2008
New Revision: 64439

Log:
Fix build on FreeBSD gcc.


Modified:
   python/trunk/Objects/floatobject.c

Modified: python/trunk/Objects/floatobject.c
==============================================================================
--- python/trunk/Objects/floatobject.c	(original)
+++ python/trunk/Objects/floatobject.c	Sat Jun 21 13:15:30 2008
@@ -405,11 +405,11 @@
    obj is not of float, int or long type, Py_NotImplemented is incref'ed,
    stored in obj, and returned from the function invoking this macro.
 */
-#define CONVERT_TO_DOUBLE(obj, dbl)			\
-	if (PyFloat_Check(obj))				\
-		dbl = PyFloat_AS_DOUBLE(obj);		\
-	else if (convert_to_double(&(obj), &(dbl)) < 0)	\
-		return obj;
+#define CONVERT_TO_DOUBLE(obj, dbl)					\
+	if (PyFloat_Check(obj))						\
+		dbl = PyFloat_AS_DOUBLE(obj);				\
+	else if (convert_to_double((PyObject **)&(obj), &(dbl)) < 0)	\
+		return (PyObject *)(obj);
 
 static int
 convert_to_double(PyObject **v, double *dbl)
@@ -1212,7 +1212,7 @@
 	int i, exp, n;
 	char *conv_str;
 
-	CONVERT_TO_DOUBLE(((PyObject *)v), x);
+	CONVERT_TO_DOUBLE(v, x);
 	if (!Py_IS_FINITE(x))
 		return PyObject_Repr((PyObject *)v);
 	fr = frexp(x, &exp);


More information about the Python-checkins mailing list