[Numpy-svn] r5393 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sat Jul 12 00:17:46 CDT 2008


Author: charris
Date: 2008-07-12 00:17:43 -0500 (Sat, 12 Jul 2008)
New Revision: 5393

Modified:
   trunk/numpy/core/src/scalartypes.inc.src
Log:
Small cleanups.


Modified: trunk/numpy/core/src/scalartypes.inc.src
===================================================================
--- trunk/numpy/core/src/scalartypes.inc.src	2008-07-12 05:14:39 UTC (rev 5392)
+++ trunk/numpy/core/src/scalartypes.inc.src	2008-07-12 05:17:43 UTC (rev 5393)
@@ -551,11 +551,10 @@
     return ret;
 }
 /**begin repeat
-
-#name=float, double, longdouble#
-#NAME=FLOAT, DOUBLE, LONGDOUBLE#
-#PREFIX=NPY_,NPY_,NPY_#
-*/
+ * #name=float, double, longdouble#
+ * #NAME=FLOAT, DOUBLE, LONGDOUBLE#
+ * #PREFIX=NPY_,NPY_,NPY_#
+ */
 static void
 format_@name@(char *buf, size_t buflen, @name@ val,
                   unsigned int precision)
@@ -640,8 +639,9 @@
 @name@type_@kind@(PyObject *self)
 {
     static char buf[100];
-    format_@name@(buf, sizeof(buf),
-            ((Py@Name@ScalarObject *)self)->obval, @NAME@PREC_@KIND@);
+    @name@ x = ((Py@Name@ScalarObject *)self)->obval;
+
+    format_@name@(buf, sizeof(buf), x, @NAME@PREC_@KIND@);
     return PyString_FromString(buf);
 }
 
@@ -651,11 +651,10 @@
     static char buf1[100];
     static char buf2[100];
     static char buf3[202];
-    c@name@ x;
-    x = ((PyC@Name@ScalarObject *)self)->obval;
+    c@name@ x = ((PyC@Name@ScalarObject *)self)->obval;
+
     format_@name@(buf1, sizeof(buf1), x.real, @NAME@PREC_@KIND@);
     format_@name@(buf2, sizeof(buf2), x.imag, @NAME@PREC_@KIND@);
-
     snprintf(buf3, sizeof(buf3), "(%s+%sj)", buf1, buf2);
     return PyString_FromString(buf3);
 }
@@ -2696,8 +2695,8 @@
     PyCLongDoubleArrType_Type.tp_as_number = &clongdoubletype_as_number;
 
     /**begin repeat
-#name=int, long, hex, oct, float, repr, str#
-#kind=tp_as_number->nb*5, tp*2#
+     * #name=int, long, hex, oct, float, repr, str#
+     * #kind=tp_as_number->nb*5, tp*2#
      */
     PyLongDoubleArrType_Type.@kind@_@name@ = longdoubletype_@name@;
     PyCLongDoubleArrType_Type.@kind@_@name@ = clongdoubletype_@name@;



More information about the Numpy-svn mailing list