[Numpy-svn] r5952 - in branches/ufunc_cleanup/numpy: core/blasdot core/code_generators core/include/numpy core/src fft lib/src linalg ma ma/tests numarray testing

numpy-svn@scip... numpy-svn@scip...
Mon Oct 20 21:48:54 CDT 2008


Author: charris
Date: 2008-10-20 21:48:38 -0500 (Mon, 20 Oct 2008)
New Revision: 5952

Added:
   branches/ufunc_cleanup/numpy/core/include/numpy/utils.h
Removed:
   branches/ufunc_cleanup/numpy/core/include/numpy/WTF_MathExtras.h
Modified:
   branches/ufunc_cleanup/numpy/core/blasdot/_dotblas.c
   branches/ufunc_cleanup/numpy/core/code_generators/generate_umath.py
   branches/ufunc_cleanup/numpy/core/include/numpy/ndarrayobject.h
   branches/ufunc_cleanup/numpy/core/src/_sortmodule.c.src
   branches/ufunc_cleanup/numpy/core/src/arraymethods.c
   branches/ufunc_cleanup/numpy/core/src/arrayobject.c
   branches/ufunc_cleanup/numpy/core/src/arraytypes.inc.src
   branches/ufunc_cleanup/numpy/core/src/math_c99.inc.src
   branches/ufunc_cleanup/numpy/core/src/multiarraymodule.c
   branches/ufunc_cleanup/numpy/core/src/scalarmathmodule.c.src
   branches/ufunc_cleanup/numpy/core/src/scalartypes.inc.src
   branches/ufunc_cleanup/numpy/core/src/ufuncobject.c
   branches/ufunc_cleanup/numpy/core/src/umathmodule.c.src
   branches/ufunc_cleanup/numpy/fft/fftpack_litemodule.c
   branches/ufunc_cleanup/numpy/lib/src/_compiled_base.c
   branches/ufunc_cleanup/numpy/linalg/lapack_litemodule.c
   branches/ufunc_cleanup/numpy/ma/core.py
   branches/ufunc_cleanup/numpy/ma/mrecords.py
   branches/ufunc_cleanup/numpy/ma/tests/test_core.py
   branches/ufunc_cleanup/numpy/ma/tests/test_mrecords.py
   branches/ufunc_cleanup/numpy/ma/tests/test_subclassing.py
   branches/ufunc_cleanup/numpy/numarray/_capi.c
   branches/ufunc_cleanup/numpy/testing/utils.py
Log:
Merge up to r5951 of trunk.

Modified: branches/ufunc_cleanup/numpy/core/blasdot/_dotblas.c
===================================================================
--- branches/ufunc_cleanup/numpy/core/blasdot/_dotblas.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/blasdot/_dotblas.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -80,7 +80,7 @@
 static char doc_alterdot[] = "alterdot() changes all dot functions to use blas.";
 
 static PyObject *
-dotblas_alterdot(PyObject *dummy, PyObject *args)
+dotblas_alterdot(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyArray_Descr *descr;
 
@@ -115,7 +115,7 @@
 static char doc_restoredot[] = "restoredot() restores dots to defaults.";
 
 static PyObject *
-dotblas_restoredot(PyObject *dummy, PyObject *args)
+dotblas_restoredot(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyArray_Descr *descr;
 
@@ -203,7 +203,7 @@
     "dimension of b.\nNB: The first argument is not conjugated.";
 
 static PyObject *
-dotblas_matrixproduct(PyObject *dummy, PyObject *args)
+dotblas_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyObject *op1, *op2;
     PyArrayObject *ap1 = NULL, *ap2 = NULL, *ret = NULL;
@@ -798,7 +798,7 @@
     "not conjugated.";
 
 static PyObject *
-dotblas_innerproduct(PyObject *dummy, PyObject *args)
+dotblas_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyObject *op1, *op2;
     PyArrayObject *ap1, *ap2, *ret;
@@ -1046,7 +1046,7 @@
 static char doc_vdot[] = "vdot(a,b)\nReturns the dot product of a and b for scalars and vectors\nof floating point and complex types.  The first argument, a, is conjugated.";
 
 
-static PyObject *dotblas_vdot(PyObject *dummy, PyObject *args) {
+static PyObject *dotblas_vdot(PyObject *NPY_UNUSED(dummy), PyObject *args) {
     PyObject *op1, *op2;
     PyArrayObject *ap1=NULL, *ap2=NULL, *ret=NULL;
     int l;

Modified: branches/ufunc_cleanup/numpy/core/code_generators/generate_umath.py
===================================================================
--- branches/ufunc_cleanup/numpy/core/code_generators/generate_umath.py	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/code_generators/generate_umath.py	2008-10-21 02:48:38 UTC (rev 5952)
@@ -316,16 +316,6 @@
           TD(noobj),
           TD(O, f='_npy_ObjectMin')
           ),
-'fmax' :
-    Ufunc(2, 1, None,
-          "",
-          TD(inexact)
-          ),
-'fmin' :
-    Ufunc(2, 1, None,
-          "",
-          TD(inexact)
-          ),
 'bitwise_and' :
     Ufunc(2, 1, One,
           docstrings.get('numpy.core.umath.bitwise_and'),

Deleted: branches/ufunc_cleanup/numpy/core/include/numpy/WTF_MathExtras.h
===================================================================
--- branches/ufunc_cleanup/numpy/core/include/numpy/WTF_MathExtras.h	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/include/numpy/WTF_MathExtras.h	2008-10-21 02:48:38 UTC (rev 5952)
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
-
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
-
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
-
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-
-#ifndef WTF_MathExtras_h
-#define WTF_MathExtras_h
-
-#include <math.h>
-#include <stdlib.h>
-#include <time.h>
-
-#if defined (__SVR4) && defined (__sun) && defined (__GNUC__)
-
-#include <ieeefp.h>
-
-#endif
-
-#if defined(_MSC_VER)
-
-#include <xmath.h>
-#include <limits.h>
-
-#if HAVE(FLOAT_H)
-#include <float.h>
-#endif
-
-#endif
-
-#ifndef M_PI
-const double piDouble = 3.14159265358979323846;
-const float piFloat = 3.14159265358979323846f;
-#else
-const double piDouble = M_PI;
-const float piFloat = (float)M_PI;
-#endif
-
-#ifndef M_PI_4
-const double piOverFourDouble = 0.785398163397448309616;
-const float piOverFourFloat = 0.785398163397448309616f;
-#else
-const double piOverFourDouble = M_PI_4;
-const float piOverFourFloat = (float)M_PI_4;
-#endif
-
-#if defined (__SVR4) && defined (__sun) && defined (__GNUC__)
-
-#ifndef isfinite
-#define isfinite(x) (finite(x) && !isnand(x))
-#endif
-#ifndef isinf
-#define isinf(x) (!finite(x) && !isnand(x))
-#endif
-#ifndef signbit
-#define signbit(x) (x < 0.0) /* FIXME: Wrong for negative 0. */
-#endif
-
-#endif
-
-#if defined(_MSC_VER)
-
-#define isinf(num) ( !_finite(num) && !_isnan(num) )
-#define isnan(num) ( !!_isnan(num) )
-/*
-#define lround(num) ( (long)(num > 0 ? num + 0.5 : ceil(num - 0.5)) )
-#define lroundf(num) ( (long)(num > 0 ? num + 0.5f : ceilf(num - 0.5f)) )
-#define round(num) ( num > 0 ? floor(num + 0.5) : ceil(num - 0.5) )
-#define roundf(num) ( num > 0 ? floorf(num + 0.5f) : ceilf(num - 0.5f) )
-*/
-#define signbit(num) ( _copysign(1.0, num) < 0 )
-#define trunc(num) ( num > 0 ? floor(num) : ceil(num) )
-#define nextafter(x, y) ( _nextafter(x, y) )
-#define nextafterf(x, y) ( x > y ? x - FLT_EPSILON : x + FLT_EPSILON )
-#define copysign(x, y) ( _copysign(x, y) )
-#define isfinite(x) ( _finite(x) )
-
-/*
- * Work around a bug in Win, where atan2(+-infinity, +-infinity)
- * yields NaN instead of specific values.
- */
-/*
-double
-wtf_atan2(double x, double y)
-{
-    static double posInf = std::numeric_limits<double>::infinity();
-    static double negInf = -std::numeric_limits<double>::infinity();
-    static double nan = std::numeric_limits<double>::quiet_NaN();
-
-
-    double result = nan;
-
-    if (x == posInf && y == posInf)
-        result = piOverFourDouble;
-    else if (x == posInf && y == negInf)
-        result = 3 * piOverFourDouble;
-    else if (x == negInf && y == posInf)
-
-        result = -piOverFourDouble;
-    else if (x == negInf && y == negInf)
-        result = -3 * piOverFourDouble;
-    else
-        result = ::atan2(x, y);
-
-    return result;
-}
-*/
-
-/*
- * Work around a bug in the Microsoft CRT, where fmod(x, +-infinity)
- * yields NaN instead of x.
- */
-#define wtf_fmod(x, y) ( (!isinf(x) && isinf(y)) ? x : fmod(x, y) )
-
-/*
- * Work around a bug in the Microsoft CRT, where pow(NaN, 0)
- * yields NaN instead of 1.
- */
-#define wtf_pow(x, y) ( y == 0 ? 1 : pow(x, y) )
-
-/*
-#define atan2(x, y) wtf_atan2(x, y)
-*/
-#define fmod(x, y) wtf_fmod(x, y)
-#define pow(x, y) wtf_pow(x, y)
-
-#endif /* COMPILER(MSVC) */
-
-
-#define deg2rad(d)  ( d * piDouble / 180.0 )
-#define rad2deg(r)  ( r * 180.0 / piDouble )
-#define deg2grad(d) ( d * 400.0 / 360.0 )
-#define grad2deg(g) ( g * 360.0 / 400.0 )
-#define rad2grad(r) ( r * 200.0 / piDouble )
-#define grad2rad(g) ( g * piDouble / 200.0 )
-
-#define deg2radf(d)  ( d * piFloat / 180.0f )
-#define rad2degf(r)  ( r * 180.0f / piFloat )
-#define deg2gradf(d) ( d * 400.0f / 360.0f )
-#define grad2degf(g) ( g * 360.0f / 400.0f )
-#define rad2gradf(r) ( r * 200.0f / piFloat )
-#define grad2radf(g) ( g * piFloat / 200.0f )
-
-
-#endif /* #ifndef WTF_MathExtras_h */

Modified: branches/ufunc_cleanup/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- branches/ufunc_cleanup/numpy/core/include/numpy/ndarrayobject.h	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/include/numpy/ndarrayobject.h	2008-10-21 02:48:38 UTC (rev 5952)
@@ -23,6 +23,8 @@
         #define NPY_ALLOW_THREADS 0
 #endif
 
+#include "utils.h"
+
 /* There are several places in the code where an array of dimensions is
  * allocated statically.  This is the size of that static allocation.
  *

Copied: branches/ufunc_cleanup/numpy/core/include/numpy/utils.h (from rev 5951, trunk/numpy/core/include/numpy/utils.h)

Modified: branches/ufunc_cleanup/numpy/core/src/_sortmodule.c.src
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/_sortmodule.c.src	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/_sortmodule.c.src	2008-10-21 02:48:38 UTC (rev 5952)
@@ -54,7 +54,7 @@
    #lessequal=STDC_LE*14,NUMC_LE*3#
 **/
 static int
-@TYPE@_quicksort(@type@ *start, intp num, void *unused)
+@TYPE@_quicksort(@type@ *start, intp num, void * NPY_UNUSED(unused))
 {
     @type@ *pl = start;
     @type@ *pr = start + num - 1;
@@ -112,7 +112,7 @@
 }
 
 static int
-@TYPE@_aquicksort(@type@ *v, intp* tosort, intp num, void *unused)
+@TYPE@_aquicksort(@type@ *v, intp* tosort, intp num, void *NPY_UNUSED(unused))
 {
     @type@ vp;
     intp *pl, *pr, SWAP_temp;
@@ -174,7 +174,7 @@
 
 
 static int
-@TYPE@_heapsort(@type@ *start, intp n, void *unused)
+@TYPE@_heapsort(@type@ *start, intp n, void *NPY_UNUSED(unused))
 {
     @type@ tmp, *a;
     intp i,j,l;
@@ -220,7 +220,7 @@
 }
 
 static int
-@TYPE@_aheapsort(@type@ *v, intp *tosort, intp n, void *unused)
+@TYPE@_aheapsort(@type@ *v, intp *tosort, intp n, void *NPY_UNUSED(unused))
 {
     intp *a, i,j,l, tmp;
     /* The arrays need to be offset by one for heapsort indexing */
@@ -306,7 +306,7 @@
 }
 
 static int
-@TYPE@_mergesort(@type@ *start, intp num, void *unused)
+@TYPE@_mergesort(@type@ *start, intp num, void *NPY_UNUSED(unused))
 {
     @type@ *pl, *pr, *pw;
 
@@ -365,7 +365,7 @@
 }
 
 static int
-@TYPE@_amergesort(@type@ *v, intp *tosort, intp num, void *unused)
+@TYPE@_amergesort(@type@ *v, intp *tosort, intp num, void *NPY_UNUSED(unused))
 {
     intp *pl, *pr, *pw;
 

Modified: branches/ufunc_cleanup/numpy/core/src/arraymethods.c
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/arraymethods.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/arraymethods.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -1105,7 +1105,7 @@
 
 
 static PyObject *
-array_reduce(PyArrayObject *self, PyObject *args)
+array_reduce(PyArrayObject *self, PyObject *NPY_UNUSED(args))
 {
     /* version number of this pickle type. Increment if we need to
        change the format. Be sure to handle the old versions in
@@ -2021,7 +2021,7 @@
          METH_VARARGS | METH_KEYWORDS, NULL},
     {"view", (PyCFunction)array_view,
          METH_VARARGS | METH_KEYWORDS, NULL},
-    {NULL, NULL}           /* sentinel */
+    {NULL, NULL, 0, NULL}           /* sentinel */
 };
 
 #undef _ARET

Modified: branches/ufunc_cleanup/numpy/core/src/arrayobject.c
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/arrayobject.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/arrayobject.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -3710,7 +3710,7 @@
 }
 
 static PyObject *
-array_power(PyArrayObject *a1, PyObject *o2, PyObject *modulo)
+array_power(PyArrayObject *a1, PyObject *o2, PyObject *NPY_UNUSED(modulo))
 {
     /* modulo is ignored! */
     PyObject *value;
@@ -3801,7 +3801,7 @@
 }
 
 static PyObject *
-array_inplace_power(PyArrayObject *a1, PyObject *o2, PyObject *modulo)
+array_inplace_power(PyArrayObject *a1, PyObject *o2, PyObject *NPY_UNUSED(modulo))
 {
     /* modulo is ignored! */
     PyObject *value;
@@ -6871,7 +6871,7 @@
    --- default sub-class behavior
 */
 static PyObject *
-array_finalize_get(PyArrayObject *self)
+array_finalize_get(PyArrayObject *NPY_UNUSED(self))
 {
     Py_INCREF(Py_None);
     return Py_None;
@@ -6880,76 +6880,76 @@
 static PyGetSetDef array_getsetlist[] = {
     {"ndim",
      (getter)array_ndim_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"flags",
      (getter)array_flags_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"shape",
      (getter)array_shape_get,
      (setter)array_shape_set,
-     NULL},
+     NULL, NULL},
     {"strides",
      (getter)array_strides_get,
      (setter)array_strides_set,
-     NULL},
+     NULL, NULL},
     {"data",
      (getter)array_data_get,
      (setter)array_data_set,
-     NULL},
+     NULL, NULL},
     {"itemsize",
      (getter)array_itemsize_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"size",
      (getter)array_size_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"nbytes",
      (getter)array_nbytes_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"base",
      (getter)array_base_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"dtype",
      (getter)array_descr_get,
      (setter)array_descr_set,
-     NULL},
+     NULL, NULL},
     {"real",
      (getter)array_real_get,
      (setter)array_real_set,
-     NULL},
+     NULL, NULL},
     {"imag",
      (getter)array_imag_get,
      (setter)array_imag_set,
-     NULL},
+     NULL, NULL},
     {"flat",
      (getter)array_flat_get,
      (setter)array_flat_set,
-     NULL},
+     NULL, NULL},
     {"ctypes",
      (getter)array_ctypes_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"T",
      (getter)array_transpose_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"__array_interface__",
      (getter)array_interface_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"__array_struct__",
      (getter)array_struct_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"__array_priority__",
      (getter)array_priority_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"__array_finalize__",
      (getter)array_finalize_get,
-     NULL, NULL},
-    {NULL, NULL, NULL, NULL},  /* Sentinel */
+     NULL, NULL, NULL},
+    {NULL, NULL, NULL, NULL, NULL},  /* Sentinel */
 };
 
 /****************** end of attribute get and set routines *******************/
 
 
 static PyObject *
