[svn-r2647] Purpose:

Bug fiX
Description:
    H5S_hyper_select_valid would report hyperslab invalid if the one of
    the count values is zero.  The verifying algorithm did not take into
    consideration that block or count can contain zeros to indicate no
    element is wanted.
Solution:
    Added code to test if block or count is zero.  If so, skip the rest
    of the validity check.
Platforms tested:
    IRIX64 -64.
This commit is contained in:
Albert Cheng 2000-10-09 21:45:05 -05:00
parent 884b83d606
commit a1e44979ed

View File

@ -4127,21 +4127,25 @@ H5S_hyper_select_valid (const H5S_t *space)
/* Check each dimension */
for(i=0; i<space->extent.u.simple.rank; i++) {
/* Bounds check the start point in this dimension */
if((diminfo[i].start+space->select.offset[i])<0 ||
(diminfo[i].start+space->select.offset[i])>=(hssize_t)space->extent.u.simple.size[i]) {
ret_value=FALSE;
break;
} /* end if */
/* if block or count is zero, then can skip the test since */
/* no data point is chosen */
if (diminfo[i].count*diminfo[i].block != 0){
/* Bounds check the start point in this dimension */
if((diminfo[i].start+space->select.offset[i])<0 ||
(diminfo[i].start+space->select.offset[i])>=(hssize_t)space->extent.u.simple.size[i]) {
ret_value=FALSE;
break;
} /* end if */
/* Compute the largest location in this dimension */
end=diminfo[i].start+diminfo[i].stride*(diminfo[i].count-1)+(diminfo[i].block-1)+space->select.offset[i];
/* Compute the largest location in this dimension */
end=diminfo[i].start+diminfo[i].stride*(diminfo[i].count-1)+(diminfo[i].block-1)+space->select.offset[i];
/* Bounds check the end point in this dimension */
if(end<0 || end>=(hssize_t)space->extent.u.simple.size[i]) {
ret_value=FALSE;
break;
} /* end if */
/* Bounds check the end point in this dimension */
if(end<0 || end>=(hssize_t)space->extent.u.simple.size[i]) {
ret_value=FALSE;
break;
} /* end if */
}
} /* end for */
} /* end if */
else {