Skip to content

Commit

Permalink
Update 'dimension scales w/ new-style refs' feature based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF committed Oct 25, 2021
1 parent 3b10167 commit 1e61bfb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 47 deletions.
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1053,16 +1053,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
endif ()
endif ()

#-----------------------------------------------------------------------------
# Option to use new-style references with dimension scale APIs
#-----------------------------------------------------------------------------
if (HDF5_BUILD_HL_LIB)
option (HDF5_DIMENSION_SCALES_NEW_REF "Use new-style references with dimension scale APIs" OFF)
if (HDF5_DIMENSION_SCALES_NEW_REF)
set (H5_DIMENSION_SCALES_WITH_NEW_REF 1)
endif ()
endif ()

#-----------------------------------------------------------------------------
# Option to build Fortran bindings/tests/examples
# Make sure this appears before the CONFIGURE_FILE step
Expand Down
8 changes: 8 additions & 0 deletions hl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
cmake_minimum_required (VERSION 3.12)
project (HDF5_HL C)

#-----------------------------------------------------------------------------
# Option to use new-style references with dimension scale APIs
#-----------------------------------------------------------------------------
option (HDF5_DIMENSION_SCALES_NEW_REF "Use new-style references with dimension scale APIs" OFF)
if (HDF5_DIMENSION_SCALES_NEW_REF)
set (H5_DIMENSION_SCALES_WITH_NEW_REF 1)
endif ()

#-----------------------------------------------------------------------------
# List Source files
#-----------------------------------------------------------------------------
Expand Down
74 changes: 37 additions & 37 deletions hl/src/H5DS.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
int is_ds;
hssize_t nelmts;
hid_t sid, sid_w; /* space ID */
hid_t tid = -1; /* attribute type ID */
hid_t ntid = -1; /* attribute native type ID */
hid_t aid = -1; /* attribute ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t ntid = H5I_INVALID_HID; /* attribute native type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
int rank; /* rank of dataset */
hsize_t dims[1]; /* dimension of the "REFERENCE_LIST" array */

Expand Down Expand Up @@ -729,11 +729,11 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
hssize_t nelmts;
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
hid_t did_i; /* dataset ID in REFERENCE_LIST */
hid_t sid = -1; /* space ID */
hid_t sid_w = -1; /* space ID */
hid_t tid = -1; /* attribute type ID */
hid_t ntid = -1; /* attribute native type ID */
hid_t aid = -1; /* attribute ID */
hid_t sid = H5I_INVALID_HID; /* space ID */
hid_t sid_w = H5I_INVALID_HID; /* space ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t ntid = H5I_INVALID_HID; /* attribute native type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
int rank; /* rank of dataset */
nds_list_t * ndsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
nds_list_t * ndsbuf_w = NULL; /* array of attribute data in the DS pointing to the dataset to write*/
Expand Down Expand Up @@ -1230,9 +1230,9 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
int has_reflist;
hssize_t nelmts;
hid_t sid; /* space ID */
hid_t tid = -1; /* attribute type ID */
hid_t ntid = -1; /* attribute native type ID */
hid_t aid = -1; /* attribute ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t ntid = H5I_INVALID_HID; /* attribute native type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
int rank; /* rank of dataset */
nds_list_t *ndsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
ds_list_t * dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
Expand Down Expand Up @@ -1602,8 +1602,8 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
H5R_ref_t nref; /* reference to the DS */
hobj_ref_t ref; /* reference to the DS */
hid_t sid; /* space ID */
hid_t tid = -1; /* attribute type ID */
hid_t aid = -1; /* attribute ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
hvl_t * buf = NULL; /* VL buffer to store in the attribute */
H5I_type_t it; /* ID type */
herr_t ret_value = 0;
Expand Down Expand Up @@ -1789,9 +1789,9 @@ herr_t
H5DSset_label(hid_t did, unsigned int idx, const char *label)
{
int has_labels;
hid_t sid = -1; /* space ID */
hid_t tid = -1; /* attribute type ID */
hid_t aid = -1; /* attribute ID */
hid_t sid = H5I_INVALID_HID; /* space ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
int rank; /* rank of dataset */
hsize_t dims[1]; /* dimensions of dataset */
H5I_type_t it; /* ID type */
Expand Down Expand Up @@ -1992,9 +1992,9 @@ ssize_t
H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
{
int has_labels;
hid_t sid = -1; /* space ID */
hid_t tid = -1; /* attribute type ID */
hid_t aid = -1; /* attribute ID */
hid_t sid = H5I_INVALID_HID; /* space ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
int rank; /* rank of dataset */
char ** buf = NULL; /* buffer to store in the attribute */
H5I_type_t it; /* ID type */
Expand Down Expand Up @@ -2140,9 +2140,9 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
ssize_t
H5DSget_scale_name(hid_t did, char *name, size_t size)
{
hid_t aid; /* attribute ID */
hid_t tid = -1; /* attribute type ID */
hid_t sid; /* space ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t sid = H5I_INVALID_HID; /* space ID */
H5I_type_t it; /* ID type */
size_t nbytes;
size_t copy_len;
Expand Down Expand Up @@ -2257,13 +2257,13 @@ H5DSget_scale_name(hid_t did, char *name, size_t size)
htri_t
H5DSis_scale(hid_t did)
{
hid_t tid = -1; /* attribute type ID */
hid_t aid = -1; /* attribute ID */
herr_t attr_class; /* has the "CLASS" attribute */
htri_t is_ds = -1; /* set to "not a dimension scale" */
H5I_type_t it; /* type of identifier */
char * buf = NULL; /* buffer to read name of attribute */
size_t string_size; /* size of storage for the attribute */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
herr_t attr_class; /* has the "CLASS" attribute */
htri_t is_ds = -1; /* set to "not a dimension scale" */
H5I_type_t it; /* type of identifier */
char * buf = NULL; /* buffer to read name of attribute */
size_t string_size; /* size of storage for the attribute */
H5T_class_t type_class;
H5T_str_t strpad;

Expand Down Expand Up @@ -2371,12 +2371,12 @@ int
H5DSget_num_scales(hid_t did, unsigned int idx)
{
int has_dimlist;
hid_t sid; /* space ID */
hid_t tid = -1; /* attribute type ID */
hid_t aid = -1; /* attribute ID */
int rank; /* rank of dataset */
hvl_t * buf = NULL; /* VL buffer to store in the attribute */
H5I_type_t it; /* ID type */
hid_t sid; /* space ID */
hid_t tid = H5I_INVALID_HID; /* attribute type ID */
hid_t aid = H5I_INVALID_HID; /* attribute ID */
int rank; /* rank of dataset */
hvl_t * buf = NULL; /* VL buffer to store in the attribute */
H5I_type_t it; /* ID type */
int nscales;

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -2489,8 +2489,8 @@ static herr_t
H5DS_is_reserved(hid_t did)
{
int has_class;
hid_t tid = -1;
hid_t aid = -1;
hid_t tid = H5I_INVALID_HID;
hid_t aid = H5I_INVALID_HID;
char * buf = NULL; /* Name of attribute */
size_t string_size; /* Size of storage for attribute */
herr_t ret;
Expand Down

0 comments on commit 1e61bfb

Please sign in to comment.