[Numpy-svn] r8359 - in trunk/numpy: core/src core/src/multiarray lib/src

numpy-svn at scipy.org numpy-svn at scipy.org
Sun Apr 25 00:31:03 EDT 2010


Author: charris
Date: 2010-04-24 23:31:03 -0500 (Sat, 24 Apr 2010)
New Revision: 8359

Modified:
   trunk/numpy/core/src/multiarray/descriptor.c
   trunk/numpy/core/src/scalarmathmodule.c.src
   trunk/numpy/lib/src/_compiled_base.c
Log:
ENH: Remove some unused variable warnings.

Modified: trunk/numpy/core/src/multiarray/descriptor.c
===================================================================
--- trunk/numpy/core/src/multiarray/descriptor.c	2010-04-25 04:31:00 UTC (rev 8358)
+++ trunk/numpy/core/src/multiarray/descriptor.c	2010-04-25 04:31:03 UTC (rev 8359)
@@ -1629,7 +1629,7 @@
 {
     int len;
     PyTypeObject *typeobj = self->typeobj;
-    PyObject *res, *tmp;
+    PyObject *res;
     char *s;
     /* fixme: not reentrant */
     static int prefix_len = 0;
@@ -2800,10 +2800,9 @@
     PyObject *retval;
 
     if (!self->names) {
-        PyObject *astr, *bstr;
-        astr = arraydescr_str(self);
+        PyObject *astr = arraydescr_str(self);
 #if defined(NPY_PY3K)
-        bstr = PyUnicode_AsUnicodeEscapeString(astr);
+        PyObject *bstr = PyUnicode_AsUnicodeEscapeString(astr);
         Py_DECREF(astr);
         astr = bstr;
 #endif

Modified: trunk/numpy/core/src/scalarmathmodule.c.src
===================================================================
--- trunk/numpy/core/src/scalarmathmodule.c.src	2010-04-25 04:31:00 UTC (rev 8358)
+++ trunk/numpy/core/src/scalarmathmodule.c.src	2010-04-25 04:31:03 UTC (rev 8359)
@@ -1490,10 +1490,8 @@
 initscalarmath(void)
 #endif
 {
-    PyObject *m;
-
 #if defined(NPY_PY3K)
-    m = PyModule_Create(&moduledef);
+    PyObject *m = PyModule_Create(&moduledef);
     if (!m) {
         return NULL;
     }

Modified: trunk/numpy/lib/src/_compiled_base.c
===================================================================
--- trunk/numpy/lib/src/_compiled_base.c	2010-04-25 04:31:00 UTC (rev 8358)
+++ trunk/numpy/lib/src/_compiled_base.c	2010-04-25 04:31:03 UTC (rev 8359)
@@ -559,7 +559,7 @@
 arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyObject *obj;
-    PyObject *str, *tmp;
+    PyObject *str;
     char *docstr;
     static char *msg = "already has a docstring";
 
@@ -573,8 +573,7 @@
         return NULL;
     }
 
-    tmp = PyUnicode_AsUTF8String(str);
-    docstr = PyBytes_AS_STRING(tmp);
+    docstr = PyBytes_AS_STRING(PyUnicode_AsUTF8String(str));
 #else
     if (!PyArg_ParseTuple(args, "OO!", &obj, &PyString_Type, &str)) {
         return NULL;
@@ -956,7 +955,7 @@
 init_compiled_base(void)
 #endif
 {
-    PyObject *m, *d, *s;
+    PyObject *m, *d;
 
 #if defined(NPY_PY3K)
     m = PyModule_Create(&moduledef);




More information about the Numpy-svn mailing list