-array_alloc(PyTypeObject *type, Py_ssize_t nitems)
+array_alloc(PyTypeObject *type, Py_ssize_t NPY_UNUSED(nitems))
 {
     PyObject *obj;
     /* nitems will always be 0 */
@@ -7017,7 +7017,17 @@
     0,                                          /* tp_mro */
     0,                                          /* tp_cache */
     0,                                          /* tp_subclasses */
-    0                                           /* tp_weaklist */
+    0,                                          /* tp_weaklist */
+    0,   /* tp_del */
+
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 };
 
 /* The rest of this code is to build the right kind of array from a python */
@@ -9960,7 +9970,7 @@
 
 
 static PyObject *
-iter_array(PyArrayIterObject *it, PyObject *op)
+iter_array(PyArrayIterObject *it, PyObject *NPY_UNUSED(op))
 {
 
     PyObject *r;
@@ -10019,7 +10029,7 @@
     /* to get array */
     {"__array__", (PyCFunction)iter_array, 1, NULL},
     {"copy", (PyCFunction)iter_copy, 1, NULL},
-    {NULL,          NULL}           /* sentinel */
+    {NULL, NULL, 0, NULL}           /* sentinel */
 };
 
 static PyObject *
@@ -10038,7 +10048,7 @@
 static PyMemberDef iter_members[] = {
     {"base", T_OBJECT, offsetof(PyArrayIterObject, ao), RO, NULL},
     {"index", T_INT, offsetof(PyArrayIterObject, index), RO, NULL},
-    {NULL},
+    {NULL, 0, 0, 0, NULL},
 };
 
 static PyObject *
@@ -10062,9 +10072,8 @@
 static PyGetSetDef iter_getsets[] = {
     {"coords",
      (getter)iter_coords_get,
-     NULL,
-     NULL},
-    {NULL, NULL, NULL, NULL},
+     NULL, NULL, NULL},
+    {NULL, NULL, NULL, NULL, NULL},
 };
 
 static PyTypeObject PyArrayIter_Type = {
@@ -10100,6 +10109,30 @@
     iter_methods,                           /* tp_methods */
     iter_members,                   /* tp_members */
     iter_getsets,                           /* tp_getset */
+    0,                                          /* tp_base */
+    0,                                          /* tp_dict */
+    0,                                          /* tp_descr_get */
+    0,                                          /* tp_descr_set */
+    0,   				    /* tp_dictoffset */
+    0,   				    /* tp_init */
+    0,   				    /* tp_alloc */
+    0,   				    /* tp_new */
+    0,   				    /* tp_free */
+    0,   				    /* tp_is_gc */
+    0,   				    /* tp_bases */
+    0,   				    /* tp_mro */
+    0,   				    /* tp_cache */
+    0,   				    /* tp_subclasses */
+    0,   				    /* tp_weaklist */
+    0,   				    /* tp_del */
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 
 };
 
@@ -10783,8 +10816,18 @@
     0,                                        /* tp_mro */
     0,                                        /* tp_cache */
     0,                                        /* tp_subclasses */
-    0                                         /* tp_weaklist */
+    0,                                        /* tp_weaklist */
+    0,   				      /* tp_del */
 
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
+
 };
 
 /** END of Subscript Iterator **/
@@ -10917,7 +10960,7 @@
 }
 
 static PyObject *
-arraymultiter_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
+arraymultiter_new(PyTypeObject *NPY_UNUSED(subtype), PyObject *args, PyObject *kwds)
 {
 
     int n, i;
@@ -11046,24 +11089,24 @@
 static PyGetSetDef arraymultiter_getsetlist[] = {
     {"size",
      (getter)arraymultiter_size_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"index",
      (getter)arraymultiter_index_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"shape",
      (getter)arraymultiter_shape_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"iters",
      (getter)arraymultiter_iters_get,
-     NULL, NULL},
-    {NULL, NULL, NULL, NULL},
+     NULL, NULL, NULL},
+    {NULL, NULL, NULL, NULL, NULL},
 };
 
 static PyMemberDef arraymultiter_members[] = {
     {"numiter", T_INT, offsetof(PyArrayMultiIterObject, numiter),
      RO, NULL},
     {"nd", T_INT, offsetof(PyArrayMultiIterObject, nd), RO, NULL},
-    {NULL},
+    {NULL, 0, 0, 0, NULL},
 };
 
 static PyObject *
@@ -11078,7 +11121,7 @@
 
 static PyMethodDef arraymultiter_methods[] = {
     {"reset", (PyCFunction) arraymultiter_reset, METH_VARARGS, NULL},
-    {NULL, NULL},
+    {NULL, NULL, 0, NULL},
 };
 
 static PyTypeObject PyArrayMultiIter_Type = {
@@ -11128,7 +11171,17 @@
     0,                                        /* tp_mro */
     0,                                        /* tp_cache */
     0,                                        /* tp_subclasses */
-    0                                         /* tp_weaklist */
+    0,                                        /* tp_weaklist */
+    0,   /* tp_del */
+
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 };
 
 /*NUMPY_API*/
@@ -11226,7 +11279,7 @@
     {"itemsize", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL},
     {"alignment", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL},
     {"flags", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL},
-    {NULL},
+    {NULL, 0, 0, 0, NULL},
 };
 
 static PyObject *
@@ -11490,43 +11543,43 @@
 static PyGetSetDef arraydescr_getsets[] = {
     {"subdtype",
      (getter)arraydescr_subdescr_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"descr",
      (getter)arraydescr_protocol_descr_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"str",
      (getter)arraydescr_protocol_typestr_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"name",
      (getter)arraydescr_typename_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"base",
      (getter)arraydescr_base_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"shape",
      (getter)arraydescr_shape_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"isbuiltin",
      (getter)arraydescr_isbuiltin_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"isnative",
      (getter)arraydescr_isnative_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"fields",
      (getter)arraydescr_fields_get,
-     NULL, NULL},
+     NULL, NULL, NULL},
     {"names",
      (getter)arraydescr_names_get,
      (setter)arraydescr_names_set,
-     NULL},
+     NULL, NULL},
     {"hasobject",
      (getter)arraydescr_hasobject_get,
-     NULL, NULL},
-    {NULL, NULL, NULL, NULL},
+     NULL, NULL, NULL},
+    {NULL, NULL, NULL, NULL, NULL},
 };
 
 static PyObject *
-arraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
+arraydescr_new(PyTypeObject *NPY_UNUSED(subtype), PyObject *args, PyObject *kwds)
 {
     PyObject *odescr;
     PyArray_Descr *descr, *conv;
@@ -11558,7 +11611,7 @@
 
 /* return a tuple of (callable object, args, state). */
 static PyObject *
-arraydescr_reduce(PyArray_Descr *self, PyObject *args)
+arraydescr_reduce(PyArray_Descr *self, PyObject *NPY_UNUSED(args))
 {
     /* version number of this pickle type. Increment if we need to
        change the format. Be sure to handle the old versions in
@@ -11896,7 +11949,7 @@
      NULL},
     {"newbyteorder", (PyCFunction)arraydescr_newbyteorder, METH_VARARGS,
      NULL},
-    {NULL,          NULL}           /* sentinel */
+    {NULL, NULL, 0, NULL}           /* sentinel */
 };
 
 static PyObject *
@@ -12130,6 +12183,12 @@
     descr_length,
     (binaryfunc)NULL,
     descr_repeat,
+    NULL, NULL,
+    NULL, /* sq_ass_item */
+    NULL, /* ssizessizeobjargproc sq_ass_slice */
+    0, /* sq_contains */
+    0, /* sq_inplace_concat */
+    0, /* sq_inplace_repeat */
 };
 
 static PyMappingMethods descr_as_mapping = {
@@ -12188,7 +12247,17 @@
     0,                                        /* tp_mro */
     0,                                        /* tp_cache */
     0,                                        /* tp_subclasses */
-    0                                         /* tp_weaklist */
+    0,                                        /* tp_weaklist */
+    0,   /* tp_del */
+
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 };
 
 
@@ -12350,60 +12419,60 @@
     {"contiguous",
      (getter)arrayflags_contiguous_get,
      NULL,
-     ""},
+     "", NULL},
     {"c_contiguous",
      (getter)arrayflags_contiguous_get,
      NULL,
-     ""},
+     "", NULL},
     {"f_contiguous",
      (getter)arrayflags_fortran_get,
      NULL,
-     ""},
+     "", NULL},
     {"fortran",
      (getter)arrayflags_fortran_get,
      NULL,
-     ""},
+     "", NULL},
     {"updateifcopy",
      (getter)arrayflags_updateifcopy_get,
      (setter)arrayflags_updateifcopy_set,
-     ""},
+     "", NULL},
     {"owndata",
      (getter)arrayflags_owndata_get,
      NULL,
-     ""},
+     "", NULL},
     {"aligned",
      (getter)arrayflags_aligned_get,
      (setter)arrayflags_aligned_set,
-     ""},
+     "", NULL},
     {"writeable",
      (getter)arrayflags_writeable_get,
      (setter)arrayflags_writeable_set,
-     ""},
+     "", NULL},
     {"fnc",
      (getter)arrayflags_fnc_get,
      NULL,
-     ""},
+     "", NULL},
     {"forc",
      (getter)arrayflags_forc_get,
      NULL,
-     ""},
+     "", NULL},
     {"behaved",
      (getter)arrayflags_behaved_get,
      NULL,
-     ""},
+     "", NULL},
     {"carray",
      (getter)arrayflags_carray_get,
      NULL,
-     ""},
+     "", NULL},
     {"farray",
      (getter)arrayflags_farray_get,
      NULL,
-     ""},
+     "", NULL},
     {"num",
      (getter)arrayflags_num_get,
      NULL,
-     ""},
-    {NULL, NULL, NULL, NULL},
+     "", NULL},
+    {NULL, NULL, NULL, NULL, NULL},
 };
 
 static PyObject *
@@ -12557,7 +12626,7 @@
 
 
 static PyObject *
-arrayflags_new(PyTypeObject *self, PyObject *args, PyObject *kwds)
+arrayflags_new(PyTypeObject *NPY_UNUSED(self), PyObject *args, PyObject *NPY_UNUSED(kwds))
 {
     PyObject *arg=NULL;
     if (!PyArg_UnpackTuple(args, "flagsobj", 0, 1, &arg))
@@ -12618,5 +12687,15 @@
     0,                                        /* tp_mro */
     0,                                        /* tp_cache */
     0,                                        /* tp_subclasses */
-    0                                         /* tp_weaklist */
+    0,                                        /* tp_weaklist */
+    0,   /* tp_del */
+
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 };

Modified: branches/ufunc_cleanup/numpy/core/src/arraytypes.inc.src
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/arraytypes.inc.src	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/arraytypes.inc.src	2008-10-21 02:48:38 UTC (rev 5952)
@@ -668,7 +668,7 @@
 */
 static void
 @from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n,
-               PyArrayObject *aip, PyArrayObject *aop)
+               PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
 {
     while (n--) {
         *op++ = (@totyp@)*ip;
@@ -683,7 +683,7 @@
 */
 static void
 @from@_to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n,
-               PyArrayObject *aip, PyArrayObject *aop)
+               PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
 {
     while (n--) {
         *op++ = (Bool)(*ip++ != FALSE);
@@ -697,7 +697,7 @@
 */
 static void
 @from@_to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n,
-               PyArrayObject *aip, PyArrayObject *aop)
+               PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
 {
     while (n--) {
         *op = (Bool)(((*ip).real != FALSE) || ((*ip).imag != FALSE));
@@ -712,7 +712,7 @@
 */
 static void
 BOOL_to_@to@(register Bool *ip, register @totyp@ *op, register intp n,
-             PyArrayObject *aip, PyArrayObject *aop)
+             PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
 {
     while (n--) {
         *op++ = (@totyp@)(*ip++ != FALSE);
@@ -729,7 +729,7 @@
 */
 static void
 @from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n,
-               PyArrayObject *aip, PyArrayObject *aop)
+               PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
 {
     while (n--) {
         *op++ = (@totyp@)*ip++;
@@ -748,7 +748,7 @@
 */
 static void
 @from@_to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n,
-               PyArrayObject *aip, PyArrayObject *aop)
+               PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
 {
     n <<= 1;
     while (n--) {
@@ -766,7 +766,7 @@
 */
 static void
 @from@_to_OBJECT(@fromtyp@ *ip, PyObject **op, intp n, PyArrayObject *aip,
-                 PyArrayObject *aop)
+                 PyArrayObject *NPY_UNUSED(aop))
 {
     register intp i;
     int skip=@skip@;
@@ -777,6 +777,26 @@
 }
 /**end repeat**/
 
+#define _NPY_UNUSEDBOOL  NPY_UNUSED
+#define _NPY_UNUSEDBYTE  NPY_UNUSED
+#define _NPY_UNUSEDUBYTE  NPY_UNUSED
+#define _NPY_UNUSEDSHORT  NPY_UNUSED
+#define _NPY_UNUSEDUSHORT  NPY_UNUSED
+#define _NPY_UNUSEDINT  NPY_UNUSED
+#define _NPY_UNUSEDUINT  NPY_UNUSED
+#define _NPY_UNUSEDLONG  NPY_UNUSED
+#define _NPY_UNUSEDULONG  NPY_UNUSED
+#define _NPY_UNUSEDLONGLONG  NPY_UNUSED
+#define _NPY_UNUSEDULONGLONG  NPY_UNUSED
+#define _NPY_UNUSEDFLOAT  NPY_UNUSED
+#define _NPY_UNUSEDDOUBLE  NPY_UNUSED
+#define _NPY_UNUSEDLONGDOUBLE  NPY_UNUSED
+#define _NPY_UNUSEDCFLOAT  NPY_UNUSED
+#define _NPY_UNUSEDCDOUBLE  NPY_UNUSED
+#define _NPY_UNUSEDCLONGDOUBLE  NPY_UNUSED
+#define _NPY_UNUSEDSTRING 
+#define _NPY_UNUSEDVOID 
+#define _NPY_UNUSEDUNICODE
 /**begin repeat
 
 #to=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE, STRING, UNICODE, VOID#
@@ -784,7 +804,7 @@
 #skip= 1*17, aip->descr->elsize*3#
 */
 static void
-OBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *aip,
+OBJECT_to_@to@(PyObject **ip, @totyp@ *op, intp n, PyArrayObject *_NPY_UNUSED@to@(aip),
                  PyArrayObject *aop)
 {
     register intp i;
@@ -883,7 +903,7 @@
 #format="hd","hu","d","u","ld","lu",LONGLONG_FMT,ULONGLONG_FMT,"f","lf","Lf"#
 */
 static int
-@fname@_scan (FILE *fp, @type@ *ip, void *ignore, PyArray_Descr *ignore2)
+@fname@_scan (FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignored))
 {
     return fscanf(fp, "%"@format@, ip);
 }
@@ -897,7 +917,7 @@
 #format="d","u"#
 */
 static int
-@fname@_scan (FILE *fp, @type@ *ip, void *ignore, PyArray_Descr *ignore2)
+@fname@_scan (FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2))
 {
     @btype@ temp;
     int num;
@@ -908,7 +928,7 @@
 /**end repeat**/
 
 static int
-BOOL_scan (FILE *fp, Bool *ip, void *ignore, PyArray_Descr *ignore2)
+BOOL_scan (FILE *fp, Bool *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2))
 {
     int temp;
     int num;
@@ -932,7 +952,7 @@
 #btype=(long,ulong)*5#
 */
 static int
-@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *ignore)
+@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
 {
     @btype@ result;
 
@@ -948,7 +968,7 @@
 */
 #if (PY_VERSION_HEX >= 0x02040000) || defined(PyOS_ascii_strtod)
 static int
-@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *ignore)
+@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
 {
     double result;
 
@@ -980,7 +1000,7 @@
 */
 static void
 @fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride,
-                   intp n, int swap, void *arr)
+                   intp n, int swap, void *NPY_UNUSED(arr))
 {
     if (src != NULL) {
         if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) {
@@ -997,7 +1017,7 @@
 }
 
 static void
-@fname@_copyswap (void *dst, void *src, int swap, void *arr)
+@fname@_copyswap (void *dst, void *src, int swap, void *NPY_UNUSED(arr))
 {
 
     if (src != NULL) /* copy first if needed */
@@ -1067,7 +1087,7 @@
 */
 static void
 @fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n,
-                   int swap, void *arr)
+                   int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
 {
     if (src != NULL) {
         if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) {
@@ -1082,7 +1102,7 @@
 }
 
 static void
-@fname@_copyswap (void *dst, void *src, int swap, void *arr)
+@fname@_copyswap (void *dst, void *src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
 {
     if (src != NULL) /* copy first if needed */
         memcpy(dst, src, sizeof(@type@));
@@ -1101,7 +1121,7 @@
 */
 static void
 @fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n,
-                   int swap, void *arr)
+                   int swap, void *NPY_UNUSED(arr))
 {
 
     if (src != NULL) { /* copy first if needed */
@@ -1123,7 +1143,7 @@
 }
 
 static void
-@fname@_copyswap (void *dst, void *src, int swap, void *arr)
+@fname@_copyswap (void *dst, void *src, int swap, void *NPY_UNUSED(arr))
 {
     if (src != NULL) /* copy first if needed */
         memcpy(dst, src, sizeof(@type@));
@@ -1225,7 +1245,7 @@
 #define __ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0)
 static void
 OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride,
-                  register intp n, int swap, void *arr)
+                  register intp n, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
 {
     register intp i;
     if (src != NULL) {
@@ -1258,7 +1278,7 @@
 }
 
 static void
-OBJECT_copyswap(PyObject **dst, PyObject **src, int swap, void *arr)
+OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
 {
 
     if (src != NULL) {
@@ -1279,7 +1299,7 @@
 /* ignore swap */
 static void
 STRING_copyswapn (char *dst, intp dstride, char *src, intp sstride,
-                  intp n, int swap, PyArrayObject *arr)
+                  intp n, int NPY_UNUSED(swap), PyArrayObject *arr)
 {
     if (src != NULL && arr != NULL) {
         int itemsize = arr->descr->elsize;
@@ -1422,7 +1442,7 @@
 
 
 static void
-STRING_copyswap (char *dst, char *src, int swap, PyArrayObject *arr)
+STRING_copyswap(char *dst, char *src, int NPY_UNUSED(swap), PyArrayObject *arr)
 {
     if (src != NULL && arr != NULL) {
         memcpy(dst, src, arr->descr->elsize);
@@ -1633,7 +1653,7 @@
 /****************** compare **********************************/
 
 static int
-BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *ap)
+BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *NPY_UNUSED(ap))
 {
     return (*ip1 ? (*ip2 ? 0 : 1) : (*ip2 ? -1 : 0));
 }
@@ -1644,7 +1664,7 @@
 */
 
 static int
-@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap)
+@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *NPY_UNUSED(ap))
 {
     return *ip1 < *ip2 ? -1 : *ip1 == *ip2 ? 0 : 1;
 }
@@ -1658,7 +1678,7 @@
 */
 
 static int
-@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *ap)
+@fname@_compare (@type@ *ip1, @type@ *ip2, PyArrayObject *NPY_UNUSED(ap))
 {
     if (*ip1 == *ip2) {
         return ip1[1]<ip2[1] ? -1 : (ip1[1] == ip2[1] ? 0 : 1);
@@ -1670,7 +1690,7 @@
  /**end repeat**/
 
 static int
-OBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *ap)
+OBJECT_compare(PyObject **ip1, PyObject **ip2, PyArrayObject *NPY_UNUSED(ap))
 {
     if ((*ip1 == NULL) || (*ip2 == NULL)) {
         if (ip1 == ip2) return 1;
@@ -1795,7 +1815,7 @@
 */
 
 static int
-@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip)
+@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip))
 {
     register intp i;
     @type@ mp=*ip;
@@ -1813,7 +1833,7 @@
 /**end repeat**/
 
 static int
-OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *aip)
+OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip))
 {
     register intp i;
     PyObject *mp=ip[0]; *max_ind=0;
@@ -1865,7 +1885,7 @@
 
 static void
 BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
-         void *ignore)
+         void *NPY_UNUSED(ignore))
 {
     register Bool tmp=FALSE;
     register intp i;
@@ -1885,7 +1905,7 @@
 */
 static void
 @name@_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
-           void *ignore)
+           void *NPY_UNUSED(ignore))
 {
     register @out@ tmp=(@out@)0;
     register intp i;
@@ -1903,7 +1923,7 @@
 #type= float, double, longdouble#
 */
 static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2,
-                       char *op, intp n, void *ignore)
+                       char *op, intp n, void *NPY_UNUSED(ignore))
 {
     @type@ tmpr=(@type@)0.0, tmpi=(@type@)0.0;
     intp i;
@@ -1920,7 +1940,7 @@
 
 static void
 OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
-           void *ignore)
+           void *NPY_UNUSED(ignore))
 {
     intp i;
     PyObject *tmp1, *tmp2, *tmp=NULL;
@@ -1955,7 +1975,7 @@
 
 /* this requires buffer to be filled with objects or NULL */
 static void
-OBJECT_fill(PyObject **buffer, intp length, void *ignored)
+OBJECT_fill(PyObject **buffer, intp length, void *NPY_UNUSED(ignored))
 {
     intp i;
     PyObject *start = buffer[0];
@@ -1983,7 +2003,7 @@
 #typ=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble#
 */
 static void
-@NAME@_fill(@typ@ *buffer, intp length, void *ignored)
+@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignored))
 {
     register intp i;
     @typ@ start = buffer[0];
@@ -2000,7 +2020,7 @@
 #typ=cfloat,cdouble,clongdouble#
 */
 static void
-@NAME@_fill(@typ@ *buffer, intp length, void *ignored)
+@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignore))
 {
     register intp i;
     @typ@ start;
@@ -2023,7 +2043,7 @@
 
 /* this requires buffer to be filled with objects or NULL */
 static void
-OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *ignored)
+OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *NPY_UNUSED(ignored))
 {
     intp i;
     PyObject *val = *value;
@@ -2038,7 +2058,7 @@
 #typ=Bool,byte,ubyte#
 */
 static void
-@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *ignored)
+@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored))
 {
     memset(buffer, *value, length);
 }
