
/*   W     W   AAA   RRRR   N   N  III  N   N   GGG   !!!
**   W     W  A   A  R   R  NN  N   I   NN  N  G   G  !!!
**   W  W  W  AAAAA  RRRR   N N N   I   N N N  G       !
**    W W W   A   A  R   R  N  NN   I   N  NN  G  GG
**     W W    A   A  R   R  N   N  III  N   N   GGG   !!!
**
** WARNING: This file is program generated by codegenerator.py.
**
** DO NOT EDIT THIS FILE! Any changes made to this file will be lost!
*/

#include <Python.h>
#include <stdio.h>
#include "libnumarray.h"

/****************** Bool *******************/

static PyObject *BoolasPyValue(void *data) {
  return Py_BuildValue(PY_BOOL_CHAR, *((Bool *) data));
}

SELF_CHECKED_CFUNC_DESCR(BoolasPyValue, CFUNC_AS_PY_VALUE);

static int BoolfromPyValue(PyObject *value, void *dataptr) {
    Bool *data = (Bool *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (Bool) isNonZERO(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (Bool) isNonZERO(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (Bool) isNonZERO(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (Bool) isNonZERO(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(BoolfromPyValue, CFUNC_FROM_PY_VALUE);

static int BoolasInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasInt8, sizeof(Bool), sizeof(Int8));

static int BoolasInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasInt16, sizeof(Bool), sizeof(Int16));

static int BoolasInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasInt32, sizeof(Bool), sizeof(Int32));

static int BoolasUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasUInt32, sizeof(Bool), sizeof(UInt32));

static int BoolasUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasUInt8, sizeof(Bool), sizeof(UInt8));

static int BoolasUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasUInt16, sizeof(Bool), sizeof(UInt16));

static int BoolasFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasFloat32, sizeof(Bool), sizeof(Float32));

static int BoolasFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasFloat64, sizeof(Bool), sizeof(Float64));

static int BoolasComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasComplex32, sizeof(Bool), sizeof(Complex32));

static int BoolasComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasComplex64, sizeof(Bool), sizeof(Complex64));

static int BoolasInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasInt64, sizeof(Bool), sizeof(Int64));

static int BoolasUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Bool     *tin  = (Bool *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(BoolasUInt64, sizeof(Bool), sizeof(UInt64));

/****************** Int8 *******************/

static PyObject *Int8asPyValue(void *data) {
  return Py_BuildValue(PY_INT8_CHAR, *((Int8 *) data));
}

SELF_CHECKED_CFUNC_DESCR(Int8asPyValue, CFUNC_AS_PY_VALUE);

static int Int8fromPyValue(PyObject *value, void *dataptr) {
    Int8 *data = (Int8 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (Int8)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (Int8)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (Int8)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (Int8)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Int8fromPyValue, CFUNC_FROM_PY_VALUE);

static int Int8asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asBool, sizeof(Int8), sizeof(Bool));

static int Int8asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asInt16, sizeof(Int8), sizeof(Int16));

static int Int8asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asInt32, sizeof(Int8), sizeof(Int32));

static int Int8asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asUInt32, sizeof(Int8), sizeof(UInt32));

static int Int8asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asUInt8, sizeof(Int8), sizeof(UInt8));

static int Int8asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asUInt16, sizeof(Int8), sizeof(UInt16));

static int Int8asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asFloat32, sizeof(Int8), sizeof(Float32));

static int Int8asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asFloat64, sizeof(Int8), sizeof(Float64));

static int Int8asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asComplex32, sizeof(Int8), sizeof(Complex32));

static int Int8asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asComplex64, sizeof(Int8), sizeof(Complex64));

static int Int8asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asInt64, sizeof(Int8), sizeof(Int64));

static int Int8asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int8     *tin  = (Int8 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int8asUInt64, sizeof(Int8), sizeof(UInt64));

/****************** Int16 *******************/

static PyObject *Int16asPyValue(void *data) {
  return Py_BuildValue(PY_INT16_CHAR, *((Int16 *) data));
}

SELF_CHECKED_CFUNC_DESCR(Int16asPyValue, CFUNC_AS_PY_VALUE);

static int Int16fromPyValue(PyObject *value, void *dataptr) {
    Int16 *data = (Int16 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (Int16)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (Int16)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (Int16)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (Int16)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Int16fromPyValue, CFUNC_FROM_PY_VALUE);

static int Int16asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asBool, sizeof(Int16), sizeof(Bool));

static int Int16asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asInt8, sizeof(Int16), sizeof(Int8));

static int Int16asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asInt32, sizeof(Int16), sizeof(Int32));

static int Int16asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asUInt32, sizeof(Int16), sizeof(UInt32));

static int Int16asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asUInt8, sizeof(Int16), sizeof(UInt8));

static int Int16asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asUInt16, sizeof(Int16), sizeof(UInt16));

static int Int16asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asFloat32, sizeof(Int16), sizeof(Float32));

static int Int16asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asFloat64, sizeof(Int16), sizeof(Float64));

static int Int16asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asComplex32, sizeof(Int16), sizeof(Complex32));

static int Int16asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asComplex64, sizeof(Int16), sizeof(Complex64));

static int Int16asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asInt64, sizeof(Int16), sizeof(Int64));

static int Int16asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int16     *tin  = (Int16 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int16asUInt64, sizeof(Int16), sizeof(UInt64));

/****************** Int32 *******************/

static PyObject *Int32asPyValue(void *data) {
  return Py_BuildValue(PY_INT32_CHAR, *((Int32 *) data));
}

SELF_CHECKED_CFUNC_DESCR(Int32asPyValue, CFUNC_AS_PY_VALUE);

