summaryrefslogtreecommitdiffstats
path: root/src/H5Tstrpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Tstrpad.c')
-rw-r--r--src/H5Tstrpad.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c
index 35de30b..32d2bf2 100644
--- a/src/H5Tstrpad.c
+++ b/src/H5Tstrpad.c
@@ -16,16 +16,13 @@
* the datatype string padding for the H5T interface.
*/
-#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 */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Tpkg.h" /* Datatypes */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Tpkg.h" /* Datatypes */
-
-
-
/*-------------------------------------------------------------------------
* Function: H5Tget_strpad
*
@@ -46,22 +43,22 @@
H5T_str_t
H5Tget_strpad(hid_t type_id)
{
- H5T_t *dt = NULL;
- H5T_str_t ret_value;
+ H5T_t * dt = NULL;
+ H5T_str_t ret_value;
FUNC_ENTER_API(H5T_STR_ERROR)
H5TRACE1("Tz", "i", type_id);
/* Check args */
- if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE)))
+ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_STR_ERROR, "not a datatype")
while (dt->shared->parent && !H5T_IS_STRING(dt->shared))
- dt = dt->shared->parent; /*defer to parent*/
+ dt = dt->shared->parent; /*defer to parent*/
if (!H5T_IS_STRING(dt->shared))
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_STR_ERROR, "operation not defined for datatype class")
/* result */
- if(H5T_IS_FIXED_STRING(dt->shared))
+ if (H5T_IS_FIXED_STRING(dt->shared))
ret_value = dt->shared->u.atomic.u.s.pad;
else
ret_value = dt->shared->u.vlen.pad;
@@ -70,7 +67,6 @@ done:
FUNC_LEAVE_API(ret_value)
}
-
/*-------------------------------------------------------------------------
* Function: H5Tset_strpad
*
@@ -99,26 +95,26 @@ done:
herr_t
H5Tset_strpad(hid_t type_id, H5T_str_t strpad)
{
- H5T_t *dt = NULL;
- herr_t ret_value=SUCCEED; /* Return value */
+ H5T_t *dt = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iTz", type_id, strpad);
/* Check args */
- if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE)))
+ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
- if (H5T_STATE_TRANSIENT!=dt->shared->state)
+ if (H5T_STATE_TRANSIENT != dt->shared->state)
HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only")
if (strpad < H5T_STR_NULLTERM || strpad >= H5T_NSTR)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal string pad type")
while (dt->shared->parent && !H5T_IS_STRING(dt->shared))
- dt = dt->shared->parent; /*defer to parent*/
+ dt = dt->shared->parent; /*defer to parent*/
if (!H5T_IS_STRING(dt->shared))
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class")
/* Commit */
- if(H5T_IS_FIXED_STRING(dt->shared))
+ if (H5T_IS_FIXED_STRING(dt->shared))
dt->shared->u.atomic.u.s.pad = strpad;
else
dt->shared->u.vlen.pad = strpad;
@@ -126,4 +122,3 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad)
done:
FUNC_LEAVE_API(ret_value)
}
-