summaryrefslogtreecommitdiffstats
path: root/hl/src
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-04-07 13:01:44 (GMT)
committerGitHub <noreply@github.com>2022-04-07 13:01:44 (GMT)
commit65568d75746b56ce7066337cf4c5c4aad11ff5f9 (patch)
tree4d43fd73ab9eb9c2218c7f2df21d54f7f6509bf2 /hl/src
parent7a83173c7b289453e17f3026e825cb97778180cd (diff)
downloadhdf5-65568d75746b56ce7066337cf4c5c4aad11ff5f9.zip
hdf5-65568d75746b56ce7066337cf4c5c4aad11ff5f9.tar.gz
hdf5-65568d75746b56ce7066337cf4c5c4aad11ff5f9.tar.bz2
Normalization of HL library with develop (#1609)
Diffstat (limited to 'hl/src')
-rw-r--r--hl/src/H5DO.c2
-rw-r--r--hl/src/H5DS.c8
-rw-r--r--hl/src/H5LT.c60
-rw-r--r--hl/src/H5LTpublic.h6
4 files changed, 64 insertions, 12 deletions
diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c
index 3bdb4e2..1703669 100644
--- a/hl/src/H5DO.c
+++ b/hl/src/H5DO.c
@@ -182,7 +182,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
if (FAIL == H5Sselect_hyperslab(new_space_id, H5S_SELECT_SET, start, stride, count, block))
goto done;
- /* The # of elemnts in the new extended dataspace */
+ /* The # of elements in the new extended dataspace */
if ((snelmts = H5Sget_select_npoints(new_space_id)) < 0)
goto done;
nelmts = (hsize_t)snelmts;
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index c947d16..387419b 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -88,7 +88,7 @@ H5DSset_scale(hid_t dsid, const char *dimname)
return FAIL;
/*-------------------------------------------------------------------------
- * check if the dataset is a dataset wich has references to dimension scales
+ * check if the dataset is a dataset which has references to dimension scales
*-------------------------------------------------------------------------
*/
@@ -1122,7 +1122,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
goto out;
} /* nelmts */
- /* Free refrences */
+ /* Free references */
if (is_new_ref) {
if (H5Treclaim(tid, sid, H5P_DEFAULT, ndsbuf) < 0)
goto out;
@@ -1189,7 +1189,7 @@ out:
dsbuf = NULL;
}
if (buf) {
- /* Failure occured before H5Treclaim was called;
+ /* Failure occurred before H5Treclaim was called;
free the pointers allocated when we read data in */
for (i = 0; i < rank; i++) {
if (buf[i].p)
@@ -1633,7 +1633,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
if (H5DSwith_new_ref(did, &is_new_ref) < 0)
return FAIL;
- /* get the number of scales assotiated with this DIM */
+ /* get the number of scales associated with this DIM */
if ((nscales = H5DSget_num_scales(did, dim)) < 0)
return FAIL;
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index e63ec92..e4b7090 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -1776,6 +1776,32 @@ H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam
}
/*-------------------------------------------------------------------------
+ * Function: H5LTset_attribute_ullong
+ *
+ * Purpose: Create and write an attribute.
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Alessandro Felder
+ *
+ * Date: August 27, 2021
+ *
+ * Comments:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ const unsigned long long *data, size_t size)
+{
+
+ if (H5LT_set_attribute_numerical(loc_id, obj_name, attr_name, size, H5T_NATIVE_ULLONG, data) < 0)
+ return -1;
+
+ return 0;
+}
+
+/*-------------------------------------------------------------------------
* Function: H5LTset_attribute_float
*
* Purpose: Create and write an attribute.
@@ -1870,19 +1896,12 @@ H5LTfind_attribute(hid_t loc_id, const char *attr_name)
*
*-------------------------------------------------------------------------
*/
-/* H5Aiterate wants a non-const pointer but we have a const pointer in the API
- * call. It's safe to ignore this because we control the callback, don't
- * modify the op_data buffer (i.e.: attr_name) during the traversal, and the
- * library never modifies that buffer.
- */
-H5_GCC_DIAG_OFF("cast-qual")
herr_t
H5LT_find_attribute(hid_t loc_id, const char *attr_name)
{
htri_t attr_exists = H5Aexists(loc_id, attr_name);
return (attr_exists < 0) ? (herr_t)-1 : (attr_exists) ? (herr_t)1 : (herr_t)0;
}
-H5_GCC_DIAG_ON("cast-qual")
/*-------------------------------------------------------------------------
* Function: H5LTget_attribute_ndims
@@ -3272,6 +3291,33 @@ H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam
}
/*-------------------------------------------------------------------------
+ * Function: H5LTget_attribute_ullong
+ *
+ * Purpose: Reads an attribute named attr_name
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Alessandro Felder
+ *
+ * Date: August 27, 2021
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, unsigned long long *data)
+{
+ /* Get the attribute */
+ if (H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_ULLONG, data) < 0)
+ return -1;
+
+ return 0;
+}
+
+/*-------------------------------------------------------------------------
* Function: H5LTget_attribute_float
*
* Purpose: Reads an attribute named attr_name
diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h
index 47bb334..a6c7c84 100644
--- a/hl/src/H5LTpublic.h
+++ b/hl/src/H5LTpublic.h
@@ -139,6 +139,9 @@ H5_HLDLL herr_t H5LTset_attribute_long_long(hid_t loc_id, const char *obj_name,
H5_HLDLL herr_t H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
const unsigned long *buffer, size_t size);
+H5_HLDLL herr_t H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ const unsigned long long *buffer, size_t size);
+
H5_HLDLL herr_t H5LTset_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
const float *buffer, size_t size);
@@ -182,6 +185,9 @@ H5_HLDLL herr_t H5LTget_attribute_long_long(hid_t loc_id, const char *obj_name,
H5_HLDLL herr_t H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
unsigned long *data);
+H5_HLDLL herr_t H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ unsigned long long *data);
+
H5_HLDLL herr_t H5LTget_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
float *data);