Skip to content

Commit

Permalink
Invert a few checks to avoid function call
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF committed Mar 27, 2024
1 parent 51069ed commit 8d1fa8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/H5Dint.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,8 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header");

/* Check for creating dataset with unusual datatype */
if (H5T_is_numeric_with_unusual_unused_bits(type) &&
!(H5O_has_chksum(oh) || (H5F_RFIC_FLAGS(file) & H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS)))
if (!(H5O_has_chksum(oh) || (H5F_RFIC_FLAGS(file) & H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS)) &&
H5T_is_numeric_with_unusual_unused_bits(type))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
"creating dataset with unusual datatype, see documentation for "
"H5Pset_relax_file_integrity_checks for details.");
Expand Down
4 changes: 2 additions & 2 deletions src/H5Oattribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr)
HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header");

/* Check for creating attribute with unusual datatype */
if (H5T_is_numeric_with_unusual_unused_bits(attr->shared->dt) &&
!(H5O_has_chksum(oh) || (H5F_RFIC_FLAGS(loc->file) & H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS)))
if (!(H5O_has_chksum(oh) || (H5F_RFIC_FLAGS(loc->file) & H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS)) &&
H5T_is_numeric_with_unusual_unused_bits(attr->shared->dt))
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL,
"creating attribute with unusual datatype, see documentation for "
"H5Pset_relax_file_integrity_checks for details.");
Expand Down
4 changes: 2 additions & 2 deletions src/H5Tcommit.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id)
HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header");

/* Check for creating committed datatype with unusual datatype */
if (H5T_is_numeric_with_unusual_unused_bits(type) &&
!(H5O_has_chksum(oh) || (H5F_RFIC_FLAGS(file) & H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS)))
if (!(H5O_has_chksum(oh) || (H5F_RFIC_FLAGS(file) & H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS)) &&
H5T_is_numeric_with_unusual_unused_bits(type))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"creating committed datatype with unusual datatype, see documentation for "
"H5Pset_relax_file_integrity_checks for details.");
Expand Down

0 comments on commit 8d1fa8f

Please sign in to comment.