summaryrefslogtreecommitdiffstats
path: root/src/H5Tcset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Tcset.c')
-rw-r--r--src/H5Tcset.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/H5Tcset.c b/src/H5Tcset.c
index 5ac2a62..a9c2f12 100644
--- a/src/H5Tcset.c
+++ b/src/H5Tcset.c
@@ -16,15 +16,13 @@
* the character set (cset) 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" /*ID functions */
+#include "H5Tpkg.h" /*data-type functions */
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5Tpkg.h" /*data-type functions */
-
-
/*-------------------------------------------------------------------------
* Function: H5Tget_cset
*
@@ -44,22 +42,23 @@
H5T_cset_t
H5Tget_cset(hid_t type_id)
{
- H5T_t *dt;
- H5T_cset_t ret_value;
+ H5T_t * dt;
+ H5T_cset_t ret_value;
FUNC_ENTER_API(H5T_CSET_ERROR)
H5TRACE1("Tc", "i", type_id);
/* Check args */
- if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_CSET_ERROR, "not a data type")
+ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_CSET_ERROR, "not a data 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, H5T_CSET_ERROR, "operation not defined for data type class")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_CSET_ERROR,
+ "operation not defined for data type class")
/* result */
- if(H5T_IS_FIXED_STRING(dt->shared))
+ if (H5T_IS_FIXED_STRING(dt->shared))
ret_value = dt->shared->u.atomic.u.s.cset;
else
ret_value = dt->shared->u.vlen.cset;
@@ -68,7 +67,6 @@ done:
FUNC_LEAVE_API(ret_value)
}
-
/*-------------------------------------------------------------------------
* Function: H5Tset_cset
*
@@ -86,26 +84,26 @@ done:
herr_t
H5Tset_cset(hid_t type_id, H5T_cset_t cset)
{
- H5T_t *dt;
- herr_t ret_value=SUCCEED; /* Return value */
+ H5T_t *dt;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "iTc", type_id, cset);
/* Check args */
- if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
- if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only")
+ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
+ if (H5T_STATE_TRANSIENT != dt->shared->state)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only")
if (cset < H5T_CSET_ASCII || cset >= H5T_NCSET)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal character set type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal character set 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 data type class")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for data type class")
/* Commit */
- if(H5T_IS_FIXED_STRING(dt->shared))
+ if (H5T_IS_FIXED_STRING(dt->shared))
dt->shared->u.atomic.u.s.cset = cset;
else
dt->shared->u.vlen.cset = cset;
@@ -113,4 +111,3 @@ H5Tset_cset(hid_t type_id, H5T_cset_t cset)
done:
FUNC_LEAVE_API(ret_value)
}
-