diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2022-04-13 21:17:29 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2022-04-13 21:17:29 (GMT) |
commit | cabc39c3e197e2591449d2604bfee26465fb60e1 (patch) | |
tree | d5f39f5f5965584bf9bf49646a2af617adfd3e4e /tools/test/h5format_convert/h5fc_chk_idx.c | |
parent | 7355f4c505092a7a85474b47f18d5206028e2c95 (diff) | |
parent | ab69f5df770ee3cc6cd6c81d905a5317b894a002 (diff) | |
download | hdf5-feature/coding_standards.zip hdf5-feature/coding_standards.tar.gz hdf5-feature/coding_standards.tar.bz2 |
Merge branch 'develop' into feature/coding_standardsfeature/coding_standards
Diffstat (limited to 'tools/test/h5format_convert/h5fc_chk_idx.c')
-rw-r--r-- | tools/test/h5format_convert/h5fc_chk_idx.c | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/tools/test/h5format_convert/h5fc_chk_idx.c b/tools/test/h5format_convert/h5fc_chk_idx.c index 8369668..26a0fb9 100644 --- a/tools/test/h5format_convert/h5fc_chk_idx.c +++ b/tools/test/h5format_convert/h5fc_chk_idx.c @@ -6,14 +6,14 @@ * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * A program to verify that the chunk indexing type of a dataset in a file - * is version 1 B-tree. + * is version 1 B-tree. * This is to support the testing of the tool "h5format_convert". */ @@ -32,7 +32,7 @@ usage(void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: To check that the chunk indexing type for the dataset in + * Purpose: To check that the chunk indexing type for the dataset in * the file is version 1 B-tree. * * Return: 0 -- the indexing type is version 1 B-tree @@ -43,16 +43,16 @@ usage(void) int main(int argc, char *argv[]) { - char *fname = NULL; - char *dname = NULL; - hid_t fid = -1; - hid_t did = -1; + char * fname = NULL; + char * dname = NULL; + hid_t fid = H5I_INVALID_HID; + hid_t did = H5I_INVALID_HID; H5D_chunk_index_t idx_type; /* h5fc_chk_idx fname dname */ - if(argc != 3) { - usage(); - HDexit(EXIT_FAILURE); + if (argc != 3) { + usage(); + HDexit(EXIT_FAILURE); } /* end if */ /* Duplicate the file name & dataset name */ @@ -60,42 +60,41 @@ main(int argc, char *argv[]) dname = HDstrdup(argv[2]); /* Try opening the file */ - if((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to open the file\n"); - HDexit(EXIT_FAILURE); + if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { + HDfprintf(stderr, "h5fc_chk_idx: unable to open the file\n"); + HDexit(EXIT_FAILURE); } /* end if */ /* Open the dataset */ - if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to open the dataset\n"); - HDexit(EXIT_FAILURE); + if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) { + HDfprintf(stderr, "h5fc_chk_idx: unable to open the dataset\n"); + HDexit(EXIT_FAILURE); } /* end if */ /* Get the dataset's chunk indexing type */ - if(H5Dget_chunk_index_type(did, &idx_type) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to get chunk index type for the dataset\n"); - HDexit(EXIT_FAILURE); + if (H5Dget_chunk_index_type(did, &idx_type) < 0) { + HDfprintf(stderr, "h5fc_chk_idx: unable to get chunk index type for the dataset\n"); + HDexit(EXIT_FAILURE); } /* end if */ /* Close the dataset */ - if(H5Dclose(did) < 0) { - HDfprintf(stderr, "h5fc_chk_idx: unable to close the dataset\n"); - HDexit(EXIT_FAILURE); + if (H5Dclose(did) < 0) { + HDfprintf(stderr, "h5fc_chk_idx: unable to close the dataset\n"); + HDexit(EXIT_FAILURE); } /* end if */ /* Close the file */ - if(H5Fclose(fid) < 0) { - HDfprintf(stderr, "h5fc_chk_idx_type: cannot close the file\n"); - HDexit(EXIT_FAILURE); + if (H5Fclose(fid) < 0) { + HDfprintf(stderr, "h5fc_chk_idx_type: cannot close the file\n"); + HDexit(EXIT_FAILURE); } /* end if */ /* Return success when the chunk indexing type is version 1 B-tree */ - if(idx_type == H5D_CHUNK_IDX_BTREE) - HDexit(EXIT_SUCCESS); + if (idx_type == H5D_CHUNK_IDX_BTREE) + HDexit(EXIT_SUCCESS); else { - HDfprintf(stderr, "Error: chunk indexing type is %d\n", idx_type); - HDexit(EXIT_FAILURE); + HDfprintf(stderr, "Error: chunk indexing type is %d\n", idx_type); + HDexit(EXIT_FAILURE); } /* end if */ } /* main() */ - |