diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-05-02 19:38:46 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-05-02 19:38:46 +0000 |
commit | 356e93e2e3d18a44bbf63a95b487fc91a1fed147 (patch) | |
tree | 6834af2f46a5212b855a97d3f8fd0406d481b9dc /numpy/core/src | |
parent | 20cd0157fa6a3ff3ad2f431965092caf1246646c (diff) | |
download | numpy-356e93e2e3d18a44bbf63a95b487fc91a1fed147.tar.gz |
Add PyArray_CHAR as an alias to PyArray_STRING with element size of 1
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/arraytypes.inc.src | 6 | ||||
-rw-r--r-- | numpy/core/src/scalarmathmodule.c.src | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src index 29f017fe4..aa20acb6b 100644 --- a/numpy/core/src/arraytypes.inc.src +++ b/numpy/core/src/arraytypes.inc.src @@ -1955,6 +1955,12 @@ PyArray_DescrFromType(int type) */ return NULL; } + else if ((type == PyArray_CHAR) || \ + (type == PyArray_CHARLTR)) { + ret = PyArray_DescrNew(_builtin_descrs[PyArray_STRING]); + ret->elsize = 1; + return ret; + } else if PyTypeNum_ISUSERDEF(type) { ret = userdescrs[type-PyArray_USERDEF]; } diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src index e9e8d09fd..c6f2088ca 100644 --- a/numpy/core/src/scalarmathmodule.c.src +++ b/numpy/core/src/scalarmathmodule.c.src @@ -597,7 +597,7 @@ static PyObject * { PyObject *ret; @name@ arg1, arg2, out; - @otyp@ out1; + @otyp@ out1=0; int retstatus; switch(_@name@_convert2_to_ctypes(a, &arg1, b, &arg2)) { |