summaryrefslogtreecommitdiffstats
path: root/src/H5Odrvinfo.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/H5Odrvinfo.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/H5Odrvinfo.c')
-rw-r--r--src/H5Odrvinfo.c133
1 files changed, 60 insertions, 73 deletions
diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c
index eb678e4..ac72b5f 100644
--- a/src/H5Odrvinfo.c
+++ b/src/H5Odrvinfo.c
@@ -11,7 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
* Thursday, March 1, 2007
*
@@ -19,51 +18,48 @@
* in the superblock extension.
*/
-#include "H5Omodule.h" /* This source code file is part of the H5O module */
-
+#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Opkg.h" /* Object headers */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Opkg.h" /* Object headers */
+#include "H5MMprivate.h" /* Memory management */
-static void *H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
- unsigned *ioflags, size_t p_size, const uint8_t *p);
+static void * H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void *H5O_drvinfo_copy(const void *_mesg, void *_dest);
+static void * H5O_drvinfo_copy(const void *_mesg, void *_dest);
static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__drvinfo_reset(void *_mesg);
-static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream,
- int indent, int fwidth);
+static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
- H5O_DRVINFO_ID, /*message id number */
- "driver info", /*message name for debugging */
- sizeof(H5O_drvinfo_t), /*native message size */
- 0, /* messages are sharable? */
- H5O_drvinfo_decode, /*decode message */
- H5O_drvinfo_encode, /*encode message */
- H5O_drvinfo_copy, /*copy the native value */
- H5O_drvinfo_size, /*raw message size */
- H5O__drvinfo_reset, /*free internal memory */
- NULL, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /*set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__drvinfo_debug /*debug the message */
+ H5O_DRVINFO_ID, /*message id number */
+ "driver info", /*message name for debugging */
+ sizeof(H5O_drvinfo_t), /*native message size */
+ 0, /* messages are sharable? */
+ H5O_drvinfo_decode, /*decode message */
+ H5O_drvinfo_encode, /*encode message */
+ H5O_drvinfo_copy, /*copy the native value */
+ H5O_drvinfo_size, /*raw message size */
+ H5O__drvinfo_reset, /*free internal memory */
+ NULL, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /*set share method */
+ NULL, /*can share method */
+ NULL, /* pre copy native value to file */
+ NULL, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__drvinfo_debug /*debug the message */
}};
/* Current version of driver info information */
-#define H5O_DRVINFO_VERSION 0
+#define H5O_DRVINFO_VERSION 0
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_decode
*
@@ -79,12 +75,11 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
*-------------------------------------------------------------------------
*/
static void *
-H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
- size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- H5O_drvinfo_t *mesg; /* Native message */
- void *ret_value = NULL; /* Return value */
+ H5O_drvinfo_t *mesg; /* Native message */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -93,12 +88,12 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
HDassert(p);
/* Version of message */
- if(*p++ != H5O_DRVINFO_VERSION)
+ if (*p++ != H5O_DRVINFO_VERSION)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for message")
/* Allocate space for message */
- if(NULL == (mesg = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info message")
+ if (NULL == (mesg = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info message")
/* Retrieve driver name */
H5MM_memcpy(mesg->name, p, 8);
@@ -110,9 +105,9 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
HDassert(mesg->len);
/* Allocate space for buffer */
- if(NULL == (mesg->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
+ if (NULL == (mesg->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
mesg = (H5O_drvinfo_t *)H5MM_xfree(mesg);
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info buffer")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for driver info buffer")
} /* end if */
/* Copy encoded driver info into buffer */
@@ -125,7 +120,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_drvinfo_decode() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_encode
*
@@ -139,7 +133,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
@@ -161,7 +156,6 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_drvinfo_encode() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_copy
*
@@ -179,26 +173,27 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share
static void *
H5O_drvinfo_copy(const void *_mesg, void *_dest)
{
- const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
- H5O_drvinfo_t *dest = (H5O_drvinfo_t *)_dest;
- void *ret_value = NULL; /* Return value */
+ const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
+ H5O_drvinfo_t * dest = (H5O_drvinfo_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity check */
HDassert(mesg);
- if(!dest && NULL == (dest = (H5O_drvinfo_t *)H5MM_malloc(sizeof(H5O_drvinfo_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for shared message table message")
+ if (!dest && NULL == (dest = (H5O_drvinfo_t *)H5MM_malloc(sizeof(H5O_drvinfo_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
+ "memory allocation failed for shared message table message")
/* Shallow copy the fields */
*dest = *mesg;
/* Copy the buffer */
- if(NULL == (dest->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
- if(dest != _dest)
+ if (NULL == (dest->buf = (uint8_t *)H5MM_malloc(mesg->len))) {
+ if (dest != _dest)
dest = (H5O_drvinfo_t *)H5MM_xfree(dest);
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
} /* end if */
H5MM_memcpy(dest->buf, mesg->buf, mesg->len);
@@ -209,7 +204,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_drvinfo_copy() */
-
/*-------------------------------------------------------------------------
* Function: H5O_drvinfo_size
*
@@ -227,8 +221,8 @@ done:
static size_t
H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
- const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
- size_t ret_value = 0; /* Return value */
+ const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -236,15 +230,14 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
HDassert(f);
HDassert(mesg);
- ret_value = 1 + /* Version number */
- 8 + /* Driver name */
- 2 + /* Buffer length */
- mesg->len; /* Buffer */
+ ret_value = 1 + /* Version number */
+ 8 + /* Driver name */
+ 2 + /* Buffer length */
+ mesg->len; /* Buffer */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_drvinfo_size() */
-
/*-------------------------------------------------------------------------
* Function: H5O__drvinfo_reset
*
@@ -262,7 +255,7 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
static herr_t
H5O__drvinfo_reset(void *_mesg)
{
- H5O_drvinfo_t *mesg = (H5O_drvinfo_t *) _mesg;
+ H5O_drvinfo_t *mesg = (H5O_drvinfo_t *)_mesg;
FUNC_ENTER_STATIC_NOERR
@@ -275,7 +268,6 @@ H5O__drvinfo_reset(void *_mesg)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__drvinfo_reset() */
-
/*-------------------------------------------------------------------------
* Function: H5O__drvinfo_debug
*
@@ -289,8 +281,7 @@ H5O__drvinfo_reset(void *_mesg)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream,
- int indent, int fwidth)
+H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
@@ -303,12 +294,8 @@ H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream,
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Driver name:", mesg->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Buffer size:", mesg->len);
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Driver name:", mesg->name);
+ HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Buffer size:", mesg->len);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__drvinfo_debug() */
-
-