summaryrefslogtreecommitdiffstats
path: root/test/gen_idx.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/gen_idx.c')
-rw-r--r--test/gen_idx.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/test/gen_idx.c b/test/gen_idx.c
index 73e2639..2fb016f 100644
--- a/test/gen_idx.c
+++ b/test/gen_idx.c
@@ -6,7 +6,7 @@
* 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. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -24,11 +24,11 @@
#include "hdf5.h"
const char *FILENAME[1] = {
- "btree_idx_1_8.h5" /* file with datasets that use B-tree indexing method */
+ "btree_idx_1_8.h5" /* file with datasets that use B-tree indexing method */
};
-#define DSET "dset"
-#define DSET_FILTER "dset_filter"
+#define DSET "dset"
+#define DSET_FILTER "dset_filter"
/*
* Function: gen_idx_file
@@ -38,35 +38,35 @@ const char *FILENAME[1] = {
* one dataset: fixed dimension, chunked layout, w/ filters
*
*/
-static void gen_idx_file(void)
+static void
+gen_idx_file(void)
{
- hid_t fapl; /* file access property id */
- hid_t fid; /* file id */
- hid_t sid; /* space id */
- hid_t dcpl; /* dataset creation property id */
- hid_t did, did2; /* dataset id */
- hsize_t dims[1] = {10}; /* dataset dimension */
- hsize_t c_dims[1] = {2}; /* chunk dimension */
- herr_t status; /* return status */
- int i; /* local index variable */
- int buf[10]; /* data buffer */
-
+ hid_t fapl; /* file access property id */
+ hid_t fid; /* file id */
+ hid_t sid; /* space id */
+ hid_t dcpl; /* dataset creation property id */
+ hid_t did, did2; /* dataset id */
+ hsize_t dims[1] = {10}; /* dataset dimension */
+ hsize_t c_dims[1] = {2}; /* chunk dimension */
+ herr_t status; /* return status */
+ int i; /* local index variable */
+ int buf[10]; /* data buffer */
/* Get a copy of the file aaccess property */
fapl = H5Pcreate(H5P_FILE_ACCESS);
assert(fapl >= 0);
/* Set the "use the latest format" bounds for creating objects in the file */
- status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
+ status = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
assert(status >= 0);
- /* Create dataset */
+ /* Create dataset */
fid = H5Fcreate(FILENAME[0], H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
assert(fid >= 0);
/* Create data */
- for(i = 0; i < 10; i++)
- buf[i] = i;
+ for (i = 0; i < 10; i++)
+ buf[i] = i;
/* Set chunk */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
@@ -78,20 +78,20 @@ static void gen_idx_file(void)
assert(sid >= 0);
/* Create a 1D dataset */
- did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
assert(did >= 0);
/* Write to the dataset */
status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
assert(status >= 0);
-#if defined (H5_HAVE_FILTER_DEFLATE)
+#if defined(H5_HAVE_FILTER_DEFLATE)
/* set deflate data */
status = H5Pset_deflate(dcpl, 9);
assert(status >= 0);
/* Create and write the dataset */
- did2 = H5Dcreate2(fid, DSET_FILTER, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ did2 = H5Dcreate2(fid, DSET_FILTER, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
assert(did2 >= 0);
status = H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
assert(status >= 0);
@@ -116,7 +116,8 @@ static void gen_idx_file(void)
} /* gen_idx_file() */
-int main(void)
+int
+main(void)
{
gen_idx_file();