Skip to content

Commit

Permalink
Sync high-level library with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins committed Jul 27, 2023
1 parent 0e82707 commit 8ecc61b
Show file tree
Hide file tree
Showing 30 changed files with 835 additions and 840 deletions.
6 changes: 3 additions & 3 deletions hl/src/H5DO.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
hsize_t *boundary = NULL; /* Boundary set in append flush property */
H5D_append_cb_t append_cb; /* Callback function set in append flush property */
void *udata; /* User data set in append flush property */
hbool_t hit = FALSE; /* Boundary is hit or not */
bool hit = false; /* Boundary is hit or not */
hsize_t k; /* Local index variable */
unsigned u; /* Local index variable */
herr_t ret_value = FAIL; /* Return value */
Expand All @@ -129,7 +129,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t

/* If the user passed in a default DXPL, sanity check it */
if (H5P_DEFAULT != dxpl_id)
if (TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
if (true != H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
goto done;

/* Get the dataspace of the dataset */
Expand Down Expand Up @@ -209,7 +209,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
/* Determine whether a boundary is hit or not */
for (k = start[axis]; k < size[axis]; k++)
if (!((k + 1) % boundary[axis])) {
hit = TRUE;
hit = true;
break;
}

Expand Down
72 changes: 36 additions & 36 deletions hl/src/H5DS.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "H5TBprivate.h"

/* Local routines */
static herr_t H5DS_is_reserved(hid_t did, hbool_t *is_reserved);
static herr_t H5DS_is_reserved(hid_t did, bool *is_reserved);

/*-------------------------------------------------------------------------
* Function: H5DSwith_new_ref
Expand All @@ -34,8 +34,8 @@ static herr_t H5DS_is_reserved(hid_t did, hbool_t *is_reserved);
herr_t
H5DSwith_new_ref(hid_t obj_id, hbool_t *with_new_ref)
{
hbool_t config_flag = FALSE;
hbool_t native = FALSE;
bool config_flag = false;
bool native = false;

if (!with_new_ref)
return FAIL;
Expand All @@ -44,7 +44,7 @@ H5DSwith_new_ref(hid_t obj_id, hbool_t *with_new_ref)
return FAIL;

#ifdef H5_DIMENSION_SCALES_WITH_NEW_REF
config_flag = TRUE;
config_flag = true;
#endif

*with_new_ref = (config_flag || !native);
Expand Down Expand Up @@ -144,16 +144,16 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
ds_list_t *dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
ds_list_t *dsbuf_w =
NULL; /* array of "REFERENCE_LIST" attribute data to write when adding new reference to a dataset */
hobj_ref_t ref_to_ds; /* reference to the DS */
hobj_ref_t ref_j; /* iterator reference */
hobj_ref_t ref_to_ds = HADDR_UNDEF; /* reference to the DS */
hobj_ref_t ref_j; /* iterator reference */

/* Variables to be used when new references are used */
nds_list_t ndsl;
nds_list_t *ndsbuf = NULL;
nds_list_t *ndsbuf_w = NULL;
H5R_ref_t nref_to_ds;
nds_list_t *ndsbuf = NULL;
nds_list_t *ndsbuf_w = NULL;
H5R_ref_t nref_to_ds = {0};
H5R_ref_t nref_j;
hbool_t is_new_ref;
bool is_new_ref;

hvl_t *buf = NULL; /* VL buffer to store in the attribute */
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
Expand All @@ -163,7 +163,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
size_t len;
int found_ds = 0;
htri_t is_scale;
hbool_t is_reserved;
bool is_reserved;

/*-------------------------------------------------------------------------
* parameter checking
Expand Down Expand Up @@ -219,7 +219,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
/* Check if the dataset is a "reserved" dataset (image, table) */
if (H5DS_is_reserved(did, &is_reserved) < 0)
return FAIL;
if (is_reserved == TRUE)
if (is_reserved == true)
return FAIL;

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -689,7 +689,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
H5Tclose(ntid);
H5Tclose(tid);
}
H5E_END_TRY;
H5E_END_TRY
return FAIL;
}