@@ -2049,7 +2069,7 @@
 #typ=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,cfloat,cdouble,clongdouble#
 */
 static void
-@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *ignored)
+@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored))
 {
     register intp i;
     @typ@ val = *value;

Modified: branches/ufunc_cleanup/numpy/core/src/math_c99.inc.src
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/math_c99.inc.src	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/math_c99.inc.src	2008-10-21 02:48:38 UTC (rev 5952)
@@ -11,7 +11,6 @@
  *****************************************************************************
  */
 
-
 /* Original code by Konrad Hinsen.  */
 #ifndef HAVE_EXPM1
 double expm1(double x)

Modified: branches/ufunc_cleanup/numpy/core/src/multiarraymodule.c
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/multiarraymodule.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/multiarraymodule.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -2327,7 +2327,7 @@
                NPY_CLIPMODE clipmode)
 {
     int n, elsize;
-    intp i, m;
+    intp i;
     char *ret_data;
     PyArrayObject **mps, *ap;
     PyArrayMultiIterObject *multi=NULL;
@@ -4177,7 +4177,7 @@
 }
 
 static PyObject *
-array_putmask(PyObject *module, PyObject *args, PyObject *kwds)
+array_putmask(PyObject *NPY_UNUSED(module), PyObject *args, PyObject *kwds)
 {
     PyObject *mask, *values;
     PyObject *array;
@@ -5697,7 +5697,7 @@
                                  PyArray_ISFORTRAN(op)))
 
 static PyObject *
-_array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws)
+_array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
 {
     PyObject *op, *ret=NULL;
     static char *kwd[]= {"object", "dtype", "copy", "order", "subok",
@@ -5816,7 +5816,7 @@
 }
 
 static PyObject *
-array_empty(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_empty(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
 {
 
     static char *kwlist[] = {"shape","dtype","order",NULL};
@@ -5851,7 +5851,7 @@
    numpy scalar objects.
 */
 static PyObject *
-array_scalar(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_scalar(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
 {
 
     static char *kwlist[] = {"dtype","obj", NULL};
@@ -5935,7 +5935,7 @@
 }
 
 static PyObject *
-array_zeros(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_zeros(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
 {
     static char *kwlist[] = {"shape","dtype","order",NULL}; /* XXX ? */
     PyArray_Descr *typecode=NULL;
@@ -5966,7 +5966,7 @@
 }
 
 static PyObject *
-array_set_typeDict(PyObject *ignored, PyObject *args)
+array_set_typeDict(PyObject *NPY_UNUSED(ignored), PyObject *args)
 {
     PyObject *dict;
     if (!PyArg_ParseTuple(args, "O", &dict)) return NULL;
@@ -6002,7 +6002,7 @@
 
 static int
 fromfile_next_element(FILE **fp, void *dptr, PyArray_Descr *dtype,
-                      void *stream_data)
+                      void *NPY_UNUSED(stream_data))
 {
     /* the NULL argument is for backwards-compatibility */
     return dtype->f->scanfunc(*fp, dptr, NULL, dtype);
@@ -6095,7 +6095,7 @@
 }
 
 static int
-fromfile_skip_separator(FILE **fp, const char *sep, void *stream_data)
+fromfile_skip_separator(FILE **fp, const char *sep, void *NPY_UNUSED(stream_data))
 {
     int result = 0;
     const char *sep_start = sep;
@@ -6307,7 +6307,7 @@
 }
 
 static PyObject *
-array_fromstring(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_fromstring(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
 {
     char *data;
     Py_ssize_t nin=-1;
@@ -6440,7 +6440,7 @@
 }
 
 static PyObject *
-array_fromfile(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_fromfile(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
 {
     PyObject *file=NULL, *ret;
     FILE *fp;
@@ -6579,7 +6579,7 @@
 }
 
 static PyObject *
-array_fromiter(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_fromiter(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
 {
     PyObject *iter;
     Py_ssize_t nin=-1;
@@ -6698,7 +6698,7 @@
 }
 
 static PyObject *
-array_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds)
+array_frombuffer(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
 {
     PyObject *obj=NULL;
     Py_ssize_t nin=-1, offset=0;
@@ -6721,7 +6721,7 @@
 }
 
 static PyObject *
-array_concatenate(PyObject *dummy, PyObject *args, PyObject *kwds)
+array_concatenate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyObject *a0;
     int axis=0;
@@ -6734,7 +6734,7 @@
     return PyArray_Concatenate(a0, axis);
 }
 
-static PyObject *array_innerproduct(PyObject *dummy, PyObject *args) {
+static PyObject *array_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) {
     PyObject *b0, *a0;
 
     if (!PyArg_ParseTuple(args, "OO", &a0, &b0)) return NULL;
@@ -6742,7 +6742,7 @@
     return _ARET(PyArray_InnerProduct(a0, b0));
 }
 
-static PyObject *array_matrixproduct(PyObject *dummy, PyObject *args) {
+static PyObject *array_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) {
     PyObject *v, *a;
 
     if (!PyArg_ParseTuple(args, "OO", &a, &v)) return NULL;
@@ -6750,7 +6750,7 @@
     return _ARET(PyArray_MatrixProduct(a, v));
 }
 
-static PyObject *array_fastCopyAndTranspose(PyObject *dummy, PyObject *args) {
+static PyObject *array_fastCopyAndTranspose(PyObject *NPY_UNUSED(dummy), PyObject *args) {
     PyObject *a0;
 
     if (!PyArg_ParseTuple(args, "O", &a0)) return NULL;
@@ -6758,7 +6758,7 @@
     return _ARET(PyArray_CopyAndTranspose(a0));
 }
 
-static PyObject *array_correlate(PyObject *dummy, PyObject *args, PyObject *kwds) {
+static PyObject *array_correlate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) {
     PyObject *shape, *a0;
     int mode=0;
     static char *kwlist[] = {"a", "v", "mode", NULL};
@@ -6988,7 +6988,7 @@
 }
 
 static PyObject *
-array_arange(PyObject *ignored, PyObject *args, PyObject *kws) {
+array_arange(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws) {
     PyObject *o_start=NULL, *o_stop=NULL, *o_step=NULL;
     static char *kwd[]= {"start", "stop", "step", "dtype", NULL};
     PyArray_Descr *typecode=NULL;
@@ -7015,7 +7015,7 @@
 }
 
 static PyObject *
-array__get_ndarray_c_version(PyObject *dummy, PyObject *args, PyObject *kwds)
+array__get_ndarray_c_version(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     static char *kwlist[] = {NULL};
     if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist )) return NULL;
@@ -7024,7 +7024,7 @@
 }
 
 static PyObject *
-array__reconstruct(PyObject *dummy, PyObject *args)
+array__reconstruct(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
 
     PyObject *ret;
@@ -7056,7 +7056,7 @@
 }
 
 static PyObject *
-array_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds)
+array_set_string_function(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyObject *op=NULL;
     int repr=1;
@@ -7078,7 +7078,7 @@
 }
 
 static PyObject *
-array_set_ops_function(PyObject *self, PyObject *args, PyObject *kwds)
+array_set_ops_function(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *kwds)
 {
     PyObject *oldops=NULL;
 
@@ -7145,7 +7145,7 @@
 }
 
 static PyObject *
-array_where(PyObject *ignored, PyObject *args)
+array_where(PyObject *NPY_UNUSED(ignored), PyObject *args)
 {
     PyObject *obj=NULL, *x=NULL, *y=NULL;
 
@@ -7155,7 +7155,7 @@
 }
 
 static PyObject *
-array_lexsort(PyObject *ignored, PyObject *args, PyObject *kwds)
+array_lexsort(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
 {
     int axis=-1;
     PyObject *obj;
@@ -7170,7 +7170,7 @@
 #undef _ARET
 
 static PyObject *
-array_can_cast_safely(PyObject *dummy, PyObject *args, PyObject *kwds)
+array_can_cast_safely(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyArray_Descr *d1=NULL;
     PyArray_Descr *d2=NULL;
@@ -7201,7 +7201,7 @@
 }
 
 static PyObject *
-new_buffer(PyObject *dummy, PyObject *args)
+new_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     int size;
 
@@ -7212,7 +7212,7 @@
 }
 
 static PyObject *
-buffer_buffer(PyObject *dummy, PyObject *args, PyObject *kwds)
+buffer_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyObject *obj;
     Py_ssize_t offset=0, size=Py_END_OF_BUFFER, n;
@@ -7258,7 +7258,7 @@
     }
 
 static PyObject *
-as_buffer(PyObject *dummy, PyObject *args, PyObject *kwds)
+as_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyObject *mem;
     Py_ssize_t size;
@@ -7315,7 +7315,7 @@
 #undef _test_code
 
 static PyObject *
-format_longfloat(PyObject *dummy, PyObject *args, PyObject *kwds)
+format_longfloat(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyObject *obj;
     unsigned int precision;
@@ -7340,7 +7340,7 @@
 }
 
 static PyObject *
-compare_chararrays(PyObject *dummy, PyObject *args, PyObject *kwds)
+compare_chararrays(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
 {
     PyObject *array;
     PyObject *other;
@@ -7441,7 +7441,7 @@
 
 
 static PyObject *
-test_interrupt(PyObject *self, PyObject *args)
+test_interrupt(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int kind=0;
     int a = 0;
@@ -7531,7 +7531,7 @@
      METH_VARARGS | METH_KEYWORDS, NULL},
     {"test_interrupt", (PyCFunction)test_interrupt,
      METH_VARARGS, NULL},
-    {NULL,          NULL, 0}                /* sentinel */
+    {NULL, NULL, 0, NULL}                /* sentinel */
 };
 
 #include "__multiarray_api.c"
@@ -7546,7 +7546,7 @@
     Thus, we call PyType_Ready on the standard Python Types, here.
 */
 static int
-setup_scalartypes(PyObject *dict)
+setup_scalartypes(PyObject *NPY_UNUSED(dict))
 {
 
     initialize_numeric_types();

Modified: branches/ufunc_cleanup/numpy/core/src/scalarmathmodule.c.src
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/scalarmathmodule.c.src	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/scalarmathmodule.c.src	2008-10-21 02:48:38 UTC (rev 5952)
@@ -14,6 +14,7 @@
 
 /** numarray adapted routines.... **/
 
+#if SIZEOF_LONGLONG == 64 || SIZEOF_LONGLONG == 128
 static int ulonglong_overflow(ulonglong a, ulonglong b)
 {
     ulonglong ah, al, bh, bl, w, x, y, z;
@@ -50,6 +51,12 @@
 #endif
 
 }
+#else
+static int ulonglong_overflow(ulonglong NPY_UNUSED(a), ulonglong NPY_UNUSED(b))
+{
+	return 0;
+}
+#endif
 
 static int slonglong_overflow(longlong a0, longlong b0)
 {
@@ -665,7 +672,7 @@
 **/
 
 static PyObject *
-@name@_power(PyObject *a, PyObject *b, PyObject *c)
+@name@_power(PyObject *a, PyObject *b, PyObject *NPY_UNUSED(c))
 {
     PyObject *ret;
     @name@ arg1, arg2;
@@ -1117,7 +1124,7 @@
 char doc_alterpyscalars[] = "";
 
 static PyObject *
-alter_pyscalars(PyObject *dummy, PyObject *args)
+alter_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     int n;
     PyObject *obj;
@@ -1152,7 +1159,7 @@
 
 char doc_restorepyscalars[] = "";
 static PyObject *
-restore_pyscalars(PyObject *dummy, PyObject *args)
+restore_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     int n;
     PyObject *obj;
@@ -1186,7 +1193,7 @@
 
 char doc_usepythonmath[] = "";
 static PyObject *
-use_pythonmath(PyObject *dummy, PyObject *args)
+use_pythonmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     int n;
     PyObject *obj;
@@ -1220,7 +1227,7 @@
 
 char doc_usescalarmath[] = "";
 static PyObject *
-use_scalarmath(PyObject *dummy, PyObject *args)
+use_scalarmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     int n;
     PyObject *obj;
@@ -1261,7 +1268,7 @@
      METH_VARARGS, doc_usepythonmath},
     {"use_scalarmath", (PyCFunction) use_scalarmath,
      METH_VARARGS, doc_usescalarmath},
-    {NULL, NULL, 0}
+    {NULL, NULL, 0, NULL}
 };
 
 PyMODINIT_FUNC initscalarmath(void) {

Modified: branches/ufunc_cleanup/numpy/core/src/scalartypes.inc.src
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/scalartypes.inc.src	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/scalartypes.inc.src	2008-10-21 02:48:38 UTC (rev 5952)
@@ -24,6 +24,59 @@
     0,                                /*ob_size*/
     "numpy.@name@",                   /*tp_name*/
     sizeof(PyObject),                 /*tp_basicsize*/
+    0,                                  /* tp_itemsize */
+    /* methods */
+    0,   /* tp_dealloc */
+    0,   /* tp_print */
+    0,   /* tp_getattr */
+    0,   /* tp_setattr */
+    0,   /* tp_compare */
+    0,   /* tp_repr */
+    0,   /* tp_as_number */
+    0,   /* tp_as_sequence */
+    0,   /* tp_as_mapping */
+    0,   /* tp_hash */
+    0,   /* tp_call */
+    0,   /* tp_str */
+    0,   /* tp_getattro */
+    0,   /* tp_setattro */
+    0,   /* tp_as_buffer */
+    0,   /* tp_flags */
+    0,   /* tp_doc */
+    0,   /* tp_traverse */
+    0,   /* tp_clear */
+    0,   /* tp_richcompare */
+    0,   /* tp_weaklistoffset */
+    0,   /* tp_iter */ 
+    0,   /* tp_iternext */ 
+    0,   /* tp_methods */
+    0,   /* tp_members */
+    0,   /* tp_getset */
+    0,   /* tp_base */
+    0,   /* tp_dict */
+    0,   /* tp_descr_get */
+    0,   /* tp_descr_set */
+    0,   /* tp_dictoffset */
+    0,   /* tp_init */
+    0,   /* tp_alloc */
+    0,   /* tp_new */
+    0,   /* tp_free */
+    0,   /* tp_is_gc */
+    0,   /* tp_bases */
+    0,   /* tp_mro */
+    0,   /* tp_cache */
+    0,   /* tp_subclasses */
+    0,   /* tp_weaklist */
+    0,   /* tp_del */
+
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 };
 /**end repeat**/
 
@@ -373,7 +426,7 @@
 
 
 static PyObject *
-gentype_power(PyObject *m1, PyObject *m2, PyObject *m3)
+gentype_power(PyObject *m1, PyObject *m2, PyObject *NPY_UNUSED(m3))
 {
     PyObject *arr, *ret, *arg2;
     char *msg="unsupported operand type(s) for ** or pow()";
@@ -770,13 +823,13 @@
 }
 
 static PyObject *
-gentype_ndim_get(PyObject *self)
+gentype_ndim_get(PyObject *NPY_UNUSED(self))
 {
     return PyInt_FromLong(0);
 }
 
 static PyObject *
-gentype_flags_get(PyObject *self)
+gentype_flags_get(PyObject *NPY_UNUSED(self))
 {
     return PyArray_NewFlagsObject(NULL);
 }
@@ -827,7 +880,7 @@
 }
 
 static PyObject *
-gentype_size_get(PyObject *self)
+gentype_size_get(PyObject *NPY_UNUSED(self))
 {
     return PyInt_FromLong(1);
 }
@@ -866,13 +919,13 @@
 }
 
 static PyObject *
-gentype_priority_get(PyObject *self)
+gentype_priority_get(PyObject *NPY_UNUSED(self))
 {
     return PyFloat_FromDouble(NPY_SCALAR_PRIORITY);
 }
 
 static PyObject *
-gentype_shape_get(PyObject *self)
+gentype_shape_get(PyObject *NPY_UNUSED(self))
 {
     return PyTuple_New(0);
 }
@@ -902,7 +955,7 @@
 
 
 static PyObject *
-gentype_base_get(PyObject *self)
+gentype_base_get(PyObject *NPY_UNUSED(self))
 {
     Py_INCREF(Py_None);
     return Py_None;
@@ -1019,72 +1072,89 @@
     {"ndim",
         (getter)gentype_ndim_get,
         (setter) 0,
-        "number of array dimensions"},
+        "number of array dimensions",
+        NULL},
     {"flags",
         (getter)gentype_flags_get,
         (setter)0,
-        "integer value of flags"},
+        "integer value of flags",
+        NULL},
     {"shape",
         (getter)gentype_shape_get,
         (setter)0,
-        "tuple of array dimensions"},
+        "tuple of array dimensions",
+        NULL},
     {"strides",
         (getter)gentype_shape_get,
         (setter) 0,
-        "tuple of bytes steps in each dimension"},
+        "tuple of bytes steps in each dimension",
+        NULL},
     {"data",
         (getter)gentype_data_get,
         (setter) 0,
-        "pointer to start of data"},
+        "pointer to start of data",
+        NULL},
     {"itemsize",
         (getter)gentype_itemsize_get,
         (setter)0,
-        "length of one element in bytes"},
+        "length of one element in bytes",
+        NULL},
     {"size",
         (getter)gentype_size_get,
         (setter)0,
-        "number of elements in the gentype"},
+        "number of elements in the gentype",
+        NULL},
     {"nbytes",
         (getter)gentype_itemsize_get,
         (setter)0,
-        "length of item in bytes"},
+        "length of item in bytes",
+        NULL},
     {"base",
         (getter)gentype_base_get,
         (setter)0,
-        "base object"},
+        "base object",
+        NULL},
     {"dtype",
         (getter)gentype_typedescr_get,
         NULL,
-        "get array data-descriptor"},
+        "get array data-descriptor",
+        NULL},
     {"real",
         (getter)gentype_real_get,
         (setter)0,
-        "real part of scalar"},
+        "real part of scalar",
+        NULL},
     {"imag",
         (getter)gentype_imag_get,
         (setter)0,
-        "imaginary part of scalar"},
+        "imaginary part of scalar",
+        NULL},
     {"flat",
         (getter)gentype_flat_get,
         (setter)0,
-        "a 1-d view of scalar"},
+        "a 1-d view of scalar",
+        NULL},
     {"T",
         (getter)gentype_transpose_get,
         (setter)0,
-        "transpose"},
+        "transpose",
+        NULL},
     {"__array_interface__",
         (getter)gentype_interface_get,
         NULL,
-        "Array protocol: Python side"},
+        "Array protocol: Python side",
+        NULL},
     {"__array_struct__",
         (getter)gentype_struct_get,
         NULL,
-        "Array protocol: struct"},
+        "Array protocol: struct",
+        NULL},
     {"__array_priority__",
         (getter)gentype_priority_get,
         NULL,
-        "Array priority."},
-    {NULL, NULL, NULL, NULL}  /* Sentinel */
+        "Array priority.",
+        NULL},
+    {NULL, NULL, NULL, NULL, NULL}  /* Sentinel */
 };
 
 
