From 7d1ca9ac85f7ad539bb9be3a169feef87f4ee7a8 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Mon, 2 Mar 2020 11:12:30 -0700 Subject: [PATCH] fix references to var->deflate' --- libhdf5/hdf5var.c | 33 --------------------------------- libsrc4/nc4var.c | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/libhdf5/hdf5var.c b/libhdf5/hdf5var.c index 1e3790ce3..e2bda5ee8 100644 --- a/libhdf5/hdf5var.c +++ b/libhdf5/hdf5var.c @@ -677,39 +677,6 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1, if (var->created) return NC_ELATEDEF; -#if 0 - /* Check compression options. */ - if (deflate && !deflate_level) - return NC_EINVAL; - - /* Valid deflate level? */ - if (deflate) - { - if (*deflate) - if (*deflate_level < NC_MIN_DEFLATE_LEVEL || - *deflate_level > NC_MAX_DEFLATE_LEVEL) - return NC_EINVAL; - - /* For scalars, just ignore attempt to deflate. */ - if (!var->ndims) - return NC_NOERR; - - /* If szip is in use, return an error. */ - if ((retval = nc_inq_var_szip(ncid, varid, &option_mask, NULL))) - return retval; - if (option_mask) - return NC_EINVAL; - - /* Set the deflate settings. */ - var->contiguous = NC_FALSE; - var->compact = NC_FALSE; - var->deflate = *deflate; - if (*deflate) - var->deflate_level = *deflate_level; - LOG((3, "%s: *deflate_level %d", __func__, *deflate_level)); - } -#endif - /* Cannot set filters of any sort on scalars */ if(var->ndims == 0) { if(shuffle && *shuffle) diff --git a/libsrc4/nc4var.c b/libsrc4/nc4var.c index 2cba6b630..79d6c5d06 100644 --- a/libsrc4/nc4var.c +++ b/libsrc4/nc4var.c @@ -446,7 +446,7 @@ NC4_var_par_access(int ncid, int varid, int par_access) /* If zlib, shuffle, or fletcher32 filters are in use, then access * must be collective. Fail an attempt to set such a variable to * independent access. */ - if ((var->deflate || var->shuffle || var->fletcher32) && + if ((nclistlength(var->filters) > 0 || var->shuffle || var->fletcher32) && par_access == NC_INDEPENDENT) return NC_EINVAL;