summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-03-12 18:00:15 (GMT)
committerGitHub <noreply@github.com>2021-03-12 18:00:15 (GMT)
commita09e1ea2191ad0ea2a72f7bd519b2cc95f218328 (patch)
tree7b41ca2a3fe29309e39db5ea13d1708c2c0ca69a /src
parent579b266e65974fad1f7c30ac5c7c24405e2d326e (diff)
downloadhdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.zip
hdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.tar.gz
hdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.tar.bz2
Hdf5 merge issue #458 to hdf5_1_12 (#463)
* Snapshot version 1.12 release 1-3. Update version to 1.12.1-4. * First cut of the H5 public API documentation. (#80) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Full set of current H5F documentation. (#105) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Migrated documentation for SWMR functions. * Catching up on MDC functions. * Integrated the H5F MDC function documentation. * Added MDC and parallel H5F functions. * Slightly updated main page. * Added doxygen/dox/H5AC_cache_config_t.dox to MANIFEST. * Doxygen - added (mostly) beginner functions (#112) * Doxygen - added (mostly) beginner functions * Removed duplicate H5Pset_szip function * Add src/H5module.h to MANIFEST. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Avoid aligned access for references by decoding into temporary buffer and then copying the result into the actual buffer. Update test to be more thorough with using compound datatype fields everywhere. (#206) * Modify temporary rpath for testing in java example scripts. (#230) * Fix undefined left shifting of negative numbers (#338) Undefined Bahavior Sanitizer errored here about left shifting negative numbers. * Fixes various warnings noticed on Windows (#425) * Fixes various warnings noticed on Windows - Adds a prototype for our implementation of vasprintf - Return type of H5_get_utf16_str() is now non-const - Fixes possible uninitialized return type in Wremove_utf8 - Better isolation of fork() code in accum.c:test_swmr_write_big() - Better isolation of non-zlib code in dsets.c:test_filter_delete() - Removed unused variable in trefer.c:test_reference_cmpnd_obj() * Fixes clang-format issues * Applied clang-tidy readability-non-const-parameter warning fixes auto… (#429) * Automatically applied clang-tidy readability-avoid-const-params-in-decls fixes Removes useless const declarations. * Fixed most readability-non-const-parameter warnings These changes were made automatically by clang-tidy, but I manually reverted the changes related to the H5Z_func_t signature. * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Added C++11 override keyword where appropriate (#433) Added H5_OVERRIDE macro for compatibility with both C++11 and older. * Various clang tidy warning fixes (#448) * Fixed clang-tidy bugprone-reserved-identifier warnings * Fixed clang-tidy bugprone-assert-side-effect warnings * Fixed clang-tidy bugprone-copy-constructor-init warning * Fixed clang-tidy readability-redundant-preprocessor warning For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block. Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing. Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS. * Fixed clang-tidy readability-redundant-string-init warnings * Fixed some clang-tidy performance-type-promotion-in-math-fn warnings * Fixed clang-tidy performance-unnecessary-value-param warnings * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Removed checks/workarounds for pre-C++89 compatibility (#449) After 30+ years, just assume that the following exist: - extension-less includes - namespaces - std:: - static_cast - bool * Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451) * Fixed all clang-tidy bugprone-suspicious-string-compare warnings This change was generated entirely by clang-tidy itself. * Reformat code with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Remove 2 functions incorrectly merged from develop in a cherry-pick merge of PR #451. Co-authored-by: Gerd Heber <gheber@hdfgroup.org> Co-authored-by: bljhdf <58825073+bljhdf@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Quincey Koziol <quincey@koziol.cc> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/H5.c2
-rw-r--r--src/H5Aint.c2
-rw-r--r--src/H5B2cache.c6
-rw-r--r--src/H5Bcache.c2
-rw-r--r--src/H5Cimage.c2
-rw-r--r--src/H5Dchunk.c2
-rw-r--r--src/H5Dpkg.h3
-rw-r--r--src/H5Dvirtual.c2
-rw-r--r--src/H5EAcache.c8
-rw-r--r--src/H5Eint.c4
-rw-r--r--src/H5FAcache.c4
-rw-r--r--src/H5FD.c4
-rw-r--r--src/H5FDmulti.c2
-rw-r--r--src/H5FScache.c4
-rw-r--r--src/H5Gcache.c2
-rw-r--r--src/H5HFcache.c6
-rw-r--r--src/H5HGcache.c2
-rw-r--r--src/H5HLcache.c2
-rw-r--r--src/H5Ocache.c2
-rw-r--r--src/H5SMcache.c4
-rw-r--r--src/H5T.c4
-rw-r--r--src/H5Tbit.c2
-rw-r--r--src/H5Tconv.c6
-rw-r--r--src/H5Tpkg.h3
-rw-r--r--src/H5Znbit.c36
-rw-r--r--src/H5Zscaleoffset.c18
-rw-r--r--src/H5Ztrans.c3
27 files changed, 70 insertions, 67 deletions
diff --git a/src/H5.c b/src/H5.c
index 35bfdaf..572e5e5 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -920,7 +920,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
HDstrncat(lib_str, "-", (size_t)1);
HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1);
} /* end if */
- if (HDstrcmp(lib_str, H5_lib_vers_info_g)) {
+ if (HDstrcmp(lib_str, H5_lib_vers_info_g) != 0) {
HDfputs("Warning! Library version information error.\n"
"The HDF5 library version information are not "
"consistent in its source code.\nThis is NOT a fatal error "
diff --git a/src/H5Aint.c b/src/H5Aint.c
index 0da88e1..0609f24 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -2496,7 +2496,7 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na
FUNC_ENTER_PACKAGE
/* Avoid thrashing things if the names are the same */
- if (HDstrcmp(old_attr_name, new_attr_name)) {
+ if (HDstrcmp(old_attr_name, new_attr_name) != 0) {
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
obj_loc.path = &obj_path;
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index d70816d..e333d61 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -250,7 +250,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header")
/* Magic number */
- if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree header signature")
image += H5_SIZEOF_MAGIC;
@@ -648,7 +648,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
internal->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
- if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node signature")
image += H5_SIZEOF_MAGIC;
@@ -1064,7 +1064,7 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
leaf->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
- if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index 6ccdc11..ec7457f 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -166,7 +166,7 @@ H5B__cache_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_uda
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate buffer for child addresses")
/* magic number */
- if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Cimage.c b/src/H5Cimage.c
index b366a94..20d3b4d 100644
--- a/src/H5Cimage.c
+++ b/src/H5Cimage.c
@@ -1773,7 +1773,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t *
p = *buf;
/* Check signature */
- if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN))
+ if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN) != 0)
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad metadata cache image header signature")
p += H5C__MDCI_BLOCK_SIGNATURE_LEN;
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index b5009d1..67c92ca 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -4258,7 +4258,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[])
+H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, const hsize_t old_dim[])
{
const H5D_t * dset = io_info->dset; /* the dataset pointer */
H5D_chk_idx_info_t idx_info; /* Chunked index info */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 61b1a87..64f2c7a 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -631,7 +631,8 @@ H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage);
H5_DLL hbool_t H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset);
H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata);
H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes);
-H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]);
+H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite,
+ const hsize_t old_dim[]);
H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk,
H5F_block_t *new_chunk, hbool_t *need_insert, const hsize_t *scaled);
H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]);
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index f2489ac..beee8c6 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -895,7 +895,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *vir
HDassert(source_dset->dset_name);
/* Check if we need to open the source file */
- if (HDstrcmp(source_dset->file_name, ".")) {
+ if (HDstrcmp(source_dset->file_name, ".") != 0) {
unsigned intent; /* File access permissions */
/* Get the virtual dataset's file open flags ("intent") */
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index 550627e..2a3153c 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -307,7 +307,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
hdr->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array header signature")
image += H5_SIZEOF_MAGIC;
@@ -697,7 +697,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
iblock->addr = hdr->idx_blk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array index block signature")
image += H5_SIZEOF_MAGIC;
@@ -1100,7 +1100,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
sblock->addr = udata->sblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array super block signature")
image += H5_SIZEOF_MAGIC;
@@ -1510,7 +1510,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
dblock->addr = udata->dblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array data block signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Eint.c b/src/H5Eint.c
index 7e46beb..3fd4099 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -218,7 +218,7 @@ H5E__walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
cls_ptr = maj_ptr->cls;
/* Print error class header if new class */
- if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) {
+ if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) {
/* update to the new class information */
if (cls_ptr->cls_name)
eprint->cls.cls_name = cls_ptr->cls_name;
@@ -346,7 +346,7 @@ H5E__walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
HGOTO_DONE(FAIL)
/* Print error class header if new class */
- if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) {
+ if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) {
/* update to the new class information */
if (cls_ptr->cls_name)
eprint->cls.cls_name = cls_ptr->cls_name;
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 4e6c57d..1b127c7 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -252,7 +252,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
hdr->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong fixed array header signature")
image += H5_SIZEOF_MAGIC;
@@ -637,7 +637,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
dblock->addr = udata->dblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong fixed array data block signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5FD.c b/src/H5FD.c
index 877334e..8757ce8 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -496,9 +496,9 @@ H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf)
/* Check if driver matches driver information saved. Unfortunately, we can't push this
* function to each specific driver because we're checking if the driver is correct.
*/
- if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family"))
+ if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family") != 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "family driver should be used")
- if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi"))
+ if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi") != 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "multi driver should be used")
/* Decode driver information */
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index a024ace..7f65f11 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -731,7 +731,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
H5Eclear2(H5E_DEFAULT);
/* Make sure the name/version number is correct */
- if (strcmp(name, "NCSAmult"))
+ if (strcmp(name, "NCSAmult") != 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1);
/* Set default values */
diff --git a/src/H5FScache.c b/src/H5FScache.c
index 4212794..39f0333 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -248,7 +248,7 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len
fspace->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header signature")
image += H5_SIZEOF_MAGIC;
@@ -988,7 +988,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l
H5_CHECKED_ASSIGN(old_sect_size, size_t, fspace->sect_size, hsize_t);
/* Magic number */
- if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index eac7545..4713193 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -176,7 +176,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, hbool_
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* magic */
- if (HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, NULL, "bad symbol table node signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 7d29ede..fde5a4f 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -209,7 +209,7 @@ H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref)
HDassert(image);
/* Magic number */
- if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "wrong fractal heap header signature")
image += H5_SIZEOF_MAGIC;
@@ -992,7 +992,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
HDassert(iblock->size == len);
/* Magic number */
- if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap indirect block signature")
image += H5_SIZEOF_MAGIC;
@@ -1831,7 +1831,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo
image = dblock->blk;
/* Magic number */
- if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap direct block signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index e0e1f2e..379e6f6 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -122,7 +122,7 @@ H5HG__hdr_deserialize(H5HG_heap_t *heap, const uint8_t *image, const H5F_t *f)
HDassert(f);
/* Magic number */
- if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad global heap collection signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 05a45f1..b46280e 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -161,7 +161,7 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, H5HL_cache_prfx_ud_t *
HDassert(udata);
/* Check magic number */
- if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad local heap signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index a903cc1..62dc2f2 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -1335,7 +1335,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image
/* Check for magic # on chunks > 0 in later versions of the format */
else if (chunkno > 0 && oh->version > H5O_VERSION_1) {
/* Magic number */
- if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "wrong object header chunk signature")
chunk_image += H5_SIZEOF_MAGIC;
} /* end if */
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 8a4c155..2ad467f 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -238,7 +238,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l
HDassert(table->table_size == len);
/* Check magic number */
- if (HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM table signature")
image += H5_SIZEOF_MAGIC;
@@ -580,7 +580,7 @@ H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED le
list->header = udata->header;
/* Check magic number */
- if (HDmemcmp(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM list signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5T.c b/src/H5T.c
index b48011a..de2a100 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -2771,7 +2771,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c
for (i = H5T_g.nsoft - 1; i >= 0; --i) {
soft = H5T_g.soft + i;
HDassert(soft);
- if (name && *name && HDstrcmp(name, soft->name))
+ if (name && *name && HDstrcmp(name, soft->name) != 0)
continue;
if (src && src->shared->type != soft->src)
continue;
@@ -2793,7 +2793,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c
/* Not a match */
if (((H5T_PERS_SOFT == pers && path->is_hard) || (H5T_PERS_HARD == pers && !path->is_hard)) ||
- (name && *name && HDstrcmp(name, path->name)) || (src && H5T_cmp(src, path->src, FALSE)) ||
+ (name && *name && HDstrcmp(name, path->name) != 0) || (src && H5T_cmp(src, path->src, FALSE)) ||
(dst && H5T_cmp(dst, path->dst, FALSE)) || (func && func != path->conv.u.app_func)) {
/*
* Notify all other functions to recalculate private data since some
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index c35a530..e2ca4b9 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -388,7 +388,7 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value)
*-------------------------------------------------------------------------
*/
ssize_t
-H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value)
+H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value)
{
ssize_t base = (ssize_t)offset;
ssize_t idx, i;
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 60ad627..7b5fce1 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -2699,7 +2699,7 @@ H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
for (i = 0, j = 0; i < src->shared->u.enumer.nmembs && j < dst->shared->u.enumer.nmembs; i++, j++) {
while (j < dst->shared->u.enumer.nmembs &&
- HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]))
+ HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]) != 0)
j++;
if (j >= dst->shared->u.enumer.nmembs)
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
@@ -8477,7 +8477,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
/* Allocate enough space for the buffer holding temporary
* converted value
*/
- buf_size = (size_t)(HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1);
+ buf_size = (size_t)(HDpow(2.0, (double)src.u.f.esize) / 8 + 1);
int_buf = (uint8_t *)H5MM_calloc(buf_size);
/* Get conversion exception callback property */
@@ -9315,7 +9315,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
}
/* Check if the exponent is too big */
- expo_max = (hsize_t)(HDpow((double)2.0f, (double)dst.u.f.esize) - 1);
+ expo_max = (hsize_t)(HDpow(2.0, (double)dst.u.f.esize) - 1);
if (expo > expo_max) { /*overflows*/
if (cb_struct.func) { /*user's exception handler. Reverse back source order*/
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 0fe4f50..51ecaca 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -852,7 +852,8 @@ H5_DLL herr_t H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset,
H5_DLL void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value);
H5_DLL uint64_t H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size);
H5_DLL void H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val);
-H5_DLL ssize_t H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value);
+H5_DLL ssize_t H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction,
+ hbool_t value);
H5_DLL hbool_t H5T__bit_inc(uint8_t *buf, size_t start, size_t size);
H5_DLL hbool_t H5T__bit_dec(uint8_t *buf, size_t start, size_t size);
H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size);
diff --git a/src/H5Znbit.c b/src/H5Znbit.c
index b19e157..795fdce 100644
--- a/src/H5Znbit.c
+++ b/src/H5Znbit.c
@@ -52,17 +52,19 @@ static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index,
static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
hbool_t *need_not_compress);
-static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len);
-static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len);
+static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned end_i, const unsigned char *buffer,
+ size_t *j, size_t *buf_len, const parms_atomic *p,
+ size_t datatype_len);
+static void H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j,
size_t *buf_len, const parms_atomic *p, size_t datatype_len);
-static void H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
- const parms_atomic *p, size_t datatype_len);
-static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, unsigned size);
-static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, const parms_atomic *p);
+static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset,
+ const unsigned char *buffer, size_t *j, size_t *buf_len,
+ unsigned size);
+static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, const parms_atomic *p);
static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
size_t *j, size_t *buf_len, const unsigned parms[],
unsigned *parms_index);
@@ -71,8 +73,8 @@ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data
const unsigned parms[], unsigned *parms_index);
static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
const unsigned parms[]);
-static void H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, unsigned size);
+static void H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset,
+ unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size);
static void H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
size_t *j, size_t *buf_len, const unsigned parms[],
unsigned *parms_index);
@@ -1026,7 +1028,7 @@ H5Z__nbit_next_byte(size_t *j, size_t *buf_len)
static void
H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
+ unsigned end_i, const unsigned char *buffer, size_t *j, size_t *buf_len,
const parms_atomic *p, size_t datatype_len)
{
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
@@ -1075,8 +1077,8 @@ H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned
}
static void
-H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, unsigned size)
+H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, const unsigned char *buffer,
+ size_t *j, size_t *buf_len, unsigned size)
{
unsigned i; /* index */
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
@@ -1341,7 +1343,7 @@ done:
}
static void
-H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
+H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
const parms_atomic *p, size_t datatype_len)
{
@@ -1383,8 +1385,8 @@ H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
}
static void
-H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, unsigned size)
+H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, unsigned size)
{
unsigned i; /* index */
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 9890c13..25acc05 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -73,9 +73,9 @@ static herr_t H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts,
uint32_t minbits, unsigned long long minval, double D_val);
static void H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len);
static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
- unsigned begin_i, unsigned char *buffer, size_t *j,
+ unsigned begin_i, const unsigned char *buffer, size_t *j,
unsigned *buf_len, parms_atomic p, unsigned dtype_len);
-static void H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+static void H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
unsigned begin_i, unsigned char *buffer, size_t *j,
unsigned *buf_len, parms_atomic p, unsigned dtype_len);
static void H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset,
@@ -364,12 +364,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
#define H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \
{ \
i = 0; \
- while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
i++; \
if (i < d_nelmts) \
min = max = buf[i]; \
for (; i < d_nelmts; i++) { \
- if (HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ if (HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
continue; /* ignore fill value */ \
if (buf[i] > max) \
max = buf[i]; \
@@ -1608,8 +1608,8 @@ H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len)
static void
H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p,
- unsigned dtype_len)
+ const unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p, unsigned dtype_len)
{
unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */
unsigned char val; /* value to be copied in each data byte */
@@ -1694,9 +1694,9 @@ H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned cha
}
static void
-H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p,
- unsigned dtype_len)
+H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p, unsigned dtype_len)
{
unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */
unsigned char val; /* value to be copied in each data byte */
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index cea68fb..0224c77 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -90,8 +90,7 @@ static void H5Z__do_op(H5Z_node *tree);
static hbool_t H5Z__op_is_numbs(H5Z_node *_tree);
static hbool_t H5Z__op_is_numbs2(H5Z_node *_tree);
static hid_t H5Z__xform_find_type(const H5T_t *type);
-static herr_t H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type,
- H5Z_result *res);
+static herr_t H5Z__xform_eval_full(H5Z_node *tree, size_t array_size, hid_t array_type, H5Z_result *res);
static void H5Z__xform_destroy_parse_tree(H5Z_node *tree);
static void * H5Z__xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers);
static void * H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers,