summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-08-12 16:17:52 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2020-08-12 16:17:52 (GMT)
commitf2681e36aeb1c1c22fd3a14efda03668d906b0a0 (patch)
tree1b047d8326d5171c4a4d6e192b4497ccc0439d25
parentc48d1b0ff49247963f71496200d13bc337a0f2fc (diff)
parentdca1733238c6f72d2707d280e893c027734ebc27 (diff)
downloadhdf5-f2681e36aeb1c1c22fd3a14efda03668d906b0a0.zip
hdf5-f2681e36aeb1c1c22fd3a14efda03668d906b0a0.tar.gz
hdf5-f2681e36aeb1c1c22fd3a14efda03668d906b0a0.tar.bz2
Merge remote-tracking branch 'origin/develop' into remove_unneeded_tagging
-rw-r--r--src/H5Oattr.c29
-rw-r--r--src/H5Odtype.c7
-rw-r--r--src/H5VLint.c20
-rw-r--r--test/h5test.c10
-rw-r--r--test/vfd.c2
5 files changed, 38 insertions, 30 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index e38ef5c..6123949 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -108,8 +108,11 @@ H5FL_EXTERN(H5S_extent_t);
with the decoded information
USAGE
void *H5O_attr_decode(f, mesg_flags, p)
- H5F_t *f; IN: pointer to the HDF5 file struct
- unsigned mesg_flags; IN: Message flags to influence decoding
+ H5F_t *f; IN: pointer to the HDF5 file struct
+ H5O_t *open_oh; IN: pointer to the object header
+ unsigned mesg_flags; IN: message flags to influence decoding
+ unsigned *ioflags; IN/OUT: flags for decoding
+ size_t p_size; IN: size of buffer *p
const uint8_t *p; IN: the raw information buffer
RETURNS
Pointer to the new message in native order on success, NULL on failure
@@ -120,16 +123,16 @@ H5FL_EXTERN(H5S_extent_t);
--------------------------------------------------------------------------*/
static void *
H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+ unsigned *ioflags, size_t p_size, const uint8_t *p)
{
- H5A_t *attr = NULL;
- H5S_extent_t *extent; /*extent dimensionality information */
- size_t name_len; /*attribute name length */
- size_t dt_size; /* Datatype size */
- hssize_t sds_size; /* Signed Dataspace size */
- hsize_t ds_size; /* Dataspace size */
- unsigned flags = 0; /* Attribute flags */
- H5A_t *ret_value = NULL; /* Return value */
+ H5A_t *attr = NULL;
+ H5S_extent_t *extent; /*extent dimensionality information */
+ size_t name_len; /*attribute name length */
+ size_t dt_size; /* Datatype size */
+ hssize_t sds_size; /* Signed Dataspace size */
+ hsize_t ds_size; /* Dataspace size */
+ unsigned flags = 0; /* Attribute flags */
+ H5A_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -138,7 +141,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
HDassert(p);
if(NULL == (attr = H5FL_CALLOC(H5A_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if(NULL == (attr->shared = H5FL_CALLOC(H5A_shared_t)))
HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared attr structure")
@@ -146,7 +149,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
/* Version number */
attr->shared->version = *p++;
if(attr->shared->version < H5O_ATTR_VERSION_1 || attr->shared->version > H5O_ATTR_VERSION_LATEST)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "bad version number for attribute message")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "bad version number for attribute message")
/* Get the flags byte if we have a later version of the attribute */
if(attr->shared->version >= H5O_ATTR_VERSION_2) {
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 6eaaae9..92a8ee3 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -1094,9 +1094,12 @@ done:
with the decoded information
USAGE
void *H5O_dtype_decode(f, mesg_flags, p)
- H5F_t *f; IN: pointer to the HDF5 file struct
+ H5F_t *f; IN: pointer to the HDF5 file struct
+ H5O_t *open_oh; IN: pointer to the object header
unsigned mesg_flags; IN: Message flags to influence decoding
- const uint8 *p; IN: the raw information buffer
+ unsigned *ioflags; IN/OUT: flags for decoding
+ size_t p_size; IN: size of buffer *p
+ const uint8_t *p; IN: the raw information buffer
RETURNS
Pointer to the new message in native order on success, NULL on failure
DESCRIPTION
diff --git a/src/H5VLint.c b/src/H5VLint.c
index 861629f..98785f8 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -2363,23 +2363,25 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref)
/* Sanity check */
HDassert(obj);
+ /* Retrieve the VOL object wrapping context */
+ if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context")
+ if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector)
+ HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its connector is NULL???")
+
/* If the datatype is already VOL-managed, the datatype's vol_obj
* field will get clobbered later, so disallow this.
*/
- if(type == H5I_DATATYPE)
- if(TRUE == H5T_already_vol_managed((const H5T_t *)obj))
- HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype")
+ if(type == H5I_DATATYPE) {
+ if(vol_wrap_ctx->connector->id == H5VL_NATIVE)
+ if(TRUE == H5T_already_vol_managed((const H5T_t *)obj))
+ HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype")
+ }
/* Wrap the object with VOL connector info */
if(NULL == (new_obj = H5VL__wrap_obj(obj, type)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object")
- /* Retrieve the VOL object wrapping context */
- if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context")
- if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector)
- HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its connector is NULL???")
-
/* Get an ID for the object */
if((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->connector->id, app_ref)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object")
diff --git a/test/h5test.c b/test/h5test.c
index 497a5f2..022bfde 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -2067,13 +2067,13 @@ h5_compare_file_bytes(char *f1name, char *f2name)
int ret_value = 0; /* for error handling */
/* Open files for reading */
- f1ptr = HDfopen(f1name, "r");
+ f1ptr = HDfopen(f1name, "rb");
if (f1ptr == NULL) {
HDfprintf(stderr, "Unable to fopen() %s\n", f1name);
ret_value = -1;
goto done;
}
- f2ptr = HDfopen(f2name, "r");
+ f2ptr = HDfopen(f2name, "rb");
if (f2ptr == NULL) {
HDfprintf(stderr, "Unable to fopen() %s\n", f2name);
ret_value = -1;
@@ -2200,7 +2200,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest)
max_buf = 4096 * sizeof(char);
- orig_ptr = HDfopen(orig, "r");
+ orig_ptr = HDfopen(orig, "rb");
if (NULL == orig_ptr) {
ret_value = -1;
goto done;
@@ -2210,7 +2210,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest)
fsize = (hsize_t)HDftell(orig_ptr);
HDrewind(orig_ptr);
- dest_ptr = HDfopen(dest, "w");
+ dest_ptr = HDfopen(dest, "wb");
if (NULL == dest_ptr) {
ret_value = -1;
goto done;
@@ -2224,7 +2224,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest)
}
while (read_size > 0) {
- if(HDfread(dup_buf, read_size, 1, orig_ptr) != 1) {
+ if (HDfread(dup_buf, read_size, 1, orig_ptr) != 1) {
ret_value = -1;
goto done;
}
diff --git a/test/vfd.c b/test/vfd.c
index f1443c5..d849d96 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -2453,7 +2453,7 @@ run_splitter_test(const struct splitter_dataset_def *data,
SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
}
- /* Verify existence of logfile iff appropriate */
+ /* Verify existence of logfile if appropriate */
logfile = fopen(vfd_config->log_file_path, "r");
if ( (TRUE == provide_logfile_path && NULL == logfile) ||
(FALSE == provide_logfile_path && NULL != logfile) )