summaryrefslogtreecommitdiffstats
path: root/src/H5FDtest.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-03-25 00:39:37 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-03-25 00:39:37 (GMT)
commitfeb20aac304b39e18c70f88cae2f7cf7d5c82db2 (patch)
treee15d7e751af4e3c42e77ea955d91db4cf27a71cf /src/H5FDtest.c
parentbdac2ecdbff2c389a222b3d93ff1eb1d23ec6b23 (diff)
downloadhdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.zip
hdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.tar.gz
hdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.tar.bz2
Formats the source and updates the gcc warning pragmas
Diffstat (limited to 'src/H5FDtest.c')
-rw-r--r--src/H5FDtest.c60
1 files changed, 27 insertions, 33 deletions
diff --git a/src/H5FDtest.c b/src/H5FDtest.c
index 53e31c7..4687d96 100644
--- a/src/H5FDtest.c
+++ b/src/H5FDtest.c
@@ -25,55 +25,47 @@
/* Module Setup */
/****************/
-#include "H5FDmodule.h" /* This source code file is part of the H5FD module */
-#define H5FD_TESTING /* Suppress warning about H5FD testing funcs */
-
+#include "H5FDmodule.h" /* This source code file is part of the H5FD module */
+#define H5FD_TESTING /* Suppress warning about H5FD testing funcs */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5FDpkg.h" /* File Drivers */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5FDpkg.h" /* File Drivers */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Eprivate.h" /* Error handling */
/****************/
/* Local Macros */
/****************/
-
/******************/
/* Local Typedefs */
/******************/
-
/********************/
/* Package Typedefs */
/********************/
-
/********************/
/* Local Prototypes */
/********************/
-
/*********************/
/* Package Variables */
/*********************/
-
/*****************************/
/* Library Private Variables */
/*****************************/
/* Declare external the free list for H5FD_vfd_swmr_idx_entry_t */
H5FL_SEQ_EXTERN(H5FD_vfd_swmr_idx_entry_t);
-
/*******************/
/* Local Variables */
/*******************/
-
/*-------------------------------------------------------------------------
* Function: H5FD__supports_swmr_test()
*
@@ -108,7 +100,7 @@ H5FD__supports_swmr_test(const char *vfd_name)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- if(!vfd_name || !HDstrcmp(vfd_name, "") || !HDstrcmp(vfd_name, "nomatch"))
+ if (!vfd_name || !HDstrcmp(vfd_name, "") || !HDstrcmp(vfd_name, "nomatch"))
ret_value = TRUE;
else
ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2");
@@ -133,50 +125,52 @@ H5FD__supports_swmr_test(const char *vfd_name)
herr_t
H5FD__vfd_swmr_reader_md_test(H5FD_t *file, unsigned num_entries, H5FD_vfd_swmr_idx_entry_t index[])
{
- unsigned vfd_num_entries = 0;
- H5FD_vfd_swmr_idx_entry_t *vfd_index = NULL;
- unsigned i;
- herr_t ret_value = SUCCEED; /* Return value */
+ unsigned vfd_num_entries = 0;
+ H5FD_vfd_swmr_idx_entry_t *vfd_index = NULL;
+ unsigned i;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Retrieve index from VFD SWMR driver */
/* Initial call to get # of entries */
- if(H5FD_vfd_swmr_get_tick_and_idx(file, TRUE, NULL, &vfd_num_entries, vfd_index) < 0)
+ if (H5FD_vfd_swmr_get_tick_and_idx(file, TRUE, NULL, &vfd_num_entries, vfd_index) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Error in retrieving index from driver")
/* Verify number of index entries */
- if(vfd_num_entries != num_entries)
+ if (vfd_num_entries != num_entries)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Error in retrieving index from driver")
- if(vfd_num_entries) {
+ if (vfd_num_entries) {
/* Allocate memory for index entries */
- if(NULL == (vfd_index = H5FL_SEQ_MALLOC(H5FD_vfd_swmr_idx_entry_t, vfd_num_entries)))
+ if (NULL == (vfd_index = H5FL_SEQ_MALLOC(H5FD_vfd_swmr_idx_entry_t, vfd_num_entries)))
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "memory allocation failed for index entries")
/* Second call to retrieve the index */
- if(H5FD_vfd_swmr_get_tick_and_idx(file, FALSE, NULL, &vfd_num_entries, vfd_index) < 0)
+ if (H5FD_vfd_swmr_get_tick_and_idx(file, FALSE, NULL, &vfd_num_entries, vfd_index) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Error in retrieving index from driver")
- /* Verify index entries */
- for(i = 0; i < vfd_num_entries; i++) {
- if(vfd_index[i].length != index[i].length)
+ /* Verify index entries */
+ for (i = 0; i < vfd_num_entries; i++) {
+ if (vfd_index[i].length != index[i].length)
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect length read from metadata file")
- if(vfd_index[i].hdf5_page_offset != index[i].hdf5_page_offset)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect hdf5_page_offset read from metadata file")
+ if (vfd_index[i].hdf5_page_offset != index[i].hdf5_page_offset)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL,
+ "incorrect hdf5_page_offset read from metadata file")
- if(vfd_index[i].md_file_page_offset != index[i].md_file_page_offset)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect md_file_page_offset read from metadata file")
+ if (vfd_index[i].md_file_page_offset != index[i].md_file_page_offset)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL,
+ "incorrect md_file_page_offset read from metadata file")
- if(vfd_index[i].chksum != index[i].chksum)
+ if (vfd_index[i].chksum != index[i].chksum)
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect chksum read from metadata file")
}
}
done:
/* Free local copy of index entries */
- if(vfd_num_entries && vfd_index)
+ if (vfd_num_entries && vfd_index)
vfd_index = (H5FD_vfd_swmr_idx_entry_t *)H5FL_SEQ_FREE(H5FD_vfd_swmr_idx_entry_t, vfd_index);
FUNC_LEAVE_NOAPI(ret_value)