Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify H5CX macro documentation #4569

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/H5CX.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* be handled by the pthread library.
*
* In order for this macro to work, H5CX_get_my_context() must be preceded
* by "H5CX_node_t *ctx =".
* by "H5CX_node_t **ctx =".
*/
#define H5CX_get_my_context() H5CX__get_context()
#else /* H5_HAVE_THREADSAFE */
Expand Down Expand Up @@ -84,22 +84,23 @@
/* Mark the field as valid */ \
(*head)->ctx.H5_GLUE(PROP_FIELD, _valid) = true;

/* Macro for the duplicated code to retrieve properties from a property list */
/* Macro for the duplicated code to retrieve a value from a plist if the context value is invalid */
#define H5CX_RETRIEVE_PROP_VALID(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
/* Check if the value has been retrieved already */ \
if (!(*head)->ctx.H5_GLUE(PROP_FIELD, _valid)) { \
H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
} /* end if */

/* Macro for the duplicated code to retrieve possibly set properties from a property list */
/* Macro for the duplicated code to retrieve a value from a plist if the context value is invalid, or the
* library has previously modified the context value for return */
#define H5CX_RETRIEVE_PROP_VALID_SET(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
/* Check if the value has been retrieved already */ \
if (!((*head)->ctx.H5_GLUE(PROP_FIELD, _valid) || (*head)->ctx.H5_GLUE(PROP_FIELD, _set))) { \
H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
} /* end if */

#if defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_INSTRUMENTED_LIBRARY)
/* Macro for the duplicated code to test and set properties for a property list */
/* Macro for the duplicated code to set a context field that may not exist as a property */
#define H5CX_TEST_SET_PROP(PROP_NAME, PROP_FIELD) \
{ \
htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ \
Expand All @@ -122,7 +123,7 @@
}
#endif /* defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_INSTRUMENTED_LIBRARY) */

/* Macro for the duplicated code to test and set properties for a property list */
/* Macro for the duplicated code to test and set properties for a property list from the context */
#define H5CX_SET_PROP(PROP_NAME, PROP_FIELD) \
if ((*head)->ctx.H5_GLUE(PROP_FIELD, _set)) { \
/* Retrieve the dataset transfer property list */ \
Expand Down
Loading