summaryrefslogtreecommitdiffstats
path: root/examples/h5_cmprss.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2020-04-20 23:12:00 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2020-04-20 23:12:00 (GMT)
commit9e5dbf69062d4d2cb40ba8f68edb355477fc9b67 (patch)
treeab184e76824e8b4250ad9bf38286a65227fe2407 /examples/h5_cmprss.c
parent7ba692badf9a1bafb9d3b2f72efbbdf773b5932a (diff)
downloadhdf5-9e5dbf69062d4d2cb40ba8f68edb355477fc9b67.zip
hdf5-9e5dbf69062d4d2cb40ba8f68edb355477fc9b67.tar.gz
hdf5-9e5dbf69062d4d2cb40ba8f68edb355477fc9b67.tar.bz2
Trim trailing whitespace
Diffstat (limited to 'examples/h5_cmprss.c')
-rw-r--r--examples/h5_cmprss.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c
index b51ec44..5feadd3 100644
--- a/examples/h5_cmprss.c
+++ b/examples/h5_cmprss.c
@@ -11,10 +11,10 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
+/*
* This example illustrates how to create a compressed dataset.
* It is used in the HDF5 Tutorial.
- */
+ */
#include "hdf5.h"
@@ -22,11 +22,11 @@
#define RANK 2
#define DIM0 100
#define DIM1 20
-
+
int main () {
hid_t file_id, dataset_id, dataspace_id; /* identifiers */
- hid_t plist_id;
+ hid_t plist_id;
size_t nelmts;
unsigned flags, filter_info;
@@ -35,12 +35,12 @@ int main () {
herr_t status;
hsize_t dims[2];
hsize_t cdims[2];
-
+
int i,j, numfilt;
int buf[DIM0][DIM1];
int rbuf [DIM0][DIM1];
- /* Uncomment these variables to use SZIP compression
+ /* Uncomment these variables to use SZIP compression
unsigned szip_options_mask;
unsigned szip_pixels_per_block;
*/
@@ -62,21 +62,21 @@ int main () {
status = H5Pset_chunk (plist_id, 2, cdims);
/* Set ZLIB / DEFLATE Compression using compression level 6.
- * To use SZIP Compression comment out these lines.
- */
- status = H5Pset_deflate (plist_id, 6);
+ * To use SZIP Compression comment out these lines.
+ */
+ status = H5Pset_deflate (plist_id, 6);
- /* Uncomment these lines to set SZIP Compression
+ /* Uncomment these lines to set SZIP Compression
szip_options_mask = H5_SZIP_NN_OPTION_MASK;
szip_pixels_per_block = 16;
status = H5Pset_szip (plist_id, szip_options_mask, szip_pixels_per_block);
*/
-
- dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE,
- dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
- for (i = 0; i< DIM0; i++)
- for (j=0; j<DIM1; j++)
+ dataset_id = H5Dcreate2 (file_id, "Compressed_Data", H5T_STD_I32BE,
+ dataspace_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+
+ for (i = 0; i< DIM0; i++)
+ for (j=0; j<DIM1; j++)
buf[i][j] = i+j;
status = H5Dwrite (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -92,10 +92,10 @@ int main () {
/* Retrieve filter information. */
plist_id = H5Dget_create_plist (dataset_id);
-
+
numfilt = H5Pget_nfilters (plist_id);
printf ("Number of filters associated with dataset: %i\n", numfilt);
-
+
for (i=0; i<numfilt; i++) {
nelmts = 0;
filter_type = H5Pget_filter2 (plist_id, 0, &flags, &nelmts, NULL, 0, NULL,
@@ -113,9 +113,9 @@ int main () {
}
}
- status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rbuf);
-
+ status = H5Dread (dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rbuf);
+
status = H5Dclose (dataset_id);
status = H5Pclose (plist_id);
status = H5Fclose (file_id);