summaryrefslogtreecommitdiffstats
path: root/src/H5Tcommit.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /src/H5Tcommit.c
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'src/H5Tcommit.c')
-rw-r--r--src/H5Tcommit.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 75e8b8f..3fed9c0 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -53,16 +53,16 @@ DESCRIPTION
static herr_t
H5T_init_commit_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_commit_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_commit_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_commit_interface() */
/*-------------------------------------------------------------------------
* Function: H5Tcommit
*
- * Purpose: Save a transient data type to a file and turn the type handle
+ * Purpose: Save a transient datatype to a file and turn the type handle
* into a named, immutable type.
*
* Return: Non-negative on success/Negative on failure
@@ -81,23 +81,23 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id)
H5T_t *type = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tcommit, FAIL);
+ FUNC_ENTER_API(H5Tcommit, FAIL)
H5TRACE3("e","isi",loc_id,name,type_id);
/* Check arguments */
if (NULL==(loc=H5G_loc (loc_id)))
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if (!name || !*name)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no name");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
if (NULL==(type=H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Commit the type */
if (H5T_commit (loc, name, type, H5AC_dxpl_id)<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit data type");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -122,11 +122,11 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id)
H5F_t *file = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5T_commit);
+ FUNC_ENTER_NOAPI_NOINIT(H5T_commit)
- assert (loc);
- assert (name && *name);
- assert (type);
+ HDassert (loc);
+ HDassert (name && *name);
+ HDassert (type);
/*
* Check arguments. We cannot commit an immutable type because H5Tclose()
@@ -134,17 +134,17 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id)
* a named type should always succeed.
*/
if (H5T_STATE_NAMED==type->shared->state || H5T_STATE_OPEN==type->shared->state)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "data type is already committed");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed")
if (H5T_STATE_IMMUTABLE==type->shared->state)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "data type is immutable");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable")
/* Find the insertion file */
if (NULL==(file=H5G_insertion_file(loc, name, dxpl_id)))
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to find insertion point");
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to find insertion point")
/* Check for a "sensible" datatype to store on disk */
- if(H5T_is_sensible(type)!=TRUE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "datatype is not sensible");
+ if(H5T_is_sensible(type)<=0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "datatype is not sensible")
/* Mark datatype as being on disk now. This step changes the size of datatype as
* stored on disk. */
@@ -156,11 +156,11 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id)
* type message and then give the object header a name.
*/
if (H5O_create (file, dxpl_id, 64, &(type->ent))<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create data type object header");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header")
if (H5O_modify (&(type->ent), H5O_DTYPE_ID, 0, H5O_FLAG_CONSTANT, H5O_UPDATE_TIME, type, dxpl_id)<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message")
if (H5G_insert (loc, name, &(type->ent), dxpl_id)<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to name data type");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to name datatype")
type->shared->state = H5T_STATE_OPEN;
type->shared->fo_count=1;
@@ -177,21 +177,21 @@ done:
if (ret_value<0) {
if ((type->shared->state==H5T_STATE_TRANSIENT || type->shared->state==H5T_STATE_RDONLY) && H5F_addr_defined(type->ent.header)) {
if(H5O_close(&(type->ent))<0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header");
+ HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header")
if(H5O_delete(file, dxpl_id,type->ent.header)<0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header");
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header")
type->ent.header = HADDR_UNDEF;
}
}
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Tcommitted
*
- * Purpose: Determines if a data type is committed or not.
+ * Purpose: Determines if a datatype is committed or not.
*
* Return: Success: TRUE if committed, FALSE otherwise.
*
@@ -210,25 +210,25 @@ H5Tcommitted(hid_t type_id)
H5T_t *type = NULL;
htri_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Tcommitted, FAIL);
+ FUNC_ENTER_API(H5Tcommitted, FAIL)
H5TRACE1("t","i",type_id);
/* Check arguments */
if (NULL==(type=H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Set return value */
ret_value= H5T_committed(type);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5T_committed
*
- * Purpose: Determines if a data type is committed or not.
+ * Purpose: Determines if a datatype is committed or not.
*
* Return: Success: TRUE if committed, FALSE otherwise.
*
@@ -240,14 +240,14 @@ done:
*-------------------------------------------------------------------------
*/
htri_t
-H5T_committed(H5T_t *type)
+H5T_committed(const H5T_t *type)
{
/* Use no-init for efficiency */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_committed);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_committed)
assert (type);
- FUNC_LEAVE_NOAPI(H5T_STATE_OPEN==type->shared->state || H5T_STATE_NAMED==type->shared->state);
+ FUNC_LEAVE_NOAPI(H5T_STATE_OPEN==type->shared->state || H5T_STATE_NAMED==type->shared->state)
} /* end H5T_committed() */
@@ -274,15 +274,15 @@ H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id)
int ret_value; /* Return value */
/* Use no-init for efficiency */
- FUNC_ENTER_NOAPI(H5T_link,FAIL);
+ FUNC_ENTER_NOAPI(H5T_link,FAIL)
assert (type);
/* Adjust the link count on the named datatype */
if((ret_value=H5O_link(&(type->ent),adjust,dxpl_id))<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_LINK, FAIL, "unable to adjust named datatype link count");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_LINK, FAIL, "unable to adjust named datatype link count")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_link() */