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 /examples/h5_write.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 'examples/h5_write.c')
-rw-r--r-- | examples/h5_write.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/examples/h5_write.c b/examples/h5_write.c index 1a7cfe7..c2bf136 100644 --- a/examples/h5_write.c +++ b/examples/h5_write.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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -18,28 +18,28 @@ #include "hdf5.h" -#define H5FILE_NAME "SDS.h5" +#define H5FILE_NAME "SDS.h5" #define DATASETNAME "IntArray" -#define NX 5 /* dataset dimensions */ -#define NY 6 -#define RANK 2 +#define NX 5 /* dataset dimensions */ +#define NY 6 +#define RANK 2 int -main (void) +main(void) { - hid_t file, dataset; /* file and dataset handles */ - hid_t datatype, dataspace; /* handles */ - hsize_t dimsf[2]; /* dataset dimensions */ - herr_t status; - int data[NX][NY]; /* data to write */ - int i, j; + hid_t file, dataset; /* file and dataset handles */ + hid_t datatype, dataspace; /* handles */ + hsize_t dimsf[2]; /* dataset dimensions */ + herr_t status; + int data[NX][NY]; /* data to write */ + int i, j; /* * Data and output buffer initialization. */ - for(j = 0; j < NX; j++) - for(i = 0; i < NY; i++) - data[j][i] = i + j; + for (j = 0; j < NX; j++) + for (i = 0; i < NY; i++) + data[j][i] = i + j; /* * 0 1 2 3 4 5 * 1 2 3 4 5 6 @@ -59,8 +59,8 @@ main (void) * Describe the size of the array and create the data space for fixed * size dataset. */ - dimsf[0] = NX; - dimsf[1] = NY; + dimsf[0] = NX; + dimsf[1] = NY; dataspace = H5Screate_simple(RANK, dimsf, NULL); /* @@ -68,14 +68,13 @@ main (void) * We will store little endian INT numbers. */ datatype = H5Tcopy(H5T_NATIVE_INT); - status = H5Tset_order(datatype, H5T_ORDER_LE); + status = H5Tset_order(datatype, H5T_ORDER_LE); /* * Create a new dataset within the file using defined dataspace and * datatype and default dataset creation properties. */ - dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. @@ -92,4 +91,3 @@ main (void) return 0; } - |