summaryrefslogtreecommitdiffstats
path: root/src/H5Z.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-04-10 18:34:00 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-04-10 18:34:00 (GMT)
commit705194a4ea98dbc5f0f4c8f78158a162c724512b (patch)
tree55396bbde693455a59a3f0f91e5a655f961baf85 /src/H5Z.c
parentb7df7a09d2bcb9d6724c7fce7930f13501f2b19f (diff)
downloadhdf5-705194a4ea98dbc5f0f4c8f78158a162c724512b.zip
hdf5-705194a4ea98dbc5f0f4c8f78158a162c724512b.tar.gz
hdf5-705194a4ea98dbc5f0f4c8f78158a162c724512b.tar.bz2
[svn-r6628] Purpose:
Buglet Fix Description: When filtering data, those filters which failed and are optional weren't being specified inside of the H5Z_pipeline() function like they're supposed to be. Solution: Modified the code to set the appropriate bit in the "failed" flag to say that the filter failed if it did and was optional. Removed some cases of setting the "failed" flag where it didn't have any effect (like, right before an HGOTO_ERROR() statement). Platforms tested: Burrwhite (Fortran) Arabica (Fortran) Modi4 (Parallel & Fortran) Misc. update:
Diffstat (limited to 'src/H5Z.c')
-rw-r--r--src/H5Z.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/H5Z.c b/src/H5Z.c
index b4b63fd..f4ce164 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -967,7 +967,6 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
continue;/*filter excluded*/
}
if ((fclass_idx=H5Z_find_idx(pline->filter[idx].id))<0) {
- failed |= (unsigned)1 << idx;
HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter is not registered");
}
fclass=&H5Z_table_g[fclass_idx];
@@ -988,15 +987,15 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
if(0==new_nbytes) {
if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data)))
- || !cb_struct.func) {
- failed |= (unsigned)1 << idx;
+ || !cb_struct.func)
HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read");
- } else {
- H5E_clear();
- *nbytes = *buf_size;
- }
- } else
+
+ *nbytes = *buf_size;
+ failed |= (unsigned)1 << idx;
+ H5E_clear();
+ } else {
*nbytes = new_nbytes;
+ }
}
} else if (pline) { /* Write */
for (idx=0; idx<pline->nfilters; idx++) {
@@ -1005,13 +1004,14 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
continue; /*filter excluded*/
}
if ((fclass_idx=H5Z_find_idx(pline->filter[idx].id))<0) {
+ /* Check if filter is optional -- If it isn't, then error */
+ if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL,
+ "required filter is not registered");
+
failed |= (unsigned)1 << idx;
- if (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) {
- H5E_clear();
- continue;
- } else {
- HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered");
- }
+ H5E_clear();
+ continue; /*filter excluded*/
}
fclass=&H5Z_table_g[fclass_idx];
#ifdef H5Z_DEBUG
@@ -1028,16 +1028,14 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
if(0==new_nbytes) {
if (0==(pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) {
if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data)))
- || !cb_struct.func) {
- failed |= (unsigned)1 << idx;
+ || !cb_struct.func)
HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure");
- } else {
- H5E_clear();
- *nbytes = *buf_size;
- }
- } else {
- H5E_clear();
+
+ *nbytes = *buf_size;
}
+
+ failed |= (unsigned)1 << idx;
+ H5E_clear();
} else {
*nbytes = new_nbytes;
}