static int Int32fromPyValue(PyObject *value, void *dataptr) {
    Int32 *data = (Int32 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (Int32)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (Int32)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (Int32)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (Int32)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Int32fromPyValue, CFUNC_FROM_PY_VALUE);

static int Int32asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asBool, sizeof(Int32), sizeof(Bool));

static int Int32asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asInt8, sizeof(Int32), sizeof(Int8));

static int Int32asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asInt16, sizeof(Int32), sizeof(Int16));

static int Int32asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asUInt32, sizeof(Int32), sizeof(UInt32));

static int Int32asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asUInt8, sizeof(Int32), sizeof(UInt8));

static int Int32asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asUInt16, sizeof(Int32), sizeof(UInt16));

static int Int32asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asFloat32, sizeof(Int32), sizeof(Float32));

static int Int32asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asFloat64, sizeof(Int32), sizeof(Float64));

static int Int32asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asComplex32, sizeof(Int32), sizeof(Complex32));

static int Int32asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asComplex64, sizeof(Int32), sizeof(Complex64));

static int Int32asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asInt64, sizeof(Int32), sizeof(Int64));

static int Int32asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int32     *tin  = (Int32 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int32asUInt64, sizeof(Int32), sizeof(UInt64));

/****************** UInt32 *******************/

static PyObject *UInt32asPyValue(void *data) {
  return Py_BuildValue(PY_UINT32_CHAR, *((UInt32 *) data));
}

SELF_CHECKED_CFUNC_DESCR(UInt32asPyValue, CFUNC_AS_PY_VALUE);

static int UInt32fromPyValue(PyObject *value, void *dataptr) {
    UInt32 *data = (UInt32 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (UInt32)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (UInt32)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (UInt32)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (UInt32)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(UInt32fromPyValue, CFUNC_FROM_PY_VALUE);

static int UInt32asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asBool, sizeof(UInt32), sizeof(Bool));

static int UInt32asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asInt8, sizeof(UInt32), sizeof(Int8));

static int UInt32asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asInt16, sizeof(UInt32), sizeof(Int16));

static int UInt32asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asInt32, sizeof(UInt32), sizeof(Int32));

static int UInt32asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asUInt8, sizeof(UInt32), sizeof(UInt8));

static int UInt32asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asUInt16, sizeof(UInt32), sizeof(UInt16));

static int UInt32asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asFloat32, sizeof(UInt32), sizeof(Float32));

static int UInt32asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asFloat64, sizeof(UInt32), sizeof(Float64));

static int UInt32asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asComplex32, sizeof(UInt32), sizeof(Complex32));

static int UInt32asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asComplex64, sizeof(UInt32), sizeof(Complex64));

static int UInt32asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asInt64, sizeof(UInt32), sizeof(Int64));

static int UInt32asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt32     *tin  = (UInt32 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt32asUInt64, sizeof(UInt32), sizeof(UInt64));

/****************** UInt8 *******************/

static PyObject *UInt8asPyValue(void *data) {
  return Py_BuildValue(PY_UINT8_CHAR, (Int16)*((UInt8 *) data));
}

SELF_CHECKED_CFUNC_DESCR(UInt8asPyValue, CFUNC_AS_PY_VALUE);

static int UInt8fromPyValue(PyObject *value, void *dataptr) {
    UInt8 *data = (UInt8 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (UInt8)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (UInt8)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (UInt8)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (UInt8)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(UInt8fromPyValue, CFUNC_FROM_PY_VALUE);

static int UInt8asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asBool, sizeof(UInt8), sizeof(Bool));

static int UInt8asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asInt8, sizeof(UInt8), sizeof(Int8));

static int UInt8asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asInt16, sizeof(UInt8), sizeof(Int16));

static int UInt8asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asInt32, sizeof(UInt8), sizeof(Int32));

static int UInt8asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asUInt32, sizeof(UInt8), sizeof(UInt32));

static int UInt8asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asUInt16, sizeof(UInt8), sizeof(UInt16));

static int UInt8asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asFloat32, sizeof(UInt8), sizeof(Float32));

static int UInt8asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asFloat64, sizeof(UInt8), sizeof(Float64));

static int UInt8asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asComplex32, sizeof(UInt8), sizeof(Complex32));

static int UInt8asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asComplex64, sizeof(UInt8), sizeof(Complex64));

static int UInt8asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asInt64, sizeof(UInt8), sizeof(Int64));

static int UInt8asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt8     *tin  = (UInt8 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt8asUInt64, sizeof(UInt8), sizeof(UInt64));

/****************** UInt16 *******************/

static PyObject *UInt16asPyValue(void *data) {
  return Py_BuildValue(PY_UINT16_CHAR, (Int32)*((UInt16 *) data));
}

SELF_CHECKED_CFUNC_DESCR(UInt16asPyValue, CFUNC_AS_PY_VALUE);

static int UInt16fromPyValue(PyObject *value, void *dataptr) {
    UInt16 *data = (UInt16 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (UInt16)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (UInt16)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (UInt16)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (UInt16)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(UInt16fromPyValue, CFUNC_FROM_PY_VALUE);

static int UInt16asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asBool, sizeof(UInt16), sizeof(Bool));

static int UInt16asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asInt8, sizeof(UInt16), sizeof(Int8));

static int UInt16asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asInt16, sizeof(UInt16), sizeof(Int16));

static int UInt16asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asInt32, sizeof(UInt16), sizeof(Int32));

static int UInt16asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asUInt32, sizeof(UInt16), sizeof(UInt32));

static int UInt16asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asUInt8, sizeof(UInt16), sizeof(UInt8));

static int UInt16asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asFloat32, sizeof(UInt16), sizeof(Float32));

static int UInt16asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asFloat64, sizeof(UInt16), sizeof(Float64));