Expand Down Expand Up @@ -742,7 +742,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
int found_dset = 0, found_ds = 0;
int have_ds = 0;
htri_t is_scale;
hbool_t is_new_ref;
bool is_new_ref;
unsigned int tmp_idx;
hid_t tmp_id;

Expand Down Expand Up @@ -1186,7 +1186,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
buf = NULL;
}
}
H5E_END_TRY;
H5E_END_TRY
return FAIL;
}

Expand Down Expand Up @@ -1231,7 +1231,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
int i;
int found_dset = 0, found_ds = 0;
htri_t is_scale;
hbool_t is_new_ref;
bool is_new_ref;

/*-------------------------------------------------------------------------
* parameter checking
Expand Down Expand Up @@ -1522,7 +1522,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
H5Tclose(tid);
H5Tclose(ntid);
}
H5E_END_TRY;
H5E_END_TRY

if (buf) {
free(buf);
Expand Down Expand Up @@ -1591,7 +1591,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
int nscales;
htri_t has_dimlist;
int i;
hbool_t is_new_ref;
bool is_new_ref;

/*-------------------------------------------------------------------------
* parameter checking
Expand Down Expand Up @@ -1680,7 +1680,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
if ((scale_id = H5Ropen_object(&nref, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
}
H5E_END_TRY;
H5E_END_TRY
}
else {
/* get the reference */
Expand All @@ -1693,7 +1693,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
if ((scale_id = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &ref)) < 0)
goto out;
}
H5E_END_TRY;
H5E_END_TRY
}

/* set the return IDX OUT value at current scale index */
Expand Down Expand Up @@ -1745,7 +1745,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
H5Aclose(aid);
H5Tclose(tid);
}
H5E_END_TRY;
H5E_END_TRY

return FAIL;
}
Expand Down Expand Up @@ -1941,7 +1941,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label)
H5Aclose(aid);
H5Tclose(tid);
}
H5E_END_TRY;
H5E_END_TRY
return FAIL;
}

Expand Down Expand Up @@ -2038,7 +2038,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
/* do only if the label name exists for the dimension */
if (buf[idx] != NULL) {
/* get the real string length */
nbytes = HDstrlen(buf[idx]);
nbytes = strlen(buf[idx]);

/* compute the string length which will fit into the user's buffer */
copy_len = MIN(size - 1, nbytes);
Expand Down Expand Up @@ -2085,7 +2085,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
H5Aclose(aid);
H5Tclose(tid);
}
H5E_END_TRY;
H5E_END_TRY
return FAIL;
}

Expand Down Expand Up @@ -2199,7 +2199,7 @@ H5DSget_scale_name(hid_t did, char *name, size_t size)
H5Tclose(tid);
H5Sclose(sid);
}
H5E_END_TRY;
H5E_END_TRY
if (buf)
free(buf);
return FAIL;
Expand Down Expand Up @@ -2288,7 +2288,7 @@ H5DSis_scale(hid_t did)
goto out;

/* compare strings */
if (HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS), HDstrlen(buf))) == 0)
if (strncmp(buf, DIMENSION_SCALE_CLASS, MIN(strlen(DIMENSION_SCALE_CLASS), strlen(buf))) == 0)
is_ds = 1;

free(buf);
Expand All @@ -2307,7 +2307,7 @@ H5DSis_scale(hid_t did)
H5Aclose(aid);
H5Tclose(tid);
}
H5E_END_TRY;
H5E_END_TRY
}
return is_ds;
}
Expand Down Expand Up @@ -2420,7 +2420,7 @@ H5DSget_num_scales(hid_t did, unsigned int idx)
H5Aclose(aid);
H5Tclose(tid);
}
H5E_END_TRY;
H5E_END_TRY

if (buf)
free(buf);
Expand All @@ -2438,7 +2438,7 @@ H5DSget_num_scales(hid_t did, unsigned int idx)
*-------------------------------------------------------------------------
*/
static herr_t
H5DS_is_reserved(hid_t did, hbool_t *is_reserved)
H5DS_is_reserved(hid_t did, bool *is_reserved)
{
htri_t has_class;
hid_t tid = H5I_INVALID_HID;
Expand All @@ -2450,7 +2450,7 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved)
if ((has_class = H5Aexists(did, "CLASS")) < 0)
return FAIL;
if (has_class == 0) {
*is_reserved = FALSE;
*is_reserved = false;
return SUCCEED;
}

