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

Make H5F_LIBVER_LATEST a real enum value #5083

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions java/src/hdf/hdf5lib/HDF5Constants.java
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Java changes are just a re-ordering, putting LATEST in front of NBOUNDS

Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,10 @@ public class HDF5Constants {
/** */
public static final int H5F_LIBVER_V200 = H5F_LIBVER_V200();
/** */
public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS();
/** */
public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST();
/** */
public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS();
/** */
public static final int H5F_OBJ_ALL = H5F_OBJ_ALL();
/** */
public static final int H5F_OBJ_ATTR = H5F_OBJ_ATTR();
Expand Down Expand Up @@ -2080,10 +2080,10 @@ public class HDF5Constants {

private static native final int H5F_LIBVER_V200();

private static native final int H5F_LIBVER_NBOUNDS();

private static native final int H5F_LIBVER_LATEST();

private static native final int H5F_LIBVER_NBOUNDS();

private static native final int H5F_OBJ_ALL();

private static native final int H5F_OBJ_ATTR();
Expand Down
8 changes: 4 additions & 4 deletions java/src/jni/h5Constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,14 +1309,14 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1V200(JNIEnv *env, jclass cls)
return H5F_LIBVER_V200;
}
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1NBOUNDS(JNIEnv *env, jclass cls)
Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls)
{
return H5F_LIBVER_NBOUNDS;
return H5F_LIBVER_LATEST;
}
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1LATEST(JNIEnv *env, jclass cls)
Java_hdf_hdf5lib_HDF5Constants_H5F_1LIBVER_1NBOUNDS(JNIEnv *env, jclass cls)
{
return H5F_LIBVER_LATEST;
return H5F_LIBVER_NBOUNDS;
}
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1OBJ_1ALL(JNIEnv *env, jclass cls)
Expand Down
11 changes: 11 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@ New Features

Library:
--------
- H5F_LIBVER_LATEST is now an enum value

This was previously #defined to the latest H5F_libver_t API version, but
is now an enum value with an integer value equal to the latest H5F_libver_t
API version's value. e.g.:

<snip>
H5F_LIBVER_V200 = 5,
H5F_LIBVER_LATEST = 5,
</snip>

- Added support for complex number datatypes

Support for the C99 "float _Complex", "double _Complex" and "long double _Complex"
Expand Down
15 changes: 7 additions & 8 deletions src/H5Fpublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,16 @@ typedef struct H5F_sect_info_t {
*/
typedef enum H5F_libver_t {
H5F_LIBVER_ERROR = -1,
H5F_LIBVER_EARLIEST = 0, /**< Use the earliest possible format for storing objects */
H5F_LIBVER_V18 = 1, /**< Use the latest v18 format for storing objects */
H5F_LIBVER_V110 = 2, /**< Use the latest v110 format for storing objects */
H5F_LIBVER_V112 = 3, /**< Use the latest v112 format for storing objects */
H5F_LIBVER_V114 = 4, /**< Use the latest v114 format for storing objects */
H5F_LIBVER_V200 = 5, /**< Use the latest v200 format for storing objects */
H5F_LIBVER_EARLIEST = 0, /**< Use the earliest possible file format for storing objects */
H5F_LIBVER_V18 = 1, /**< Use the 1.8 file format for storing objects */
H5F_LIBVER_V110 = 2, /**< Use the 1.10 file format for storing objects */
H5F_LIBVER_V112 = 3, /**< Use the 1.12 file format for storing objects */
H5F_LIBVER_V114 = 4, /**< Use the 1.14 file format for storing objects */
H5F_LIBVER_V200 = 5, /**< Use the 2.0 file format for storing objects */
H5F_LIBVER_LATEST = 5, /**< Use the latest file format for storing objects */
H5F_LIBVER_NBOUNDS /**< Sentinel */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to check what consequences this will have by making H5F_LIBVER_NBOUNDS inaccurate as a counting sentinel value. H5F_LIBVER_NBOUNDS is used in several places in the library.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look

} H5F_libver_t;

#define H5F_LIBVER_LATEST H5F_LIBVER_V200

/**
* File space handling strategy
*/
Expand Down
6 changes: 3 additions & 3 deletions src/H5Ppublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -4967,9 +4967,9 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref);
* enumerated values in the #H5F_libver_t struct, which is
* defined in H5Fpublic.h.
*
* The macro #H5F_LIBVER_LATEST is aliased to the highest
* enumerated value in #H5F_libver_t, indicating that this is
* currently the latest format available.
* #H5F_LIBVER_LATEST is equivalent to the highest explicitly numbered
* API value in #H5F_libver_t, indicating that this is currently the
* latest format available.
*
* The library supports the following pairs of (\p low, \p high)
* combinations as derived from the values in #H5F_libver_t:
Expand Down
Loading