static int UInt16asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asComplex32, sizeof(UInt16), sizeof(Complex32));

static int UInt16asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asComplex64, sizeof(UInt16), sizeof(Complex64));

static int UInt16asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asInt64, sizeof(UInt16), sizeof(Int64));

static int UInt16asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt16     *tin  = (UInt16 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt16asUInt64, sizeof(UInt16), sizeof(UInt64));

/****************** Float32 *******************/

static PyObject *Float32asPyValue(void *data) {
  return Py_BuildValue(PY_FLOAT32_CHAR, *((Float32 *) data));
}

SELF_CHECKED_CFUNC_DESCR(Float32asPyValue, CFUNC_AS_PY_VALUE);

static int Float32fromPyValue(PyObject *value, void *dataptr) {
    Float32 *data = (Float32 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (Float32)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (Float32)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (Float32)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (Float32)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Float32fromPyValue, CFUNC_FROM_PY_VALUE);

static int Float32asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asBool, sizeof(Float32), sizeof(Bool));

static int Float32asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asInt8, sizeof(Float32), sizeof(Int8));

static int Float32asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asInt16, sizeof(Float32), sizeof(Int16));

static int Float32asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asInt32, sizeof(Float32), sizeof(Int32));

static int Float32asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asUInt32, sizeof(Float32), sizeof(UInt32));

static int Float32asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asUInt8, sizeof(Float32), sizeof(UInt8));

static int Float32asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asUInt16, sizeof(Float32), sizeof(UInt16));

static int Float32asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asFloat64, sizeof(Float32), sizeof(Float64));

static int Float32asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asComplex32, sizeof(Float32), sizeof(Complex32));

static int Float32asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asComplex64, sizeof(Float32), sizeof(Complex64));

static int Float32asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asInt64, sizeof(Float32), sizeof(Int64));

static int Float32asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float32     *tin  = (Float32 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float32asUInt64, sizeof(Float32), sizeof(UInt64));

/****************** Float64 *******************/

static PyObject *Float64asPyValue(void *data) {
  return Py_BuildValue(PY_FLOAT64_CHAR, *((Float64 *) data));
}

SELF_CHECKED_CFUNC_DESCR(Float64asPyValue, CFUNC_AS_PY_VALUE);

static int Float64fromPyValue(PyObject *value, void *dataptr) {
    Float64 *data = (Float64 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (Float64)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (Float64)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (Float64)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (Float64)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Float64fromPyValue, CFUNC_FROM_PY_VALUE);

static int Float64asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asBool, sizeof(Float64), sizeof(Bool));

static int Float64asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asInt8, sizeof(Float64), sizeof(Int8));

static int Float64asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asInt16, sizeof(Float64), sizeof(Int16));

static int Float64asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asInt32, sizeof(Float64), sizeof(Int32));

static int Float64asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asUInt32, sizeof(Float64), sizeof(UInt32));

static int Float64asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asUInt8, sizeof(Float64), sizeof(UInt8));

static int Float64asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asUInt16, sizeof(Float64), sizeof(UInt16));

static int Float64asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asFloat32, sizeof(Float64), sizeof(Float32));

static int Float64asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asComplex32, sizeof(Float64), sizeof(Complex32));

static int Float64asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asComplex64, sizeof(Float64), sizeof(Complex64));

static int Float64asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asInt64, sizeof(Float64), sizeof(Int64));

static int Float64asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Float64     *tin  = (Float64 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Float64asUInt64, sizeof(Float64), sizeof(UInt64));

/****************** Complex32 *******************/

static PyObject *Complex32asPyValue(void *data) {
  return PyComplex_FromDoubles(((Complex32 *) data)->r, 
                               ((Complex32 *) data)->i);
}

SELF_CHECKED_CFUNC_DESCR(Complex32asPyValue, CFUNC_AS_PY_VALUE);

static int Complex32fromPyValue(PyObject *value, void *dataptr) {
    Complex32 *data = (Complex32 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            data->r = PyLong_AsLong(value);
            data->i = 0;
        } else if (PyInt_Check(value)) {
            data->r = PyInt_AsLong(value);
            data->i = 0;
        } else if (PyFloat_Check(value)) {
            data->r = PyFloat_AsDouble(value);
            data->i = 0;
        } else if (PyComplex_Check(value)) {
           data->r = PyComplex_RealAsDouble(value);
           data->i = PyComplex_ImagAsDouble(value);
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Complex32fromPyValue, CFUNC_FROM_PY_VALUE);

static int Complex32asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asBool, sizeof(Complex32), sizeof(Bool));

static int Complex32asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asInt8, sizeof(Complex32), sizeof(Int8));

static int Complex32asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asInt16, sizeof(Complex32), sizeof(Int16));

static int Complex32asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asInt32, sizeof(Complex32), sizeof(Int32));

static int Complex32asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asUInt32, sizeof(Complex32), sizeof(UInt32));

static int Complex32asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asUInt8, sizeof(Complex32), sizeof(UInt8));

static int Complex32asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asUInt16, sizeof(Complex32), sizeof(UInt16));

static int Complex32asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asFloat32, sizeof(Complex32), sizeof(Float32));

static int Complex32asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asFloat64, sizeof(Complex32), sizeof(Float64));

static int Complex32asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = tin->r; tout->i = tin->i;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asComplex64, sizeof(Complex32), sizeof(Complex64));

static int Complex32asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asInt64, sizeof(Complex32), sizeof(Int64));

static int Complex32asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex32     *tin  = (Complex32 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex32asUInt64, sizeof(Complex32), sizeof(UInt64));

/****************** Complex64 *******************/

static PyObject *Complex64asPyValue(void *data) {
  return PyComplex_FromDoubles(((Complex64 *) data)->r, 
                               ((Complex64 *) data)->i);
}