Expand All @@ -2477,12 +2477,12 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved)
if (H5Aread(aid, tid, buf) < 0)
goto error;

if (HDstrncmp(buf, IMAGE_CLASS, MIN(HDstrlen(IMAGE_CLASS), HDstrlen(buf))) == 0 ||
HDstrncmp(buf, PALETTE_CLASS, MIN(HDstrlen(PALETTE_CLASS), HDstrlen(buf))) == 0 ||
HDstrncmp(buf, TABLE_CLASS, MIN(HDstrlen(TABLE_CLASS), HDstrlen(buf))) == 0)
*is_reserved = TRUE;
if (strncmp(buf, IMAGE_CLASS, MIN(strlen(IMAGE_CLASS), strlen(buf))) == 0 ||
strncmp(buf, PALETTE_CLASS, MIN(strlen(PALETTE_CLASS), strlen(buf))) == 0 ||
strncmp(buf, TABLE_CLASS, MIN(strlen(TABLE_CLASS), strlen(buf))) == 0)
*is_reserved = true;
else
*is_reserved = FALSE;
*is_reserved = false;

free(buf);

Expand All @@ -2499,7 +2499,7 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved)
H5Tclose(tid);
H5Aclose(aid);
}
H5E_END_TRY;
H5E_END_TRY

free(buf);

Expand Down
14 changes: 7 additions & 7 deletions hl/src/H5IM.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ H5IMmake_image_24bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t

/* Initialize the image dimensions */

if (HDstrncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
if (strncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
/* Number of color planes is defined as the third dimension */
dims[0] = height;
dims[1] = width;
dims[2] = IMAGE24_RANK;
}
else if (HDstrncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
else if (strncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
/* Number of color planes is defined as the first dimension */
dims[0] = IMAGE24_RANK;
dims[1] = height;
Expand Down Expand Up @@ -158,7 +158,7 @@ find_palette(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
*/
if (HDstrncmp(name, "PALETTE", 7) == 0)
if (strncmp(name, "PALETTE", 7) == 0)
ret = H5_ITER_STOP;

return ret;
Expand Down Expand Up @@ -261,13 +261,13 @@ H5IMget_image_info(hid_t loc_id, const char *dset_name, hsize_t *width, hsize_t
if (has_attr > 0) {
/* This is a 24 bit image */

if (HDstrncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
if (strncmp(interlace, "INTERLACE_PIXEL", 15) == 0) {
/* Number of color planes is defined as the third dimension */
*height = dims[0];
*width = dims[1];
*planes = dims[2];
}
else if (HDstrncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
else if (strncmp(interlace, "INTERLACE_PLANE", 15) == 0) {
/* Number of color planes is defined as the first dimension */
*planes = dims[0];
*height = dims[1];
Expand Down Expand Up @@ -1036,7 +1036,7 @@ H5IMis_image(hid_t loc_id, const char *dset_name)
if (H5Aread(aid, atid, attr_data) < 0)
goto out;

if (HDstrncmp(attr_data, IMAGE_CLASS, MIN(HDstrlen(IMAGE_CLASS), HDstrlen(attr_data))) == 0)
if (strncmp(attr_data, IMAGE_CLASS, MIN(strlen(IMAGE_CLASS), strlen(attr_data))) == 0)
ret = 1;
else
ret = 0;
Expand Down Expand Up @@ -1131,7 +1131,7 @@ H5IMis_palette(hid_t loc_id, const char *dset_name)
if (H5Aread(aid, atid, attr_data) < 0)
goto out;

if (HDstrncmp(attr_data, PALETTE_CLASS, MIN(HDstrlen(PALETTE_CLASS), HDstrlen(attr_data))) == 0)
if (strncmp(attr_data, PALETTE_CLASS, MIN(strlen(PALETTE_CLASS), strlen(attr_data))) == 0)
ret = 1;
else
ret = 0;
Expand Down
Loading

0 comments on commit 8ecc61b

Please sign in to comment.