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 /test/gen_file_image.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'test/gen_file_image.c')
-rw-r--r-- | test/gen_file_image.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/test/gen_file_image.c b/test/gen_file_image.c index 9607cc2..44bf0d2 100644 --- a/test/gen_file_image.c +++ b/test/gen_file_image.c @@ -20,14 +20,13 @@ */ #include "h5test.h" -#define TESTFILE "file_image_core_test.h5" +#define TESTFILE "file_image_core_test.h5" /* 2-D dataset with fixed dimensions */ -#define SPACE_RANK 2 -#define SPACE_DIM1 128 -#define SPACE_DIM2 32 +#define SPACE_RANK 2 +#define SPACE_DIM1 128 +#define SPACE_DIM2 32 - /*------------------------------------------------------------------------- * Function: main * @@ -42,53 +41,54 @@ int main(void) { hid_t fid = -1, sid = -1, did = -1; - hsize_t dims[SPACE_RANK] = {SPACE_DIM1, SPACE_DIM2}; - size_t i,j; /* Local index variables */ - int *data = NULL; /* Dataset data */ + hsize_t dims[SPACE_RANK] = {SPACE_DIM1, SPACE_DIM2}; + size_t i, j; /* Local index variables */ + int * data = NULL; /* Dataset data */ /* Initialize the data */ - if(NULL == (data = (int *)HDmalloc(SPACE_DIM1 * SPACE_DIM2 * sizeof(int)))) + if (NULL == (data = (int *)HDmalloc(SPACE_DIM1 * SPACE_DIM2 * sizeof(int)))) TEST_ERROR - for(i = 0; i < SPACE_DIM1; i++) - for(j = 0; j < SPACE_DIM2; j++) + for (i = 0; i < SPACE_DIM1; i++) + for (j = 0; j < SPACE_DIM2; j++) data[(i * SPACE_DIM2) + j] = (int)(j % 5); /* Create the file */ - if((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create the dataspace */ - if((sid = H5Screate_simple(SPACE_RANK, dims, NULL)) < 0) + if ((sid = H5Screate_simple(SPACE_RANK, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create the compressed dataset */ - if((did = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((did = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Write the data to the dataset */ - if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR /* Close everything */ - if(H5Dclose(did) < 0) + if (H5Dclose(did) < 0) FAIL_STACK_ERROR - if(H5Sclose(sid) < 0) + if (H5Sclose(sid) < 0) FAIL_STACK_ERROR - if(H5Fclose(fid) < 0) + if (H5Fclose(fid) < 0) FAIL_STACK_ERROR return EXIT_SUCCESS; error: - if(data) + if (data) HDfree(data); - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Dclose(did); H5Sclose(sid); H5Fclose(fid); - } H5E_END_TRY; + } + H5E_END_TRY; return EXIT_FAILURE; } /* end main() */ - |