summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-09-30 20:13:14 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-09-30 20:13:14 (GMT)
commit81410a3bbe50815669bd5225d5e7d26aeafe459f (patch)
treeda78f60c390e8d87bf89166a1ea0572d30409c80
parent6637250d76004c8cc19f85ff1c918408278fbb8f (diff)
downloadhdf5-81410a3bbe50815669bd5225d5e7d26aeafe459f.zip
hdf5-81410a3bbe50815669bd5225d5e7d26aeafe459f.tar.gz
hdf5-81410a3bbe50815669bd5225d5e7d26aeafe459f.tar.bz2
Fix for statement declare variable
-rw-r--r--src/H5FDhdfs.c43
-rw-r--r--src/H5FDros3.c3
-rw-r--r--tools/libtest/h5tools_test_utils.c3
3 files changed, 28 insertions, 21 deletions
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index 59d954f..efbd329 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -463,7 +463,9 @@ typedef struct H5FD_hdfs_t {
*
*/
#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
+#ifdef H5_HAVE_LIBHDFS
#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
+#endif /* H5_HAVE_LIBHDFS */
/* Prototypes */
static void *H5FD_hdfs_fapl_get(H5FD_t *_file);
@@ -471,21 +473,23 @@ static void *H5FD_hdfs_fapl_copy(const void *_old_fa);
static herr_t H5FD_hdfs_fapl_free(void *_fa);
static H5FD_t *H5FD_hdfs_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
-static herr_t H5FD_hdfs_close(H5FD_t *_file);
-static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags);
+static herr_t H5FD_hdfs_close(H5FD_t *_file);
+static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags);
static haddr_t H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
-static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
- size_t size, void *buf);
-static herr_t H5FD_hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
- size_t size, const void *buf);
-static herr_t H5FD_hdfs_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_hdfs_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_hdfs_unlock(H5FD_t *_file);
-static herr_t H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa);
+static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl,
+ void** file_handle);
+static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+ haddr_t addr, size_t size, void *buf);
+static herr_t H5FD_hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+ haddr_t addr, size_t size, const void *buf);
+static herr_t H5FD_hdfs_truncate(H5FD_t *_file, hid_t dxpl_id,
+ hbool_t closing);
+static herr_t H5FD_hdfs_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD_hdfs_unlock(H5FD_t *_file);
+static herr_t H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa);
static const H5FD_class_t H5FD_hdfs_g = {
"hdfs", /* name */
@@ -526,7 +530,7 @@ static const H5FD_class_t H5FD_hdfs_g = {
H5FL_DEFINE_STATIC(H5FD_hdfs_t);
#endif /* H5_HAVE_LIBHDFS */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_hdfs_init_interface
*
@@ -564,6 +568,7 @@ hid_t
H5FD_hdfs_init(void)
{
hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ unsigned int bin_i;
FUNC_ENTER_NOAPI(FAIL)
@@ -572,12 +577,12 @@ H5FD_hdfs_init(void)
#endif
if (H5I_VFL != H5I_get_type(H5FD_HDFS_g))
- H5FD_HDFS_g = H5FD_register( &H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE);
+ H5FD_HDFS_g = H5FD_register(&H5FD_hdfs_g sizeof(H5FD_class_t), FALSE);
#if HDFS_STATS
/* pre-compute statsbin boundaries
*/
- for (unsigned bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) {
+ for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;
HDFS_STATS_POW(bin_i, &value)
hdfs_stats_boundaries[bin_i] = value;
@@ -590,7 +595,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_hdfs_init() */
-
+
/*---------------------------------------------------------------------------
* Function: H5FD_log_term
*
@@ -617,7 +622,7 @@ H5FD_hdfs_term(void)
FUNC_LEAVE_NOAPI_VOID
} /* end H5FD_hdfs_term() */
-
+
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_hdfs
*
@@ -659,7 +664,7 @@ done:
FUNC_LEAVE_API(ret_value)
} /* H5Pset_fapl_hdfs() */
-
+
/*-------------------------------------------------------------------------
* Function: H5FD_hdfs_open()
*
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index 5456a1b..f167ca0 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -313,6 +313,7 @@ hid_t
H5FD_ros3_init(void)
{
hid_t ret_value = H5I_INVALID_HID;
+ unsigned int bin_i;
FUNC_ENTER_NOAPI(FAIL)
@@ -326,7 +327,7 @@ H5FD_ros3_init(void)
#if ROS3_STATS
/* pre-compute statsbin boundaries
*/
- for (unsigned bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
+ for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;
ROS3_STATS_POW(bin_i, &value)
ros3_stats_boundaries[bin_i] = value;
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index 7908519..120f803 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -1134,6 +1134,7 @@ test_set_configured_fapl(void)
#endif /* H5_HAVE_LIBHDFS */
}; /* testcases `cases` array */
+ unsigned int i;
#ifdef H5_HAVE_ROS3_VFD
n_cases += 5;
@@ -1145,7 +1146,7 @@ test_set_configured_fapl(void)
TESTING("programmatic fapl set");
- for (unsigned i = 0; i < n_cases; i++) {
+ for (i = 0; i < n_cases; i++) {
int result;
testcase C = cases[i];