summaryrefslogtreecommitdiffstats
path: root/src/H5Tvisit.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-10-01 15:29:53 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-10-01 15:29:53 (GMT)
commitec8ad09125032c9c232878d02e90aa86df162841 (patch)
tree5d63105d3a0db7d5bbee41c5b74b097649a2115e /src/H5Tvisit.c
parent453238e90e1574ef1c15e3c79f7fb3d77920e77c (diff)
downloadhdf5-ec8ad09125032c9c232878d02e90aa86df162841.zip
hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.gz
hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.bz2
Source formatted
Diffstat (limited to 'src/H5Tvisit.c')
-rw-r--r--src/H5Tvisit.c60
1 files changed, 24 insertions, 36 deletions
diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c
index 00c7d8f..5b19bfe 100644
--- a/src/H5Tvisit.c
+++ b/src/H5Tvisit.c
@@ -33,53 +33,43 @@
/* Module Setup */
/****************/
-#include "H5Tmodule.h" /* This source code file is part of the H5T module */
-
+#include "H5Tmodule.h" /* This source code file is part of the H5T module */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Tpkg.h" /* Datatypes */
-
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Tpkg.h" /* Datatypes */
/****************/
/* Local Macros */
/****************/
-
/******************/
/* Local Typedefs */
/******************/
-
/********************/
/* Package Typedefs */
/********************/
-
/********************/
/* Local Prototypes */
/********************/
-
/*********************/
/* Package Variables */
/*********************/
-
/*****************************/
/* Library Private Variables */
/*****************************/
-
/*******************/
/* Local Variables */
/*******************/
-
-
/*-------------------------------------------------------------------------
* Function: H5T__visit
*
@@ -96,8 +86,8 @@
herr_t
H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value)
{
- hbool_t is_complex; /* Flag indicating current datatype is "complex" */
- herr_t ret_value = SUCCEED; /* Return value */
+ hbool_t is_complex; /* Flag indicating current datatype is "complex" */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -106,31 +96,30 @@ H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value)
HDassert(op);
/* Check for complex datatype */
- is_complex = H5T_IS_COMPLEX(dt->shared->type);
+ is_complex = H5T_IS_COMPLEX(dt->shared->type);
/* If the callback is to be made on the datatype first, do that */
- if(is_complex && (visit_flags & H5T_VISIT_COMPLEX_FIRST))
- if(op(dt, op_value) < 0)
+ if (is_complex && (visit_flags & H5T_VISIT_COMPLEX_FIRST))
+ if (op(dt, op_value) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "operator callback failed")
/* Make callback for each member/child, if requested */
- switch(dt->shared->type) {
- case H5T_COMPOUND:
- {
- unsigned u; /* Local index variable */
-
- /* Visit each member of the compound datatype */
- for(u = 0; u < dt->shared->u.compnd.nmembs; u++)
- if(H5T__visit(dt->shared->u.compnd.memb[u].type, visit_flags, op, op_value) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "can't visit member datatype")
- } /* end case */
- break;
+ switch (dt->shared->type) {
+ case H5T_COMPOUND: {
+ unsigned u; /* Local index variable */
+
+ /* Visit each member of the compound datatype */
+ for (u = 0; u < dt->shared->u.compnd.nmembs; u++)
+ if (H5T__visit(dt->shared->u.compnd.memb[u].type, visit_flags, op, op_value) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "can't visit member datatype")
+ } /* end case */
+ break;
case H5T_ARRAY:
case H5T_VLEN:
case H5T_ENUM:
/* Visit parent type */
- if(H5T__visit(dt->shared->parent, visit_flags, op, op_value) < 0)
+ if (H5T__visit(dt->shared->parent, visit_flags, op, op_value) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "can't visit parent datatype")
break;
@@ -149,18 +138,17 @@ H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value)
case H5T_REFERENCE:
default:
/* Visit "simple" datatypes here */
- if(visit_flags & H5T_VISIT_SIMPLE)
- if(op(dt, op_value) < 0)
+ if (visit_flags & H5T_VISIT_SIMPLE)
+ if (op(dt, op_value) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "operator callback failed")
break;
} /* end switch */
/* If the callback is to be made on the datatype last, do that */
- if(is_complex && (visit_flags & H5T_VISIT_COMPLEX_LAST))
- if(op(dt, op_value) < 0)
+ if (is_complex && (visit_flags & H5T_VISIT_COMPLEX_LAST))
+ if (op(dt, op_value) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "operator callback failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__visit() */
-