@@ -1110,7 +1180,7 @@
 static char doc_sc_wraparray[] = "sc.__array_wrap__(obj) return scalar from array";
 
 static PyObject *
-gentype_wraparray(PyObject *scalar, PyObject *args)
+gentype_wraparray(PyObject *NPY_UNUSED(scalar), PyObject *args)
 {
     PyObject *arr;
 
@@ -1143,7 +1213,7 @@
 /**end repeat**/
 
 static PyObject *
-gentype_itemset(PyObject *self, PyObject *args)
+gentype_itemset(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
 {
     PyErr_SetString(PyExc_ValueError, "array-scalars are immutable");
     return NULL;
@@ -1230,7 +1300,7 @@
 }
 
 static PyObject *
-gentype_setfield(PyObject *self, PyObject *args, PyObject *kwds)
+gentype_setfield(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds))
 {
     PyErr_SetString(PyExc_TypeError,
             "Can't set fields in a non-void array scalar.");
@@ -1296,7 +1366,7 @@
 
 
 static PyObject *
-gentype_reduce(PyObject *self, PyObject *args)
+gentype_reduce(PyObject *self, PyObject *NPY_UNUSED(args))
 {
     PyObject *ret=NULL, *obj=NULL, *mod=NULL;
     const char *buffer;
@@ -1369,7 +1439,7 @@
 
 /* ignores everything */
 static PyObject *
-gentype_setstate(PyObject *self, PyObject *args)
+gentype_setstate(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args))
 {
     Py_INCREF(Py_None);
     return (Py_None);
@@ -1400,7 +1470,7 @@
 
 /* setting flags cannot be done for scalars */
 static PyObject *
-gentype_setflags(PyObject *self, PyObject *args, PyObject *kwds)
+gentype_setflags(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *NPY_UNUSED(kwds))
 {
     Py_INCREF(Py_None);
     return Py_None;
@@ -1574,7 +1644,7 @@
     {"newbyteorder",
         (PyCFunction)gentype_newbyteorder,
         METH_VARARGS, NULL},
-    {NULL, NULL}           /* sentinel */
+    {NULL, NULL, 0, NULL} /* sentinel */
 };
 
 
@@ -1582,12 +1652,14 @@
     {"flags",
         (getter)voidtype_flags_get,
         (setter)0,
-        "integer value of flags"},
+        "integer value of flags",
+        NULL},
     {"dtype",
         (getter)voidtype_dtypedescr_get,
         (setter)0,
-        "dtype object"},
-    {NULL, NULL}
+        "dtype object",
+        NULL},
+    {NULL, NULL, NULL, NULL, NULL}
 };
 
 static PyMethodDef voidtype_methods[] = {
@@ -1597,7 +1669,7 @@
     {"setfield",
         (PyCFunction)voidtype_setfield,
         METH_VARARGS | METH_KEYWORDS, NULL},
-    {NULL, NULL}
+    {NULL, NULL, 0, NULL}
 };
 
 /************* As_mapping functions for void array scalar ************/
@@ -1757,15 +1829,19 @@
     0,                                          /*sq_repeat*/
     (ssizeargfunc)voidtype_item,                /*sq_item*/
     0,                                          /*sq_slice*/
-    (ssizeobjargproc)voidtype_ass_item          /*sq_ass_item*/
+    (ssizeobjargproc)voidtype_ass_item,         /*sq_ass_item*/
 #else
         (inquiry)voidtype_length,               /*sq_length*/
     0,                                          /*sq_concat*/
     0,                                          /*sq_repeat*/
     (intargfunc)voidtype_item,                  /*sq_item*/
     0,                                          /*sq_slice*/
-    (intobjargproc)voidtype_ass_item            /*sq_ass_item*/
+    (intobjargproc)voidtype_ass_item,           /*sq_ass_item*/
 #endif
+    0,                                          /* ssq_ass_slice */
+    0,                                          /* sq_contains */
+    0,                                          /* sq_inplace_concat */
+    0,                                          /* sq_inplace_repeat */
 };
 
 
@@ -1844,6 +1920,59 @@
     0,                          /*ob_size*/
     "numpy.generic",            /*tp_name*/
     sizeof(PyObject),           /*tp_basicsize*/
+    0,   /* tp_itemsize */
+    /* methods */
+    0,   /* tp_dealloc */
+    0,   /* tp_print */
+    0,   /* tp_getattr */
+    0,   /* tp_setattr */
+    0,   /* tp_compare */
+    0,   /* tp_repr */
+    0,   /* tp_as_number */
+    0,   /* tp_as_sequence */
+    0,   /* tp_as_mapping */
+    0,   /* tp_hash */
+    0,   /* tp_call */
+    0,   /* tp_str */
+    0,   /* tp_getattro */
+    0,   /* tp_setattro */
+    0,   /* tp_as_buffer */
+    0,   /* tp_flags */
+    0,   /* tp_doc */
+    0,   /* tp_traverse */
+    0,   /* tp_clear */
+    0,   /* tp_richcompare */
+    0,   /* tp_weaklistoffset */
+    0,   /* tp_iter */ 
+    0,   /* tp_iternext */ 
+    0,   /* tp_methods */
+    0,   /* tp_members */
+    0,   /* tp_getset */
+    0,   /* tp_base */
+    0,   /* tp_dict */
+    0,   /* tp_descr_get */
+    0,   /* tp_descr_set */
+    0,   /* tp_dictoffset */
+    0,   /* tp_init */
+    0,   /* tp_alloc */
+    0,   /* tp_new */
+    0,   /* tp_free */
+    0,   /* tp_is_gc */
+    0,   /* tp_bases */
+    0,   /* tp_mro */
+    0,   /* tp_cache */
+    0,   /* tp_subclasses */
+    0,   /* tp_weaklist */
+    0,   /* tp_del */
+
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 };
 
 static void
@@ -1892,8 +2021,16 @@
 #work=0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,0#
 #default=0*16,1*2,2#
 */
+
+#define _NPY_UNUSED2_1 
+#define _NPY_UNUSED2_z
+#define _NPY_UNUSED2_0 NPY_UNUSED
+#define _NPY_UNUSED1_0
+#define _NPY_UNUSED1_1
+#define _NPY_UNUSED1_2 NPY_UNUSED
+
 static PyObject *
-@name@_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+@name@_arrtype_new(PyTypeObject *_NPY_UNUSED1_@default@(type), PyObject *args, PyObject *_NPY_UNUSED2_@work@(kwds))
 {
     PyObject *obj = NULL;
     PyObject *robj;
@@ -1999,7 +2136,7 @@
 
 /* bool->tp_new only returns Py_True or Py_False */
 static PyObject *
-bool_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+bool_arrtype_new(PyTypeObject *NPY_UNUSED(type), PyObject *args, PyObject *NPY_UNUSED(kwds))
 {
     PyObject *obj=NULL;
     PyObject *arr;
@@ -2092,10 +2229,36 @@
     (binaryfunc)bool_arrtype_and,           /* nb_and */
     (binaryfunc)bool_arrtype_xor,           /* nb_xor */
     (binaryfunc)bool_arrtype_or,            /* nb_or */
+    0,	/* nb_coerce */
+    0,  /* nb_int */
+    0,  /* nb_long */
+    0,  /* nb_float */
+    0,  /* nb_oct */
+    0,  /* nb_hex */
+    /* Added in release 2.0 */
+    0, 	/* nb_inplace_add */
+    0,	/* nb_inplace_subtract */
+    0,	/* nb_inplace_multiply */
+    0,	/* nb_inplace_divide */
+    0,	/* nb_inplace_remainder */
+    0,	/* nb_inplace_power */
+    0,	/* nb_inplace_lshift */
+    0,	/* nb_inplace_rshift */
+    0,	/* nb_inplace_and */
+    0,	/* nb_inplace_xor */
+    0,	/* nb_inplace_or */
+    /* Added in release 2.2 */
+    /* The following require the Py_TPFLAGS_HAVE_CLASS flag */
+    0, 	/* nb_floor_divide */
+    0, 	/* nb_true_divide */
+    0, 	/* nb_inplace_floor_divide */
+    0, 	/* nb_inplace_true_divide */
+    /* Added in release 2.5 */
+    0, 	/* nb_index */
 };
 
 static PyObject *
-void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds))
 {
     PyObject *obj, *arr;
     ulonglong memu=1;
@@ -2489,6 +2652,40 @@
     (setattrofunc)object_arrtype_setattro,    /* tp_setattro */
     &object_arrtype_as_buffer,                /* tp_as_buffer */
     0,                                        /* tp_flags */
+    0,   				      /* tp_doc */
+    0,   				      /* tp_traverse */
+    0,   				      /* tp_clear */
+    0,   				      /* tp_richcompare */
+    0,   				      /* tp_weaklistoffset */
+    0,   				      /* tp_iter */ 
+    0,   				      /* tp_iternext */ 
+    0,   				      /* tp_methods */
+    0,   				      /* tp_members */
+    0,   				      /* tp_getset */
+    0,   				      /* tp_base */
+    0,   				      /* tp_dict */
+    0,   				      /* tp_descr_get */
+    0,   				      /* tp_descr_set */
+    0,   				      /* tp_dictoffset */
+    0,   				      /* tp_init */
+    0,   				      /* tp_alloc */
+    0,   				      /* tp_new */
+    0,   				      /* tp_free */
+    0,   				      /* tp_is_gc */
+    0,   				      /* tp_bases */
+    0,   				      /* tp_mro */
+    0,   				      /* tp_cache */
+    0,   				      /* tp_subclasses */
+    0,   				      /* tp_weaklist */
+    0,   				      /* tp_del */
+#ifdef COUNT_ALLOCS
+    /* these must be last and never explicitly initialized */
+    0, 					      /* tp_allocs */
+    0, 					      /* tp_frees */
+    0, 					      /* tp_maxalloc */
+    0, 					      /* tp_prev */
+    0, 					      /* *tp_next */
+#endif
 };
 
 
