[arrayfire] 207/248: Fix iota dims check

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:54:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit 6975da85b8df8f06332b59ef4d07c7ff46f5abe2
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Thu Nov 5 19:16:29 2015 -0500

    Fix iota dims check
---
 src/api/c/data.cpp | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/api/c/data.cpp b/src/api/c/data.cpp
index 56a1dcf..4d77fb2 100644
--- a/src/api/c/data.cpp
+++ b/src/api/c/data.cpp
@@ -517,16 +517,9 @@ af_err af_iota(af_array *result, const unsigned ndims, const dim_t * const dims,
 
         DIM_ASSERT(1, ndims > 0 && ndims <= 4);
         DIM_ASSERT(3, t_ndims > 0 && t_ndims <= 4);
-        dim4 d;
-        dim4 t;
-        for(unsigned i = 0; i < 4; i++) {
-            d[i] = dims[i];
-            DIM_ASSERT(2, d[i] >= 1);
-        }
-        for(unsigned i = 0; i < 4; i++) {
-            t[i] = tdims[i];
-            DIM_ASSERT(4, t[i] >= 1);
-        }
+
+        dim4 d = verifyDims(ndims, dims);
+        dim4 t = verifyDims(t_ndims, tdims);
 
         switch(type) {
         case f32:   out = iota_<float  >(d, t); break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list