diff options
Diffstat (limited to 'src/H5V.c')
-rw-r--r-- | src/H5V.c | 146 |
1 files changed, 73 insertions, 73 deletions
@@ -78,7 +78,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - assert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(1 == H5V_vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -127,8 +127,8 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - assert(1 == H5V_vector_reduce_product(0, NULL)); - assert (*elmt_size>0); + HDassert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(*elmt_size>0); /* * Combine adjacent memory accesses @@ -267,48 +267,48 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(size); - assert(total_size); - assert(stride); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(size); + HDassert(total_size); + HDassert(stride); /* init */ - assert(n>0); + HDassert(n>0); stride[n-1] = 1; skip = offset ? offset[n-1] : 0; switch(n) { case 2: /* 1-D dataset */ - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = total_size[1]-size[1]; /*overflow checked*/ acc = total_size[1]; skip += acc * (offset ? offset[0] : 0); break; case 3: /* 2-D dataset */ - assert (total_size[2]>=size[2]); + HDassert(total_size[2]>=size[2]); stride[1] = total_size[2]-size[2]; /*overflow checked*/ acc = total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); break; case 4: /* 3-D dataset */ - assert (total_size[3]>=size[3]); + HDassert(total_size[3]>=size[3]); stride[2] = total_size[3]-size[3]; /*overflow checked*/ acc = total_size[3]; skip += acc * (offset ? (hsize_t)offset[2] : 0); - assert (total_size[2]>=size[2]); + HDassert(total_size[2]>=size[2]); stride[1] = acc * (total_size[2] - size[2]); /*overflow checked*/ acc *= total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - assert (total_size[1]>=size[1]); + HDassert(total_size[1]>=size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); @@ -317,7 +317,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, default: /* others */ for (i=(int)(n-2), acc=1; i>=0; --i) { - assert (total_size[i+1]>=size[i+1]); + HDassert(total_size[i+1]>=size[i+1]); stride[i] = acc * (total_size[i+1] - size[i+1]); /*overflow checked*/ acc *= total_size[i+1]; skip += acc * (offset ? (hsize_t)offset[i] : 0); @@ -474,14 +474,14 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(n > 0 && n <= H5V_HYPER_NDIMS); - assert(_size); - assert(total_size); - assert(dst); + HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(_size); + HDassert(total_size); + HDassert(dst); #ifndef NDEBUG for (u = 0; u < n; u++) { - assert(_size[u] > 0); - assert(total_size[u] > 0); + HDassert(_size[u] > 0); + HDassert(total_size[u] > 0); } #endif @@ -560,17 +560,17 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(n > 0 && n <= H5V_HYPER_NDIMS); - assert(_size); - assert(dst_size); - assert(src_size); - assert(dst); - assert(src); + HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(_size); + HDassert(dst_size); + HDassert(src_size); + HDassert(dst); + HDassert(src); #ifndef NDEBUG for (u = 0; u < n; u++) { - assert(_size[u] > 0); - assert(dst_size[u] > 0); - assert(src_size[u] > 0); + HDassert(_size[u] > 0); + HDassert(dst_size[u] > 0); + HDassert(src_size[u] > 0); } #endif @@ -589,7 +589,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, int ii; /*counter */ /* init */ - assert(n>0); + HDassert(n>0); dst_stride[n-1] = 1; src_stride[n-1] = 1; dst_start = dst_offset ? dst_offset[n-1] : 0; @@ -598,8 +598,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, /* Unroll loop for common cases */ switch(n) { case 2: - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_size[1] - size[1]; /*overflow checked*/ src_stride[0] = src_size[1] - size[1]; /*overflow checked*/ dst_acc = dst_size[1]; @@ -609,8 +609,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, break; case 3: - assert (dst_size[2]>=size[2]); - assert (src_size[2]>=size[2]); + HDassert(dst_size[2]>=size[2]); + HDassert(src_size[2]>=size[2]); dst_stride[1] = dst_size[2] - size[2]; /*overflow checked*/ src_stride[1] = src_size[2] - size[2]; /*overflow checked*/ dst_acc = dst_size[2]; @@ -618,8 +618,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -629,8 +629,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, break; case 4: - assert (dst_size[3]>=size[3]); - assert (src_size[3]>=size[3]); + HDassert(dst_size[3]>=size[3]); + HDassert(src_size[3]>=size[3]); dst_stride[2] = dst_size[3] - size[3]; /*overflow checked*/ src_stride[2] = src_size[3] - size[3]; /*overflow checked*/ dst_acc = dst_size[3]; @@ -638,8 +638,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[2] : 0); src_start += src_acc * (src_offset ? src_offset[2] : 0); - assert (dst_size[2]>=size[2]); - assert (src_size[2]>=size[2]); + HDassert(dst_size[2]>=size[2]); + HDassert(src_size[2]>=size[2]); dst_stride[1] = dst_acc * (dst_size[2] - size[2]); /*overflow checked*/ src_stride[1] = src_acc * (src_size[2] - size[2]); /*overflow checked*/ dst_acc *= dst_size[2]; @@ -647,8 +647,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - assert (dst_size[1]>=size[1]); - assert (src_size[1]>=size[1]); + HDassert(dst_size[1]>=size[1]); + HDassert(src_size[1]>=size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -660,8 +660,8 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, default: /* others */ for (ii=(int)(n-2), dst_acc=1, src_acc=1; ii>=0; --ii) { - assert (dst_size[ii+1]>=size[ii+1]); - assert (src_size[ii+1]>=size[ii+1]); + HDassert(dst_size[ii+1]>=size[ii+1]); + HDassert(src_size[ii+1]>=size[ii+1]); dst_stride[ii] = dst_acc * (dst_size[ii+1] - size[ii+1]); /*overflow checked*/ src_stride[ii] = src_acc * (src_size[ii+1] - size[ii+1]); /*overflow checked*/ dst_acc *= dst_size[ii+1]; @@ -713,7 +713,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size < SIZET_MAX); + HDassert(elmt_size < SIZET_MAX); H5V_vector_cpy(n, idx, size); nelmts = H5V_vector_reduce_product(n, size); @@ -729,7 +729,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, if (--idx[j]) carry = FALSE; else { - assert(size); + HDassert(size); idx[j] = size[j]; } /* end else */ } @@ -775,7 +775,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size<SIZET_MAX); + HDassert(elmt_size<SIZET_MAX); if (n) { H5V_vector_cpy(n, idx, size); @@ -794,7 +794,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, if (--idx[j]) carry = FALSE; else { - assert(size); + HDassert(size); idx[j] = size[j]; } } @@ -844,7 +844,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size<SIZET_MAX); + HDassert(elmt_size<SIZET_MAX); if (n) { H5V_vector_cpy(n, idx, size); @@ -863,7 +863,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, if (--idx[j]) carry = FALSE; else { - assert(size); + HDassert(size); idx[j] = size[j]; } } @@ -918,9 +918,9 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (elmt_size < SIZET_MAX); - assert(dst_n>0); - assert(src_n>0); + HDassert(elmt_size < SIZET_MAX); + HDassert(dst_n>0); + HDassert(src_n>0); H5V_vector_cpy(dst_n, dst_idx, dst_size); H5V_vector_cpy(src_n, src_idx, src_size); @@ -937,7 +937,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, if (--dst_idx[j]) carry = FALSE; else { - assert(dst_size); + HDassert(dst_size); dst_idx[j] = dst_size[j]; } /* end else */ } @@ -946,7 +946,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, if (--src_idx[j]) carry = FALSE; else { - assert(src_size); + HDassert(src_size); src_idx[j] = src_size[j]; } /* end else */ } @@ -983,10 +983,10 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert (dst); - assert (src); - assert (size < SIZET_MAX && size > 0); - assert (count < SIZET_MAX && count > 0); + HDassert(dst); + HDassert(src); + HDassert(size < SIZET_MAX && size > 0); + HDassert(count < SIZET_MAX && count > 0); HDmemcpy(dst, src, size); /* copy first item */ @@ -1038,9 +1038,9 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(total_size); - assert(down); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(total_size); + HDassert(down); /* Build the sizes of each dimension in the array */ /* (From fastest to slowest) */ @@ -1084,9 +1084,9 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(n <= H5V_HYPER_NDIMS); - assert(acc); - assert(offset); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(acc); + HDassert(offset); /* Compute offset in array */ for (i=(int)(n-1), ret_value=0; i>=0; --i) @@ -1124,9 +1124,9 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset) FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */ - assert(n <= H5V_HYPER_NDIMS); - assert(total_size); - assert(offset); + HDassert(n <= H5V_HYPER_NDIMS); + HDassert(total_size); + HDassert(offset); /* Build the sizes of each dimension in the array */ if(H5V_array_down(n,total_size,acc_arr)<0) @@ -1278,10 +1278,10 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - assert(ndims <= H5V_HYPER_NDIMS); - assert(coord); - assert(chunk); - assert(chunk_idx); + HDassert(ndims <= H5V_HYPER_NDIMS); + HDassert(coord); + HDassert(chunk); + HDassert(chunk_idx); /* Compute the scaled coordinates for actual coordinates */ for(u=0; u<ndims; u++) |