@@ -2549,6 +2746,57 @@
     0,                                        /*ob_size*/
     "numpy.@name@@ex@",                       /*tp_name*/
     sizeof(Py@NAME@ScalarObject),             /*tp_basicsize*/
+    0,                                        /* tp_itemsize */
+    0,       				      /* tp_dealloc */
+    0,                                        /* tp_print */
+    0,                                        /* tp_getattr */
+    0,                                        /* tp_setattr */
+    0,                                        /* tp_compare */
+    0,                                        /* tp_repr */
+    0,                                        /* tp_as_number */
+    0,              			      /* tp_as_sequence */
+    0,               			      /* tp_as_mapping */
+    0,                                        /* tp_hash */
+    0,         				      /* tp_call */
+    0,                                        /* tp_str */
+    0,					      /* tp_getattro */
+    0,					      /* tp_setattro */
+    0,					      /* tp_as_buffer */
+    0,                                        /* tp_flags */
+    0,   				      /* tp_doc */
+    0,   				      /* tp_traverse */
+    0,   				      /* tp_clear */
+    0,   				      /* tp_richcompare */
+    0,   				      /* tp_weaklistoffset */
+    0,   				      /* tp_iter */ 
+    0,   				      /* tp_iternext */ 
+    0,   				      /* tp_methods */
+    0,   				      /* tp_members */
+    0,   				      /* tp_getset */
+    0,   				      /* tp_base */
+    0,   				      /* tp_dict */
+    0,   				      /* tp_descr_get */
+    0,   				      /* tp_descr_set */
+    0,   				      /* tp_dictoffset */
+    0,   				      /* tp_init */
+    0,   				      /* tp_alloc */
+    0,   				      /* tp_new */
+    0,   				      /* tp_free */
+    0,   				      /* tp_is_gc */
+    0,   				      /* tp_bases */
+    0,   				      /* tp_mro */
+    0,   				      /* tp_cache */
+    0,   				      /* tp_subclasses */
+    0,   				      /* tp_weaklist */
+    0,   				      /* tp_del */
+#ifdef COUNT_ALLOCS
+    /* these must be last and never explicitly initialized */
+    0, 					      /* tp_allocs */
+    0, 					      /* tp_frees */
+    0, 					      /* tp_maxalloc */
+    0, 					      /* tp_prev */
+    0, 					      /* *tp_next */
+#endif
 };
 /**end repeat**/
 
@@ -2579,6 +2827,57 @@
     0,                                          /*ob_size*/
     "numpy.@name@" _THIS_SIZE,                  /*tp_name*/
     sizeof(Py@NAME@ScalarObject),               /*tp_basicsize*/
+    0,                                        /* tp_itemsize */
+    0,       				      /* tp_dealloc */
+    0,                                        /* tp_print */
+    0,                                        /* tp_getattr */
+    0,                                        /* tp_setattr */
+    0,                                        /* tp_compare */
+    0,                                        /* tp_repr */
+    0,                                        /* tp_as_number */
+    0,              			      /* tp_as_sequence */
+    0,               			      /* tp_as_mapping */
+    0,                                        /* tp_hash */
+    0,         				      /* tp_call */
+    0,                                        /* tp_str */
+    0,					      /* tp_getattro */
+    0,					      /* tp_setattro */
+    0,					      /* tp_as_buffer */
+    0,                                        /* tp_flags */
+    0,   				      /* tp_doc */
+    0,   				      /* tp_traverse */
+    0,   				      /* tp_clear */
+    0,   				      /* tp_richcompare */
+    0,   				      /* tp_weaklistoffset */
+    0,   				      /* tp_iter */ 
+    0,   				      /* tp_iternext */ 
+    0,   				      /* tp_methods */
+    0,   				      /* tp_members */
+    0,   				      /* tp_getset */
+    0,   				      /* tp_base */
+    0,   				      /* tp_dict */
+    0,   				      /* tp_descr_get */
+    0,   				      /* tp_descr_set */
+    0,   				      /* tp_dictoffset */
+    0,   				      /* tp_init */
+    0,   				      /* tp_alloc */
+    0,   				      /* tp_new */
+    0,   				      /* tp_free */
+    0,   				      /* tp_is_gc */
+    0,   				      /* tp_bases */
+    0,   				      /* tp_mro */
+    0,   				      /* tp_cache */
+    0,   				      /* tp_subclasses */
+    0,   				      /* tp_weaklist */
+    0,   				      /* tp_del */
+#ifdef COUNT_ALLOCS
+    /* these must be last and never explicitly initialized */
+    0, 					      /* tp_allocs */
+    0, 					      /* tp_frees */
+    0, 					      /* tp_maxalloc */
+    0, 					      /* tp_prev */
+    0, 					      /* *tp_next */
+#endif
 };
 
 #undef _THIS_SIZE
@@ -2642,6 +2941,39 @@
     0,                                              /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT,                             /*tp_flags*/
     "Composed of two " _THIS_SIZE2 " bit floats",   /* tp_doc */
+    0,   				      /* tp_traverse */
+    0,   				      /* tp_clear */
+    0,   				      /* tp_richcompare */
+    0,   				      /* tp_weaklistoffset */
+    0,   				      /* tp_iter */ 
+    0,   				      /* tp_iternext */ 
+    0,   				      /* tp_methods */
+    0,   				      /* tp_members */
+    0,   				      /* tp_getset */
+    0,   				      /* tp_base */
+    0,   				      /* tp_dict */
+    0,   				      /* tp_descr_get */
+    0,   				      /* tp_descr_set */
+    0,   				      /* tp_dictoffset */
+    0,   				      /* tp_init */
+    0,   				      /* tp_alloc */
+    0,   				      /* tp_new */
+    0,   				      /* tp_free */
+    0,   				      /* tp_is_gc */
+    0,   				      /* tp_bases */
+    0,   				      /* tp_mro */
+    0,   				      /* tp_cache */
+    0,   				      /* tp_subclasses */
+    0,   				      /* tp_weaklist */
+    0,   				      /* tp_del */
+#ifdef COUNT_ALLOCS
+    /* these must be last and never explicitly initialized */
+    0, 					      /* tp_allocs */
+    0, 					      /* tp_frees */
+    0, 					      /* tp_maxalloc */
+    0, 					      /* tp_prev */
+    0, 					      /* *tp_next */
+#endif
 };
 #undef _THIS_SIZE1
 #undef _THIS_SIZE2

Modified: branches/ufunc_cleanup/numpy/core/src/ufuncobject.c
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/ufuncobject.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/ufuncobject.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -3500,7 +3500,7 @@
 }
 
 static PyObject *
-ufunc_geterr(PyObject *dummy, PyObject *args)
+ufunc_geterr(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyObject *thedict;
     PyObject *res;
@@ -3563,7 +3563,7 @@
 #endif
 
 static PyObject *
-ufunc_seterr(PyObject *dummy, PyObject *args)
+ufunc_seterr(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyObject *thedict;
     int res;
@@ -3600,7 +3600,7 @@
 doc_frompyfunc[] = "frompyfunc(func, nin, nout) take an arbitrary python function that takes nin objects as input and returns nout objects and return a universal function (ufunc).  This ufunc always returns PyObject arrays";
 
 static PyObject *
-ufunc_frompyfunc(PyObject *dummy, PyObject *args, PyObject *kwds) {
+ufunc_frompyfunc(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *NPY_UNUSED(kwds)) {
     /* Keywords are ignored for now */
 
     PyObject *function, *pyname=NULL;
@@ -4034,13 +4034,13 @@
 
 
 static struct PyMethodDef ufunc_methods[] = {
-    {"reduce",  (PyCFunction)ufunc_reduce, METH_VARARGS | METH_KEYWORDS },
+    {"reduce",  (PyCFunction)ufunc_reduce, METH_VARARGS | METH_KEYWORDS, NULL },
     {"accumulate",  (PyCFunction)ufunc_accumulate,
-     METH_VARARGS | METH_KEYWORDS },
+     METH_VARARGS | METH_KEYWORDS, NULL },
     {"reduceat",  (PyCFunction)ufunc_reduceat,
-     METH_VARARGS | METH_KEYWORDS },
-    {"outer", (PyCFunction)ufunc_outer, METH_VARARGS | METH_KEYWORDS },
-    {NULL,          NULL}           /* sentinel */
+     METH_VARARGS | METH_KEYWORDS, NULL },
+    {"outer", (PyCFunction)ufunc_outer, METH_VARARGS | METH_KEYWORDS, NULL},
+    {NULL, NULL, 0, NULL}           /* sentinel */
 };
 
 
@@ -4193,15 +4193,15 @@
 /* static char *Ufunctype__doc__ = NULL; */
 
 static PyGetSetDef ufunc_getset[] = {
-    {"__doc__",  (getter)ufunc_get_doc,      NULL, "documentation string"},
-    {"nin",      (getter)ufunc_get_nin,      NULL, "number of inputs"},
-    {"nout",     (getter)ufunc_get_nout,     NULL, "number of outputs"},
-    {"nargs",    (getter)ufunc_get_nargs,    NULL, "number of arguments"},
-    {"ntypes",   (getter)ufunc_get_ntypes,   NULL, "number of types"},
-    {"types",    (getter)ufunc_get_types,    NULL, "return a list with types grouped input->output"},
-    {"__name__", (getter)ufunc_get_name,     NULL, "function name"},
-    {"identity", (getter)ufunc_get_identity, NULL, "identity value"},
-    {NULL, NULL, NULL, NULL},  /* Sentinel */
+    {"__doc__",  (getter)ufunc_get_doc,      NULL, "documentation string", NULL},
+    {"nin",      (getter)ufunc_get_nin,      NULL, "number of inputs", NULL},
+    {"nout",     (getter)ufunc_get_nout,     NULL, "number of outputs", NULL},
+    {"nargs",    (getter)ufunc_get_nargs,    NULL, "number of arguments", NULL},
+    {"ntypes",   (getter)ufunc_get_ntypes,   NULL, "number of types", NULL},
+    {"types",    (getter)ufunc_get_types,    NULL, "return a list with types grouped input->output", NULL},
+    {"__name__", (getter)ufunc_get_name,     NULL, "function name", NULL},
+    {"identity", (getter)ufunc_get_identity, NULL, "identity value", NULL},
+    {NULL, NULL, NULL, NULL, NULL},  /* Sentinel */
 };
 
 static PyTypeObject PyUFunc_Type = {
@@ -4237,6 +4237,31 @@
     ufunc_methods,                 /* tp_methods */
     0,                             /* tp_members */
     ufunc_getset,                  /* tp_getset */
+    0,   /* tp_base */
+    0,   /* tp_dict */
+    0,   /* tp_descr_get */
+    0,   /* tp_descr_set */
+    0,   /* tp_dictoffset */
+    0,   /* tp_init */
+    0,   /* tp_alloc */
+    0,   /* tp_new */
+    0,   /* tp_free */
+    0,   /* tp_is_gc */
+    0,   /* tp_bases */
+    0,   /* tp_mro */
+    0,   /* tp_cache */
+    0,   /* tp_subclasses */
+    0,   /* tp_weaklist */
+    0,   /* tp_del */
+
+#ifdef COUNT_ALLOCS
+	/* these must be last and never explicitly initialized */
+    0, /* tp_allocs */
+    0, /* tp_frees */
+    0, /* tp_maxalloc */
+    0, /* tp_prev */
+    0, /* *tp_next */
+#endif
 };
 
 /* End of code for ufunc objects */

Modified: branches/ufunc_cleanup/numpy/core/src/umathmodule.c.src
===================================================================
--- branches/ufunc_cleanup/numpy/core/src/umathmodule.c.src	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/core/src/umathmodule.c.src	2008-10-21 02:48:38 UTC (rev 5952)
@@ -56,7 +56,7 @@
 }
 
 static PyObject *
-Py_get_one(PyObject *o)
+Py_get_one(PyObject *NPY_UNUSED(o))
 {
     return PyInt_FromLong(1);
 }
@@ -106,7 +106,7 @@
  */
 
 
-/*
+/* 
  * Don't pass structures between functions (only pointers) because how
  * structures are passed is compiler dependent and could cause
  * segfaults if ufuncobject.c is compiled with a different compiler
@@ -554,7 +554,7 @@
  **/
 
 static void
-BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         Bool in1 = *((Bool *)ip1) != 0;
@@ -565,7 +565,7 @@
 /**end repeat**/
 
 static void
-BOOL_logical_xor(char **args, intp *dimensions, intp *steps, void *func)
+BOOL_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         Bool in1 = *((Bool *)ip1) != 0;
@@ -579,7 +579,7 @@
  * #OP =  >, <#
  **/
 static void
-BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         Bool in1 = *((Bool *)ip1) != 0;
@@ -594,7 +594,7 @@
  * #OP =  !=, ==#
  **/
 static void
-BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         Bool in1 = *(Bool *)ip1;
@@ -604,7 +604,7 @@
 /**end repeat**/
 
 static void
-BOOL_ones_like(char **args, intp *dimensions, intp *steps, void *data)
+BOOL_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     OUTPUT_LOOP {
         *((Bool *)op) = 1;
@@ -633,7 +633,7 @@
 #define @S@@TYPE@_floor_divide @S@@TYPE@_divide
 
 static void
-@S@@TYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *data)
+@S@@TYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     OUTPUT_LOOP {
         *((@s@@type@ *)op) = 1;
@@ -641,7 +641,7 @@
 }
 
 static void
-@S@@TYPE@_square(char **args, intp *dimensions, intp *steps, void *data)
+@S@@TYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     UNARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -650,16 +650,16 @@
 }
 
 static void
-@S@@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *data)
+@S@@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     UNARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
-        *((@s@@type@ *)op) = (@s@@type@)(1.0/in1);
+        *((@s@@type@ *)op) = 1.0/in1;
     }
 }
 
 static void
-@S@@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -668,7 +668,7 @@
 }
 
 static void
-@S@@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -677,7 +677,7 @@
 }
 
 static void
-@S@@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -686,7 +686,7 @@
 }
 
 static void
-@S@@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -701,7 +701,7 @@
  * #OP = +, -,*, &, |, ^, <<, >>#
  */
 static void
-@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -717,7 +717,7 @@
  * #OP =  ==, !=, >, >=, <, <=, &&, ||#
  */
 static void
-@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -728,7 +728,7 @@
 /**end repeat2**/
 
 static void
-@S@@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -742,7 +742,7 @@
  * #OP =  >, <#
  **/
 static void
-@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -753,7 +753,7 @@
 /**end repeat2**/
 
 static void
-@S@@TYPE@_true_divide(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -769,7 +769,7 @@
 }
 
 static void
-@S@@TYPE@_power(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @ftype@ in1 = (@ftype@)*(@s@@type@ *)ip1;
@@ -779,7 +779,7 @@
 }
 
 static void
-@S@@TYPE@_fmod(char **args, intp *dimensions, intp *steps, void *func)
+@S@@TYPE@_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @s@@type@ in1 = *(@s@@type@ *)ip1;
@@ -798,7 +798,7 @@
 /**end repeat1**/
 
 static void
-U@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func)
+U@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const u@type@ in1 = *(u@type@ *)ip1;
@@ -807,7 +807,7 @@
 }
 
 static void
-@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -816,7 +816,7 @@
 }
 
 static void
-U@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func)
+U@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const u@type@ in1 = *(u@type@ *)ip1;
@@ -825,7 +825,7 @@
 }
 
 static void
-@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -834,7 +834,7 @@
 }
 
 static void
-@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -853,7 +853,7 @@
 }
 
 static void
-U@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *func)
+U@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const u@type@ in1 = *(u@type@ *)ip1;
@@ -869,7 +869,7 @@
 }
 
 static void
-@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -892,7 +892,7 @@
 }
 
 static void
-U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func)
+U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const u@type@ in1 = *(u@type@ *)ip1;
@@ -924,16 +924,13 @@
  *  #C = F, , L#
  */
 