SELF_CHECKED_CFUNC_DESCR(Complex64asPyValue, CFUNC_AS_PY_VALUE);

static int Complex64fromPyValue(PyObject *value, void *dataptr) {
    Complex64 *data = (Complex64 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            data->r = PyLong_AsLong(value);
            data->i = 0;
        } else if (PyInt_Check(value)) {
            data->r = PyInt_AsLong(value);
            data->i = 0;
        } else if (PyFloat_Check(value)) {
            data->r = PyFloat_AsDouble(value);
            data->i = 0;
        } else if (PyComplex_Check(value)) {
           data->r = PyComplex_RealAsDouble(value);
           data->i = PyComplex_ImagAsDouble(value);
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Complex64fromPyValue, CFUNC_FROM_PY_VALUE);

static int Complex64asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asBool, sizeof(Complex64), sizeof(Bool));

static int Complex64asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asInt8, sizeof(Complex64), sizeof(Int8));

static int Complex64asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asInt16, sizeof(Complex64), sizeof(Int16));

static int Complex64asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asInt32, sizeof(Complex64), sizeof(Int32));

static int Complex64asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asUInt32, sizeof(Complex64), sizeof(UInt32));

static int Complex64asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asUInt8, sizeof(Complex64), sizeof(UInt8));

static int Complex64asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asUInt16, sizeof(Complex64), sizeof(UInt16));

static int Complex64asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asFloat32, sizeof(Complex64), sizeof(Float32));

static int Complex64asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asFloat64, sizeof(Complex64), sizeof(Float64));

static int Complex64asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = tin->r; tout->i = tin->i;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asComplex32, sizeof(Complex64), sizeof(Complex32));

static int Complex64asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asInt64, sizeof(Complex64), sizeof(Int64));

static int Complex64asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Complex64     *tin  = (Complex64 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(tin->r);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Complex64asUInt64, sizeof(Complex64), sizeof(UInt64));

/****************** Int64 *******************/

static PyObject *Int64asPyValue(void *data) {
  return Py_BuildValue(PY_LONG_CHAR, *((Int64 *) data));
}

SELF_CHECKED_CFUNC_DESCR(Int64asPyValue, CFUNC_AS_PY_VALUE);

static int Int64fromPyValue(PyObject *value, void *dataptr) {
    Int64 *data = (Int64 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (Int64)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (Int64)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (Int64)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (Int64)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(Int64fromPyValue, CFUNC_FROM_PY_VALUE);

static int Int64asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asBool, sizeof(Int64), sizeof(Bool));

static int Int64asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asInt8, sizeof(Int64), sizeof(Int8));

static int Int64asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asInt16, sizeof(Int64), sizeof(Int16));

static int Int64asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asInt32, sizeof(Int64), sizeof(Int32));

static int Int64asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asUInt32, sizeof(Int64), sizeof(UInt32));

static int Int64asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asUInt8, sizeof(Int64), sizeof(UInt8));

static int Int64asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asUInt16, sizeof(Int64), sizeof(UInt16));

static int Int64asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asFloat32, sizeof(Int64), sizeof(Float32));

static int Int64asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asFloat64, sizeof(Int64), sizeof(Float64));

static int Int64asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asComplex32, sizeof(Int64), sizeof(Complex32));

static int Int64asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asComplex64, sizeof(Int64), sizeof(Complex64));

