[Numpy-svn] r5783 - branches/clean_math_config/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Fri Sep 5 01:47:13 CDT 2008


Author: cdavid
Date: 2008-09-05 01:47:10 -0500 (Fri, 05 Sep 2008)
New Revision: 5783

Modified:
   branches/clean_math_config/numpy/core/src/umathmodule.c.src
Log:
Remove HAVE_FLOAT_FUNCS, and use function-specific HAVE_ instead.

Modified: branches/clean_math_config/numpy/core/src/umathmodule.c.src
===================================================================
--- branches/clean_math_config/numpy/core/src/umathmodule.c.src	2008-09-05 06:34:55 UTC (rev 5782)
+++ branches/clean_math_config/numpy/core/src/umathmodule.c.src	2008-09-05 06:47:10 UTC (rev 5783)
@@ -1628,13 +1628,13 @@
 }
 /**end repeat**/
 
-#define HAVE_DOUBLE_FUNCS
 /**begin repeat
    #TYPE=FLOAT, DOUBLE, LONGDOUBLE#
    #typ=float, double, longdouble#
    #c=f,,l#
+   #C=F,,L#
 */
-#ifdef HAVE_@TYPE@_FUNCS
+#ifdef HAVE_FREXP@C@
 static void
 @TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *func)
 {
@@ -1650,7 +1650,9 @@
         *((int *) op2) = y2;
     }
 }
+#endif
 
+#ifdef HAVE_LDEXP@C@
 static void
 @TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *func)
 {
@@ -1668,47 +1670,46 @@
 }
 #endif
 /**end repeat**/
-#undef HAVE_DOUBLE_FUNCS
 
 
 static PyUFuncGenericFunction frexp_functions[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_FREXPF
     FLOAT_frexp,
 #endif
     DOUBLE_frexp
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_FREXPL
     ,LONGDOUBLE_frexp
 #endif
 };
 
 static void * blank3_data[] = { (void *)NULL, (void *)NULL, (void *)NULL};
 static char frexp_signatures[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_FREXPF
     PyArray_FLOAT, PyArray_FLOAT, PyArray_INT,
 #endif
     PyArray_DOUBLE, PyArray_DOUBLE, PyArray_INT
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_FREXPL
     ,PyArray_LONGDOUBLE, PyArray_LONGDOUBLE, PyArray_INT
 #endif
 };
 
 
 static PyUFuncGenericFunction ldexp_functions[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_LDEXPF
     FLOAT_ldexp,
 #endif
     DOUBLE_ldexp
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_LDEXPL
     ,LONGDOUBLE_ldexp
 #endif
 };
 
 static char ldexp_signatures[] = {
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_LDEXPF
     PyArray_FLOAT, PyArray_INT, PyArray_FLOAT,
 #endif
     PyArray_DOUBLE, PyArray_INT, PyArray_DOUBLE
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_LDEXPL
     ,PyArray_LONGDOUBLE, PyArray_INT, PyArray_LONGDOUBLE
 #endif
 };
@@ -1761,10 +1762,10 @@
     PyObject *f;
     int num=1;
 
-#ifdef HAVE_LONGDOUBLE_FUNCS
+#ifdef HAVE_FREXPL
     num += 1;
 #endif
-#ifdef HAVE_FLOAT_FUNCS
+#ifdef HAVE_FREXPF
     num += 1;
 #endif
     f = PyUFunc_FromFuncAndData(frexp_functions, blank3_data,
@@ -1775,6 +1776,13 @@
     PyDict_SetItemString(dictionary, "frexp", f);
     Py_DECREF(f);
 
+    num = 1;
+#ifdef HAVE_LDEXPL
+    num += 1;
+#endif
+#ifdef HAVE_LDEXPF
+    num += 1;
+#endif
     f = PyUFunc_FromFuncAndData(ldexp_functions, blank3_data, ldexp_signatures, num,
                                 2, 1, PyUFunc_None, "ldexp",
                                 "Compute y = x1 * 2**x2.",0);



More information about the Numpy-svn mailing list