summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-07-08 21:18:18 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-07-08 21:18:18 (GMT)
commit5f554bcced24f97371c34c36bb83eea921e2a85b (patch)
tree2ce1160aad30f3732f0e9d5504e5ac1fe0768dca /src/H5T.c
parent44d5c8823eb4370ff70bf7ed56c8eae7404d222c (diff)
downloadhdf5-5f554bcced24f97371c34c36bb83eea921e2a85b.zip
hdf5-5f554bcced24f97371c34c36bb83eea921e2a85b.tar.gz
hdf5-5f554bcced24f97371c34c36bb83eea921e2a85b.tar.bz2
[svn-r473] Changes since 19980708
---------------------- ./src/H5Fistore.c ./src/H5S.c Fixed places where `herr_t' functions returned NULL for failure: H5F_istore_get_addr() and printf(?!?) (probably because a printf() was in the first column :-/ so I don't know what function it really was that I fixed), and H5S_extent_copy(). ./src/H5Fprivate.h Added declarations for H5F_istore_get_addr() and H5F_istore_allocate(). ./src/H5S.c ./src/H5Sprivate.h Split H5Sset_extent_simple() into H5S_set_extent_simple() and replaced calls to the API function with calls to the internal function. Changed calls to H5Screate() to H5S_create() and H5Sclose() to H5S_close(). ./src/H5Shyper.c ./src/H5Spoint.c Removed unused labels and variable. ./src/H5T.c ./src/H5Tconv.c Changed calls to H5Tfind() to H5T_find(). ./src/H5TB.c Split function return type onto a separate line for five functions and added API tracing calls.
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 07bc062..11eef4b 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -3284,6 +3284,7 @@ H5Tconvert (hid_t src_id, hid_t dst_id, size_t nelmts, void *buf,
H5T_cdata_t *cdata = NULL; /*conversion data */
H5T_conv_t tconv_func = NULL; /*conversion function */
herr_t status; /*func return status */
+ H5T_t *src=NULL, *dst=NULL; /*unatomized types */
#ifdef H5T_DEBUG
H5_timer_t timer; /*conversion timer */
#endif
@@ -3291,7 +3292,16 @@ H5Tconvert (hid_t src_id, hid_t dst_id, size_t nelmts, void *buf,
FUNC_ENTER (H5Tconvert, FAIL);
H5TRACE5("e","iizxx",src_id,dst_id,nelmts,buf,background);
- if (NULL==(tconv_func=H5Tfind (src_id, dst_id, &cdata))) {
+ /* Check args */
+ if (H5_DATATYPE!=H5I_group(src_id) ||
+ NULL==(src=H5I_object(src_id)) ||
+ H5_DATATYPE!=H5I_group(dst_id) ||
+ NULL==(dst=H5I_object(dst_id))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ }
+
+ /* Find the conversion function */
+ if (NULL==(tconv_func=H5T_find (src, dst, H5T_BKG_NO, &cdata))) {
HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,
"unable to convert between src and dst data types");
}