static int Int64asUInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    Int64     *tin  = (Int64 *)     buffers[0];
    UInt64 *tout = (UInt64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(Int64asUInt64, sizeof(Int64), sizeof(UInt64));

/****************** UInt64 *******************/

static PyObject *UInt64asPyValue(void *data) {
  return Py_BuildValue(PY_LONG_CHAR, *((UInt64 *) data));
}

SELF_CHECKED_CFUNC_DESCR(UInt64asPyValue, CFUNC_AS_PY_VALUE);

static int UInt64fromPyValue(PyObject *value, void *dataptr) {
    UInt64 *data = (UInt64 *) dataptr;
    if (!PyNumber_Check(value))
        return 0;
    else {
        if (PyLong_Check(value)) {
            *data = (UInt64)(PyLong_AsLongLong(value));
        } else if (PyInt_Check(value)) {
            *data = (UInt64)(PyInt_AsLong(value));
        } else if (PyFloat_Check(value)) {
            *data = (UInt64)(PyFloat_AsDouble(value));
        } else if (PyComplex_Check(value)) {
           *data = (UInt64)(PyComplex_RealAsDouble(value));
        } else {
            return 0;
        }
        if (PyErr_Occurred())
           return 0;
        else
           return 1;
    }
}

SELF_CHECKED_CFUNC_DESCR(UInt64fromPyValue, CFUNC_FROM_PY_VALUE);

static int UInt64asBool(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Bool *tout = (Bool *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Bool) isNonZERO(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asBool, sizeof(UInt64), sizeof(Bool));

static int UInt64asInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Int8 *tout = (Int8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asInt8, sizeof(UInt64), sizeof(Int8));

static int UInt64asInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Int16 *tout = (Int16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asInt16, sizeof(UInt64), sizeof(Int16));

static int UInt64asInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Int32 *tout = (Int32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asInt32, sizeof(UInt64), sizeof(Int32));

static int UInt64asUInt32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    UInt32 *tout = (UInt32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asUInt32, sizeof(UInt64), sizeof(UInt32));

static int UInt64asUInt8(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    UInt8 *tout = (UInt8 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt8)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asUInt8, sizeof(UInt64), sizeof(UInt8));

static int UInt64asUInt16(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    UInt16 *tout = (UInt16 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (UInt16)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asUInt16, sizeof(UInt64), sizeof(UInt16));

static int UInt64asFloat32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Float32 *tout = (Float32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float32)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asFloat32, sizeof(UInt64), sizeof(Float32));

static int UInt64asFloat64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Float64 *tout = (Float64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Float64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asFloat64, sizeof(UInt64), sizeof(Float64));

static int UInt64asComplex32(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Complex32 *tout = (Complex32 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asComplex32, sizeof(UInt64), sizeof(Complex32));

static int UInt64asComplex64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Complex64 *tout = (Complex64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        tout->r = *tin; tout->i = 0;
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asComplex64, sizeof(UInt64), sizeof(Complex64));

static int UInt64asInt64(long niter, long ninargs, long noutargs, void **buffers, long *bsizes) {
    long i;
    UInt64     *tin  = (UInt64 *)     buffers[0];
    Int64 *tout = (Int64 *) buffers[1];
    BEGIN_THREADS
    for (i=0; i<niter; i++, tout++, tin++) {
        *tout = (Int64)(*tin);
    }
    END_THREADS
    return 0;
}

UFUNC_DESCR2(UInt64asInt64, sizeof(UInt64), sizeof(Int64));

static PyMethodDef _convMethods[] = {

	{NULL,      NULL}        /* Sentinel */
};

static PyObject *init_funcDict(void) {
    PyObject *dict;
    dict = PyDict_New();
    NA_add_cfunc(dict, "('Bool', 'asPyValue')", (void *) &BoolasPyValue_descr);
    NA_add_cfunc(dict, "('Bool', 'fromPyValue')", (void *) &BoolfromPyValue_descr);
    NA_add_cfunc(dict, "('Bool', 'Int8')", (void *) &BoolasInt8_descr);
    NA_add_cfunc(dict, "('Bool', 'Int16')", (void *) &BoolasInt16_descr);
    NA_add_cfunc(dict, "('Bool', 'Int32')", (void *) &BoolasInt32_descr);
    NA_add_cfunc(dict, "('Bool', 'UInt32')", (void *) &BoolasUInt32_descr);
    NA_add_cfunc(dict, "('Bool', 'UInt8')", (void *) &BoolasUInt8_descr);
    NA_add_cfunc(dict, "('Bool', 'UInt16')", (void *) &BoolasUInt16_descr);
    NA_add_cfunc(dict, "('Bool', 'Float32')", (void *) &BoolasFloat32_descr);
    NA_add_cfunc(dict, "('Bool', 'Float64')", (void *) &BoolasFloat64_descr);
    NA_add_cfunc(dict, "('Bool', 'Complex32')", (void *) &BoolasComplex32_descr);
    NA_add_cfunc(dict, "('Bool', 'Complex64')", (void *) &BoolasComplex64_descr);
    NA_add_cfunc(dict, "('Bool', 'Int64')", (void *) &BoolasInt64_descr);
    NA_add_cfunc(dict, "('Bool', 'UInt64')", (void *) &BoolasUInt64_descr);
    NA_add_cfunc(dict, "('Int8', 'asPyValue')", (void *) &Int8asPyValue_descr);
    NA_add_cfunc(dict, "('Int8', 'fromPyValue')", (void *) &Int8fromPyValue_descr);
    NA_add_cfunc(dict, "('Int8', 'Bool')", (void *) &Int8asBool_descr);
    NA_add_cfunc(dict, "('Int8', 'Int16')", (void *) &Int8asInt16_descr);
    NA_add_cfunc(dict, "('Int8', 'Int32')", (void *) &Int8asInt32_descr);
    NA_add_cfunc(dict, "('Int8', 'UInt32')", (void *) &Int8asUInt32_descr);
    NA_add_cfunc(dict, "('Int8', 'UInt8')", (void *) &Int8asUInt8_descr);
    NA_add_cfunc(dict, "('Int8', 'UInt16')", (void *) &Int8asUInt16_descr);
    NA_add_cfunc(dict, "('Int8', 'Float32')", (void *) &Int8asFloat32_descr);
    NA_add_cfunc(dict, "('Int8', 'Float64')", (void *) &Int8asFloat64_descr);
    NA_add_cfunc(dict, "('Int8', 'Complex32')", (void *) &Int8asComplex32_descr);
    NA_add_cfunc(dict, "('Int8', 'Complex64')", (void *) &Int8asComplex64_descr);
    NA_add_cfunc(dict, "('Int8', 'Int64')", (void *) &Int8asInt64_descr);
    NA_add_cfunc(dict, "('Int8', 'UInt64')", (void *) &Int8asUInt64_descr);
    NA_add_cfunc(dict, "('Int16', 'asPyValue')", (void *) &Int16asPyValue_descr);
    NA_add_cfunc(dict, "('Int16', 'fromPyValue')", (void *) &Int16fromPyValue_descr);
    NA_add_cfunc(dict, "('Int16', 'Bool')", (void *) &Int16asBool_descr);
    NA_add_cfunc(dict, "('Int16', 'Int8')", (void *) &Int16asInt8_descr);
    NA_add_cfunc(dict, "('Int16', 'Int32')", (void *) &Int16asInt32_descr);
    NA_add_cfunc(dict, "('Int16', 'UInt32')", (void *) &Int16asUInt32_descr);
    NA_add_cfunc(dict, "('Int16', 'UInt8')", (void *) &Int16asUInt8_descr);
    NA_add_cfunc(dict, "('Int16', 'UInt16')", (void *) &Int16asUInt16_descr);
    NA_add_cfunc(dict, "('Int16', 'Float32')", (void *) &Int16asFloat32_descr);
    NA_add_cfunc(dict, "('Int16', 'Float64')", (void *) &Int16asFloat64_descr);
    NA_add_cfunc(dict, "('Int16', 'Complex32')", (void *) &Int16asComplex32_descr);
    NA_add_cfunc(dict, "('Int16', 'Complex64')", (void *) &Int16asComplex64_descr);
    NA_add_cfunc(dict, "('Int16', 'Int64')", (void *) &Int16asInt64_descr);
    NA_add_cfunc(dict, "('Int16', 'UInt64')", (void *) &Int16asUInt64_descr);
    NA_add_cfunc(dict, "('Int32', 'asPyValue')", (void *) &Int32asPyValue_descr);
    NA_add_cfunc(dict, "('Int32', 'fromPyValue')", (void *) &Int32fromPyValue_descr);
    NA_add_cfunc(dict, "('Int32', 'Bool')", (void *) &Int32asBool_descr);
    NA_add_cfunc(dict, "('Int32', 'Int8')", (void *) &Int32asInt8_descr);
    NA_add_cfunc(dict, "('Int32', 'Int16')", (void *) &Int32asInt16_descr);
    NA_add_cfunc(dict, "('Int32', 'UInt32')", (void *) &Int32asUInt32_descr);
    NA_add_cfunc(dict, "('Int32', 'UInt8')", (void *) &Int32asUInt8_descr);
    NA_add_cfunc(dict, "('Int32', 'UInt16')", (void *) &Int32asUInt16_descr);
    NA_add_cfunc(dict, "('Int32', 'Float32')", (void *) &Int32asFloat32_descr);
    NA_add_cfunc(dict, "('Int32', 'Float64')", (void *) &Int32asFloat64_descr);
    NA_add_cfunc(dict, "('Int32', 'Complex32')", (void *) &Int32asComplex32_descr);
    NA_add_cfunc(dict, "('Int32', 'Complex64')", (void *) &Int32asComplex64_descr);
    NA_add_cfunc(dict, "('Int32', 'Int64')", (void *) &Int32asInt64_descr);
    NA_add_cfunc(dict, "('Int32', 'UInt64')", (void *) &Int32asUInt64_descr);
    NA_add_cfunc(dict, "('UInt32', 'asPyValue')", (void *) &UInt32asPyValue_descr);
    NA_add_cfunc(dict, "('UInt32', 'fromPyValue')", (void *) &UInt32fromPyValue_descr);
    NA_add_cfunc(dict, "('UInt32', 'Bool')", (void *) &UInt32asBool_descr);
    NA_add_cfunc(dict, "('UInt32', 'Int8')", (void *) &UInt32asInt8_descr);
    NA_add_cfunc(dict, "('UInt32', 'Int16')", (void *) &UInt32asInt16_descr);
    NA_add_cfunc(dict, "('UInt32', 'Int32')", (void *) &UInt32asInt32_descr);
    NA_add_cfunc(dict, "('UInt32', 'UInt8')", (void *) &UInt32asUInt8_descr);
    NA_add_cfunc(dict, "('UInt32', 'UInt16')", (void *) &UInt32asUInt16_descr);
    NA_add_cfunc(dict, "('UInt32', 'Float32')", (void *) &UInt32asFloat32_descr);
    NA_add_cfunc(dict, "('UInt32', 'Float64')", (void *) &UInt32asFloat64_descr);
    NA_add_cfunc(dict, "('UInt32', 'Complex32')", (void *) &UInt32asComplex32_descr);
    NA_add_cfunc(dict, "('UInt32', 'Complex64')", (void *) &UInt32asComplex64_descr);
    NA_add_cfunc(dict, "('UInt32', 'Int64')", (void *) &UInt32asInt64_descr);
    NA_add_cfunc(dict, "('UInt32', 'UInt64')", (void *) &UInt32asUInt64_descr);
    NA_add_cfunc(dict, "('UInt8', 'asPyValue')", (void *) &UInt8asPyValue_descr);
    NA_add_cfunc(dict, "('UInt8', 'fromPyValue')", (void *) &UInt8fromPyValue_descr);
    NA_add_cfunc(dict, "('UInt8', 'Bool')", (void *) &UInt8asBool_descr);
    NA_add_cfunc(dict, "('UInt8', 'Int8')", (void *) &UInt8asInt8_descr);
    NA_add_cfunc(dict, "('UInt8', 'Int16')", (void *) &UInt8asInt16_descr);
    NA_add_cfunc(dict, "('UInt8', 'Int32')", (void *) &UInt8asInt32_descr);
    NA_add_cfunc(dict, "('UInt8', 'UInt32')", (void *) &UInt8asUInt32_descr);
    NA_add_cfunc(dict, "('UInt8', 'UInt16')", (void *) &UInt8asUInt16_descr);
    NA_add_cfunc(dict, "('UInt8', 'Float32')", (void *) &UInt8asFloat32_descr);
    NA_add_cfunc(dict, "('UInt8', 'Float64')", (void *) &UInt8asFloat64_descr);
    NA_add_cfunc(dict, "('UInt8', 'Complex32')", (void *) &UInt8asComplex32_descr);
    NA_add_cfunc(dict, "('UInt8', 'Complex64')", (void *) &UInt8asComplex64_descr);
    NA_add_cfunc(dict, "('UInt8', 'Int64')", (void *) &UInt8asInt64_descr);
    NA_add_cfunc(dict, "('UInt8', 'UInt64')", (void *) &UInt8asUInt64_descr);
    NA_add_cfunc(dict, "('UInt16', 'asPyValue')", (void *) &UInt16asPyValue_descr);
    NA_add_cfunc(dict, "('UInt16', 'fromPyValue')", (void *) &UInt16fromPyValue_descr);
    NA_add_cfunc(dict, "('UInt16', 'Bool')", (void *) &UInt16asBool_descr);
    NA_add_cfunc(dict, "('UInt16', 'Int8')", (void *) &UInt16asInt8_descr);
    NA_add_cfunc(dict, "('UInt16', 'Int16')", (void *) &UInt16asInt16_descr);
    NA_add_cfunc(dict, "('UInt16', 'Int32')", (void *) &UInt16asInt32_descr);
    NA_add_cfunc(dict, "('UInt16', 'UInt32')", (void *) &UInt16asUInt32_descr);
    NA_add_cfunc(dict, "('UInt16', 'UInt8')", (void *) &UInt16asUInt8_descr);
    NA_add_cfunc(dict, "('UInt16', 'Float32')", (void *) &UInt16asFloat32_descr);
    NA_add_cfunc(dict, "('UInt16', 'Float64')", (void *) &UInt16asFloat64_descr);
    NA_add_cfunc(dict, "('UInt16', 'Complex32')", (void *) &UInt16asComplex32_descr);
    NA_add_cfunc(dict, "('UInt16', 'Complex64')", (void *) &UInt16asComplex64_descr);
    NA_add_cfunc(dict, "('UInt16', 'Int64')", (void *) &UInt16asInt64_descr);
    NA_add_cfunc(dict, "('UInt16', 'UInt64')", (void *) &UInt16asUInt64_descr);
    NA_add_cfunc(dict, "('Float32', 'asPyValue')", (void *) &Float32asPyValue_descr);
    NA_add_cfunc(dict, "('Float32', 'fromPyValue')", (void *) &Float32fromPyValue_descr);
    NA_add_cfunc(dict, "('Float32', 'Bool')", (void *) &Float32asBool_descr);
    NA_add_cfunc(dict, "('Float32', 'Int8')", (void *) &Float32asInt8_descr);
    NA_add_cfunc(dict, "('Float32', 'Int16')", (void *) &Float32asInt16_descr);
    NA_add_cfunc(dict, "('Float32', 'Int32')", (void *) &Float32asInt32_descr);
    NA_add_cfunc(dict, "('Float32', 'UInt32')", (void *) &Float32asUInt32_descr);
    NA_add_cfunc(dict, "('Float32', 'UInt8')", (void *) &Float32asUInt8_descr);
    NA_add_cfunc(dict, "('Float32', 'UInt16')", (void *) &Float32asUInt16_descr);
    NA_add_cfunc(dict, "('Float32', 'Float64')", (void *) &Float32asFloat64_descr);
    NA_add_cfunc(dict, "('Float32', 'Complex32')", (void *) &Float32asComplex32_descr);
    NA_add_cfunc(dict, "('Float32', 'Complex64')", (void *) &Float32asComplex64_descr);
    NA_add_cfunc(dict, "('Float32', 'Int64')", (void *) &Float32asInt64_descr);
    NA_add_cfunc(dict, "('Float32', 'UInt64')", (void *) &Float32asUInt64_descr);
    NA_add_cfunc(dict, "('Float64', 'asPyValue')", (void *) &Float64asPyValue_descr);
    NA_add_cfunc(dict, "('Float64', 'fromPyValue')", (void *) &Float64fromPyValue_descr);
    NA_add_cfunc(dict, "('Float64', 'Bool')", (void *) &Float64asBool_descr);
    NA_add_cfunc(dict, "('Float64', 'Int8')", (void *) &Float64asInt8_descr);
    NA_add_cfunc(dict, "('Float64', 'Int16')", (void *) &Float64asInt16_descr);
    NA_add_cfunc(dict, "('Float64', 'Int32')", (void *) &Float64asInt32_descr);
    NA_add_cfunc(dict, "('Float64', 'UInt32')", (void *) &Float64asUInt32_descr);
    NA_add_cfunc(dict, "('Float64', 'UInt8')", (void *) &Float64asUInt8_descr);
    NA_add_cfunc(dict, "('Float64', 'UInt16')", (void *) &Float64asUInt16_descr);
    NA_add_cfunc(dict, "('Float64', 'Float32')", (void *) &Float64asFloat32_descr);
    NA_add_cfunc(dict, "('Float64', 'Complex32')", (void *) &Float64asComplex32_descr);
    NA_add_cfunc(dict, "('Float64', 'Complex64')", (void *) &Float64asComplex64_descr);
    NA_add_cfunc(dict, "('Float64', 'Int64')", (void *) &Float64asInt64_descr);
    NA_add_cfunc(dict, "('Float64', 'UInt64')", (void *) &Float64asUInt64_descr);
    NA_add_cfunc(dict, "('Complex32', 'asPyValue')", (void *) &Complex32asPyValue_descr);
    NA_add_cfunc(dict, "('Complex32', 'fromPyValue')", (void *) &Complex32fromPyValue_descr);
    NA_add_cfunc(dict, "('Complex32', 'Bool')", (void *) &Complex32asBool_descr);
    NA_add_cfunc(dict, "('Complex32', 'Int8')", (void *) &Complex32asInt8_descr);
    NA_add_cfunc(dict, "('Complex32', 'Int16')", (void *) &Complex32asInt16_descr);
    NA_add_cfunc(dict, "('Complex32', 'Int32')", (void *) &Complex32asInt32_descr);
    NA_add_cfunc(dict, "('Complex32', 'UInt32')", (void *) &Complex32asUInt32_descr);
    NA_add_cfunc(dict, "('Complex32', 'UInt8')", (void *) &Complex32asUInt8_descr);
    NA_add_cfunc(dict, "('Complex32', 'UInt16')", (void *) &Complex32asUInt16_descr);
    NA_add_cfunc(dict, "('Complex32', 'Float32')", (void *) &Complex32asFloat32_descr);
    NA_add_cfunc(dict, "('Complex32', 'Float64')", (void *) &Complex32asFloat64_descr);
    NA_add_cfunc(dict, "('Complex32', 'Complex64')", (void *) &Complex32asComplex64_descr);
    NA_add_cfunc(dict, "('Complex32', 'Int64')", (void *) &Complex32asInt64_descr);
    NA_add_cfunc(dict, "('Complex32', 'UInt64')", (void *) &Complex32asUInt64_descr);
    NA_add_cfunc(dict, "('Complex64', 'asPyValue')", (void *) &Complex64asPyValue_descr);
    NA_add_cfunc(dict, "('Complex64', 'fromPyValue')", (void *) &Complex64fromPyValue_descr);
    NA_add_cfunc(dict, "('Complex64', 'Bool')", (void *) &Complex64asBool_descr);
    NA_add_cfunc(dict, "('Complex64', 'Int8')", (void *) &Complex64asInt8_descr);
    NA_add_cfunc(dict, "('Complex64', 'Int16')", (void *) &Complex64asInt16_descr);
    NA_add_cfunc(dict, "('Complex64', 'Int32')", (void *) &Complex64asInt32_descr);
    NA_add_cfunc(dict, "('Complex64', 'UInt32')", (void *) &Complex64asUInt32_descr);
    NA_add_cfunc(dict, "('Complex64', 'UInt8')", (void *) &Complex64asUInt8_descr);
    NA_add_cfunc(dict, "('Complex64', 'UInt16')", (void *) &Complex64asUInt16_descr);
    NA_add_cfunc(dict, "('Complex64', 'Float32')", (void *) &Complex64asFloat32_descr);
    NA_add_cfunc(dict, "('Complex64', 'Float64')", (void *) &Complex64asFloat64_descr);
    NA_add_cfunc(dict, "('Complex64', 'Complex32')", (void *) &Complex64asComplex32_descr);
    NA_add_cfunc(dict, "('Complex64', 'Int64')", (void *) &Complex64asInt64_descr);
    NA_add_cfunc(dict, "('Complex64', 'UInt64')", (void *) &Complex64asUInt64_descr);
    NA_add_cfunc(dict, "('Int64', 'asPyValue')", (void *) &Int64asPyValue_descr);
    NA_add_cfunc(dict, "('Int64', 'fromPyValue')", (void *) &Int64fromPyValue_descr);
    NA_add_cfunc(dict, "('Int64', 'Bool')", (void *) &Int64asBool_descr);
    NA_add_cfunc(dict, "('Int64', 'Int8')", (void *) &Int64asInt8_descr);
    NA_add_cfunc(dict, "('Int64', 'Int16')", (void *) &Int64asInt16_descr);
    NA_add_cfunc(dict, "('Int64', 'Int32')", (void *) &Int64asInt32_descr);
    NA_add_cfunc(dict, "('Int64', 'UInt32')", (void *) &Int64asUInt32_descr);
    NA_add_cfunc(dict, "('Int64', 'UInt8')", (void *) &Int64asUInt8_descr);
    NA_add_cfunc(dict, "('Int64', 'UInt16')", (void *) &Int64asUInt16_descr);
    NA_add_cfunc(dict, "('Int64', 'Float32')", (void *) &Int64asFloat32_descr);
    NA_add_cfunc(dict, "('Int64', 'Float64')", (void *) &Int64asFloat64_descr);
    NA_add_cfunc(dict, "('Int64', 'Complex32')", (void *) &Int64asComplex32_descr);
    NA_add_cfunc(dict, "('Int64', 'Complex64')", (void *) &Int64asComplex64_descr);
    NA_add_cfunc(dict, "('Int64', 'UInt64')", (void *) &Int64asUInt64_descr);
    NA_add_cfunc(dict, "('UInt64', 'asPyValue')", (void *) &UInt64asPyValue_descr);
    NA_add_cfunc(dict, "('UInt64', 'fromPyValue')", (void *) &UInt64fromPyValue_descr);
    NA_add_cfunc(dict, "('UInt64', 'Bool')", (void *) &UInt64asBool_descr);
    NA_add_cfunc(dict, "('UInt64', 'Int8')", (void *) &UInt64asInt8_descr);
    NA_add_cfunc(dict, "('UInt64', 'Int16')", (void *) &UInt64asInt16_descr);
    NA_add_cfunc(dict, "('UInt64', 'Int32')", (void *) &UInt64asInt32_descr);
    NA_add_cfunc(dict, "('UInt64', 'UInt32')", (void *) &UInt64asUInt32_descr);
    NA_add_cfunc(dict, "('UInt64', 'UInt8')", (void *) &UInt64asUInt8_descr);
    NA_add_cfunc(dict, "('UInt64', 'UInt16')", (void *) &UInt64asUInt16_descr);
    NA_add_cfunc(dict, "('UInt64', 'Float32')", (void *) &UInt64asFloat32_descr);
    NA_add_cfunc(dict, "('UInt64', 'Float64')", (void *) &UInt64asFloat64_descr);
    NA_add_cfunc(dict, "('UInt64', 'Complex32')", (void *) &UInt64asComplex32_descr);
    NA_add_cfunc(dict, "('UInt64', 'Complex64')", (void *) &UInt64asComplex64_descr);
    NA_add_cfunc(dict, "('UInt64', 'Int64')", (void *) &UInt64asInt64_descr);
    return dict;
}

/* platform independent*/
#ifdef MS_WIN32
__declspec(dllexport)
#endif
void init_conv(void) {
    PyObject *m, *d, *functions;
    m = Py_InitModule("_conv", _convMethods);
    d = PyModule_GetDict(m);
    import_libnumarray();
    functions = init_funcDict();
    PyDict_SetItemString(d, "functionDict", functions);
    Py_DECREF(functions);
    ADD_VERSION(m);
}
