From 32bf2db97a66f1df865aa58fc9ca9a8e4d0a9d7a Mon Sep 17 00:00:00 2001 From: disheng222 Date: Sat, 20 Aug 2022 07:58:46 -0500 Subject: [PATCH] remove the duplicated H5Pget_filter_by_id --- hdf5-filter/H5Z-SZ/src/H5Z_SZ.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hdf5-filter/H5Z-SZ/src/H5Z_SZ.c b/hdf5-filter/H5Z-SZ/src/H5Z_SZ.c index 02d0be3..f55cd2a 100644 --- a/hdf5-filter/H5Z-SZ/src/H5Z_SZ.c +++ b/hdf5-filter/H5Z-SZ/src/H5Z_SZ.c @@ -391,13 +391,14 @@ static herr_t H5Z_sz_set_local(hid_t dcpl_id, hid_t type_id, hid_t chunk_space_i unsigned int mem_cd_values[12]={0,0,0,0,0,0,0,0,0,0,0,0}; //H5Z_FILTER_SZ + //note that mem_cd_nelmts must be non-zero, otherwise, mem_cd_values cannot be filled. if (0 > H5Pget_filter_by_id(dcpl_id, H5Z_FILTER_SZ, &flags, &mem_cd_nelmts, mem_cd_values, 0, NULL, NULL)) H5Z_SZ_PUSH_AND_GOTO(H5E_PLINE, H5E_CANTGET, 0, "unable to get current SZ cd_values"); //the duplicated H5Pget_filter_by_id() is not a careless mistake.... //The first H5Pget_filter_by_id() is to get the number of cd_values, and the second one is to fill the cd_values. - if (0 > H5Pget_filter_by_id(dcpl_id, H5Z_FILTER_SZ, &flags, &mem_cd_nelmts, mem_cd_values, 0, NULL, NULL)) - H5Z_SZ_PUSH_AND_GOTO(H5E_PLINE, H5E_CANTGET, 0, "unable to get current SZ cd_values"); + //if (0 > H5Pget_filter_by_id(dcpl_id, H5Z_FILTER_SZ, &flags, &mem_cd_nelmts, mem_cd_values, 0, NULL, NULL)) + // H5Z_SZ_PUSH_AND_GOTO(H5E_PLINE, H5E_CANTGET, 0, "unable to get current SZ cd_values"); //printf("22mem_cd_nelmts=%zu\n", mem_cd_nelmts); //for(int i=0;i