Fixes warnings when the deflate filter is not built (#1904)

* Fixes warnings when the deflate filter is not built

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Dana Robinson 2022-07-18 07:35:21 -07:00 committed by GitHub
parent 9b53b2f6ca
commit 08b797de73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -438,9 +438,11 @@ static herr_t
test_dataset_write_with_filters(hid_t fid)
{
hid_t dcpl_id = -1; /* Dataset creation property list ID */
unsigned int compress_level; /* Deflate compression level */
unsigned int filter1_data; /* Data used by filter 1 */
unsigned int libver_values[4]; /* Used w/ the filter that makes HDF5 calls */
#ifdef H5_HAVE_FILTER_DEFLATE
unsigned int compress_level; /* Deflate compression level */
#endif
/*----------------------------------------------------------
* STEP 1: Test deflation by itself.

View File

@ -2059,7 +2059,6 @@ gen_dataset_idx(const char *file, int format)
{
hid_t fid = H5I_INVALID_HID; /* file id */
hid_t did = H5I_INVALID_HID;
hid_t did2 = H5I_INVALID_HID; /* dataset id */
hid_t sid = H5I_INVALID_HID; /* space id */
hid_t fapl = H5I_INVALID_HID; /* file access property id */
hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
@ -2068,6 +2067,9 @@ gen_dataset_idx(const char *file, int format)
herr_t status; /* return status */
int buf[10]; /* data buffer */
int i; /* local index variable */
#if defined(H5_HAVE_FILTER_DEFLATE)
hid_t did2 = H5I_INVALID_HID; /* dataset id */
#endif
/* Get a copy of the file aaccess property */
fapl = H5Pcreate(H5P_FILE_ACCESS);

View File

@ -2526,12 +2526,16 @@ error:
static int
make_deflate(hid_t loc_id)
{
hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
#if defined(H5_HAVE_FILTER_DEFLATE)
hobj_ref_t bufref[1]; /* reference */
hsize_t dims1r[1] = {1};
#else
(void)loc_id;
#endif
/* Create and fill array */
struct {