summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2016-03-07 22:35:43 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2016-11-29 23:42:32 (GMT)
commitb4aa4a88b1c2c4e4af54668e77847ec1648ac13e (patch)
tree4a1126d7511d4f5d6e2dbcd7ed3ed4baf6554b0e /src
parent7c1cd40d7eaf67b0560765dd3ec032f62cc11c84 (diff)
downloadhdf5-b4aa4a88b1c2c4e4af54668e77847ec1648ac13e.zip
hdf5-b4aa4a88b1c2c4e4af54668e77847ec1648ac13e.tar.gz
hdf5-b4aa4a88b1c2c4e4af54668e77847ec1648ac13e.tar.bz2
Some more fixes to H5R to separate int/ext refs
Diffstat (limited to 'src')
-rw-r--r--src/H5R.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/H5R.c b/src/H5R.c
index 20bab2b..c56b8a6 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -1823,7 +1823,6 @@ done:
ssize_t
H5R__get_attr_name(H5F_t *f, href_t _ref, char *name, size_t size)
{
- H5O_loc_t oloc; /* Object location describing object for reference */
ssize_t ret_value = -1; /* Return value */
const uint8_t *p = NULL; /* Pointer to reference to decode */
size_t attr_name_len; /* Length of the attribute name */
@@ -1833,14 +1832,9 @@ H5R__get_attr_name(H5F_t *f, href_t _ref, char *name, size_t size)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- HDassert(f);
HDassert(ref);
HDassert((ref->ref_type == H5R_ATTR) || (ref->ref_type == H5R_EXT_ATTR));
- /* Initialize the object location */
- H5O_loc_reset(&oloc);
- oloc.file = f;
-
/* Point to reference buffer now */
p = (const uint8_t *)ref->ref.serial.buf;
@@ -1861,6 +1855,14 @@ H5R__get_attr_name(H5F_t *f, href_t _ref, char *name, size_t size)
/* Skip the path name */
p += pathname_len;
} else {
+ H5O_loc_t oloc; /* Object location describing object for reference */
+
+ HDassert(f);
+
+ /* Initialize the object location */
+ H5O_loc_reset(&oloc);
+ oloc.file = f;
+
/* Get the object oid for the dataset */
H5F_addr_decode(oloc.file, &p, &(oloc.addr));
}