-#define ONE 1.0@c@
-#define ZERO 0.0@c@
-
 /**begin repeat1
  * Arithmetic
  * # kind = add, subtract, multiply, divide#
  * # OP = +, -, *, /#
  */
 static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -949,7 +946,7 @@
  * #OP = ==, !=, <, <=, >, >=, &&, ||#
  */
 static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -960,7 +957,7 @@
 /**end repeat1**/
 
 static void
-@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -970,7 +967,7 @@
 }
 
 static void
-@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -983,7 +980,7 @@
  * #func = isnan, isinf, isfinite, signbit#
  **/
 static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -994,48 +991,32 @@
 
 /**begin repeat1
  * #kind = maximum, minimum#
- * #OP =  >=, <=#
+ * #OP =  >, <#
  **/
 static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     /*  */
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
         const @type@ in2 = *(@type@ *)ip2;
-        *((@type@ *)op) = (in1 @OP@ in2 || isnan(in1)) ? in1 : in2;
+        *((@type@ *)op) = in1 @OP@ in2 ? in1 : in2;
     }
 }
 /**end repeat1**/
 
-/**begin repeat1
- * #kind = fmax, fmin#
- * #OP =  >=, <=#
- **/
 static void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
-    /*  */
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
         const @type@ in2 = *(@type@ *)ip2;
-        *((@type@ *)op) = (in1 @OP@ in2 || isnan(in2)) ? in1 : in2;
-    }
-}
-/**end repeat1**/
-
-static void
-@TYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *func)
-{
-    BINARY_LOOP {
-        const @type@ in1 = *(@type@ *)ip1;
-        const @type@ in2 = *(@type@ *)ip2;
         *((@type@ *)op) = floor@c@(in1/in2);
     }
 }
 
 static void
-@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -1051,7 +1032,7 @@
 }
 
 static void
-@TYPE@_square(char **args, intp *dimensions, intp *steps, void *data)
+@TYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -1060,24 +1041,24 @@
 }
 
 static void
-@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *data)
+@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
-        *((@type@ *)op) = ONE/in1;
+        *((@type@ *)op) = 1.0/in1;
     }
 }
 
 static void
-@TYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *data)
+@TYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     OUTPUT_LOOP {
-        *((@type@ *)op) = ONE;
+        *((@type@ *)op) = 1;
     }
 }
 
 static void
-@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -1086,18 +1067,18 @@
 }
 
 static void
-@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
-        const @type@ tmp = in1 > 0 ? in1 : -in1;
+        const @type@ tmp = (in1 > 0) ? in1 : -in1;
         /* add 0 to clear -0.0 */
         *((@type@ *)op) = tmp + 0;
     }
 }
 
 static void
-@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -1106,7 +1087,7 @@
 }
 
 static void
-@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     /*  */
     UNARY_LOOP {
@@ -1124,7 +1105,7 @@
 }
 
 static void
-@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP_TWO_OUT {
         const @type@ in1 = *(@type@ *)ip1;
@@ -1134,7 +1115,7 @@
 
 #ifdef HAVE_FREXP@C@
 static void
-@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP_TWO_OUT {
         const @type@ in1 = *(@type@ *)ip1;
@@ -1145,7 +1126,7 @@
 
 #ifdef HAVE_LDEXP@C@
 static void
-@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *func)
+@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1 = *(@type@ *)ip1;
@@ -1157,9 +1138,6 @@
 
 #define @TYPE@_true_divide @TYPE@_divide
 
-#undef ONE
-#undef ZERO
-
 /**end repeat**/
 
 
@@ -1177,18 +1155,13 @@
  * #c = f, , l#
  */
 
-#define CGE(xr,xi,yr,yi) (xr > yr || (xr == yr && xi >= yi))
-#define CLE(xr,xi,yr,yi) (xr < yr || (xr == yr && xi <= yi))
-#define ONE 1.0@c@
-#define ZERO 0.0@c@
-
 /**begin repeat1
  * arithmetic
  * #kind = add, subtract#
  * #OP = +, -#
  */
 static void
-@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1202,7 +1175,7 @@
 /**end repeat1**/
 
 static void
-@CTYPE@_multiply(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1215,7 +1188,7 @@
 }
 
 static void
-@CTYPE@_divide(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1229,7 +1202,7 @@
 }
 
 static void
-@CTYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1248,7 +1221,7 @@
    #OP2 = &&, ||#
 */
 static void
-@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1265,7 +1238,7 @@
  * #OP = >, >=, <, <=#
  */
 static void
-@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1288,7 +1261,7 @@
    #OP2 = &&, ||#
 */
 static void
-@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1301,7 +1274,7 @@
 /**end repeat1**/
 
 static void
-@CTYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1315,7 +1288,7 @@
 }
 
 static void
-@CTYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1330,7 +1303,7 @@
  * #OP = ||, ||, &&#
  **/
 static void
-@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1341,7 +1314,7 @@
 /**end repeat1**/
 
 static void
-@CTYPE@_square(char **args, intp *dimensions, intp *steps, void *data)
+@CTYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     UNARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1352,7 +1325,7 @@
 }
 
 static void
-@CTYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *data)
+@CTYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     UNARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1372,16 +1345,16 @@
 }
 
 static void
-@CTYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *data)
+@CTYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))
 {
     OUTPUT_LOOP {
-        ((@type@ *)op)[0] = ONE;
-        ((@type@ *)op)[1] = ZERO;
+        ((@type@ *)op)[0] = 1;
+        ((@type@ *)op)[1] = 0;
     }
 }
 
 static void
-@CTYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *func) {
+@CTYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) {
     UNARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
         const @type@ in1i = ((@type@ *)ip1)[1];
@@ -1391,7 +1364,7 @@
 }
 
 static void
-@CTYPE@_absolute(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
@@ -1401,84 +1374,49 @@
 }
 
 static void
-@CTYPE@_sign(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     UNARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
         const @type@ in1i = ((@type@ *)ip1)[1];
         if (in1r > 0) {
-            ((@type@ *)op)[0] = ONE;
+            ((@type@ *)op)[0] = 1;
         }
         else if (in1r < 0) {
-            ((@type@ *)op)[0] = -ONE;
+            ((@type@ *)op)[0] = -1;
         }
         else {
             if (in1i > 0) {
-                ((@type@ *)op)[0] = ONE;
+                ((@type@ *)op)[0] = 1;
             }
             else if (in1i < 0) {
-                ((@type@ *)op)[0] = -ONE;
+                ((@type@ *)op)[0] = -1;
             }
             else {
-                ((@type@ *)op)[0] = ZERO;
+                ((@type@ *)op)[0] = 0;
             }
         }
-        ((@type@ *)op)[1] = ZERO;
+        ((@type@ *)op)[1] = 0;
     }
 }
 
 /**begin repeat1
  * #kind = maximum, minimum#
- * #OP1 = CGE, CLE#
- * #OP2 = CLE, CGE#
+ * #OP = >, <#
  */
 static void
