mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
fix references to var->deflate'
This commit is contained in:
parent
e66c727c28
commit
7d1ca9ac85
@ -677,39 +677,6 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1,
|
|||||||
if (var->created)
|
if (var->created)
|
||||||
return NC_ELATEDEF;
|
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 */
|
/* Cannot set filters of any sort on scalars */
|
||||||
if(var->ndims == 0) {
|
if(var->ndims == 0) {
|
||||||
if(shuffle && *shuffle)
|
if(shuffle && *shuffle)
|
||||||
|
@ -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
|
/* If zlib, shuffle, or fletcher32 filters are in use, then access
|
||||||
* must be collective. Fail an attempt to set such a variable to
|
* must be collective. Fail an attempt to set such a variable to
|
||||||
* independent access. */
|
* independent access. */
|
||||||
if ((var->deflate || var->shuffle || var->fletcher32) &&
|
if ((nclistlength(var->filters) > 0 || var->shuffle || var->fletcher32) &&
|
||||||
par_access == NC_INDEPENDENT)
|
par_access == NC_INDEPENDENT)
|
||||||
return NC_EINVAL;
|
return NC_EINVAL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user