summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-08-25 23:21:03 (GMT)
committerGitHub <noreply@github.com>2021-08-25 23:21:03 (GMT)
commite367c80b39529c9a863c3236e25bfb46b707b815 (patch)
treebb41c38c290d4203d557d0da60f7e61307b45a80 /examples
parent8f3878de399538d5848f8ba0b98aefe0c77c8a9a (diff)
downloadhdf5-e367c80b39529c9a863c3236e25bfb46b707b815.zip
hdf5-e367c80b39529c9a863c3236e25bfb46b707b815.tar.gz
hdf5-e367c80b39529c9a863c3236e25bfb46b707b815.tar.bz2
1.10 merge clang tidy of examples and hl (#966)
* Merge of clang tidy of examples and hl from 1.12 * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/h5_attribute.c3
-rw-r--r--examples/h5_extlink.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c
index 4dbe71e..68653d4 100644
--- a/examples/h5_attribute.c
+++ b/examples/h5_attribute.c
@@ -184,6 +184,8 @@ main(void)
printf("The value of the attribute \"Integer attribute\" is %d \n", point_out);
ret = H5Aclose(attr);
+ //! [H5Oget_info2_snip]
+
/*
* Find string attribute by iterating through all attributes
*/
@@ -203,6 +205,7 @@ main(void)
ret = H5Tclose(atype);
}
+ //! [H5Oget_info2_snip]
/*
* Get attribute info using iteration function.
*/
diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c
index 5f58f0a..a7bb355 100644
--- a/examples/h5_extlink.c
+++ b/examples/h5_extlink.c
@@ -413,10 +413,15 @@ UD_hard_create(const char *link_name, hid_t loc_group, const void *udata, size_t
addr = *((const haddr_t *)udata);
+ //! [H5Oopen_by_addr_snip]
+
/* Open the object this link points to so that we can increment
* its reference count. This also ensures that the address passed
* in points to a real object (although this check is not perfect!) */
target_obj = H5Oopen_by_addr(loc_group, addr);
+
+ //! [H5Oopen_by_addr_snip]
+
if (target_obj < 0) {
ret_value = -1;
goto done;
@@ -611,7 +616,7 @@ UD_plist_traverse(const char *link_name, hid_t cur_group, const void *udata, siz
hid_t dxpl_id)
{
char *path;
- hid_t ret_value = -1;
+ hid_t ret_value = H5I_INVALID_HID;
/* If the link property isn't set or can't be found, traversal fails. */
if (H5Pexist(lapl_id, PLIST_LINK_PROP) < 0)
@@ -628,7 +633,7 @@ UD_plist_traverse(const char *link_name, hid_t cur_group, const void *udata, siz
return ret_value;
error:
- return -1;
+ return H5I_INVALID_HID;
}
/* Main function