-@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
+@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     BINARY_LOOP {
         const @type@ in1r = ((@type@ *)ip1)[0];
         const @type@ in1i = ((@type@ *)ip1)[1];
         const @type@ in2r = ((@type@ *)ip2)[0];
         const @type@ in2i = ((@type@ *)ip2)[1];
-        if (@OP1@(in1r, in1i, in2r, in2i)) {
+        if (in1r @OP@ in2r || ((in1r == in2r) && (in1i @OP@ in2i))) {
             ((@type@ *)op)[0] = in1r;
             ((@type@ *)op)[1] = in1i;
         }
-        else if (@OP2@(in1r, in1i, in2r, in2i)) {
-            ((@type@ *)op)[0] = in2r;
-            ((@type@ *)op)[1] = in2i;
-        }
         else {
-            ((@type@ *)op)[0] = NAN;
-            ((@type@ *)op)[1] = NAN;
-        }
-    }
-}
-/**end repeat1**/
-
-/**begin repeat1
- * #kind = fmax, fmin#
- * #OP1 = CGE, CLE#
- */
-static void
-@CTYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *func)
-{
-    BINARY_LOOP {
-        const @type@ in1r = ((@type@ *)ip1)[0];
-        const @type@ in1i = ((@type@ *)ip1)[1];
-        const @type@ in2r = ((@type@ *)ip2)[0];
-        const @type@ in2i = ((@type@ *)ip2)[1];
-        if (@OP1@(in1r, in1i, in2r, in2i) || isnan(in2r) || isnan(in2i)) {
-            if (isnan(in1r) || isnan(in1i)) {
-                ((@type@ *)op)[0] = NAN;
-                ((@type@ *)op)[1] = NAN;
-            }
-            else {
-                ((@type@ *)op)[0] = in1r;
-                ((@type@ *)op)[1] = in1i;
-            }
-        }
-        else {
             ((@type@ *)op)[0] = in2r;
             ((@type@ *)op)[1] = in2i;
         }
@@ -1487,12 +1425,6 @@
 /**end repeat1**/
 
 #define @CTYPE@_true_divide @CTYPE@_divide
-
-#undef CGE
-#undef CLE
-#undef ONE
-#undef ZERO
-
 /**end repeat**/
 
 /*
@@ -1506,7 +1438,7 @@
  * #OP = EQ, NE, GT, GE, LT, LE#
  */
 static void
-OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *func) {
+OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)) {
     BINARY_LOOP {
         PyObject *in1 = *(PyObject **)ip1;
         PyObject *in2 = *(PyObject **)ip2;
@@ -1515,8 +1447,7 @@
 }
 /**end repeat**/
 
-static void
-OBJECT_sign(char **args, intp *dimensions, intp *steps, void *func)
+OBJECT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
 {
     PyObject *zero = PyInt_FromLong(0);
     UNARY_LOOP {
@@ -1533,16 +1464,6 @@
  */
 
 
-/*
- *****************************************************************************
- **                            SETUP UFUNCS                                 **
- *****************************************************************************
- */
-
-#include "__umath_generated.c"
-#include "ufuncobject.c"
-#include "__ufunc_api.c"
-
 static PyUFuncGenericFunction frexp_functions[] = {
 #ifdef HAVE_FREXPF
     FLOAT_frexp,
@@ -1564,6 +1485,7 @@
 #endif
 };
 
+
 static PyUFuncGenericFunction ldexp_functions[] = {
 #ifdef HAVE_LDEXPF
     FLOAT_ldexp,
@@ -1585,6 +1507,10 @@
 };
 
 
+#include "__umath_generated.c"
+#include "ufuncobject.c"
+#include "__ufunc_api.c"
+
 static double
 pinf_init(void)
 {
@@ -1660,7 +1586,7 @@
      METH_VARARGS, NULL},
     {"geterrobj", (PyCFunction) ufunc_geterr,
      METH_VARARGS, NULL},
-    {NULL,          NULL, 0}                /* sentinel */
+    {NULL, NULL, 0, NULL}                /* sentinel */
 };
 
 PyMODINIT_FUNC initumath(void) {

Modified: branches/ufunc_cleanup/numpy/fft/fftpack_litemodule.c
===================================================================
--- branches/ufunc_cleanup/numpy/fft/fftpack_litemodule.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/fft/fftpack_litemodule.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -9,7 +9,7 @@
 static char fftpack_cfftf__doc__[] = "";
 
 PyObject *
-fftpack_cfftf(PyObject *self, PyObject *args)
+fftpack_cfftf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     PyObject *op1, *op2;
     PyArrayObject *data;
@@ -60,7 +60,7 @@
 static char fftpack_cfftb__doc__[] = "";
 
 PyObject *
-fftpack_cfftb(PyObject *self, PyObject *args)
+fftpack_cfftb(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     PyObject *op1, *op2;
     PyArrayObject *data;
@@ -111,7 +111,7 @@
 static char fftpack_cffti__doc__[] ="";
 
 static PyObject *
-fftpack_cffti(PyObject *self, PyObject *args)
+fftpack_cffti(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     PyArrayObject *op;
     npy_intp dim;
@@ -138,7 +138,7 @@
 static char fftpack_rfftf__doc__[] ="";
 
 PyObject *
-fftpack_rfftf(PyObject *self, PyObject *args)
+fftpack_rfftf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     PyObject *op1, *op2;
     PyArrayObject *data, *ret;
@@ -204,7 +204,7 @@
 
 
 PyObject *
-fftpack_rfftb(PyObject *self, PyObject *args)
+fftpack_rfftb(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     PyObject *op1, *op2;
     PyArrayObject *data, *ret;
@@ -265,7 +265,7 @@
 static char fftpack_rffti__doc__[] ="";
 
 static PyObject *
-fftpack_rffti(PyObject *self, PyObject *args)
+fftpack_rffti(PyObject *NPY_UNUSED(self), PyObject *args)
 {
   PyArrayObject *op;
   npy_intp dim;

Modified: branches/ufunc_cleanup/numpy/lib/src/_compiled_base.c
===================================================================
--- branches/ufunc_cleanup/numpy/lib/src/_compiled_base.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/lib/src/_compiled_base.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -80,7 +80,7 @@
 
 
 static PyObject *
-arr_bincount(PyObject *self, PyObject *args, PyObject *kwds)
+arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
 {
     /* arr_bincount is registered as bincount.
      * bincount accepts one or two arguments. The first is an array of
@@ -147,7 +147,7 @@
 
 
 static PyObject *
-arr_digitize(PyObject *self, PyObject *args, PyObject *kwds)
+arr_digitize(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
 {
     /* digitize (x, bins) returns an array of python integers the same
        length of x. The values i returned are such that bins [i - 1] <= x <
@@ -219,7 +219,7 @@
 static char arr_insert__doc__[] = "Insert vals sequentially into equivalent 1-d positions indicated by mask.";
 
 static PyObject *
-arr_insert(PyObject *self, PyObject *args, PyObject *kwdict)
+arr_insert(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
 {
     /* Returns input array with values inserted sequentially into places
        indicated by the mask
@@ -379,7 +379,7 @@
 }
 
 static PyObject *
-arr_interp(PyObject *self, PyObject *args, PyObject *kwdict)
+arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
 {
 
     PyObject *fp, *xp, *x;
@@ -474,7 +474,7 @@
 /* Can only be called if doc is currently NULL
  */
 static PyObject *
-arr_add_docstring(PyObject *dummy, PyObject *args)
+arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *args)
 {
     PyObject *obj;
     PyObject *str;
@@ -624,11 +624,11 @@
 static void
 _unpackbits(
 		void      *In,
-		int       el_size,  /* unused */
+		int       NPY_UNUSED(el_size),  /* unused */
 		npy_intp  in_N,
 		npy_intp  in_stride,
 	        void      *Out,
-	        npy_intp  out_N,
+	        npy_intp  NPY_UNUSED(out_N),
 		npy_intp  out_stride
                )
 {
@@ -772,7 +772,7 @@
 
 
 static PyObject *
-io_pack(PyObject *self, PyObject *args, PyObject *kwds)
+io_pack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
 {
   PyObject *obj;
   int axis=NPY_MAXDIMS;
@@ -785,7 +785,7 @@
 }
 
 static PyObject *
-io_unpack(PyObject *self, PyObject *args, PyObject *kwds)
+io_unpack(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
 {
   PyObject *obj;
   int axis=NPY_MAXDIMS;

Modified: branches/ufunc_cleanup/numpy/linalg/lapack_litemodule.c
===================================================================
--- branches/ufunc_cleanup/numpy/linalg/lapack_litemodule.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/linalg/lapack_litemodule.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -129,7 +129,7 @@
 #define IDATA(p) ((int *) (((PyArrayObject *)p)->data))
 
 static PyObject *
-lapack_lite_dgeev(PyObject *self, PyObject *args)
+lapack_lite_dgeev(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     char jobvl;
@@ -169,7 +169,7 @@
 }
 
 static PyObject *
-lapack_lite_dsyevd(PyObject *self, PyObject *args)
+lapack_lite_dsyevd(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     /*  Arguments */
     /*  ========= */
@@ -251,7 +251,7 @@
 }
 
 static PyObject *
-lapack_lite_zheevd(PyObject *self, PyObject *args)
+lapack_lite_zheevd(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     /*  Arguments */
     /*  ========= */
@@ -339,7 +339,7 @@
 }
 
 static PyObject *
-lapack_lite_dgelsd(PyObject *self, PyObject *args)
+lapack_lite_dgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int m;
@@ -378,7 +378,7 @@
 }
 
 static PyObject *
-lapack_lite_dgesv(PyObject *self, PyObject *args)
+lapack_lite_dgesv(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int n;
@@ -404,7 +404,7 @@
 }
 
 static PyObject *
-lapack_lite_dgesdd(PyObject *self, PyObject *args)
+lapack_lite_dgesdd(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     char jobz;
@@ -470,7 +470,7 @@
 }
 
 static PyObject *
-lapack_lite_dgetrf(PyObject *self, PyObject *args)
+lapack_lite_dgetrf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int m;
@@ -492,7 +492,7 @@
 }
 
 static PyObject *
-lapack_lite_dpotrf(PyObject *self, PyObject *args)
+lapack_lite_dpotrf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int n;
@@ -512,7 +512,7 @@
 }
 
 static PyObject *
-lapack_lite_dgeqrf(PyObject *self, PyObject *args)
+lapack_lite_dgeqrf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
         int  lapack_lite_status__;
         int m, n, lwork;
@@ -538,7 +538,7 @@
 
 
 static PyObject *
-lapack_lite_dorgqr(PyObject *self, PyObject *args)
+lapack_lite_dorgqr(PyObject *NPY_UNUSED(self), PyObject *args)
 {
         int  lapack_lite_status__;
         int m, n, k, lwork;
@@ -559,7 +559,7 @@
 
 
 static PyObject *
-lapack_lite_zgeev(PyObject *self, PyObject *args)
+lapack_lite_zgeev(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     char jobvl;
@@ -599,7 +599,7 @@
 }
 
 static PyObject *
-lapack_lite_zgelsd(PyObject *self, PyObject *args)
+lapack_lite_zgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int m;
@@ -638,7 +638,7 @@
 }
 
 static PyObject *
-lapack_lite_zgesv(PyObject *self, PyObject *args)
+lapack_lite_zgesv(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int n;
@@ -664,7 +664,7 @@
 }
 
 static PyObject *
-lapack_lite_zgesdd(PyObject *self, PyObject *args)
+lapack_lite_zgesdd(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     char jobz;
@@ -706,7 +706,7 @@
 }
 
 static PyObject *
-lapack_lite_zgetrf(PyObject *self, PyObject *args)
+lapack_lite_zgetrf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int m;
@@ -728,7 +728,7 @@
 }
 
 static PyObject *
-lapack_lite_zpotrf(PyObject *self, PyObject *args)
+lapack_lite_zpotrf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
     int  lapack_lite_status__;
     int n;
@@ -747,7 +747,7 @@
 }
 
 static PyObject *
-lapack_lite_zgeqrf(PyObject *self, PyObject *args)
+lapack_lite_zgeqrf(PyObject *NPY_UNUSED(self), PyObject *args)
 {
         int  lapack_lite_status__;
         int m, n, lwork;
@@ -770,7 +770,7 @@
 
 
 static PyObject *
-lapack_lite_zungqr(PyObject *self, PyObject *args)
+lapack_lite_zungqr(PyObject *NPY_UNUSED(self), PyObject *args)
 {
         int  lapack_lite_status__;
         int m, n, k, lwork;

Modified: branches/ufunc_cleanup/numpy/ma/core.py
===================================================================
--- branches/ufunc_cleanup/numpy/ma/core.py	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/ma/core.py	2008-10-21 02:48:38 UTC (rev 5952)
@@ -749,11 +749,20 @@
     Each field is set to a bool.
 
     """
+    # Make sure we do have a dtype
+    if not isinstance(ndtype, np.dtype):
+        ndtype = np.dtype(ndtype)
+    # Do we have some name fields ?
     if ndtype.names:
         mdescr = [list(_) for _ in ndtype.descr]
         for m in mdescr:
             m[1] = '|b1'
-        return [tuple(_) for _ in mdescr]
+        return np.dtype([tuple(_) for _ in mdescr])
+    # Is this some kind of composite a la (np.float,2)
+    elif ndtype.subdtype:
+        mdescr = list(ndtype.subdtype)
+        mdescr[0] = np.dtype(bool)
+        return np.dtype(tuple(mdescr))
     else:
         return MaskType
 
@@ -1434,20 +1443,33 @@
         return result
     #.............................................
     def view(self, dtype=None, type=None):
-        if dtype is not None:
+        if dtype is None:
             if type is None:
-                args = (dtype,)
+                output = ndarray.view(self)
             else:
-                args = (dtype, type)
+                output = ndarray.view(self, type)
         elif type is None:
-            args = ()
+            try:
+                if issubclass(dtype, ndarray):
+                    output = ndarray.view(self, dtype)
+                    dtype = None
+                else:
+                    output = ndarray.view(self, dtype)
+            except TypeError:
+                output = ndarray.view(self, dtype)
         else:
-            args = (type,)
-        output = ndarray.view(self, *args)
+            output = ndarray.view(self, dtype, type)
+        # Should we update the mask ?
         if (getattr(output,'_mask', nomask) is not nomask):
-            mdtype = make_mask_descr(output.dtype)
+            if dtype is None:
+                dtype = output.dtype
+            mdtype = make_mask_descr(dtype)
+            
             output._mask = self._mask.view(mdtype, ndarray)
             output._mask.shape = output.shape
+        # Make sure to reset the _fill_value if needed
+        if getattr(output, '_fill_value', None):
+            output._fill_value = None
         return output
     view.__doc__ = ndarray.view.__doc__
     #.............................................
@@ -1996,7 +2018,7 @@
     #
     def __rmul__(self, other):
         "Multiply other by self, and return a new masked array."
-        return multiply(self, other)
+        return multiply(other, self)
     #
     def __div__(self, other):
         "Divide other into self, and return a new masked array."

Modified: branches/ufunc_cleanup/numpy/ma/mrecords.py
===================================================================
--- branches/ufunc_cleanup/numpy/ma/mrecords.py	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/ma/mrecords.py	2008-10-21 02:48:38 UTC (rev 5952)
@@ -106,8 +106,6 @@
     _fill_value : {record}
         Filling values for each field.
     """
-    _defaultfieldmask = nomask
-    _defaulthardmask = False
     #............................................
     def __new__(cls, shape, dtype=None, buf=None, offset=0, strides=None,
                 formats=None, names=None, titles=None,
@@ -164,7 +162,7 @@
                                dtype=mdescr).view(recarray)
         # Update some of the attributes
         _dict = self.__dict__
-        _dict.update(_mask=_mask, _fieldmask=_mask)
+        _dict.update(_mask=_mask)
         self._update_from(obj)
         if _dict['_baseclass'] == ndarray:
             _dict['_baseclass'] = recarray
@@ -201,32 +199,38 @@
         if obj.dtype.fields:
             raise NotImplementedError("MaskedRecords is currently limited to"\
                                       "simple records...")
-        obj = obj.view(MaskedArray)
-        obj._baseclass = ndarray
-        obj._isfield = True
         # Get some special attributes
-        _fill_value = _localdict.get('_fill_value', None)
+        # Reset the object's mask
+        hasmasked = False
         _mask = _localdict.get('_mask', None)
-        # Reset the object's mask
         if _mask is not None:
             try:
-                obj._mask = _mask[attr]
+                _mask = _mask[attr]
             except IndexError:
                 # Couldn't find a mask: use the default (nomask)
                 pass
-        # Reset the field values
-        if _fill_value is not None:
-            try:
-                obj._fill_value = _fill_value[attr]
-            except ValueError:
-                obj._fill_value = None
+            hasmasked = _mask.view((np.bool,(len(_mask.dtype) or 1))).any()
+        if (obj.shape or hasmasked):
+            obj = obj.view(MaskedArray)
+            obj._baseclass = ndarray
+            obj._isfield = True
+            obj._mask = _mask
+            # Reset the field values
+            _fill_value = _localdict.get('_fill_value', None)
+            if _fill_value is not None:
+                try:
+                    obj._fill_value = _fill_value[attr]
+                except ValueError:
+                    obj._fill_value = None
+        else:
+            obj = obj.item()
         return obj
 
 
     def __setattr__(self, attr, val):
         "Sets the attribute attr to the value val."
         # Should we call __setmask__ first ?
-        if attr in ['_mask','mask','_fieldmask','fieldmask']:
+        if attr in ['mask', 'fieldmask']:
             self.__setmask__(val)
             return
         # Create a shortcut (so that we don't have to call getattr all the time)
@@ -331,18 +335,44 @@
         reprstr.extend([fmt % ('    fill_value', self.fill_value),
                          '              )'])
         return str("\n".join(reprstr))
-    #......................................................
-    def view(self, obj):
+#    #......................................................
+    def view(self, dtype=None, type=None):
         """Returns a view of the mrecarray."""
-        try:
-            if issubclass(obj, ndarray):
-                return ndarray.view(self, obj)
-        except TypeError:
-            pass
-        dtype_ = np.dtype(obj)
-        if dtype_.fields is None:
-            return self.__array__().view(dtype_)
-        return ndarray.view(self, obj)
+        # OK, basic copy-paste from MaskedArray.view...
+        if dtype is None:
+            if type is None:
+                output = ndarray.view(self)
+            else:
+                output = ndarray.view(self, type)
+        # Here again...
+        elif type is None:
+            try:
+                if issubclass(dtype, ndarray):
+                    output = ndarray.view(self, dtype)
+                    dtype = None
+                else:
+                    output = ndarray.view(self, dtype)
+            # OK, there's the change 
+            except TypeError:
+                dtype = np.dtype(dtype)
+                # we need to revert to MaskedArray, but keeping the possibility
+                # ...of subclasses (eg, TimeSeriesRecords), so we'll force a type
+                # ...set to the first parent
+                if dtype.fields is None:
+                    basetype = self.__class__.__bases__[0]
+                    output = self.__array__().view(dtype, basetype)
+                    output._update_from(self)
+                else:
+                    output = ndarray.view(self, dtype)
+                output._fill_value = None
+        else:
+            output = ndarray.view(self, dtype, type)
+        # Update the mask, just like in MaskedArray.view
+        if (getattr(output,'_mask', nomask) is not nomask):
+            mdtype = ma.make_mask_descr(output.dtype)
+            output._mask = self._mask.view(mdtype, ndarray)
+            output._mask.shape = output.shape
+        return output
 
     def harden_mask(self):
         "Forces the mask to hard"
@@ -355,7 +385,7 @@
         """Returns a copy of the masked record."""
         _localdict = self.__dict__
         copied = self._data.copy().view(type(self))
-        copied._fieldmask = self._fieldmask.copy()
+        copied._mask = self._mask.copy()
         return copied
 
     def tolist(self, fill_value=None):
@@ -371,7 +401,7 @@
         if fill_value is not None:
             return self.filled(fill_value).tolist()
         result = narray(self.filled().tolist(), dtype=object)
-        mask = narray(self._fieldmask.tolist())
+        mask = narray(self._mask.tolist())
         result[mask] = None
         return result.tolist()
     #--------------------------------------------
@@ -385,7 +415,7 @@
                  self.dtype,
                  self.flags.fnc,
                  self._data.tostring(),
-                 self._fieldmask.tostring(),
+                 self._mask.tostring(),
                  self._fill_value,
                  )
         return state
@@ -405,7 +435,7 @@
         (ver, shp, typ, isf, raw, msk, flv) = state
         ndarray.__setstate__(self, (shp, typ, isf, raw))
         mdtype = dtype([(k,bool_) for (k,_) in self.dtype.descr])
-        self.__dict__['_fieldmask'].__setstate__((shp, mdtype, isf, msk))
+        self.__dict__['_mask'].__setstate__((shp, mdtype, isf, msk))
         self.fill_value = flv
     #
     def __reduce__(self):
@@ -508,7 +538,7 @@
     Lists of tuples should be preferred over lists of lists for faster processing.
     """
     # Grab the initial _fieldmask, if needed:
-    _fieldmask = getattr(reclist, '_fieldmask', None)
+    _mask = getattr(reclist, '_mask', None)
     # Get the list of records.....
     try:
         nfields = len(reclist[0])
@@ -533,13 +563,13 @@
         mask = np.array(mask, copy=False)
         maskrecordlength = len(mask.dtype)
         if maskrecordlength:
-            mrec._fieldmask.flat = mask
+            mrec._mask.flat = mask
         elif len(mask.shape) == 2:
-            mrec._fieldmask.flat = [tuple(m) for m in mask]
+            mrec._mask.flat = [tuple(m) for m in mask]
         else:
-            mrec._mask = mask
-    if _fieldmask is not None:
-        mrec._fieldmask[:] = _fieldmask
+            mrec.__setmask__(mask)
+    if _mask is not None:
+        mrec._mask[:] = _mask
     return mrec
 
 def _guessvartypes(arr):
@@ -680,5 +710,5 @@
     # Add the mask of the new field
     newmask.setfield(getmaskarray(newfield),
                      *newmask.dtype.fields[newfieldname])
-    newdata._fieldmask = newmask
+    newdata._mask = newmask
     return newdata

Modified: branches/ufunc_cleanup/numpy/ma/tests/test_core.py
===================================================================
--- branches/ufunc_cleanup/numpy/ma/tests/test_core.py	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/ma/tests/test_core.py	2008-10-21 02:48:38 UTC (rev 5952)
@@ -2270,6 +2270,21 @@
         self.failUnless(c[0,0] is masked)
         self.failUnless(c.flags['C'])
 
+
+    def test_make_mask_descr(self):
+        "Test make_mask_descr"
+        ntype = [('a',np.float), ('b',np.float)]
+        test = make_mask_descr(ntype)
+        assert_equal(test, [('a',np.bool),('b',np.bool)])
+        #
+        ntype = (np.float, 2)
+        test = make_mask_descr(ntype)
+        assert_equal(test, (np.bool,2))
+        #
+        ntype = np.float
+        test = make_mask_descr(ntype)
+        assert_equal(test, np.dtype(np.bool))
+
 #------------------------------------------------------------------------------
 
 class TestMaskedFields(TestCase):
@@ -2361,23 +2376,15 @@
         a = array(iterator, dtype=[('a',float),('b',float)])
         a.mask[0] = (1,0)
         controlmask = np.array([1]+19*[0], dtype=bool)
-        #
+        # Transform globally to simple dtype
         test = a.view(float)
         assert_equal(test, data.ravel())
         assert_equal(test.mask, controlmask)
-        #
+        # Transform globally to dty
         test = a.view((float,2))
         assert_equal(test, data)
         assert_equal(test.mask, controlmask.reshape(-1,2))
         #
-        test = a.view([('A',float),('B',float)])
-        assert_equal(test.mask.dtype.names, ('A', 'B'))
-        assert_equal(test['A'], a['a'])
-        assert_equal(test['B'], a['b'])
-        #
-        test = a.view(np.ndarray)
-        assert_equal(test, a._data)
-        #
         test = a.view((float,2), np.matrix)
         assert_equal(test, data)
         self.failUnless(isinstance(test, np.matrix))
@@ -2399,6 +2406,86 @@
         assert_equal_records(a[-2]._data, a._data[-2])
         assert_equal_records(a[-2]._mask, a._mask[-2])
 
+
+class TestMaskedView(TestCase):
+    #
+    def setUp(self):
+        iterator = zip(np.arange(10), np.random.rand(10))
+        data = np.array(iterator)
+        a = array(iterator, dtype=[('a',float),('b',float)])
+        a.mask[0] = (1,0)
+        controlmask = np.array([1]+19*[0], dtype=bool)
+        self.data = (data, a, controlmask)
+    #
+    def test_view_to_nothing(self):
+        (data, a, controlmask) = self.data
+        test = a.view()
+        self.failUnless(isinstance(test, MaskedArray))
+        assert_equal(test._data, a._data)
+        assert_equal(test._mask, a._mask)
+        
+    #
+    def test_view_to_type(self):
+        (data, a, controlmask) = self.data
+        test = a.view(np.ndarray)
+        self.failUnless(not isinstance(test, MaskedArray))
+        assert_equal(test, a._data)
+        assert_equal_records(test, data.view(a.dtype).squeeze())
+    #
+    def test_view_to_simple_dtype(self):
+        (data, a, controlmask) = self.data
+        # View globally
+        test = a.view(float)
+        self.failUnless(isinstance(test, MaskedArray))
+        assert_equal(test, data.ravel())
+        assert_equal(test.mask, controlmask)
+    #
+    def test_view_to_flexible_dtype(self):
+        (data, a, controlmask) = self.data
+        #
+        test = a.view([('A',float),('B',float)])
+        assert_equal(test.mask.dtype.names, ('A', 'B'))
+        assert_equal(test['A'], a['a'])
+        assert_equal(test['B'], a['b'])
+        #
+        test = a[0].view([('A',float),('B',float)])
+        self.failUnless(isinstance(test, MaskedArray))
+        assert_equal(test.mask.dtype.names, ('A', 'B'))
+        assert_equal(test['A'], a['a'][0])
+        assert_equal(test['B'], a['b'][0])
+        #
+        test = a[-1].view([('A',float),('B',float)])
+        self.failUnless(not isinstance(test, MaskedArray))
+        assert_equal(test.dtype.names, ('A', 'B'))
+        assert_equal(test['A'], a['a'][-1])
+        assert_equal(test['B'], a['b'][-1])
+        
+    #
+    def test_view_to_subdtype(self):
+        (data, a, controlmask) = self.data
+        # View globally
+        test = a.view((float,2))
+        self.failUnless(isinstance(test, MaskedArray))
+        assert_equal(test, data)
+        assert_equal(test.mask, controlmask.reshape(-1,2))
+        # View on 1 masked element
+        test = a[0].view((float,2))
+        self.failUnless(isinstance(test, MaskedArray))
+        assert_equal(test, data[0])
+        assert_equal(test.mask, (1,0))
+        # View on 1 unmasked element
+        test = a[-1].view((float,2))
+        self.failUnless(not isinstance(test, MaskedArray))
+        assert_equal(test, data[-1])
+    #
+    def test_view_to_dtype_and_type(self):
+        (data, a, controlmask) = self.data
+        #
+        test = a.view((float,2), np.matrix)
+        assert_equal(test, data)
+        self.failUnless(isinstance(test, np.matrix))
+        self.failUnless(not isinstance(test, MaskedArray))
+
 ###############################################################################
 #------------------------------------------------------------------------------
 if __name__ == "__main__":

Modified: branches/ufunc_cleanup/numpy/ma/tests/test_mrecords.py
===================================================================
--- branches/ufunc_cleanup/numpy/ma/tests/test_mrecords.py	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/ma/tests/test_mrecords.py	2008-10-21 02:48:38 UTC (rev 5952)
@@ -65,8 +65,6 @@
         assert_equal(mbase_first.tolist(), (1,1.1,'one'))
         # Used to be mask, now it's recordmask
         assert_equal(mbase_first.recordmask, nomask)
-        # _fieldmask and _mask should be the same thing
-        assert_equal(mbase_first._fieldmask.item(), (False, False, False))
         assert_equal(mbase_first._mask.item(), (False, False, False))
         assert_equal(mbase_first['a'], mbase['a'][0])
         mbase_last = mbase[-1]
@@ -75,7 +73,7 @@
         assert_equal(mbase_last.tolist(), (None,None,None))
         # Used to be mask, now it's recordmask
         assert_equal(mbase_last.recordmask, True)
-        assert_equal(mbase_last._fieldmask.item(), (True, True, True))
+        assert_equal(mbase_last._mask.item(), (True, True, True))
         assert_equal(mbase_last['a'], mbase['a'][-1])
         assert (mbase_last['a'] is masked)
         # as slice ..........
@@ -107,7 +105,7 @@
         assert_equal(ma.getmaskarray(mbase['a']), [0]*5)
         # Use to be _mask, now it's recordmask
         assert_equal(mbase.recordmask, [False]*5)
-        assert_equal(mbase._fieldmask.tolist(),
+        assert_equal(mbase._mask.tolist(),
                      np.array([(0,0,0),(0,1,1),(0,0,0),(0,0,0),(0,1,1)],
                               dtype=bool))
         # Set a field to mask ........................
@@ -117,7 +115,7 @@
         assert_equal(mbase.c.recordmask, [1]*5)
         assert_equal(ma.getmaskarray(mbase['c']), [1]*5)
         assert_equal(ma.getdata(mbase['c']), ['N/A']*5)
-        assert_equal(mbase._fieldmask.tolist(),
+        assert_equal(mbase._mask.tolist(),
                      np.array([(0,0,1),(0,1,1),(0,0,1),(0,0,1),(0,1,1)],
                               dtype=bool))
         # Set fields by slices .......................
@@ -159,23 +157,23 @@
         base = self.base.copy()
         mbase = base.view(mrecarray)
         # Set the mask to True .......................
-        mbase._mask = masked
+        mbase.mask = masked
         assert_equal(ma.getmaskarray(mbase['b']), [1]*5)
         assert_equal(mbase['a']._mask, mbase['b']._mask)
         assert_equal(mbase['a']._mask, mbase['c']._mask)
-        assert_equal(mbase._fieldmask.tolist(),
+        assert_equal(mbase._mask.tolist(),
                      np.array([(1,1,1)]*5, dtype=bool))
         # Delete the mask ............................
-        mbase._mask = nomask
+        mbase.mask = nomask
         assert_equal(ma.getmaskarray(mbase['c']), [0]*5)
-        assert_equal(mbase._fieldmask.tolist(),
+        assert_equal(mbase._mask.tolist(),
                      np.array([(0,0,0)]*5, dtype=bool))
     #
     def test_set_mask_fromarray(self):
         base = self.base.copy()
         mbase = base.view(mrecarray)
         # Sets the mask w/ an array
-        mbase._mask = [1,0,0,0,1]
+        mbase.mask = [1,0,0,0,1]
         assert_equal(mbase.a.mask, [1,0,0,0,1])
         assert_equal(mbase.b.mask, [1,0,0,0,1])
         assert_equal(mbase.c.mask, [1,0,0,0,1])
@@ -206,7 +204,7 @@
         # Set an element to mask .....................
         mbase = base.view(mrecarray).copy()
         mbase[-2] = masked
-        assert_equal(mbase._fieldmask.tolist(),
+        assert_equal(mbase._mask.tolist(),
                      np.array([(0,0,0),(1,1,1),(0,0,0),(1,1,1),(1,1,1)],
                               dtype=bool))
         # Used to be mask, now it's recordmask!
@@ -265,11 +263,11 @@
         mbase = base.view(mrecarray)
         mbase.harden_mask()
         self.failUnless(mbase._hardmask)
-        mbase._mask = nomask
+        mbase.mask = nomask
         assert_equal_records(mbase._mask, base._mask)
         mbase.soften_mask()
         self.failUnless(not mbase._hardmask)
-        mbase._mask = nomask
+        mbase.mask = nomask
         # So, the mask of a field is no longer set to nomask...
         assert_equal_records(mbase._mask,
                              ma.make_mask_none(base.shape,base.dtype))
@@ -286,7 +284,7 @@
         assert_equal(mrec_.dtype, mrec.dtype)
         assert_equal_records(mrec_._data, mrec._data)
         assert_equal(mrec_._mask, mrec._mask)
-        assert_equal_records(mrec_._fieldmask, mrec._fieldmask)
+        assert_equal_records(mrec_._mask, mrec._mask)
     #
     def test_filled(self):
         "Test filling the array"
@@ -340,6 +338,45 @@
                      np.array([(0,0,0),(1,1,1)], dtype=mult.dtype))
 
 
+class TestView(TestCase):
+    #
+    def setUp(self):
+        (a, b) = (np.arange(10), np.random.rand(10))
+        ndtype = [('a',np.float), ('b',np.float)]
+        arr = np.array(zip(a,b), dtype=ndtype)
+        rec = arr.view(np.recarray)
+        #
+        marr = ma.array(zip(a,b), dtype=ndtype, fill_value=(-9., -99.))
+        mrec = fromarrays([a,b], dtype=ndtype, fill_value=(-9., -99.))
+        mrec.mask[3] = (False, True)
+        self.data = (mrec, a, b, arr)
+    #
+    def test_view_by_itself(self):
+        (mrec, a, b, arr) = self.data
+        test = mrec.view()
+        self.failUnless(isinstance(test, MaskedRecords))
+        assert_equal_records(test, mrec)
+        assert_equal_records(test._mask, mrec._mask)
+    #
+    def test_view_simple_dtype(self):
+        (mrec, a, b, arr) = self.data
+        ntype = (np.float, 2)
+        test = mrec.view(ntype)
+        self.failUnless(isinstance(test, ma.MaskedArray))
+        assert_equal(test, np.array(zip(a,b), dtype=np.float))
+        self.failUnless(test[3,1] is ma.masked)
+    #
+    def test_view_flexible_type(self):
+        (mrec, a, b, arr) = self.data
+        alttype = [('A',np.float), ('B',np.float)]
+        test = mrec.view(alttype)
+        self.failUnless(isinstance(test, MaskedRecords))
+        assert_equal_records(test, arr.view(alttype))
+        self.failUnless(test['B'][3] is masked)
+        assert_equal(test.dtype, np.dtype(alttype))
+        self.failUnless(test._fill_value is None)
+
+
 ################################################################################
 class TestMRecordsImport(TestCase):
     "Base test class for MaskedArrays."
@@ -395,7 +432,7 @@
         _mrec = fromrecords(mrec)
         assert_equal(_mrec.dtype, mrec.dtype)
         assert_equal_records(_mrec._data, mrec.filled())
-        assert_equal_records(_mrec._fieldmask, mrec._fieldmask)
+        assert_equal_records(_mrec._mask, mrec._mask)
 
     def test_fromrecords_wmask(self):
         "Tests construction from records w/ mask."
@@ -403,20 +440,20 @@
         #
         _mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=[0,1,0,])
         assert_equal_records(_mrec._data, mrec._data)
-        assert_equal(_mrec._fieldmask.tolist(), [(0,0,0),(1,1,1),(0,0,0)])
+        assert_equal(_mrec._mask.tolist(), [(0,0,0),(1,1,1),(0,0,0)])
         #
         _mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=True)
         assert_equal_records(_mrec._data, mrec._data)
-        assert_equal(_mrec._fieldmask.tolist(), [(1,1,1),(1,1,1),(1,1,1)])
+        assert_equal(_mrec._mask.tolist(), [(1,1,1),(1,1,1),(1,1,1)])
         #
-        _mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=mrec._fieldmask)
+        _mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=mrec._mask)
         assert_equal_records(_mrec._data, mrec._data)
-        assert_equal(_mrec._fieldmask.tolist(), mrec._fieldmask.tolist())
+        assert_equal(_mrec._mask.tolist(), mrec._mask.tolist())
         #
         _mrec = fromrecords(nrec.tolist(), dtype=ddtype,
-                            mask=mrec._fieldmask.tolist())
+                            mask=mrec._mask.tolist())
         assert_equal_records(_mrec._data, mrec._data)
-        assert_equal(_mrec._fieldmask.tolist(), mrec._fieldmask.tolist())
+        assert_equal(_mrec._mask.tolist(), mrec._mask.tolist())
 
     def test_fromtextfile(self):
         "Tests reading from a text file."

Modified: branches/ufunc_cleanup/numpy/ma/tests/test_subclassing.py
===================================================================
--- branches/ufunc_cleanup/numpy/ma/tests/test_subclassing.py	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/ma/tests/test_subclassing.py	2008-10-21 02:48:38 UTC (rev 5952)
@@ -154,24 +154,4 @@
 if __name__ == '__main__':
     run_module_suite()
 
-    if 0:
-        x = array(arange(5), mask=[0]+[1]*4)
-        my = masked_array(subarray(x))
-        ym = msubarray(x)
-        #
-        z = (my+1)
-        self.failUnless(isinstance(z,MaskedArray))
-        self.failUnless(not isinstance(z, MSubArray))
-        self.failUnless(isinstance(z._data, SubArray))
-        assert_equal(z._data.info, {})
-        #
-        z = (ym+1)
-        self.failUnless(isinstance(z, MaskedArray))
-        self.failUnless(isinstance(z, MSubArray))
-        self.failUnless(isinstance(z._data, SubArray))
-        self.failUnless(z._data.info['added'] > 0)
-        #
-        ym._set_mask([1,0,0,0,1])
-        assert_equal(ym._mask, [1,0,0,0,1])
-        ym._series._set_mask([0,0,0,0,1])
-        assert_equal(ym._mask, [0,0,0,0,1])
+

Modified: branches/ufunc_cleanup/numpy/numarray/_capi.c
===================================================================
--- branches/ufunc_cleanup/numpy/numarray/_capi.c	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/numarray/_capi.c	2008-10-21 02:48:38 UTC (rev 5952)
@@ -225,7 +225,7 @@
 ** should always be 0                                               *
 */
 
-static int int_dividebyzero_error(long value, long unused) {
+static int int_dividebyzero_error(long NPY_UNUSED(value), long NPY_UNUSED(unused)) {
     double dummy;
     dummy = 1./numarray_zero;
     if (dummy) /* to prevent optimizer from eliminating expression */
@@ -876,7 +876,7 @@
    cfunc and wrapper.
 */
 static PyObject *
-cfunc_call(PyObject *self, PyObject *argsTuple, PyObject *argsDict)
+cfunc_call(PyObject *self, PyObject *argsTuple, PyObject *NPY_UNUSED(argsDict))
 {
 	CfuncObject *me = (CfuncObject *) self;
 	switch(me->descr.type) {
@@ -2546,9 +2546,9 @@
 NA_callStrideConvCFuncCore(
 	PyObject *self, int nshape, maybelong *shape,
 	PyObject *inbuffObj,  long inboffset, 
-	int ninbstrides, maybelong *inbstrides,
+	int NPY_UNUSED(ninbstrides), maybelong *inbstrides,
 	PyObject *outbuffObj, long outboffset, 
-	int noutbstrides, maybelong *outbstrides,
+	int NPY_UNUSED(noutbstrides), maybelong *outbstrides,
 	long nbytes)
 {
 	CfuncObject *me = (CfuncObject *) self;
@@ -2627,17 +2627,17 @@
 }
 
 static int
-NA_OperatorCheck(PyObject *op) {
+NA_OperatorCheck(PyObject *NPY_UNUSED(op)) {
         return 0;
 }
 
 static int
-NA_ConverterCheck(PyObject *op) {
+NA_ConverterCheck(PyObject *NPY_UNUSED(op)) {
         return 0;
 }
 
 static int
-NA_UfuncCheck(PyObject *op) {
+NA_UfuncCheck(PyObject *NPY_UNUSED(op)) {
         return 0;
 }
 
@@ -2647,8 +2647,8 @@
 }
 
 static int
-NA_getByteOffset(PyArrayObject *array, int nindices, maybelong *indices, 
-		 long *offset)
+NA_getByteOffset(PyArrayObject *NPY_UNUSED(array), int NPY_UNUSED(nindices),
+		 maybelong *NPY_UNUSED(indices), long *NPY_UNUSED(offset))
 {
         return 0;
 }
@@ -2742,8 +2742,9 @@
 /* ignores bytestride */
 static PyArrayObject *
 NA_NewAllFromBuffer(int ndim, maybelong *shape, NumarrayType type,
-		    PyObject *bufferObject, maybelong byteoffset, maybelong bytestride,
-		    int byteorder, int aligned, int writeable)
+		    PyObject *bufferObject, maybelong byteoffset, 
+		    maybelong NPY_UNUSED(bytestride), int byteorder, 
+		    int NPY_UNUSED(aligned), int NPY_UNUSED(writeable))
 {
 	PyArrayObject *self = NULL;
 	PyArray_Descr *dtype;
@@ -2822,17 +2823,17 @@
 }
 
 static int
-NA_OperatorCheckExact(PyObject *op) {
+NA_OperatorCheckExact(PyObject *NPY_UNUSED(op)) {
         return 0;
 }
 
 static int
-NA_ConverterCheckExact(PyObject *op) {
+NA_ConverterCheckExact(PyObject *NPY_UNUSED(op)) {
         return 0;
 }
 
 static int
-NA_UfuncCheckExact(PyObject *op) {
+NA_UfuncCheckExact(PyObject *NPY_UNUSED(op)) {
         return 0;
 }
 
@@ -2854,7 +2855,7 @@
 
 /* Byteswap is not a flag of the array --- it is implicit in the data-type */
 static void
-NA_updateByteswap(PyArrayObject *self)
+NA_updateByteswap(PyArrayObject *NPY_UNUSED(self))
 {
         return;
 }

Modified: branches/ufunc_cleanup/numpy/testing/utils.py
===================================================================
--- branches/ufunc_cleanup/numpy/testing/utils.py	2008-10-20 21:57:01 UTC (rev 5951)
+++ branches/ufunc_cleanup/numpy/testing/utils.py	2008-10-21 02:48:38 UTC (rev 5952)
@@ -8,19 +8,14 @@
 import operator
 from nosetester import import_nose
 
-__all__ = ['assert_', 'assert_equal', 'assert_almost_equal',
-           'assert_approx_equal', 'assert_array_equal', 'assert_array_less',
-           'assert_string_equal', 'assert_array_almost_equal', 'assert_raises',
-           'build_err_msg', 'decorate_methods', 'jiffies', 'memusage',
-           'print_assert_equal', 'raises', 'rand', 'rundocs', 'runstring',
-           'verbose']
+__all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal',
+           'assert_array_equal', 'assert_array_less', 'assert_string_equal',
+           'assert_array_almost_equal', 'assert_raises', 'build_err_msg',
+           'decorate_methods', 'jiffies', 'memusage', 'print_assert_equal',
+           'raises', 'rand', 'rundocs', 'runstring', 'verbose']
 
 verbose = 0
 
-def assert_(test, message=""):
-    if not test:
-        raise AssertionError(message)
-
 def rand(*args):
     """Returns an array of random numbers with the given shape.
 



More information about the Numpy-svn mailing list