diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-10-20 06:26:57 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-10-20 06:26:57 +0000 |
commit | 143fa8c512e15c72c12301c05f263cb2e08b61b9 (patch) | |
tree | 3546a3499c95b6cc06258f5b757423eb972241d0 | |
parent | 0c9bbdeb1f5bde55d1070f1a83844b85f1a0c603 (diff) | |
download | numpy-143fa8c512e15c72c12301c05f263cb2e08b61b9.tar.gz |
Set memory to zero when using SimpleNew
-rw-r--r-- | scipy/f2py2e/src/fortranobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scipy/f2py2e/src/fortranobject.c b/scipy/f2py2e/src/fortranobject.c index 556dcd5db..646cb13b5 100644 --- a/scipy/f2py2e/src/fortranobject.c +++ b/scipy/f2py2e/src/fortranobject.c @@ -559,6 +559,7 @@ PyArrayObject* array_from_pyobj(const int type_num, " have defined dimensions.\n"); arr = (PyArrayObject *)PyArray_SimpleNew(rank,dims,type_num); ARR_IS_NULL(arr==NULL,"FromDims failed: optional,intent(cache)\n"); + memset(arr->data, 0, PyArray_NBYTES(arr)); /* if (intent & F2PY_INTENT_OUT) */ /* Py_INCREF(arr); */ return arr; @@ -586,6 +587,7 @@ PyArrayObject* array_from_pyobj(const int type_num, CHECK_DIMS_DEFINED(rank,dims,"intent(hide) must have defined dimensions.\n"); arr = (PyArrayObject *)PyArray_SimpleNew(rank, dims, type_num); ARR_IS_NULL(arr==NULL,"FromDims failed: intent(hide)\n"); + memset(arr->data, 0, PyArray_NBYTES(arr)); if (intent & F2PY_INTENT_OUT) { if ((!(intent & F2PY_INTENT_C)) && (rank>1)) { transpose_strides(arr); @@ -664,6 +666,7 @@ PyArrayObject* array_from_pyobj(const int type_num, CHECK_DIMS_DEFINED(rank,dims,"optional must have defined dimensions.\n"); arr = (PyArrayObject *)PyArray_SimpleNew(rank,dims,type_num); ARR_IS_NULL(arr==NULL,"FromDims failed: optional.\n"); + memset(arr->data, 0, PyArray_NBYTES(arr)); if (intent & F2PY_INTENT_OUT) { if ((!(intent & F2PY_INTENT_C)) && (rank>1)) { transpose_strides(arr); |