summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-11-07 17:48:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-11-07 17:48:12 (GMT)
commit0b4b91cb559bdb9268e8b3d5b7efea4d85b6a7d7 (patch)
tree8094e06acdd0d730048709db1a4100a255754c92 /src/H5D.c
parent2c78145f74f5aab70fdd3f81106fca6a0dfc4b16 (diff)
downloadhdf5-0b4b91cb559bdb9268e8b3d5b7efea4d85b6a7d7.zip
hdf5-0b4b91cb559bdb9268e8b3d5b7efea4d85b6a7d7.tar.gz
hdf5-0b4b91cb559bdb9268e8b3d5b7efea4d85b6a7d7.tar.bz2
[svn-r6063] Purpose:
Code cleanup Description: Cleaned up some error values that were incorrect, added some assertions and refactored the integer & floating-point native conversions some. Platforms tested: FreeBSD 4.7 (sleipnir), too small for h5committest
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 89656a8..3b236f9 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -3695,7 +3695,7 @@ done:
*
* Return: Success: the address of dataset
*
- * Failure: Zero
+ * Failure: HADDR_UNDEF
*
* Programmer: Raymond Lu
* November 6, 2002
@@ -3710,12 +3710,12 @@ H5Dget_offset(hid_t dset_id)
H5D_t *dset=NULL;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Dget_offset, 0);
+ FUNC_ENTER_API(H5Dget_offset, HADDR_UNDEF);
H5TRACE1("h","i",dset_id);
/* Check args */
if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a dataset");
/* Set return value */
ret_value = H5D_get_offset(dset);
@@ -3733,7 +3733,7 @@ done:
*
* Return: Success: the address of dataset
*
- * Failure: Zero
+ * Failure: HADDR_UNDEF
*
* Programmer: Raymond Lu
* November 6, 2002
@@ -3749,6 +3749,8 @@ H5D_get_offset(H5D_t *dset)
FUNC_ENTER_NOAPI(H5D_get_offset, HADDR_UNDEF);
+ assert(dset);
+
switch(dset->layout.type) {
case H5D_CHUNKED:
case H5D_COMPACT:
@@ -3762,7 +3764,7 @@ H5D_get_offset(H5D_t *dset)
break;
default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a dataset type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "unknown dataset layout type");
}
done: