summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-21 18:24:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-21 18:24:28 (GMT)
commit28f555604c12561c4bbde4c83283c6651638ce6b (patch)
tree9437dcf1472653735b63df1239d65747c9cf0e06 /src
parent942db9322725b3d73ecc1db1892fe12752b06519 (diff)
downloadhdf5-28f555604c12561c4bbde4c83283c6651638ce6b.zip
hdf5-28f555604c12561c4bbde4c83283c6651638ce6b.tar.gz
hdf5-28f555604c12561c4bbde4c83283c6651638ce6b.tar.bz2
[svn-r7387] Purpose:
Code cleanup Description: More de-linting Platforms tested: FreeBSD 4.8 (sleipnir) too small to need h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5FDfphdf5.c300
-rw-r--r--src/H5FDgass.c126
-rw-r--r--src/H5FDlog.c175
-rwxr-xr-xsrc/hdf5.lnt6
4 files changed, 309 insertions, 298 deletions
diff --git a/src/H5FDfphdf5.c b/src/H5FDfphdf5.c
index 765c6b8..3aca1ad 100644
--- a/src/H5FDfphdf5.c
+++ b/src/H5FDfphdf5.c
@@ -12,18 +12,21 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include "H5private.h" /* Library functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Dprivate.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* Files */
-#include "H5FDprivate.h" /* File driver */
-#include "H5FDfphdf5.h" /* Flexible PHDF5 I/O file driver */
-#include "H5FDmpio.h" /* MPI I/O file driver */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5Iprivate.h" /* Object IDs */
-#include "H5MMprivate.h" /* Memory allocation */
-#include "H5Pprivate.h" /* Property lists */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5FD_fphdf5_mask
+
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* Files access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDfphdf5.h" /* Flexible PHDF5 file driver */
+#include "H5FDmpio.h" /* MPI I/O file driver */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
#ifdef H5_HAVE_FPHDF5
@@ -109,9 +112,7 @@ const H5FD_class_t H5FD_fphdf5_g = {
};
/* Interface initialization */
-#define PABLO_MASK H5FD_fphdf5_mask
#define INTERFACE_INIT H5FD_fphdf5_init
-
static int interface_initialize_g = 0;
/*
@@ -155,7 +156,7 @@ H5FD_fphdf5_init(void)
{
hid_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_init, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_init, FAIL)
if (H5Iget_type(H5FD_FPHDF5_g) != H5I_VFL)
H5FD_FPHDF5_g = H5FDregister(&H5FD_fphdf5_g);
@@ -164,7 +165,7 @@ H5FD_fphdf5_init(void)
ret_value = H5FD_FPHDF5_g;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -206,19 +207,18 @@ H5Pset_fapl_fphdf5(hid_t fapl_id, MPI_Comm comm, MPI_Comm barrier_comm,
int mrc, comm_size;
herr_t ret_value;
- FUNC_ENTER_API(H5Pset_fapl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pset_fapl_fphdf5, FAIL)
H5TRACE5("e","iMcMcMiIu",fapl_id,comm,barrier_comm,info,sap_rank);
if (fapl_id == H5P_DEFAULT)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
- "can't set values in default property list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list")
/* Check arguments */
if ((plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
if ((mrc = MPI_Comm_size(comm, &comm_size)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Comm_size failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Comm_size failed", mrc)
/* Initialize driver specific properties */
fa.comm = comm;
@@ -230,7 +230,7 @@ H5Pset_fapl_fphdf5(hid_t fapl_id, MPI_Comm comm, MPI_Comm barrier_comm,
ret_value = H5P_set_driver(plist, H5FD_FPHDF5, &fa);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -260,18 +260,18 @@ H5Pget_fapl_fphdf5(hid_t fapl_id, MPI_Comm *comm, MPI_Comm *barrier_comm,
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_API(H5Pget_fapl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pget_fapl_fphdf5, FAIL)
H5TRACE6("e","i*Mc*Mc*Mi*Iu*Iu",fapl_id,comm,barrier_comm,info,sap_rank,
capt_rank);
if ((plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
if (H5P_get_driver(plist) != H5FD_FPHDF5)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
if ((fa = H5P_get_driver_info(plist)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
if (comm)
*comm = fa->comm;
@@ -289,7 +289,7 @@ H5Pget_fapl_fphdf5(hid_t fapl_id, MPI_Comm *comm, MPI_Comm *barrier_comm,
*capt_rank = fa->capt_rank;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -309,7 +309,7 @@ H5FD_fphdf5_communicator(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
MPI_Comm ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL)
/* check args */
assert(file);
@@ -319,7 +319,7 @@ H5FD_fphdf5_communicator(H5FD_t *_file)
ret_value = file->comm;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@@ -340,7 +340,7 @@ H5FD_fphdf5_barrier_communicator(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
MPI_Comm ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_communicator, MPI_COMM_NULL)
/* check args */
assert(file);
@@ -350,7 +350,7 @@ H5FD_fphdf5_barrier_communicator(H5FD_t *_file)
ret_value = file->barrier_comm;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -370,7 +370,7 @@ H5FD_fphdf5_mpi_rank(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
int ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_rank, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_rank, FAIL)
/* check args */
assert(file);
@@ -380,7 +380,7 @@ H5FD_fphdf5_mpi_rank(H5FD_t *_file)
ret_value = file->mpi_rank;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -400,7 +400,7 @@ H5FD_fphdf5_mpi_size(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
int ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_size, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_size, FAIL)
/* check args */
assert(file);
@@ -410,7 +410,7 @@ H5FD_fphdf5_mpi_size(H5FD_t *_file)
ret_value = file->mpi_size;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -430,7 +430,7 @@ H5FD_fphdf5_file_id(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
unsigned ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_file_id, 0);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_file_id, 0)
/* check args */
assert(file);
@@ -440,7 +440,7 @@ H5FD_fphdf5_file_id(H5FD_t *_file)
ret_value = file->file_id;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -460,7 +460,7 @@ H5FD_fphdf5_is_sap(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE)
/* check args */
assert(file);
@@ -470,7 +470,7 @@ H5FD_fphdf5_is_sap(H5FD_t *_file)
ret_value = ((unsigned)file->mpi_rank == H5FP_sap_rank);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -490,7 +490,7 @@ H5FD_fphdf5_is_captain(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_is_sap, FALSE)
/* check args */
assert(file);
@@ -500,7 +500,7 @@ H5FD_fphdf5_is_captain(H5FD_t *_file)
ret_value = ((unsigned)file->mpi_rank == H5FP_capt_rank);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -520,7 +520,7 @@ H5FD_is_fphdf5_driver(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI(H5FD_is_fphdf5_driver, FALSE);
+ FUNC_ENTER_NOAPI(H5FD_is_fphdf5_driver, FALSE)
/* check args */
assert(file);
@@ -529,7 +529,7 @@ H5FD_is_fphdf5_driver(H5FD_t *_file)
ret_value = file->pub.driver_id == H5FD_FPHDF5;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -551,32 +551,32 @@ H5FD_fphdf5_setup(hid_t dxpl_id, MPI_Datatype btype,
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_setup, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_setup, FAIL)
/* Check arguments */
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list")
/* Set buffer MPI type */
if (H5P_insert(plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME,
H5FD_FPHDF5_XFER_MEM_MPI_TYPE_SIZE, &btype,
NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
/* Set file MPI type */
if (H5P_insert(plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME,
H5FD_FPHDF5_XFER_FILE_MPI_TYPE_SIZE, &ftype,
NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
/* Set 'use view' property */
if (H5P_insert(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME,
H5FD_FPHDF5_XFER_USE_VIEW_SIZE, &use_view,
NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -596,26 +596,26 @@ H5FD_fphdf5_teardown(hid_t dxpl_id)
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_teardown, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_teardown, FAIL)
/* Check arguments */
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list")
/* Remove buffer MPI type */
if (H5P_remove(dxpl_id, plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
/* Remove file MPI type */
if (H5P_remove(dxpl_id, plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
/* Remove 'use view' property */
if (H5P_remove(dxpl_id, plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -644,29 +644,28 @@ H5Pset_dxpl_fphdf5(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_API(H5Pset_dxpl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pset_dxpl_fphdf5, FAIL)
H5TRACE2("e","iDt",dxpl_id,xfer_mode);
if (dxpl_id == H5P_DEFAULT)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
- "can't set values in default property list");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list")
/* Check arguments */
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
if (xfer_mode != H5FD_MPIO_INDEPENDENT && xfer_mode != H5FD_MPIO_COLLECTIVE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode")
/* Set the transfer mode */
if (H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value")
/* Initialize driver-specific properties */
ret_value = H5P_set_driver(plist, H5FD_FPHDF5, NULL);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -689,22 +688,22 @@ H5Pget_dxpl_fphdf5(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode)
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_API(H5Pget_dxpl_fphdf5, FAIL);
+ FUNC_ENTER_API(H5Pget_dxpl_fphdf5, FAIL)
H5TRACE2("e","i*Dt",dxpl_id,xfer_mode);
if ((plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl")
if (H5P_get_driver(plist) != H5FD_FPHDF5)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
/* Get the transfer mode */
if (xfer_mode)
if (H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, xfer_mode) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get value");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get value")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -727,14 +726,14 @@ H5FD_fphdf5_fapl_get(H5FD_t *_file)
H5FD_fphdf5_fapl_t *fa = NULL;
void *ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_fapl_get, NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_fapl_get, NULL)
/* check args */
assert(file);
assert(file->pub.driver_id == H5FD_FPHDF5);
if ((fa = H5MM_calloc(sizeof(H5FD_fphdf5_fapl_t))) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* These should both be copied. --rpm, 1999-08-13 */
fa->comm = file->comm;
@@ -745,7 +744,7 @@ H5FD_fphdf5_fapl_get(H5FD_t *_file)
ret_value = fa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -789,14 +788,14 @@ H5FD_fphdf5_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
/* Flag to indicate that the file was successfully opened */
unsigned file_opened = FALSE;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_open, NULL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_open, NULL)
/* check args */
assert(name);
/* Obtain a pointer to fphdf5-specific file access properties */
if ((plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
if (fapl_id == H5P_FILE_ACCESS_DEFAULT || H5P_get_driver(plist) != H5FD_FPHDF5) {
_fa.comm = MPI_COMM_SELF; /*default*/
@@ -820,21 +819,21 @@ H5FD_fphdf5_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
/* OKAY: CAST DISCARDS CONST */
if ((mrc = MPI_File_open(H5FP_SAP_BARRIER_COMM, (char *)name, mpi_amode,
fa->info, &fh)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mrc)
file_opened = TRUE;
if (H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &meta_block_size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get meta data block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get meta data block size")
if (H5P_get(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &sdata_block_size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'small data' block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'small data' block size")
if (H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &threshold) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold")
if (H5P_get(plist, H5F_ACS_ALIGN_NAME, &alignment) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment")
/* Retrieve the VFL driver feature flags */
H5FD_fphdf5_query(NULL, &feature_flags); /* doesn't fail */
@@ -843,50 +842,49 @@ H5FD_fphdf5_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
if (H5FP_request_open(H5FP_OBJ_FILE, maxaddr, feature_flags,
meta_block_size, sdata_block_size, threshold,
alignment, &file_id, &req_id) == FAIL)
- HGOTO_ERROR(H5E_FPHDF5, H5E_CANTOPENFILE, NULL,
- "can't inform SAP of file open");
+ HGOTO_ERROR(H5E_FPHDF5, H5E_CANTOPENFILE, NULL, "can't inform SAP of file open")
/* Broadcast the file ID */
if ((mrc = MPI_Bcast(&file_id, 1, MPI_UNSIGNED,
(int)H5FP_capt_barrier_rank,
H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc)
/* Grab the rank of this process */
if ((mrc = MPI_Comm_rank(H5FP_SAP_COMM, &mpi_rank)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Comm_rank failed", mrc)
/* The captain rank will get the filesize and broadcast it. */
if ((unsigned)mpi_rank == H5FP_capt_rank)
/* Get current file size */
if ((mrc = MPI_File_get_size(fh, &size)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_File_get_size failed", mrc)
/* Broadcast file size */
if ((mrc = MPI_Bcast(&size, sizeof(MPI_Offset), MPI_BYTE,
(int)H5FP_capt_barrier_rank,
H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc)
/* Only if size > 0, truncate the file - if requested */
if (size && (flags & H5F_ACC_TRUNC)) {
if ((mrc = MPI_File_set_size(fh, (MPI_Offset)0)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_File_set_size (file truncation) failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_File_set_size (file truncation) failed", mrc)
/* Don't let any proc return until all have truncated the file. */
if ((mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mrc)
size = 0;
}
/* Grab the size of the communicator */
if ((mrc = MPI_Comm_size(H5FP_SAP_COMM, &mpi_size)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mrc);
+ HMPI_GOTO_ERROR(NULL, "MPI_Comm_size failed", mrc)
/* Build the return value and initialize it */
if ((file = H5MM_calloc(sizeof(H5FD_fphdf5_t))) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
file->file_id = file_id;
file->f = fh;
@@ -903,7 +901,7 @@ done:
if (!ret_value && file_opened)
MPI_File_close(&fh);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -926,7 +924,7 @@ H5FD_fphdf5_close(H5FD_t *_file)
int mrc;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_close, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_close, FAIL)
/* check args */
assert(file);
@@ -934,23 +932,22 @@ H5FD_fphdf5_close(H5FD_t *_file)
/* Tell the SAP that we're closing the file... */
if (H5FP_request_close(_file, file->file_id, &req_id, &status) == FAIL)
- HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL,
- "can't inform SAP of file close");
+ HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "can't inform SAP of file close")
/* Let all of the processes catch up to this point. */
/* XXX: This barrier isn't necessary, MPI-I/O will syncronize for you -QAK */
if ((mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc)
/* MPI_File_close sets argument to MPI_FILE_NULL */
if ((mrc = MPI_File_close(&file->f)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_close failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_close failed", mrc)
/* Clean up other stuff */
H5MM_xfree(file);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -970,7 +967,7 @@ H5FD_fphdf5_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_query, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_query, FAIL)
/* Set the VFL feature flags that this driver supports */
if (flags) {
@@ -1007,7 +1004,7 @@ H5FD_fphdf5_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1029,7 +1026,7 @@ H5FD_fphdf5_get_eoa(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file;
haddr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eoa, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eoa, HADDR_UNDEF)
/* check args */
assert(file);
@@ -1039,7 +1036,7 @@ H5FD_fphdf5_get_eoa(H5FD_t *_file)
ret_value = file->eoa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1062,7 +1059,7 @@ H5FD_fphdf5_set_eoa(H5FD_t *_file, haddr_t addr)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_set_eoa, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_set_eoa, FAIL)
/* check args */
assert(file);
@@ -1071,7 +1068,7 @@ H5FD_fphdf5_set_eoa(H5FD_t *_file, haddr_t addr)
file->eoa = addr;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1100,7 +1097,7 @@ H5FD_fphdf5_get_eof(H5FD_t *_file)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
haddr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eof, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_get_eof, HADDR_UNDEF)
/* check args */
assert(file);
@@ -1110,7 +1107,7 @@ H5FD_fphdf5_get_eof(H5FD_t *_file)
ret_value = file->eof;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1130,18 +1127,18 @@ H5FD_fphdf5_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_get_handle, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_get_handle, FAIL)
/* check args */
assert(file);
if (!file_handle)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
*file_handle = &file->f;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1182,7 +1179,7 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_INDEPENDENT;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_read, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_read, FAIL)
/* check args */
assert(file);
@@ -1198,17 +1195,16 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
/* Some numeric conversions */
if (H5FD_fphdf5_haddr_to_MPIOff(addr, &mpi_off) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL,
- "can't convert from haddr_t to MPI offset");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr_t to MPI offset")
size_i = (int)size;
if ((hsize_t)size_i != size)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size_t to int");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size_t to int")
/* Obtain the data transfer properties */
if ((plist = H5I_object(dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
if (H5P_get_driver(plist) == H5FD_FPHDF5)
/* Get the transfer mode */
@@ -1222,15 +1218,15 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
*/
if (H5P_exist_plist(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME) > 0)
if (H5P_get(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME, &use_view_this_time) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (use_view_this_time) {
/* Prepare for a full-blown xfer using btype, ftype, and disp */
if (H5P_get(plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (H5P_get(plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
/*
* When using types, use the address as the displacement for
@@ -1243,7 +1239,7 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
if ((mrc = MPI_File_set_view(file->f, (MPI_Offset)mpi_disp, MPI_BYTE,
file_type, H5FD_mpio_native,
file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
} else {
/*
* Prepare for a simple xfer of a contiguous block of bytes. The
@@ -1285,11 +1281,11 @@ HDfprintf(stderr, "%s:%d: Metadata cache read failed!\n", FUNC, __LINE__);
if (xfer_mode == H5FD_MPIO_INDEPENDENT) {
if ((mrc = MPI_File_read_at(file->f, mpi_off, buf, size_i,
buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mrc)
} else {
if ((mrc = MPI_File_read_at_all(file->f, mpi_off, buf, size_i,
buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mrc)
}
/*
@@ -1304,12 +1300,12 @@ HDfprintf(stderr, "%s:%d: Metadata cache read failed!\n", FUNC, __LINE__);
if (use_view_this_time)
if ((mrc = MPI_File_set_view(file->f, (MPI_Offset)0, MPI_BYTE, MPI_BYTE,
H5FD_mpio_native, file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
finished_read:
/* Check for read failure */
if (bytes_read < 0 || bytes_read > size_i)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed")
/*
* This gives us zeroes beyond end of physical MPI file. What about
@@ -1323,13 +1319,13 @@ finished_read:
* INCOMPLETE rky 1998-09-18
* Haven't implemented reading zeros beyond EOF. What to do???
*/
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "eof file read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "eof file read failed")
memset((char*)buf + bytes_read, 0, (size_t)n);
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1362,7 +1358,7 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_write, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_write, FAIL)
/* check args */
assert(file);
@@ -1375,17 +1371,16 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
/* some numeric conversions */
if (H5FD_fphdf5_haddr_to_MPIOff(addr, &mpi_off) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL,
- "can't convert from haddr to MPI off");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off")
size_i = (int)size;
if ((hsize_t)size_i != size)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i")
/* Obtain the data transfer properties */
if ((plist = H5I_object(dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
#if 0
/* Metadata specific actions */
@@ -1404,17 +1399,17 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
if (H5P_exist_plist(plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME) > 0)
if (H5P_get(plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME,
&block_before_meta_write) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get H5AC property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get H5AC property")
if (block_before_meta_write)
if ((mrc = MPI_Barrier(file->barrier_comm)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc)
}
#endif /* 0 */
if (H5P_exist_plist(plist, H5FD_FPHDF5_XFER_DUMPING_METADATA) > 0)
if (H5P_get(plist, H5FD_FPHDF5_XFER_DUMPING_METADATA, &dumping) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
/*
* If metadata, write to the metadata cache but only if we're not
@@ -1437,9 +1432,9 @@ HDfprintf(stderr, "%s:%d: Couldn't write metadata to SAP (%d)\n",
/* WAH-HOO! We've written it! We can leave now */
/* Forget the EOF value (see H5FD_fphdf5_get_eof()) */
file->eof = HADDR_UNDEF;
- HGOTO_DONE(ret_value);
+ HGOTO_DONE(ret_value)
case H5FP_STATUS_FILE_CLOSING:
- HGOTO_DONE(ret_value);
+ HGOTO_DONE(ret_value)
case H5FP_STATUS_DUMPING_FAILED:
case H5FP_STATUS_OOM:
case H5FP_STATUS_BAD_FILE_ID:
@@ -1455,7 +1450,7 @@ HDfprintf(stderr, "%s: Couldn't write metadata to SAP (%d)\n",
ret_value = H5FD_fphdf5_write_real(_file, dxpl_id, mpi_off, size_i, buf);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1486,7 +1481,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_INDEPENDENT;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_write_real, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_write_real, FAIL)
/* check args */
assert(file);
@@ -1502,7 +1497,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/* Obtain the data transfer properties */
if ((plist = H5I_object(dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
/*
* Set up for a fancy xfer using complex types, or single byte block.
@@ -1512,7 +1507,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
*/
if (H5P_exist_plist(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME) > 0)
if (H5P_get(plist, H5FD_FPHDF5_XFER_USE_VIEW_NAME, &use_view_this_time) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (use_view_this_time) {
@@ -1520,10 +1515,10 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/* Prepare for a full-blown xfer using btype, ftype, and disp */
if (H5P_get(plist, H5FD_FPHDF5_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
if (H5P_get(plist, H5FD_FPHDF5_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
/*
* When using types, use the address as the displacement for
@@ -1536,7 +1531,7 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
if ((mrc = MPI_File_set_view(file->f, mpi_disp, MPI_BYTE,
file_type, H5FD_mpio_native,
file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
} else {
/*
* Prepare for a simple xfer of a contiguous block of bytes. The
@@ -1558,19 +1553,19 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
if ((mrc = MPI_File_write_at(file->f, mpi_off, (void*)buf,
size, buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mrc)
} else {
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
if ((mrc = MPI_File_write_at_all(file->f, mpi_off, (void*)buf,
size, buf_type, &status)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mrc)
}
/* Reset the file view when we used MPI derived types */
if (use_view_this_time)
if ((mrc = MPI_File_set_view(file->f, (MPI_Offset)0, MPI_BYTE, MPI_BYTE,
H5FD_mpio_native, file->info)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mrc)
/*
* MPI_Get_count incorrectly returns negative count; fake a complete
@@ -1580,13 +1575,13 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/* Check for write failure */
if (bytes_written < 0 || bytes_written > size)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file write failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file write failed")
/* Forget the EOF value (see H5FD_fphdf5_get_eof()) */
file->eof = HADDR_UNDEF;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1610,7 +1605,7 @@ H5FD_fphdf5_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
H5FP_status_t status = H5FP_STATUS_OK;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_fphdf5_flush, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_fphdf5_flush, FAIL)
/* check args */
assert(file);
@@ -1625,12 +1620,11 @@ H5FD_fphdf5_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
*/
if (file->eoa > file->last_eoa) {
if (H5FD_fphdf5_haddr_to_MPIOff(file->eoa, &mpi_off) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL,
- "cannot convert from haddr_t to MPI_Offset");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset")
/* Extend the file's size */
if ((mrc = MPI_File_set_size(file->f, mpi_off)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mrc)
/*
* Don't let any proc return until all have extended the file.
@@ -1640,7 +1634,7 @@ H5FD_fphdf5_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
* the file and dropping the new data written)
*/
if ((mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc)
/* Update the 'last' eoa value */
file->last_eoa = file->eoa;
@@ -1657,11 +1651,11 @@ HDfprintf(stderr, "%s:%d: Flush failed (%d)\n", FUNC, __LINE__, status);
/* Only sync the file if we are not going to immediately close it */
if (!closing)
if ((mrc = MPI_File_sync(file->f)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mrc);
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mrc)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1680,9 +1674,9 @@ H5FD_fphdf5_MPIOff_to_haddr(MPI_Offset mpi_off)
{
haddr_t ret_value;
- FUNC_ENTER_NOINIT(H5FD_fphdf5_MPIOff_to_haddr);
+ FUNC_ENTER_NOINIT(H5FD_fphdf5_MPIOff_to_haddr)
ret_value = (mpi_off != (MPI_Offset)(haddr_t)mpi_off ? HADDR_UNDEF : (haddr_t)mpi_off);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1702,13 +1696,13 @@ H5FD_fphdf5_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off)
{
herr_t ret_value = FAIL;
- FUNC_ENTER_NOINIT(H5FD_fphdf5_haddr_to_MPIOff);
+ FUNC_ENTER_NOINIT(H5FD_fphdf5_haddr_to_MPIOff)
if (mpi_off)
*mpi_off = (MPI_Offset)addr;
ret_value = (addr != (haddr_t)(MPI_Offset)addr ? FAIL : SUCCEED);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_FPHDF5 */
diff --git a/src/H5FDgass.c b/src/H5FDgass.c
index dbbc249..0f888b8 100644
--- a/src/H5FDgass.c
+++ b/src/H5FDgass.c
@@ -19,14 +19,19 @@
* Purpose: This is the GASS I/O driver.
*
*/
-#include "H5private.h" /*library functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Fprivate.h" /*files */
-#include "H5FDprivate.h" /*file driver */
-#include "H5FDgass.h" /* Core file driver */
-#include "H5Iprivate.h" /*object IDs */
-#include "H5MMprivate.h" /* Memory allocation */
-#include "H5Pprivate.h" /*property lists */
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5FD_gass_mask
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* Files access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDgass.h" /* GASS file driver */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
#ifdef H5_HAVE_GASS
@@ -170,7 +175,6 @@ static const H5FD_class_t H5FD_gass_g = {
};
/* Interface initialization */
-#define PABLO_MASK H5FD_gass_mask
#define INTERFACE_INIT H5FD_gass_init
static int interface_initialize_g = 0;
@@ -197,7 +201,7 @@ H5FD_gass_init(void)
{
hid_t ret_value=H5FD_GASS_g; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_gass_init, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_gass_init, FAIL)
if (!H5FD_GASS_g)
H5FD_GASS_g = H5FDregister(&H5FD_gass_g);
@@ -209,7 +213,7 @@ H5FD_gass_init(void)
ret_value=H5FD_GASS_g;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -248,12 +252,12 @@ H5Pset_fapl_gass(hid_t fapl_id, GASS_Info info)
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value;
- FUNC_ENTER_API(H5Pset_fapl_gass, FAIL);
+ FUNC_ENTER_API(H5Pset_fapl_gass, FAIL)
/*NO TRACE*/
/* Check arguments */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
#ifdef LATER
#warning "We need to verify that INFO contain sensible information."
@@ -265,7 +269,7 @@ H5Pset_fapl_gass(hid_t fapl_id, GASS_Info info)
ret_value= H5P_set_driver(plist, H5FD_GASS, &fa);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -301,21 +305,21 @@ H5Pget_fapl_gass(hid_t fapl_id, GASS_Info *info/*out*/)
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Pget_fapl_gass, FAIL);
+ FUNC_ENTER_API(H5Pget_fapl_gass, FAIL)
H5TRACE2("e","ix",fapl_id,info);
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
if (H5FD_GASS!=H5P_get_driver(plist))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
if (NULL==(fa=H5P_get_driver_info(plist)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info");
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
if (info)
*info = fa->info;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -355,23 +359,23 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id,
h5_stat_t sb;
H5FD_t *ret_value;
- FUNC_ENTER_NOAPI(H5FD_gass_open, NULL);
+ FUNC_ENTER_NOAPI(H5FD_gass_open, NULL)
/* fprintf(stdout, "Entering H5FD_gass_open name=%s flags=0x%x\n", name, flags); */
/* Check arguments */
if (!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
if (0==maxaddr || HADDR_UNDEF==maxaddr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
if (ADDR_OVERFLOW(maxaddr))
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
strcpy (filename, name);
/* Obtain a pointer to gass-specific file access properties */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
if (H5P_FILE_ACCESS_DEFAULT==fapl_id || H5FD_GASS!=H5P_get_driver(plist)) {
GASS_INFO_NULL (_fa.info);
/* _fa.info = GASS_INFO_NULL; */
@@ -404,37 +408,37 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id,
if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && (flags & H5F_ACC_EXCL)) {
if ((fd = globus_gass_open (filename, O_RDWR|O_TRUNC)) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed");
+ HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed")
}
else if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && (flags & H5F_ACC_TRUNC)) {
if ((fd = globus_gass_open (filename, O_RDWR|O_TRUNC)) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed");
+ HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed")
}
else if ((flags & H5F_ACC_RDWR) && (flags & H5F_ACC_TRUNC)) {
if ((fd = globus_gass_open (filename, O_RDWR|O_TRUNC)) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed");
+ HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed")
}
else if (flags & H5F_ACC_RDWR) {
if ((fd = globus_gass_open (filename, O_RDWR)) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed");
+ HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed")
}
else { /* This is case where H5F_ACC_RDWR is not set */
if ((fd = globus_gass_open (filename, O_RDONLY)) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed");
+ HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed")
}
if (HDfstat(fd, &sb)<0) {
close(fd);
- HGOTO_ERROR(H5E_IO, H5E_BADFILE, NULL, "fstat failed");
+ HGOTO_ERROR(H5E_IO, H5E_BADFILE, NULL, "fstat failed")
}
/* Create the new file struct */
if (NULL==(file=H5MM_calloc(sizeof(H5FD_gass_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate file struct");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate file struct")
file->fd = fd;
file->eof = sb.st_size;
file->pos = HADDR_UNDEF;
@@ -445,7 +449,7 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id,
ret_value=(H5FD_t*)file;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -471,18 +475,18 @@ H5FD_gass_close (H5FD_t *_file)
H5FD_gass_t *file = (H5FD_gass_t *)_file;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_gass_close, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_gass_close, FAIL)
if (file == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file handle");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file handle")
if (globus_gass_close (file->fd) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "can't close GASS file");
+ HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "can't close GASS file")
H5MM_xfree(file);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -508,7 +512,7 @@ H5FD_gass_query(const UNUSED H5FD_t *_f, unsigned long *flags /* out */)
{
herr_t ret_value=SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_gass_query, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_gass_query, FAIL)
/* Set the VFL feature flags that this driver supports */
if(flags) {
@@ -518,7 +522,7 @@ H5FD_gass_query(const UNUSED H5FD_t *_f, unsigned long *flags /* out */)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -546,13 +550,13 @@ H5FD_gass_get_eoa(H5FD_t *_file)
H5FD_gass_t *file = (H5FD_gass_t *)_file;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_gass_get_eoa, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_gass_get_eoa, HADDR_UNDEF)
/* Set return value */
ret_value=file->eoa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -578,12 +582,12 @@ H5FD_gass_set_eoa(H5FD_t *_file, haddr_t addr)
H5FD_gass_t *file = (H5FD_gass_t *)_file;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_gass_set_eoa, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_gass_set_eoa, FAIL)
file->eoa = addr;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -613,13 +617,13 @@ H5FD_gass_get_eof(H5FD_t *_file)
H5FD_gass_t *file = (H5FD_gass_t*)_file;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_gass_get_eof, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_gass_get_eof, HADDR_UNDEF)
/* Set return value */
ret_value=MAX(file->eof, file->eoa);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -643,15 +647,15 @@ H5FD_gass_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
H5FD_gass_t *file = (H5FD_gass_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_gass_get_handle, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_gass_get_handle, FAIL)
if(!file_handle)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
*file_handle = &(file->fd);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -681,25 +685,25 @@ H5FD_gass_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/, h
ssize_t nbytes;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_gass_read, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_gass_read, FAIL)
assert(file && file->pub.cls);
assert(buf);
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "addr undefined");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "addr undefined")
if (REGION_OVERFLOW(addr, size))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large")
if (addr+size>file->eoa)
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large")
/* Seek to the correct location */
if ((addr!=file->pos || OP_READ!=file->op) &&
file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) {
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "gass file seek failed");
+ HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "gass file seek failed")
}
/*
@@ -715,7 +719,7 @@ H5FD_gass_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/, h
/* error */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "gass file read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "gass file read failed")
}
if (0==nbytes) {
/* end of file but not end of format address space */
@@ -734,7 +738,7 @@ H5FD_gass_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/, h
file->op = OP_READ;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -763,25 +767,25 @@ H5FD_gass_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id/*unused*/, haddr_t
ssize_t nbytes;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_gass_write, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_gass_write, FAIL)
assert(file && file->pub.cls);
assert(buf);
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "addr undefined");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "addr undefined")
if (REGION_OVERFLOW(addr, size))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large")
if (addr+size>file->eoa)
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr too large")
/* Seek to the correct location */
if ((addr!=file->pos || OP_WRITE!=file->op) &&
file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) {
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "gass file seek failed");
+ HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "gass file seek failed")
}
/*
@@ -797,7 +801,7 @@ H5FD_gass_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id/*unused*/, haddr_t
/* error */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "gass file write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "gass file write failed")
}
assert(nbytes>0);
assert(nbytes<=size);
@@ -813,7 +817,7 @@ H5FD_gass_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id/*unused*/, haddr_t
file->eof = file->pos;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_GASS */
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 6ba47cf..50876e7 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -25,15 +25,18 @@
* With custom modifications...
*/
-#include "H5private.h" /*library functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Fprivate.h" /*files */
-#include "H5FDprivate.h" /*file driver */
-#include "H5FDlog.h" /* logging file driver */
-#include "H5FLprivate.h" /*Free Lists */
-#include "H5Iprivate.h" /*object IDs */
-#include "H5MMprivate.h" /* Memory allocation */
-#include "H5Pprivate.h" /*property lists */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5FD_log_mask
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDlog.h" /* Logging file driver */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
#ifdef MAX
#undef MAX
@@ -108,8 +111,8 @@ typedef struct H5FD_log_t {
* identifier and the volume serial number to determine whether two
* handles refer to the same file.
*/
- int fileindexlo;
- int fileindexhi;
+ DWORD fileindexlo;
+ DWORD fileindexhi;
#endif
} H5FD_log_t;
@@ -234,7 +237,6 @@ static const H5FD_class_t H5FD_log_g = {
};
/* Interface initialization */
-#define PABLO_MASK H5FD_log_mask
#define INTERFACE_INIT H5FD_log_init
static int interface_initialize_g = 0;
@@ -261,7 +263,7 @@ H5FD_log_init(void)
{
hid_t ret_value=H5FD_LOG_g; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_init, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_init, FAIL)
if (H5I_VFL!=H5Iget_type(H5FD_LOG_g))
H5FD_LOG_g = H5FDregister(&H5FD_log_g);
@@ -270,7 +272,7 @@ H5FD_log_init(void)
ret_value=H5FD_LOG_g;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -301,11 +303,11 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned flags, size_t buf_s
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value;
- FUNC_ENTER_API(H5Pset_fapl_log, FAIL);
+ FUNC_ENTER_API(H5Pset_fapl_log, FAIL)
H5TRACE4("e","isIuz",fapl_id,logfile,flags,buf_size);
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
fa.logfile=(char*)logfile;
fa.flags=flags;
@@ -313,7 +315,7 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned flags, size_t buf_s
ret_value= H5P_set_driver(plist, H5FD_LOG, &fa);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -342,13 +344,13 @@ H5FD_log_fapl_get(H5FD_t *_file)
H5FD_log_t *file = (H5FD_log_t*)_file;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_fapl_get, NULL);
+ FUNC_ENTER_NOAPI(H5FD_log_fapl_get, NULL)
/* Set return value */
ret_value= H5FD_log_fapl_copy(&(file->fa));
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_log_fapl_get() */
@@ -375,7 +377,7 @@ H5FD_log_fapl_copy(const void *_old_fa)
H5FD_log_fapl_t *new_fa = H5MM_malloc(sizeof(H5FD_log_fapl_t));
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_fapl_copy, NULL);
+ FUNC_ENTER_NOAPI(H5FD_log_fapl_copy, NULL)
assert(new_fa);
@@ -385,13 +387,13 @@ H5FD_log_fapl_copy(const void *_old_fa)
/* Deep copy the log file name */
if(old_fa->logfile!=NULL)
if (NULL==(new_fa->logfile=HDstrdup(old_fa->logfile)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate log file name");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate log file name")
/* Set return value */
ret_value=new_fa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_log_fapl_copy() */
@@ -417,7 +419,7 @@ H5FD_log_fapl_free(void *_fa)
H5FD_log_fapl_t *fa = (H5FD_log_fapl_t*)_fa;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_fapl_free, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_fapl_free, FAIL)
/* Free the fapl information */
if(fa->logfile)
@@ -425,7 +427,7 @@ H5FD_log_fapl_free(void *_fa)
H5MM_xfree(fa);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_log_fapl_free() */
@@ -458,21 +460,20 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id,
#ifdef WIN32
HFILE filehandle;
struct _BY_HANDLE_FILE_INFORMATION fileinfo;
- int results;
#endif
h5_stat_t sb;
H5P_genplist_t *plist; /* Property list */
H5FD_t *ret_value;
- FUNC_ENTER_NOAPI(H5FD_log_open, NULL);
+ FUNC_ENTER_NOAPI(H5FD_log_open, NULL)
/* Check arguments */
if (!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
if (0==maxaddr || HADDR_UNDEF==maxaddr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
if (ADDR_OVERFLOW(maxaddr))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
/* Build the open flags */
o_flags = (H5F_ACC_RDWR & flags) ? O_RDWR : O_RDONLY;
@@ -482,26 +483,26 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id,
/* Open the file */
if ((fd=HDopen(name, o_flags, 0666))<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file")
if (HDfstat(fd, &sb)<0)
- HGOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file");
+ HGOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file")
/* Create the new file struct */
if (NULL==(file=H5MM_calloc(sizeof(H5FD_log_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
/* Get the driver specific information */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
fa = H5P_get_driver_info(plist);
file->fd = fd;
- file->eof = sb.st_size;
+ H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,off_t,haddr_t);
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#ifdef WIN32
filehandle = _get_osfhandle(fd);
- results = GetFileInformationByHandle((HANDLE)filehandle, &fileinfo);
+ (void)GetFileInformationByHandle((HANDLE)filehandle, &fileinfo);
file->fileindexhi = fileinfo.nFileIndexHigh;
file->fileindexlo = fileinfo.nFileIndexLow;
#else
@@ -542,7 +543,7 @@ done:
HDclose(fd);
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_log_open() */
@@ -572,14 +573,14 @@ H5FD_log_close(H5FD_t *_file)
#endif /* H5_HAVE_GETTIMEOFDAY */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_close, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_close, FAIL)
#ifdef H5_HAVE_GETTIMEOFDAY
if(file->fa.flags&H5FD_LOG_TIME_CLOSE)
HDgettimeofday(&timeval_start,NULL);
#endif /* H5_HAVE_GETTIMEOFDAY */
if (close(file->fd)<0)
- HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file");
+ HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file")
#ifdef H5_HAVE_GETTIMEOFDAY
if(file->fa.flags&H5FD_LOG_TIME_CLOSE)
HDgettimeofday(&timeval_stop,NULL);
@@ -669,7 +670,7 @@ H5FD_log_close(H5FD_t *_file)
H5MM_xfree(file);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -698,34 +699,34 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
const H5FD_log_t *f2 = (const H5FD_log_t*)_f2;
int ret_value=0;
- FUNC_ENTER_NOAPI(H5FD_log_cmp, H5FD_VFD_DEFAULT);
+ FUNC_ENTER_NOAPI(H5FD_log_cmp, H5FD_VFD_DEFAULT)
#ifdef WIN32
- if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1);
- if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1);
+ if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1)
+ if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1)
- if (f1->fileindexlo < f2->fileindexlo) HGOTO_DONE(-1);
- if (f1->fileindexlo > f2->fileindexlo) HGOTO_DONE(1);
+ if (f1->fileindexlo < f2->fileindexlo) HGOTO_DONE(-1)
+ if (f1->fileindexlo > f2->fileindexlo) HGOTO_DONE(1)
#else
#ifdef H5_DEV_T_IS_SCALAR
- if (f1->device < f2->device) HGOTO_DONE(-1);
- if (f1->device > f2->device) HGOTO_DONE(1);
+ if (f1->device < f2->device) HGOTO_DONE(-1)
+ if (f1->device > f2->device) HGOTO_DONE(1)
#else /* H5_DEV_T_IS_SCALAR */
/* If dev_t isn't a scalar value on this system, just use memcmp to
* determine if the values are the same or not. The actual return value
* shouldn't really matter...
*/
- if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))<0) HGOTO_DONE(-1);
- if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) HGOTO_DONE(1);
+ if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))<0) HGOTO_DONE(-1)
+ if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) HGOTO_DONE(1)
#endif /* H5_DEV_T_IS_SCALAR */
- if (f1->inode < f2->inode) HGOTO_DONE(-1);
- if (f1->inode > f2->inode) HGOTO_DONE(1);
+ if (f1->inode < f2->inode) HGOTO_DONE(-1)
+ if (f1->inode > f2->inode) HGOTO_DONE(1)
#endif
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -746,12 +747,13 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5FD_log_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
{
herr_t ret_value=SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_log_query, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_query, FAIL)
/* Set the VFL feature flags that this driver supports */
if(flags) {
@@ -763,7 +765,7 @@ H5FD_log_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -783,6 +785,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static haddr_t
H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t size)
{
@@ -790,7 +793,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t siz
haddr_t addr;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_alloc, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_log_alloc, HADDR_UNDEF)
/* Compute the address for the block to allocate */
addr = file->eoa;
@@ -820,7 +823,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t siz
ret_value=addr;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_log_alloc() */
@@ -848,13 +851,13 @@ H5FD_log_get_eoa(H5FD_t *_file)
H5FD_log_t *file = (H5FD_log_t*)_file;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_get_eoa, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_log_get_eoa, HADDR_UNDEF)
/* Set return value */
ret_value=file->eoa;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -882,12 +885,12 @@ H5FD_log_set_eoa(H5FD_t *_file, haddr_t addr)
H5FD_log_t *file = (H5FD_log_t*)_file;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_set_eoa, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_set_eoa, FAIL)
file->eoa = addr;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -917,13 +920,13 @@ H5FD_log_get_eof(H5FD_t *_file)
H5FD_log_t *file = (H5FD_log_t*)_file;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_get_get_eof, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI(H5FD_get_get_eof, HADDR_UNDEF)
/* Set return value */
ret_value=MAX(file->eof, file->eoa);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -941,21 +944,22 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5FD_log_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_log_get_handle, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_get_handle, FAIL)
if(!file_handle)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
*file_handle = &(file->fd);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -978,6 +982,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr,
size_t size, void *buf/*out*/)
@@ -986,18 +991,18 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr
ssize_t nbytes;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_read, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_read, FAIL)
assert(file && file->pub.cls);
assert(buf);
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined")
if (REGION_OVERFLOW(addr, size))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
if (addr+size>file->eoa)
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
/* Log the I/O information about the read */
if(file->fa.flags!=0) {
@@ -1032,7 +1037,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr
file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) {
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position");
+ HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
}
/*
@@ -1047,7 +1052,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr
/* error */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed")
}
if (0==nbytes) {
/* end of file but not end of format address space */
@@ -1056,7 +1061,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr
}
assert(nbytes>=0);
assert((size_t)nbytes<=size);
- size -= nbytes;
+ size -= (size_t)nbytes;
addr += (haddr_t)nbytes;
buf = (char*)buf + nbytes;
}
@@ -1066,7 +1071,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr
file->op = OP_READ;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1088,6 +1093,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr,
size_t size, const void *buf)
@@ -1102,7 +1108,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add
#endif /* H5_HAVE_GETTIMEOFDAY */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_write, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_write, FAIL)
assert(file && file->pub.cls);
assert(size>0);
@@ -1114,11 +1120,11 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined")
if (REGION_OVERFLOW(addr, size))
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
if (addr+size>file->eoa)
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
/* Log the I/O information about the write */
if(file->fa.flags&H5FD_LOG_FILE_WRITE) {
@@ -1139,7 +1145,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add
if(file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) {
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position");
+ HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
} /* end if */
#ifdef H5_HAVE_GETTIMEOFDAY
if(file->fa.flags&H5FD_LOG_TIME_SEEK)
@@ -1186,11 +1192,11 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add
file->op = OP_UNKNOWN;
if(file->fa.flags&H5FD_LOG_LOC_WRITE)
HDfprintf(file->logfp,"Error! Writing: %10a-%10a (%10Zu bytes)\n",orig_addr,orig_addr+orig_size-1,orig_size);
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
}
assert(nbytes>0);
assert((size_t)nbytes<=size);
- size -= nbytes;
+ size -= (size_t)nbytes;
addr += (haddr_t)nbytes;
buf = (const char*)buf + nbytes;
}
@@ -1238,7 +1244,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add
file->eof = file->pos;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1259,24 +1265,25 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5FD_log_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing)
{
H5FD_log_t *file = (H5FD_log_t*)_file;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_log_flush, FAIL);
+ FUNC_ENTER_NOAPI(H5FD_log_flush, FAIL)
if (file->eoa>file->eof) {
if (-1==file_seek(file->fd, (file_offset_t)(file->eoa-1), SEEK_SET))
- HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position");
+ HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
if (write(file->fd, "", 1)!=1)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
file->eof = file->eoa;
file->pos = file->eoa;
file->op = OP_WRITE;
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/hdf5.lnt b/src/hdf5.lnt
index 0dccf10..eb433bd 100755
--- a/src/hdf5.lnt
+++ b/src/hdf5.lnt
@@ -80,6 +80,7 @@
H5FD.c
H5FDcore.c
H5FDfamily.c
+ H5FDlog.c
H5V.c
H5Z.c
@@ -87,4 +88,9 @@
H5Zfletcher32.c
H5Zshuffle.c
H5Zszip.c
+
+ The following files have had their FUNC_ENTER, FUNC_LEAVE & HGOTO*
+ macros cleaned up and the PABLO_MASK adjusted, but have not been linted:
+ H5FDfphdf5.c
+ H5FDgass.c
*/