diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
commit | b2d661b508a7fc7a2592c13bc6bdc175551f075d (patch) | |
tree | 13baeb0d83a7c2a4c6299993c182b1227c2f6114 /hl/examples/ex_lite2.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'hl/examples/ex_lite2.c')
-rw-r--r-- | hl/examples/ex_lite2.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/hl/examples/ex_lite2.c b/hl/examples/ex_lite2.c index 261fc73..4441844 100644 --- a/hl/examples/ex_lite2.c +++ b/hl/examples/ex_lite2.c @@ -14,38 +14,34 @@ #include "hdf5.h" #include "hdf5_hl.h" -int main( void ) +int +main(void) { - hid_t file_id; - int data[6]; - hsize_t dims[2]; - size_t i, j, nrow, n_values; + hid_t file_id; + int data[6]; + hsize_t dims[2]; + size_t i, j, nrow, n_values; - /* open file from ex_lite1.c */ - file_id = H5Fopen ("ex_lite1.h5", H5F_ACC_RDONLY, H5P_DEFAULT); + /* open file from ex_lite1.c */ + file_id = H5Fopen("ex_lite1.h5", H5F_ACC_RDONLY, H5P_DEFAULT); - /* read dataset */ - H5LTread_dataset_int(file_id,"/dset",data); + /* read dataset */ + H5LTread_dataset_int(file_id, "/dset", data); - /* get the dimensions of the dataset */ - H5LTget_dataset_info(file_id,"/dset",dims,NULL,NULL); + /* get the dimensions of the dataset */ + H5LTget_dataset_info(file_id, "/dset", dims, NULL, NULL); - /* print it by rows */ - n_values = (size_t)(dims[0] * dims[1]); - nrow = (size_t)dims[1]; - for (i=0; i<n_values/nrow; i++ ) - { - for (j=0; j<nrow; j++) - printf (" %d", data[i*nrow + j]); - printf ("\n"); - } - - /* close file */ - H5Fclose (file_id); - - return 0; + /* print it by rows */ + n_values = (size_t)(dims[0] * dims[1]); + nrow = (size_t)dims[1]; + for (i = 0; i < n_values / nrow; i++) { + for (j = 0; j < nrow; j++) + printf(" %d", data[i * nrow + j]); + printf("\n"); + } + /* close file */ + H5Fclose(file_id); + return 0; } - - |