summaryrefslogtreecommitdiffstats
path: root/src/H5FDfamily.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDfamily.c')
-rw-r--r--src/H5FDfamily.c52
1 files changed, 33 insertions, 19 deletions
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 98ece84..d110ef7 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -36,6 +36,7 @@
#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
@@ -170,28 +171,25 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_family_init
+ * Function: H5FD_family_init
*
- * Purpose: Initialize this driver by registering the driver with the
- * library.
+ * Purpose: Initialize this driver by registering the driver with the
+ * library.
*
- * Return: Success: The driver ID for the family driver.
+ * Return: Success: The driver ID for the family driver
+ * Failure: H5I_INVALID_HID
*
- * Failure: Negative
- *
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hid_t
H5FD_family_init(void)
{
- hid_t ret_value = H5FD_FAMILY_g; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
if(H5I_VFL != H5I_get_type(H5FD_FAMILY_g))
H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), FALSE);
@@ -413,7 +411,7 @@ H5FD_family_fapl_copy(const void *_old_fa)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy the fields of the structure */
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t));
+ H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_family_fapl_t));
/* Deep copy the property list objects in the structure */
if(old_fa->memb_fapl_id==H5P_FILE_ACCESS_DEFAULT) {
@@ -547,7 +545,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*
/*-------------------------------------------------------------------------
* Function: H5FD_family_sb_decode
*
- * Purpose: This function has 2 seperate purpose. One is to decodes the
+ * Purpose: This function has 2 separate purpose. One is to decodes the
* superblock information for this driver. The NAME argument is
* the eight-character (plus null termination) name stored in i
* the file. The FILE argument is updated according to the
@@ -615,6 +613,13 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * memb_name & temp in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static H5FD_t *
H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr)
@@ -717,7 +722,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
(0==file->nmembs ? flags : t_flags), file->memb_fapl_id, HADDR_UNDEF);
} H5E_END_TRY;
if (!file->memb[file->nmembs]) {
- if (0==file->nmembs)
+ if (0 == file->nmembs)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open member file")
H5E_clear_stack(NULL);
break;
@@ -725,7 +730,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
file->nmembs++;
}
- /* If the file is reopened and there's only one member file existing, this file maybe
+ /* If the file is reopened and there's only one member file existing, this file may be
* smaller than the size specified through H5Pset_fapl_family(). Update the actual
* member size.
*/
@@ -765,6 +770,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_family_open() */
+H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
@@ -944,6 +950,13 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() call with
+ * memb_name in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static herr_t
H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
{
@@ -1010,6 +1023,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
+H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
@@ -1265,7 +1279,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
+H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
unsigned u, nerrors = 0;
@@ -1274,7 +1288,7 @@ H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
FUNC_ENTER_NOAPI_NOINIT
for(u = 0; u < file->nmembs; u++)
- if(file->memb[u] && H5FD_flush(file->memb[u], dxpl_id, closing) < 0)
+ if(file->memb[u] && H5FD_flush(file->memb[u], closing) < 0)
nerrors++;
if(nerrors)
@@ -1300,7 +1314,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
+H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
unsigned u, nerrors = 0;
@@ -1309,7 +1323,7 @@ H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
FUNC_ENTER_NOAPI_NOINIT
for(u = 0; u < file->nmembs; u++)
- if(file->memb[u] && H5FD_truncate(file->memb[u], dxpl_id, closing) < 0)
+ if(file->memb[u] && H5FD_truncate(file->memb[u], closing) < 0)
nerrors++;
if(nerrors)