summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-05-15 10:33:42 (GMT)
committerGitHub <noreply@github.com>2021-05-15 10:33:42 (GMT)
commitbf4a260b53f435a6ea98f306ff684ae4f354566e (patch)
tree07efdaf87efb0b923dcc9d90a040d2ac944b81bb /src
parent8977e43b7766f4f817fa067b2d22e84b775bf5a2 (diff)
downloadhdf5-bf4a260b53f435a6ea98f306ff684ae4f354566e.zip
hdf5-bf4a260b53f435a6ea98f306ff684ae4f354566e.tar.gz
hdf5-bf4a260b53f435a6ea98f306ff684ae4f354566e.tar.bz2
Merge PRs in issue #642 to hdf5_1_12 (#643)
* 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. * Minor parallel improvements (#519) * Improve MPI error reporting, handled failed operations in parallel tests more nicely, and clean up MPI_Allreduce for determining whether to break collective I/O * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Clean up MPI-IO VFD tracing support (#520) * Clean up tracing support * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Brings the native implementation of H5Fdelete() from Bitbucket (#524) * Committing clang-format changes * Brings the native VFD H5Fdelete() implementation from Bitbucket Only brings the 'del' callbacks, not the 'open/close' scheme. * Formatter changes * Committing clang-format changes * Fixes direct VFD callback name * Removes UNUSED macro from family API call * Adds barrier and rank 0 check to MPI-I/O VFD delete * Revert "Adds barrier and rank 0 check to MPI-I/O VFD delete" This reverts commit 909765f759d9d96e84f4b8b1cc14f7d2b3ac8143. * Revert "Revert "Adds barrier and rank 0 check to MPI-I/O VFD delete"" This reverts commit 9b04bef1157853fc79fcb8fcc3e8ba1371091702. * Adds a second barrier after the delete in MPI-I/O VFD * Only delete files in the core VFD when the backing store flag is set * Fixes string issues in multi VFD Also, h5test.c cleanup code now uses H5Fdelete(). * Formatted source * Rework fapl checks for MPI-I/O VFD delete callback Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Minor warning fixes in develop (#526) * Committing clang-format changes * Minor warning fixes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes implementation of my_strdup() from the multi VFD (#527) * Committing clang-format changes * Removes my_strdup() from the multi VFD * Use strdup directly when memory sanity checks are off Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes dead H5ST package from the library (#528) * Committing clang-format changes * Removes the unused H5ST package from the library Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix HDFFV-11232 (#530) * fixed missed closing of a dataset * fixed missed closing of a dataset * fixed typo in error return * Committing clang-format changes * minor edits * code format * Committing clang-format changes * code format * minor edit * added H5fortkit dependency for H5VLff.F90, HDFFV-11232 Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fixes incorrect usage of H5I_BADID (#554) * Committing clang-format changes * Fixes incorrect use of H5I_BADID Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fixes a segfault when H5Pset_mdc_log_options is called multiple times on a fapl (#601) * Committing clang-format changes * Fixes a segfault when H5Pset_mdc_log_options() is called multiple times An internal string is incorrectly freed when the API call is invoked multiple times on a property list, which will usually cause a segfault to occur. On the first call the log location is NULL so the problem doesn't occur. Fixes HDFFV-11239 * Fixes typos Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix for a segfault when H5Pset_fapl_log is passed an invalid fapl ID (#607) * Committing clang-format changes * Fixes an issue where H5Pset_fapl_log sefaults when passed an invalid fapl ID This was due to a pointer-containing struct being memset after the first internal API call. If the first call failed, the error condition would check if the pointer was not NULL and then attempt to free it if not. This would lead to the freeing of a wild pointer if an invalid fapl ID were passed in. This was fixed by reordering the memset and adding a test to ensure the problem stays fixed. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fixes crashes when size_hint > UINT32_MAX is passed to H5Gcreate1 (#611) * Committing clang-format changes * Fixes incorrect size_hint handling in H5Gcreate1 * Updates the size hint type for group creation * Updates the RELEASE.txt note * Revert "Updates the RELEASE.txt note" This reverts commit 3df386acca806d652bbe2209f7c4503b30f068ff. * Reverts previous behavior to use a uint32_t struct field * Updates RELEASE.txt Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Revert "Brings the native implementation of H5Fdelete() from Bitbucket (#524)" This reverts commit 38d1b121ae428138b8863c2a319518c7363c2d94. * Removed mentions of Wdeclaration-after-statement now that C99 is requ… (#447) * Removed mentions of Wdeclaration-after-statement now that C99 is required * Remove -Werror=declaration-after-statement from error-general file. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Made private my_yyinput function static (#618) This prevents it being exported as a public symbol. * Adds const to a few global variables (#623) * Committing clang-format changes * Adds consts to a few global variables Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * (fix) Segmentation fault when using a compound type. (#143) * (fix) Segmentation fault when using a compound type. In the case when a compounded attribute is written to dataset followed by writing the data with a data transform function to the dataset will result in a segmentation fault. It turns out the data is classified as compounded while it is not. Now, the state is always reset first to not compounded followed by the existing check if the variable is compounded. * (fix) Removed undesired comment lines. * (fix) Segmentation fault when using a compound type: added test. * (fix) Added the missing cmpd_transform.c file to MANIFEST. * (fix) cmpd_dtransform test: autotools and source header. Added the cmp_dtransform test to the autotools configuration and updated the HDF Group copyright header. Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com> * (fix) H5Z_xform_create function and scientific notation (#144) * (fix) H5Z_xform_create function and scientific notation Implemented a more sophisticated check to support scientific notation in the expression of the H5Zset_data_transform function. * (fix) H5Z_xform_create and scientific notation: Added test. Added a test to demonstrate that the parsing of expression which includes scientific notation works correctly. Improved inline comment. Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com> * Committing clang-format changes * Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625) * Cleanup tools debug build warnings (#627) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * Split format source and commit changes on repo push * remove pre-split setting * Change windows TS to use older VS. * correct window os name * HDFFV-11212 JNI export util and Javadoc * Suggested review changes * Another change found * Committing clang-format changes * HDFFV-11113 long double in tools * HDFFV-11113 add note * Disable long double tests for now * HDFFV-11228 remove arbitrary CMake warning groups. * Make each flag a string * Some Javadoc warning fixes * Updated javadoc fixes * # WARNING: head commit changed in the meantime HDFFV-11229 Fix long double usage in tools and java Changed h5dump and h5ls to just print 128-bit for long double type. Added test and file for dataset and attributes with all three float types. * Committing clang-format changes * HDFFV-11229 Add release note * HDFFV-11229 windows testfile needed * fix typo * Remove non supported message text * HDFFV-11229 - change ldouble test to check both native and general * HDFFV-11229 add second file compare * HDFFV-11229 fix reference file * HDFFV-11229 autotools check two refs * HDFFV-11229 revert back to removal of NATIVE_LDOUBLE in tools output * Committing clang-format changes * Update release note * Update attribute type of ref file * Change source of ninja for macs * try port instead of brew * Recommended is to use brew. * Undo non long double changes * remove unneeded file * Fix perl and doxygen CMake code * Add "option" command for clang options * Rework CMake add_custom to use the BYPRODUCTS argument * Add stamp files to BYPRODUCTS * Only one copy of file exists * Fix custom cmmand depends targets * Fix fortran custom command DEPENDS * Add LD_LIBRARY_PATH to tests * Add custom target for DEPENDS * Add h5detect conditionaly to generated target DEPENDS * Correct DEPENDS targets * Parallel builds need the mpi compiler for pkgconfig scripts. * install only if MPI build * Fortran target depends * Remove incorrect source attribute * doxygen adjustments * doxygen build updates * Correct version * Correct function version - function has been merged to 1.12 * Correct version string for map functions * Cleanup warnings for tools debug builds Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * h5diff subset indexing (#628) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * Split format source and commit changes on repo push * remove pre-split setting * Change windows TS to use older VS. * correct window os name * HDFFV-11212 JNI export util and Javadoc * Suggested review changes * Another change found * Committing clang-format changes * HDFFV-11113 long double in tools * HDFFV-11113 add note * Disable long double tests for now * HDFFV-11228 remove arbitrary CMake warning groups. * Make each flag a string * Some Javadoc warning fixes * Updated javadoc fixes * # WARNING: head commit changed in the meantime HDFFV-11229 Fix long double usage in tools and java Changed h5dump and h5ls to just print 128-bit for long double type. Added test and file for dataset and attributes with all three float types. * Committing clang-format changes * HDFFV-11229 Add release note * HDFFV-11229 windows testfile needed * fix typo * Remove non supported message text * HDFFV-11229 - change ldouble test to check both native and general * HDFFV-11229 add second file compare * HDFFV-11229 fix reference file * HDFFV-11229 autotools check two refs * HDFFV-11229 revert back to removal of NATIVE_LDOUBLE in tools output * Committing clang-format changes * Update release note * Update attribute type of ref file * Change source of ninja for macs * try port instead of brew * Recommended is to use brew. * Undo non long double changes * remove unneeded file * Fix perl and doxygen CMake code * Add "option" command for clang options * Rework CMake add_custom to use the BYPRODUCTS argument * Add stamp files to BYPRODUCTS * Only one copy of file exists * Fix custom cmmand depends targets * Fix fortran custom command DEPENDS * Add LD_LIBRARY_PATH to tests * Add custom target for DEPENDS * Add h5detect conditionaly to generated target DEPENDS * Correct DEPENDS targets * Parallel builds need the mpi compiler for pkgconfig scripts. * install only if MPI build * Fortran target depends * Remove incorrect source attribute * doxygen adjustments * doxygen build updates * Correct version * Correct function version - function has been merged to 1.12 * Correct version string for map functions * Cleanup warnings for tools debug builds * TRILAB-227 - fix indexing for h5diff selections * Correct location of pos to index function call Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Removes gratuitous (double)x.yF casts (#632) * Committing clang-format changes * Removes gratuitous (double)x.yF casts * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Cleans up a const warning left over from previous constification (#633) * Committing clang-format changes * Adds consts to a few global variables * Cleans up a const warning left over from previous constification Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Purges UFAIL from the library (#637) * Committing clang-format changes * Purges UFAIL from the library * H5HL_insert change requested in PR Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Bmr dev hdffv 11223 (#640) * Fixed HDFFV-11223 (CVE-2018-14460) Description - Added checks against buffer size to prevent segfault, in case of data corruption, for sdim->size and sdim->max. - Renamed data files in an existing test to shorten their length as agreed with other developers previously. Platforms tested: Linux/64 (jelly) * Committing clang-format changes * Updated for test files * Updated for HDFFV-11223 Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Revert "Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625)" This reverts commit 7a682862846fa206aa3a0151c0aa08d7c759b1f7. 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> Co-authored-by: Quincey Koziol <koziol@lbl.gov> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org> Co-authored-by: Jan-Willem Blokland <J.W.S.Blokland@XS4All.nl> Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com> Co-authored-by: jhendersonHDF <jhenderson@hdfgroup.org> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/H5C.c49
-rw-r--r--src/H5Cdbg.c23
-rw-r--r--src/H5Cimage.c9
-rw-r--r--src/H5Clog.h8
-rw-r--r--src/H5Cprivate.h16
-rw-r--r--src/H5Dchunk.c6
-rw-r--r--src/H5Dearray.c16
-rw-r--r--src/H5Dlayout.c17
-rw-r--r--src/H5Gent.c13
-rw-r--r--src/H5Gstab.c5
-rw-r--r--src/H5HFdbg.c2
-rw-r--r--src/H5HL.c42
-rw-r--r--src/H5HLdbg.c2
-rw-r--r--src/H5HLprivate.h2
-rw-r--r--src/H5Oefl.c8
-rw-r--r--src/H5Osdspace.c23
-rw-r--r--src/H5Pdapl.c2
-rw-r--r--src/H5Pdxpl.c5
-rw-r--r--src/H5Pfapl.c2
-rw-r--r--src/H5SM.c59
-rw-r--r--src/H5Smpio.c3
-rw-r--r--src/H5T.c4
-rw-r--r--src/H5Tbit.c9
-rw-r--r--src/H5VM.c386
-rw-r--r--src/H5VMprivate.h2
-rw-r--r--src/H5Zdeflate.c2
-rw-r--r--src/H5Zscaleoffset.c2
-rw-r--r--src/H5private.h1
-rw-r--r--src/H5timer.c40
-rw-r--r--src/H5trace.c2
30 files changed, 368 insertions, 392 deletions
diff --git a/src/H5C.c b/src/H5C.c
index ea11114..185b421 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -445,17 +445,17 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id,
(cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT;
(cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off;
- (cache_ptr->resize_ctl).flash_multiple = (double)1.0f;
- (cache_ptr->resize_ctl).flash_threshold = (double)0.25f;
+ (cache_ptr->resize_ctl).flash_multiple = 1.0;
+ (cache_ptr->resize_ctl).flash_threshold = 0.25;
(cache_ptr->resize_ctl).decr_mode = H5C_decr__off;
- (cache_ptr->resize_ctl).upper_hr_threshold = (double)H5C__DEF_AR_UPPER_THRESHHOLD;
- (cache_ptr->resize_ctl).decrement = (double)H5C__DEF_AR_DECREMENT;
+ (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD;
+ (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT;
(cache_ptr->resize_ctl).apply_max_decrement = TRUE;
(cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT;
(cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT;
(cache_ptr->resize_ctl).apply_empty_reserve = TRUE;
- (cache_ptr->resize_ctl).empty_reserve = (double)H5C__DEF_AR_EMPTY_RESERVE;
+ (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE;
cache_ptr->epoch_markers_active = 0;
@@ -2705,7 +2705,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p
break;
case H5C_incr__threshold:
- if ((config_ptr->lower_hr_threshold <= (double)0.0f) || (config_ptr->increment <= (double)1.0f) ||
+ if ((config_ptr->lower_hr_threshold <= 0.0) || (config_ptr->increment <= 1.0) ||
((config_ptr->apply_max_increment) && (config_ptr->max_increment <= 0)))
cache_ptr->size_increase_possible = FALSE;
break;
@@ -2725,21 +2725,21 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p
break;
case H5C_decr__threshold:
- if ((config_ptr->upper_hr_threshold >= (double)1.0f) || (config_ptr->decrement >= (double)1.0f) ||
+ if ((config_ptr->upper_hr_threshold >= 1.0) || (config_ptr->decrement >= 1.0) ||
((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)))
cache_ptr->size_decrease_possible = FALSE;
break;
case H5C_decr__age_out:
- if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) ||
+ if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) ||
((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)))
cache_ptr->size_decrease_possible = FALSE;
break;
case H5C_decr__age_out_with_threshold:
- if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= (double)1.0f)) ||
+ if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) ||
((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)) ||
- (config_ptr->upper_hr_threshold >= (double)1.0f))
+ (config_ptr->upper_hr_threshold >= 1.0))
cache_ptr->size_decrease_possible = FALSE;
break;
@@ -3720,8 +3720,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"initial_size must be in the interval [min_size, max_size]")
- if ((config_ptr->min_clean_fraction < (double)0.0f) ||
- (config_ptr->min_clean_fraction > (double)1.0f))
+ if ((config_ptr->min_clean_fraction < 0.0) || (config_ptr->min_clean_fraction > 1.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_clean_fraction must be in the interval [0.0, 1.0]")
if (config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH)
@@ -3736,12 +3735,11 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid incr_mode")
if (config_ptr->incr_mode == H5C_incr__threshold) {
- if ((config_ptr->lower_hr_threshold < (double)0.0f) ||
- (config_ptr->lower_hr_threshold > (double)1.0f))
+ if ((config_ptr->lower_hr_threshold < 0.0) || (config_ptr->lower_hr_threshold > 1.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"lower_hr_threshold must be in the range [0.0, 1.0]")
- if (config_ptr->increment < (double)1.0f)
+ if (config_ptr->increment < 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "increment must be greater than or equal to 1.0")
/* no need to check max_increment, as it is a size_t,
@@ -3755,12 +3753,10 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
break;
case H5C_flash_incr__add_space:
- if ((config_ptr->flash_multiple < (double)0.1f) ||
- (config_ptr->flash_multiple > (double)10.0f))
+ if ((config_ptr->flash_multiple < 0.1) || (config_ptr->flash_multiple > 10.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"flash_multiple must be in the range [0.1, 10.0]")
- if ((config_ptr->flash_threshold < (double)0.1f) ||
- (config_ptr->flash_threshold > (double)1.0f))
+ if ((config_ptr->flash_threshold < 0.1) || (config_ptr->flash_threshold > 1.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"flash_threshold must be in the range [0.1, 1.0]")
break;
@@ -3781,10 +3777,10 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
}
if (config_ptr->decr_mode == H5C_decr__threshold) {
- if (config_ptr->upper_hr_threshold > (double)1.0f)
+ if (config_ptr->upper_hr_threshold > 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be <= 1.0")
- if ((config_ptr->decrement > (double)1.0f) || (config_ptr->decrement < (double)0.0f))
+ if ((config_ptr->decrement > 1.0) || (config_ptr->decrement < 0.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "decrement must be in the interval [0.0, 1.0]")
/* no need to check max_decrement as it is a size_t
@@ -3801,7 +3797,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction too big")
if ((config_ptr->apply_empty_reserve) &&
- ((config_ptr->empty_reserve > (double)1.0f) || (config_ptr->empty_reserve < (double)0.0f)))
+ ((config_ptr->empty_reserve > 1.0) || (config_ptr->empty_reserve < 0.0)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty_reserve must be in the interval [0.0, 1.0]")
/* no need to check max_decrement as it is a size_t
@@ -3810,8 +3806,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests)
} /* H5C_decr__age_out || H5C_decr__age_out_with_threshold */
if (config_ptr->decr_mode == H5C_decr__age_out_with_threshold) {
- if ((config_ptr->upper_hr_threshold > (double)1.0f) ||
- (config_ptr->upper_hr_threshold < (double)0.0f))
+ if ((config_ptr->upper_hr_threshold > 1.0) || (config_ptr->upper_hr_threshold < 0.0))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"upper_hr_threshold must be in the interval [0.0, 1.0]")
} /* H5C_decr__age_out_with_threshold */
@@ -4279,8 +4274,8 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted)
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length);
- HDassert((double)0.0f <= (cache_ptr->resize_ctl).min_clean_fraction);
- HDassert((cache_ptr->resize_ctl).min_clean_fraction <= (double)100.0f);
+ HDassert(0.0 <= (cache_ptr->resize_ctl).min_clean_fraction);
+ HDassert((cache_ptr->resize_ctl).min_clean_fraction <= 100.0);
/* check to see if cache_ptr->resize_in_progress is TRUE. If it, this
* is a re-entrant call via a client callback called in the resize
@@ -4303,7 +4298,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted)
if (H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate")
- HDassert(((double)0.0f <= hit_rate) && (hit_rate <= (double)1.0f));
+ HDassert((0.0 <= hit_rate) && (hit_rate <= 1.0));
switch ((cache_ptr->resize_ctl).incr_mode) {
case H5C_incr__off:
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index e59012c..104f1af 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -429,11 +429,11 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
int32_t aggregate_max_pins = 0;
double hit_rate;
double prefetch_use_rate;
- double average_successful_search_depth = 0.0f;
- double average_failed_search_depth = 0.0f;
- double average_entries_skipped_per_calls_to_msic = 0.0f;
- double average_dirty_pf_entries_skipped_per_call_to_msic = 0.0f;
- double average_entries_scanned_per_calls_to_msic = 0.0f;
+ double average_successful_search_depth = 0.0;
+ double average_failed_search_depth = 0.0;
+ double average_entries_skipped_per_calls_to_msic = 0.0;
+ double average_dirty_pf_entries_skipped_per_call_to_msic = 0.0;
+ double average_entries_scanned_per_calls_to_msic = 0.0;
#endif /* H5C_COLLECT_CACHE_STATS */
herr_t ret_value = SUCCEED; /* Return value */
@@ -492,9 +492,9 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
} /* end for */
if ((total_hits > 0) || (total_misses > 0))
- hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses));
+ hit_rate = 100.0 * ((double)(total_hits)) / ((double)(total_hits + total_misses));
else
- hit_rate = 0.0f;
+ hit_rate = 0.0;
if (cache_ptr->successful_ht_searches > 0)
average_successful_search_depth = ((double)(cache_ptr->total_successful_ht_search_depth)) /
@@ -630,10 +630,9 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
(long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID]));
if (cache_ptr->prefetches > 0)
- prefetch_use_rate =
- (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
+ prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
else
- prefetch_use_rate = 0.0f;
+ prefetch_use_rate = 0.0;
HDfprintf(stdout, "%s prefetched entry use rate = %lf\n", cache_ptr->prefix, prefetch_use_rate);
@@ -658,10 +657,10 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
((cache_ptr->class_table_ptr))[i]->name);
if ((cache_ptr->hits[i] > 0) || (cache_ptr->misses[i] > 0))
- hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) /
+ hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) /
((double)(cache_ptr->hits[i] + cache_ptr->misses[i]));
else
- hit_rate = 0.0f;
+ hit_rate = 0.0;
HDfprintf(stdout, "%s hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix,
(long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate);
diff --git a/src/H5Cimage.c b/src/H5Cimage.c
index 20d3b4d..f17ff48 100644
--- a/src/H5Cimage.c
+++ b/src/H5Cimage.c
@@ -933,15 +933,14 @@ H5C_image_stats(H5C_t *cache_ptr, hbool_t H5_ATTR_UNUSED print_header)
} /* end for */
if ((total_hits > 0) || (total_misses > 0))
- hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses));
+ hit_rate = 100.0 * ((double)(total_hits)) / ((double)(total_hits + total_misses));
else
- hit_rate = 0.0f;
+ hit_rate = 0.0;
if (cache_ptr->prefetches > 0)
- prefetch_use_rate =
- (double)100.0f * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
+ prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
else
- prefetch_use_rate = 0.0f;
+ prefetch_use_rate = 0.0;
if (print_header) {
HDfprintf(stdout, "\nhit prefetches prefetch image pf hit\n");
diff --git a/src/H5Clog.h b/src/H5Clog.h
index bd5c413..790a073 100644
--- a/src/H5Clog.h
+++ b/src/H5Clog.h
@@ -79,10 +79,10 @@ typedef struct H5C_log_class_t {
/* Logging information */
struct H5C_log_info_t {
- hbool_t enabled; /* Was the logging set up? */
- hbool_t logging; /* Are we currently logging? */
- H5C_log_class_t *cls; /* Callbacks for writing log messages */
- void * udata; /* Log-specific data */
+ hbool_t enabled; /* Was the logging set up? */
+ hbool_t logging; /* Are we currently logging? */
+ const H5C_log_class_t *cls; /* Callbacks for writing log messages */
+ void * udata; /* Log-specific data */
};
/*****************************/
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index fb5c3ea..27a24c4 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -115,20 +115,20 @@
#define H5C__CURR_CACHE_IMAGE_CTL_VER 1
/* Default configuration settings */
-#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
-#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
+#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999
+#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9
#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
#define H5C__DEF_AR_INIT_SIZE ((size_t)(1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_SIZE ((size_t)(1 * 1024 * 1024))
-#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
-#define H5C__DEF_AR_INCREMENT 2.0f
+#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5
+#define H5C__DEF_AR_INCREMENT 2.0
#define H5C__DEF_AR_MAX_INCREMENT ((size_t)(2 * 1024 * 1024))
-#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
-#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
-#define H5C__DEF_AR_DECREMENT 0.9f
+#define H5C__DEF_AR_FLASH_MULTIPLE 1.0
+#define H5C__DEV_AR_FLASH_THRESHOLD 0.25
+#define H5C__DEF_AR_DECREMENT 0.9
#define H5C__DEF_AR_MAX_DECREMENT ((size_t)(1 * 1024 * 1024))
#define H5C__DEF_AR_EPCHS_B4_EVICT 3
-#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
+#define H5C__DEF_AR_EMPTY_RESERVE 0.05
#define H5C__MIN_AR_EPOCH_LENGTH 100
#define H5C__DEF_AR_EPOCH_LENGTH 50000
#define H5C__MAX_AR_EPOCH_LENGTH 1000000
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 67c92ca..f335a25 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -711,10 +711,8 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize
} /* end for */
/* Get the "down" sizes for each dimension */
- if (H5VM_array_down(ndims, layout->chunks, layout->down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value")
- if (H5VM_array_down(ndims, layout->max_chunks, layout->max_down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value")
+ H5VM_array_down(ndims, layout->chunks, layout->down_chunks);
+ H5VM_array_down(ndims, layout->max_chunks, layout->max_down_chunks);
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index 24e8df2..abce233 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -1160,9 +1160,7 @@ done:
static herr_t
H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(layout);
@@ -1182,8 +1180,7 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
H5VM_swizzle_coords(hsize_t, swizzled_chunks, layout->u.earray.unlim_dim);
/* Get the swizzled "down" sizes for each dimension */
- if (H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value")
+ H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks);
/* Get the swizzled max number of chunks in each dimension */
H5MM_memcpy(swizzled_max_chunks, layout->max_chunks,
@@ -1191,13 +1188,10 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
H5VM_swizzle_coords(hsize_t, swizzled_max_chunks, layout->u.earray.unlim_dim);
/* Get the swizzled max "down" sizes for each dimension */
- if (H5VM_array_down((layout->ndims - 1), swizzled_max_chunks,
- layout->u.earray.swizzled_max_down_chunks) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value")
- } /* end if */
+ H5VM_array_down((layout->ndims - 1), swizzled_max_chunks, layout->u.earray.swizzled_max_down_chunks);
+ }
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_idx_resize() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index 78defde..c02b89e 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -503,6 +503,7 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id)
H5HL_t * heap; /* Pointer to local heap for EFL file names */
size_t heap_size = H5HL_ALIGN(1);
size_t u;
+ size_t name_offset;
/* Determine size of heap needed to stored the file names */
for (u = 0; u < efl->nused; ++u)
@@ -517,24 +518,22 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect EFL file name heap")
/* Insert "empty" name first */
- if (UFAIL == H5HL_insert(file, heap, (size_t)1, "")) {
+ if (H5HL_insert(file, heap, (size_t)1, "", &name_offset) < 0) {
H5HL_unprotect(heap);
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap")
- } /* end if */
+ }
for (u = 0; u < efl->nused; ++u) {
- size_t offset; /* Offset of file name in heap */
-
/* Insert file name into heap */
- if (UFAIL ==
- (offset = H5HL_insert(file, heap, HDstrlen(efl->slot[u].name) + 1, efl->slot[u].name))) {
+ if (H5HL_insert(file, heap, HDstrlen(efl->slot[u].name) + 1, efl->slot[u].name, &name_offset) <
+ 0) {
H5HL_unprotect(heap);
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap")
- } /* end if */
+ }
/* Store EFL file name offset */
- efl->slot[u].name_offset = offset;
- } /* end for */
+ efl->slot[u].name_offset = name_offset;
+ }
/* Release the heap */
if (H5HL_unprotect(heap) < 0)
diff --git a/src/H5Gent.c b/src/H5Gent.c
index b26e308..2f1a2b4 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -384,11 +384,8 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk
/* Reset the new entry */
H5G__ent_reset(ent);
- /*
- * Add the new name to the heap.
- */
- name_offset = H5HL_insert(f, heap, HDstrlen(name) + 1, name);
- if (0 == name_offset || UFAIL == name_offset)
+ /* Add the new name to the heap */
+ if (H5HL_insert(f, heap, HDstrlen(name) + 1, name, &name_offset) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert symbol name into heap")
ent->name_off = name_offset;
@@ -476,14 +473,12 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk
size_t lnk_offset; /* Offset to sym-link value */
/* Insert link value into local heap */
- if (UFAIL ==
- (lnk_offset = H5HL_insert(f, heap, HDstrlen(lnk->u.soft.name) + 1, lnk->u.soft.name)))
+ if (H5HL_insert(f, heap, HDstrlen(lnk->u.soft.name) + 1, lnk->u.soft.name, &lnk_offset) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write link value to local heap")
ent->type = H5G_CACHED_SLINK;
ent->cache.slink.lval_offset = lnk_offset;
- } /* end case */
- break;
+ } break;
case H5L_TYPE_ERROR:
case H5L_TYPE_EXTERNAL:
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 6fba0a1..54b28b5 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -150,11 +150,10 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint)
HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap")
/* Insert name into the heap */
- if (UFAIL == (name_offset = H5HL_insert(f, heap, (size_t)1, "")))
+ if (H5HL_insert(f, heap, (size_t)1, "", &name_offset) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert name into heap")
- /*
- * B-tree's won't work if the first name isn't at the beginning
+ /* B-trees won't work if the first name isn't at the beginning
* of the heap.
*/
HDassert(0 == name_offset);
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index cc61aa1..a244035 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -543,7 +543,7 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
amount_free = 0;
HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of available space for data used:",
- ((double)100.0f * (double)((dblock->size - blk_prefix_size) - amount_free) /
+ (100.0 * (double)((dblock->size - blk_prefix_size) - amount_free) /
(double)(dblock->size - blk_prefix_size)));
/*
diff --git a/src/H5HL.c b/src/H5HL.c
index 50d24c3..ca83445 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -508,27 +508,31 @@ END_FUNC(STATIC) /* end H5HL__dirty() */
*
* Purpose: Inserts a new item into the heap.
*
- * Return: Success: Offset of new item within heap.
- * Failure: UFAIL
+ * Return: Success: SUCCEED
+ * Offset set to location of new item within heap
+ *
+ * Failure: FAIL
+ * Offset set to SIZE_MAX
*
* Programmer: Robb Matzke
* Jul 17 1997
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
- H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf))
+BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
+ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *offset_out))
H5HL_free_t *fl = NULL, *last_fl = NULL;
- size_t offset = 0;
size_t need_size;
+ size_t offset = 0;
hbool_t found;
- /* check arguments */
+ /* Check arguments */
HDassert(f);
HDassert(heap);
HDassert(buf_size > 0);
HDassert(buf);
+ HDassert(offset_out);
/* Mark heap as dirty in cache */
/* (A bit early in the process, but it's difficult to determine in the
@@ -539,20 +543,18 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
if (FAIL == H5HL__dirty(heap))
H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark heap as dirty");
- /*
- * In order to keep the free list descriptors aligned on word boundaries,
+ /* In order to keep the free list descriptors aligned on word boundaries,
* whatever that might mean, we round the size up to the next multiple of
* a word.
*/
need_size = H5HL_ALIGN(buf_size);
- /*
- * Look for a free slot large enough for this object and which would
+ /* Look for a free slot large enough for this object and which would
* leave zero or at least H5G_SIZEOF_FREE bytes left over.
*/
for (fl = heap->freelist, found = FALSE; fl; fl = fl->next) {
if (fl->size > need_size && fl->size - need_size >= H5HL_SIZEOF_FREE(f)) {
- /* a big enough free block was found */
+ /* A big enough free block was found */
offset = fl->offset;
fl->offset += need_size;
fl->size -= need_size;
@@ -562,20 +564,19 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
break;
}
else if (fl->size == need_size) {
- /* free block of exact size found */
+ /* Free block of exact size found */
offset = fl->offset;
fl = H5HL__remove_free(heap, fl);
found = TRUE;
break;
}
else if (!last_fl || last_fl->offset < fl->offset) {
- /* track free space that's closest to end of heap */
+ /* Track free space that's closest to end of heap */
last_fl = fl;
}
} /* end for */
- /*
- * If no free chunk was large enough, then allocate more space and
+ /* If no free chunk was large enough, then allocate more space and
* add it to the free list. If the heap ends with a free chunk, we
* can extend that free chunk. Otherwise we'll have to make another
* free chunk. If the heap must expand, we double its size.
@@ -587,7 +588,8 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
htri_t was_extended; /* Whether the local heap's data segment on disk was extended */
/* At least double the heap's size, making certain there's enough room
- * for the new object */
+ * for the new object
+ */
need_more = MAX(need_size, heap->dblk_size);
/* If there is no last free block or it's not at the end of the heap,
@@ -657,8 +659,7 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
}
} /* end if */
else {
- /*
- * Create a new free list element large enough that we can
+ /* Create a new free list element large enough that we can
* take some space out of it right away.
*/
offset = old_dblk_size;
@@ -700,11 +701,10 @@ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL,
/* Copy the data into the heap */
H5MM_memcpy(heap->dblk_image + offset, buf, buf_size);
- /* Set return value */
- ret_value = offset;
+ *offset_out = offset;
CATCH
- /* No special processing on errors */
+ /* No special processing on exit */
END_FUNC(PRIV) /* H5HL_insert() */
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index d0cfa96..76e4ec0 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -102,7 +102,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
if (h->dblk_size)
HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of heap used:",
- ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
+ (100.0 * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
/* Print the data in a VMS-style octal dump */
H5_buffer_dump(stream, indent, h->dblk_image, marker, (size_t)0, h->dblk_size);
diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h
index 739e761..5c98846 100644
--- a/src/H5HLprivate.h
+++ b/src/H5HLprivate.h
@@ -57,7 +57,7 @@ H5_DLL herr_t H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr /*out*/);
H5_DLL herr_t H5HL_delete(H5F_t *f, haddr_t addr);
H5_DLL herr_t H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size);
H5_DLL herr_t H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size);
-H5_DLL size_t H5HL_insert(H5F_t *f, H5HL_t *heap, size_t size, const void *buf);
+H5_DLL herr_t H5HL_insert(H5F_t *f, H5HL_t *heap, size_t size, const void *buf, size_t *offset);
H5_DLL void * H5HL_offset_into(const H5HL_t *heap, size_t offset);
H5_DLL H5HL_t *H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags);
H5_DLL herr_t H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size);
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 1ecaf36..d950249 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -466,7 +466,7 @@ H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_d
HGOTO_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to protect EFL file name heap")
/* Insert "empty" name first */
- if (UFAIL == (name_offset = H5HL_insert(file_dst, heap, (size_t)1, "")))
+ if (H5HL_insert(file_dst, heap, (size_t)1, "", &name_offset) < 0)
HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
HDassert(0 == name_offset);
@@ -483,10 +483,10 @@ H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_d
/* copy the name from the source */
for (idx = 0; idx < efl_src->nused; idx++) {
efl_dst->slot[idx].name = H5MM_xstrdup(efl_src->slot[idx].name);
- if (UFAIL == (efl_dst->slot[idx].name_offset = H5HL_insert(
- file_dst, heap, HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name)))
+ if (H5HL_insert(file_dst, heap, HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name,
+ &(efl_dst->slot[idx].name_offset)) < 0)
HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap")
- } /* end for */
+ }
/* Set return value */
ret_value = efl_dst;
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index 2cdf6ec..dab989f 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -106,12 +106,13 @@ H5FL_ARR_EXTERN(hsize_t);
--------------------------------------------------------------------------*/
static void *
H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
{
- H5S_extent_t *sdim = NULL; /* New extent dimensionality structure */
- unsigned flags, version;
- unsigned i; /* Local counting variable */
- void * ret_value = NULL; /* Return value */
+ H5S_extent_t * sdim = NULL; /* New extent dimensionality structure */
+ unsigned flags, version;
+ unsigned i; /* Local counting variable */
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -161,6 +162,13 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN
/* Decode dimension sizes */
if (sdim->rank > 0) {
+ /* Ensure that rank doesn't cause reading passed buffer's end,
+ due to possible data corruption */
+ uint8_t sizeof_size = H5F_SIZEOF_SIZE(f);
+ if (p + (sizeof_size * sdim->rank - 1) > p_end) {
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "rank might cause reading passed buffer's end")
+ }
+
if (NULL == (sdim->size = (hsize_t *)H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -170,6 +178,11 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN
if (flags & H5S_VALID_MAX) {
if (NULL == (sdim->max = (hsize_t *)H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+
+ /* Ensure that rank doesn't cause reading passed buffer's end */
+ if (p + (sizeof_size * sdim->rank - 1) > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "rank might cause reading passed buffer's end")
+
for (i = 0; i < sdim->rank; i++)
H5F_DECODE_LENGTH(f, p, sdim->max[i]);
} /* end if */
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index 0ef1519..3b14959 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -768,7 +768,7 @@ H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double
/* Check arguments. Note that we allow negative values - they are
* considered to "unset" the property. */
- if (rdcc_w0 > (double)1.0f)
+ if (rdcc_w0 > 1.0)
HGOTO_ERROR(
H5E_ARGS, H5E_BADVALUE, FAIL,
"raw data cache w0 value must be between 0.0 and 1.0 inclusive, or H5D_CHUNK_CACHE_W0_DEFAULT");
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 36cf678..2d6b313 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -1486,9 +1486,8 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, double right)
H5TRACE4("e", "iddd", plist_id, left, middle, right);
/* Check arguments */
- if (left < (double)0.0f || left > (double)1.0f || middle < (double)0.0f || middle > (double)1.0f ||
- right < (double)0.0f || right > (double)1.0f)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0")
+ if (left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 || right < 0.0 || right > 1.0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0 <= X <= 1.0")
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index f0fc39f..a7f84fb 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1686,7 +1686,7 @@ H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, size_t rdcc_nslots,
H5TRACE5("e", "iIszzd", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0);
/* Check arguments */
- if (rdcc_w0 < (double)0.0f || rdcc_w0 > (double)1.0f)
+ if (rdcc_w0 < 0.0 || rdcc_w0 > 1.0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"raw data cache w0 value must be between 0.0 and 1.0 inclusive")
diff --git a/src/H5SM.c b/src/H5SM.c
index d1695c4..fa446cf 100644
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -1262,16 +1262,16 @@ static herr_t
H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t defer, unsigned type_id,
void *mesg, unsigned *cache_flags_ptr)
{
- H5SM_list_t * list = NULL; /* List index */
- H5SM_mesg_key_t key; /* Key used to search the index */
- H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- H5O_shared_t shared; /* Shared H5O message */
- hbool_t found = FALSE; /* Was the message in the index? */
- H5HF_t * fheap = NULL; /* Fractal heap handle */
- H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */
- size_t buf_size; /* Size of the encoded message */
- void * encoding_buf = NULL; /* Buffer for encoded message */
- size_t empty_pos = UFAIL; /* Empty entry in list */
+ H5SM_list_t * list = NULL; /* List index */
+ H5SM_mesg_key_t key; /* Key used to search the index */
+ H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */
+ H5O_shared_t shared; /* Shared H5O message */
+ hbool_t found = FALSE; /* Was the message in the index? */
+ H5HF_t * fheap = NULL; /* Fractal heap handle */
+ H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */
+ size_t buf_size; /* Size of the encoded message */
+ void * encoding_buf = NULL; /* Buffer for encoded message */
+ size_t empty_pos = SIZE_MAX; /* Empty entry in list */
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
@@ -1325,11 +1325,11 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t
HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to search for message in list")
if (defer) {
- if (list_pos != UFAIL)
+ if (list_pos != SIZE_MAX)
found = TRUE;
} /* end if */
else {
- if (list_pos != UFAIL) {
+ if (list_pos != SIZE_MAX) {
/* If the message was previously shared in an object header, share
* it in the heap now.
*/
@@ -1484,13 +1484,13 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t
/* Insert the new message into the SOHM index */
if (header->index_type == H5SM_LIST) {
/* Index is a list. Find an empty spot if we haven't already */
- if (empty_pos == UFAIL) {
+ if (empty_pos == SIZE_MAX) {
size_t pos;
if (H5SM__find_in_list(list, NULL, &empty_pos, &pos) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to search for message in list")
- if (pos == UFAIL || empty_pos == UFAIL)
+ if (pos == SIZE_MAX || empty_pos == SIZE_MAX)
HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to find empty entry in list")
}
/* Insert message into list */
@@ -1650,9 +1650,14 @@ done:
*
* If EMPTY_POS is NULL, don't store anything in it.
*
- * Return: Message's position in the list on success
- * UFAIL if message couldn't be found
- * empty_pos set to position of empty message or UFAIL.
+ * Return: Success: SUCCEED
+ * pos = position (if found)
+ * pos = SIZE_MAX (if not found)
+ * empty_pos = indeterminate (if found)
+ * empty_pos = 1st empty position (if not found)
+ *
+ * Failure: FAIL
+ * pos & empty_pos indeterminate
*
* Programmer: James Laird
* Tuesday, May 2, 2006
@@ -1673,7 +1678,7 @@ H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *
/* Initialize empty_pos to an invalid value */
if (empty_pos)
- *empty_pos = UFAIL;
+ *empty_pos = SIZE_MAX;
/* Find the first (only) message equal to the key passed in.
* Also record the first empty position we find.
@@ -1696,11 +1701,11 @@ H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *
/* Found earlier position possible, don't check any more */
empty_pos = NULL;
- } /* end if */
- } /* end for */
+ }
+ }
/* If we reached this point, we didn't find the message */
- *pos = UFAIL;
+ *pos = SIZE_MAX;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1842,7 +1847,7 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, c
/* Find the message in the list */
if (H5SM__find_in_list(list, &key, NULL, &list_pos) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to search for message in list")
- if (list_pos == UFAIL)
+ if (list_pos == SIZE_MAX)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index")
if (list->messages[list_pos].location == H5SM_IN_HEAP)
@@ -2224,7 +2229,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize
/* Find the message in the list */
if (H5SM__find_in_list(list, &key, NULL, &list_pos) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to search for message in list")
- if (list_pos == UFAIL)
+ if (list_pos == SIZE_MAX)
HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index")
/* Copy the message */
@@ -2521,7 +2526,7 @@ H5SM__list_free(H5SM_list_t *list)
*
* Purpose: Print debugging information for the master table.
*
- * If table_vers and num_indexes are not UFAIL, they are used
+ * If table_vers and num_indexes are not UINT_MAX, they are used
* instead of the values in the superblock.
*
* Return: Non-negative on success/Negative on failure
@@ -2548,14 +2553,14 @@ H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int indent, int fwi
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- /* If table_vers and num_indexes are UFAIL, replace them with values from
+ /* If table_vers and num_indexes are UINT_MAX, replace them with values from
* userblock
*/
- if (table_vers == UFAIL)
+ if (table_vers == UINT_MAX)
table_vers = H5F_SOHM_VERS(f);
else if (table_vers != H5F_SOHM_VERS(f))
HDfprintf(stream, "*** SOHM TABLE VERSION DOESN'T MATCH VERSION IN SUPERBLOCK!\n");
- if (num_indexes == UFAIL)
+ if (num_indexes == UINT_MAX)
num_indexes = H5F_SOHM_NINDEXES(f);
else if (num_indexes != H5F_SOHM_NINDEXES(f))
HDfprintf(stream, "*** NUMBER OF SOHM INDEXES DOESN'T MATCH VALUE IN SUPERBLOCK!\n");
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 9a38aaa..7b85209 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -1014,8 +1014,7 @@ H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *ne
elmt_type_is_derived = TRUE;
/* Compute 'down' sizes for each dimension */
- if (H5VM_array_down(space->extent.rank, space->extent.size, down) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGETSIZE, FAIL, "couldn't compute 'down' dimension sizes")
+ H5VM_array_down(space->extent.rank, space->extent.size, down);
/* Acquire an operation generation value for creating MPI datatypes */
op_gen = H5S__hyper_get_op_gen();
diff --git a/src/H5T.c b/src/H5T.c
index 587ba0f..c3ca03b 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -561,8 +561,8 @@ size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0;
/* (+/- Inf for all floating-point types) */
float H5T_NATIVE_FLOAT_POS_INF_g = 0.0f;
float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0f;
-double H5T_NATIVE_DOUBLE_POS_INF_g = (double)0.0f;
-double H5T_NATIVE_DOUBLE_NEG_INF_g = (double)0.0f;
+double H5T_NATIVE_DOUBLE_POS_INF_g = 0.0;
+double H5T_NATIVE_DOUBLE_NEG_INF_g = 0.0;
/* Declare the free list for H5T_t's and H5T_shared_t's */
H5FL_DEFINE(H5T_t);
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index e2ca4b9..9f0c061 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -228,10 +228,7 @@ done:
* Purpose: Return a small bit sequence as a number. Bit vector starts
* at OFFSET and is SIZE bits long.
*
- * Return: Success: The bit sequence interpretted as an unsigned
- * integer.
- *
- * Failure: 0
+ * Return: The bit sequence interpretted as an unsigned integer
*
*-------------------------------------------------------------------------
*/
@@ -264,8 +261,8 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size)
case H5T_ORDER_NONE:
case H5T_ORDER_MIXED:
default:
- /* Unknown endianness. Bail out. */
- HGOTO_DONE(UFAIL)
+ /* This function can't return errors */
+ HDassert(0 && "unknown byte order");
}
/* Set return value */
diff --git a/src/H5VM.c b/src/H5VM.c
index 49cad20..4d65d75 100644
--- a/src/H5VM.c
+++ b/src/H5VM.c
@@ -43,20 +43,20 @@ static void H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n
#endif /* LATER */
/*-------------------------------------------------------------------------
- * Function: H5VM__stride_optimize1
+ * Function: H5VM__stride_optimize1
*
- * Purpose: Given a stride vector which references elements of the
- * specified size, optimize the dimensionality, the stride
- * vector, and the element size to minimize the dimensionality
- * and the number of memory accesses.
+ * Purpose: Given a stride vector which references elements of the
+ * specified size, optimize the dimensionality, the stride
+ * vector, and the element size to minimize the dimensionality
+ * and the number of memory accesses.
*
- * All arguments are passed by reference and their values may be
- * modified by this function.
+ * All arguments are passed by reference and their values may be
+ * modified by this function.
*
- * Return: None
+ * Return: void
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -66,15 +66,12 @@ H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
{
FUNC_ENTER_STATIC_NOERR
- /*
- * This has to be true because if we optimize the dimensionality down to
+ /* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
HDassert(1 == H5VM_vector_reduce_product(0, NULL));
- /*
- * Combine adjacent memory accesses
- */
+ /* Combine adjacent memory accesses */
while (*np && stride1[*np - 1] > 0 && (hsize_t)(stride1[*np - 1]) == *elmt_size) {
*elmt_size *= size[*np - 1];
if (--*np)
@@ -85,20 +82,20 @@ H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
}
/*-------------------------------------------------------------------------
- * Function: H5VM__stride_optimize2
+ * Function: H5VM__stride_optimize2
*
- * Purpose: Given two stride vectors which reference elements of the
- * specified size, optimize the dimensionality, the stride
- * vectors, and the element size to minimize the dimensionality
- * and the number of memory accesses.
+ * Purpose: Given two stride vectors which reference elements of the
+ * specified size, optimize the dimensionality, the stride
+ * vectors, and the element size to minimize the dimensionality
+ * and the number of memory accesses.
*
- * All arguments are passed by reference and their values may be
- * modified by this function.
+ * All arguments are passed by reference and their values may be
+ * modified by this function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -108,16 +105,13 @@ H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
{
FUNC_ENTER_STATIC_NOERR
- /*
- * This has to be true because if we optimize the dimensionality down to
+ /* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
HDassert(1 == H5VM_vector_reduce_product(0, NULL));
HDassert(*elmt_size > 0);
- /*
- * Combine adjacent memory accesses
- */
+ /* Combine adjacent memory accesses */
/* Unroll loop for common cases */
switch (*np) {
@@ -206,29 +200,26 @@ H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c
}
/*-------------------------------------------------------------------------
- * Function: H5VM_hyper_stride
- *
- * Purpose: Given a description of a hyperslab, this function returns
- * (through STRIDE[]) the byte strides appropriate for accessing
- * all bytes of the hyperslab and the byte offset where the
- * striding will begin. The SIZE can be passed to the various
- * stride functions.
+ * Function: H5VM_hyper_stride
*
- * The dimensionality of the whole array, the hyperslab, and the
- * returned stride array is N. The whole array dimensions are
- * TOTAL_SIZE and the hyperslab is at offset OFFSET and has
- * dimensions SIZE.
+ * Purpose: Given a description of a hyperslab, this function returns
+ * (through STRIDE[]) the byte strides appropriate for accessing
+ * all bytes of the hyperslab and the byte offset where the
+ * striding will begin. The SIZE can be passed to the various
+ * stride functions.
*
- * The stride and starting point returned will cause the
- * hyperslab elements to be referenced in C order.
+ * The dimensionality of the whole array, the hyperslab, and the
+ * returned stride array is N. The whole array dimensions are
+ * TOTAL_SIZE and the hyperslab is at offset OFFSET and has
+ * dimensions SIZE.
*
- * Return: Success: Byte offset from beginning of array to start
- * of striding.
+ * The stride and starting point returned will cause the
+ * hyperslab elements to be referenced in C order.
*
- * Failure: abort() -- should never fail
+ * Return: Byte offset from beginning of array to start of striding.
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -308,23 +299,22 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, co
}
/*-------------------------------------------------------------------------
- * Function: H5VM_hyper_eq
+ * Function: H5VM_hyper_eq
*
- * Purpose: Determines whether two hyperslabs are equal. This function
- * assumes that both hyperslabs are relative to the same array,
- * for if not, they could not possibly be equal.
+ * Purpose: Determines whether two hyperslabs are equal. This function
+ * assumes that both hyperslabs are relative to the same array,
+ * for if not, they could not possibly be equal.
*
- * Return: Success: TRUE if the hyperslabs are equal (that is,
- * both refer to exactly the same elements of an
- * array)
+ * Return: TRUE if the hyperslabs are equal (that is,
+ * both refer to exactly the same elements of an
+ * array)
*
- * FALSE otherwise.
+ * FALSE otherwise
*
- * Failure: TRUE the rank is zero or if both hyperslabs
- * are of zero size.
+ * Never returns FAIL
*
- * Programmer: Robb Matzke
- * Friday, October 17, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 17, 1997
*
*-------------------------------------------------------------------------
*/
@@ -360,19 +350,19 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VM_hyper_fill
*
- * Purpose: Similar to memset() except it operates on hyperslabs...
+ * Purpose: Similar to memset() except it operates on hyperslabs...
*
- * Fills a hyperslab of array BUF with some value VAL. BUF
- * is treated like a C-order array with N dimensions where the
- * size of each dimension is TOTAL_SIZE[]. The hyperslab which
- * will be filled with VAL begins at byte offset OFFSET[] from
- * the minimum corner of BUF and continues for SIZE[] bytes in
- * each dimension.
+ * Fills a hyperslab of array BUF with some value VAL. BUF
+ * is treated like a C-order array with N dimensions where the
+ * size of each dimension is TOTAL_SIZE[]. The hyperslab which
+ * will be filled with VAL begins at byte offset OFFSET[] from
+ * the minimum corner of BUF and continues for SIZE[] bytes in
+ * each dimension.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
@@ -418,31 +408,31 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con
}
/*-------------------------------------------------------------------------
- * Function: H5VM_hyper_copy
+ * Function: H5VM_hyper_copy
*
- * Purpose: Copies a hyperslab from the source to the destination.
+ * Purpose: Copies a hyperslab from the source to the destination.
*
- * A hyperslab is a logically contiguous region of
- * multi-dimensional size SIZE of an array whose dimensionality
- * is N and whose total size is DST_TOTAL_SIZE or SRC_TOTAL_SIZE.
- * The minimum corner of the hyperslab begins at a
- * multi-dimensional offset from the minimum corner of the DST
- * (destination) or SRC (source) array. The sizes and offsets
- * are assumed to be in C order, that is, the first size/offset
- * varies the slowest while the last varies the fastest in the
- * mapping from N-dimensional space to linear space. This
- * function assumes that the array elements are single bytes (if
- * your array has multi-byte elements then add an additional
- * dimension whose size is that of your element).
+ * A hyperslab is a logically contiguous region of
+ * multi-dimensional size SIZE of an array whose dimensionality
+ * is N and whose total size is DST_TOTAL_SIZE or SRC_TOTAL_SIZE.
+ * The minimum corner of the hyperslab begins at a
+ * multi-dimensional offset from the minimum corner of the DST
+ * (destination) or SRC (source) array. The sizes and offsets
+ * are assumed to be in C order, that is, the first size/offset
+ * varies the slowest while the last varies the fastest in the
+ * mapping from N-dimensional space to linear space. This
+ * function assumes that the array elements are single bytes (if
+ * your array has multi-byte elements then add an additional
+ * dimension whose size is that of your element).
*
- * The SRC and DST array may be the same array, but the results
- * are undefined if the source hyperslab overlaps the
- * destination hyperslab.
+ * The SRC and DST array may be the same array, but the results
+ * are undefined if the source hyperslab overlaps the
+ * destination hyperslab.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
@@ -592,13 +582,13 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const
/*-------------------------------------------------------------------------
* Function: H5VM_stride_fill
*
- * Purpose: Fills all bytes of a hyperslab with the same value using
- * memset().
+ * Purpose: Fills all bytes of a hyperslab with the same value using
+ * memset().
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -643,19 +633,19 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
/*-------------------------------------------------------------------------
* Function: H5VM_stride_copy
*
- * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
- * DST and SRC while copying bytes from SRC to DST. This
- * function minimizes the number of calls to memcpy() by
- * combining various strides, but it will never touch memory
- * outside the hyperslab defined by the strides.
+ * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
+ * DST and SRC while copying bytes from SRC to DST. This
+ * function minimizes the number of calls to memcpy() by
+ * combining various strides, but it will never touch memory
+ * outside the hyperslab defined by the strides.
*
- * Note: If the src_stride is all zero and elmt_size is one, then it's
- * probably more efficient to use H5VM_stride_fill() instead.
+ * Note: If the src_stride is all zero and elmt_size is one, then it's
+ * probably more efficient to use H5VM_stride_fill() instead.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -709,19 +699,19 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
/*-------------------------------------------------------------------------
* Function: H5VM_stride_copy_s
*
- * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
- * DST and SRC while copying bytes from SRC to DST. This
- * function minimizes the number of calls to memcpy() by
- * combining various strides, but it will never touch memory
- * outside the hyperslab defined by the strides.
+ * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
+ * DST and SRC while copying bytes from SRC to DST. This
+ * function minimizes the number of calls to memcpy() by
+ * combining various strides, but it will never touch memory
+ * outside the hyperslab defined by the strides.
*
- * Note: If the src_stride is all zero and elmt_size is one, then it's
- * probably more efficient to use H5VM_stride_fill() instead.
+ * Note: If the src_stride is all zero and elmt_size is one, then it's
+ * probably more efficient to use H5VM_stride_fill() instead.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -775,17 +765,17 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss
#ifdef LATER
/*-------------------------------------------------------------------------
- * Function: H5VM__stride_copy2
+ * Function: H5VM__stride_copy2
*
- * Purpose: Similar to H5VM_stride_copy() except the source and
- * destination each have their own dimensionality and size and
- * we copy exactly NELMTS elements each of size ELMT_SIZE. The
- * size counters wrap if NELMTS is more than a size counter.
+ * Purpose: Similar to H5VM_stride_copy() except the source and
+ * destination each have their own dimensionality and size and
+ * we copy exactly NELMTS elements each of size ELMT_SIZE. The
+ * size counters wrap if NELMTS is more than a size counter.
*
- * Return: None
+ * Return: void
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -843,16 +833,16 @@ H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsiz
#endif /* LATER */
/*-------------------------------------------------------------------------
- * Function: H5VM_array_fill
+ * Function: H5VM_array_fill
*
- * Purpose: Fills all bytes of an array with the same value using
- * memset(). Increases amount copied by power of two until the
- * halfway point is crossed, then copies the rest in one swoop.
+ * Purpose: Fills all bytes of an array with the same value using
+ * memset(). Increases amount copied by power of two until the
+ * halfway point is crossed, then copies the rest in one swoop.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, June 18, 1998
+ * Programmer: Quincey Koziol
+ * Thursday, June 18, 1998
*
*-------------------------------------------------------------------------
*/
@@ -895,25 +885,25 @@ H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count)
} /* H5VM_array_fill() */
/*-------------------------------------------------------------------------
- * Function: H5VM_array_down
+ * Function: H5VM_array_down
*
- * Purpose: Given a set of dimension sizes, calculate the size of each
+ * Purpose: Given a set of dimension sizes, calculate the size of each
* "down" slice. This is the size of the dimensions for all the
* dimensions below the current one, which is used for indexing
* offsets in this dimension.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: void
*
- * Programmer: Quincey Koziol
- * Monday, April 28, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 28, 2003
*
*-------------------------------------------------------------------------
*/
-herr_t
+void
H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
{
- hsize_t acc; /*accumulator */
- int i; /*counter */
+ hsize_t acc; /* Accumulator */
+ int i; /* Counter */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -921,31 +911,31 @@ H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
HDassert(total_size);
HDassert(down);
- /* Build the sizes of each dimension in the array */
- /* (From fastest to slowest) */
+ /* Build the sizes of each dimension in the array
+ * (From fastest to slowest)
+ */
for (i = (int)(n - 1), acc = 1; i >= 0; i--) {
down[i] = acc;
acc *= total_size[i];
- } /* end for */
+ }
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI_VOID
} /* end H5VM_array_down() */
/*-------------------------------------------------------------------------
* Function: H5VM_array_offset_pre
*
- * Purpose: Given a coordinate description of a location in an array, this
- * function returns the byte offset of the coordinate.
+ * Purpose: Given a coordinate description of a location in an array, this
+ * function returns the byte offset of the coordinate.
*
- * The dimensionality of the whole array, and the offset is N.
+ * The dimensionality of the whole array, and the offset is N.
* The whole array dimensions are TOTAL_SIZE and the coordinate
* is at offset OFFSET.
*
- * Return: Success: Byte offset from beginning of array to element offset
- * Failure: abort() -- should never fail
+ * Return: Byte offset from beginning of array to element offset
*
* Programmer: Quincey Koziol
- * Tuesday, June 22, 1999
+ * Tuesday, June 22, 1999
*
*-------------------------------------------------------------------------
*/
@@ -971,18 +961,17 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
/*-------------------------------------------------------------------------
* Function: H5VM_array_offset
*
- * Purpose: Given a coordinate description of a location in an array, this
- * function returns the byte offset of the coordinate.
+ * Purpose: Given a coordinate description of a location in an array,
+ * this function returns the byte offset of the coordinate.
*
- * The dimensionality of the whole array, and the offset is N.
+ * The dimensionality of the whole array, and the offset is N.
* The whole array dimensions are TOTAL_SIZE and the coordinate
* is at offset OFFSET.
*
- * Return: Success: Byte offset from beginning of array to element offset
- * Failure: abort() -- should never fail
+ * Return: Byte offset from beginning of array to element offset
*
* Programmer: Quincey Koziol
- * Tuesday, June 22, 1999
+ * Tuesday, June 22, 1999
*
*-------------------------------------------------------------------------
*/
@@ -992,38 +981,36 @@ H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset)
hsize_t acc_arr[H5VM_HYPER_NDIMS]; /* Accumulated size of down dimensions */
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */
+ FUNC_ENTER_NOAPI_NOERR
HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(total_size);
HDassert(offset);
/* Build the sizes of each dimension in the array */
- if (H5VM_array_down(n, total_size, acc_arr) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes")
+ H5VM_array_down(n, total_size, acc_arr);
/* Set return value */
ret_value = H5VM_array_offset_pre(n, acc_arr, offset);
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VM_array_offset() */
/*-------------------------------------------------------------------------
* Function: H5VM_array_calc_pre
*
- * Purpose: Given a linear offset in an array, the dimensions of that
+ * Purpose: Given a linear offset in an array, the dimensions of that
* array and the pre-computed 'down' (accumulator) sizes, this
* function computes the coordinates of that offset in the array.
*
- * The dimensionality of the whole array, and the coordinates is N.
+ * The dimensionality of the whole array, and the coordinates is N.
* The array dimensions are TOTAL_SIZE and the coordinates
* are returned in COORD. The linear offset is in OFFSET.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, July 16, 2009
+ * Programmer: Quincey Koziol
+ * Thursday, July 16, 2009
*
*-------------------------------------------------------------------------
*/
@@ -1050,18 +1037,18 @@ H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *co
/*-------------------------------------------------------------------------
* Function: H5VM_array_calc
*
- * Purpose: Given a linear offset in an array and the dimensions of that
+ * Purpose: Given a linear offset in an array and the dimensions of that
* array, this function computes the coordinates of that offset
* in the array.
*
- * The dimensionality of the whole array, and the coordinates is N.
+ * The dimensionality of the whole array, and the coordinates is N.
* The array dimensions are TOTAL_SIZE and the coordinates
* are returned in COORD. The linear offset is in OFFSET.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Wednesday, April 16, 2003
+ * Programmer: Quincey Koziol
+ * Wednesday, April 16, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1079,8 +1066,7 @@ H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *
HDassert(coords);
/* Build the sizes of each dimension in the array */
- if (H5VM_array_down(n, total_size, idx) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute down sizes")
+ H5VM_array_down(n, total_size, idx);
/* Compute the coordinates from the offset */
if (H5VM_array_calc_pre(offset, n, idx, coords) < 0)
@@ -1093,7 +1079,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VM_chunk_index
*
- * Purpose: Given a coordinate offset (COORD), the size of each chunk
+ * Purpose: Given a coordinate offset (COORD), the size of each chunk
* (CHUNK), the number of chunks in each dimension (NCHUNKS)
* and the number of dimensions of all of these (NDIMS), calculate
* a "chunk index" for the chunk that the coordinate offset is
@@ -1123,10 +1109,10 @@ done:
* The chunk index is placed in the CHUNK_IDX location for return
* from this function
*
- * Return: Chunk index on success (can't fail)
+ * Return: Chunk index on success (can't fail)
*
- * Programmer: Quincey Koziol
- * Monday, April 21, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 21, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1151,14 +1137,14 @@ H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, co
} /* end H5VM_chunk_index() */
/*-------------------------------------------------------------------------
- * Function: H5VM_chunk_scaled
+ * Function: H5VM_chunk_scaled
*
- * Purpose: Compute the scaled coordinates for a chunk offset
+ * Purpose: Compute the scaled coordinates for a chunk offset
*
- * Return: <none>
+ * Return: void
*
- * Programmer: Quincey Koziol
- * Wednesday, November 19, 2014
+ * Programmer: Quincey Koziol
+ * Wednesday, November 19, 2014
*
*-------------------------------------------------------------------------
*/
@@ -1186,7 +1172,7 @@ H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, h
/*-------------------------------------------------------------------------
* Function: H5VM_chunk_index_scaled
*
- * Purpose: Given a coordinate offset (COORD), the size of each chunk
+ * Purpose: Given a coordinate offset (COORD), the size of each chunk
* (CHUNK), the number of chunks in each dimension (NCHUNKS)
* and the number of dimensions of all of these (NDIMS), calculate
* a "chunk index" for the chunk that the coordinate offset is
@@ -1216,13 +1202,13 @@ H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, h
* The chunk index is placed in the CHUNK_IDX location for return
* from this function
*
- * Note: This routine is identical to H5VM_chunk_index(), except for
- * caching the scaled information. Make changes in both places.
+ * Note: This routine is identical to H5VM_chunk_index(), except for
+ * caching the scaled information. Make changes in both places.
*
- * Return: Chunk index on success (can't fail)
+ * Return: Chunk index on success (can't fail)
*
- * Programmer: Vailin Choi
- * Monday, February 9, 2015
+ * Programmer: Vailin Choi
+ * Monday, February 9, 2015
*
*-------------------------------------------------------------------------
*/
@@ -1257,22 +1243,22 @@ H5VM_chunk_index_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *ch
/*-------------------------------------------------------------------------
* Function: H5VM_opvv
*
- * Purpose: Perform an operation on a source & destination sequences
- * of offset/length pairs. Each set of sequnces has an array
- * of lengths, an array of offsets, the maximum number of
- * sequences and the current sequence to start at in the sequence.
+ * Purpose: Perform an operation on a source & destination sequences
+ * of offset/length pairs. Each set of sequnces has an array
+ * of lengths, an array of offsets, the maximum number of
+ * sequences and the current sequence to start at in the sequence.
*
* There may be different numbers of bytes in the source and
* destination sequences, the operation stops when either the
* source or destination sequence runs out of information.
*
- * Note: The algorithm in this routine is [basically] the same as for
- * H5VM_memcpyvv(). Changes should be made to both!
+ * Note: The algorithm in this routine is [basically] the same as for
+ * H5VM_memcpyvv(). Changes should be made to both!
*
- * Return: Non-negative # of bytes operated on, on success/Negative on failure
+ * Return: Non-negative # of bytes operated on, on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, September 30, 2010
+ * Programmer: Quincey Koziol
+ * Thursday, September 30, 2010
*
*-------------------------------------------------------------------------
*/
@@ -1460,7 +1446,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5VM_memcpyvv
*
- * Purpose: Given source and destination buffers in memory (SRC & DST)
+ * Purpose: Given source and destination buffers in memory (SRC & DST)
* copy sequences of from the source buffer into the destination
* buffer. Each set of sequences has an array of lengths, an
* array of offsets, the maximum number of sequences and the
@@ -1470,13 +1456,13 @@ done:
* destination sequences, data copying stops when either the
* source or destination buffer runs out of sequence information.
*
- * Note: The algorithm in this routine is [basically] the same as for
- * H5VM_opvv(). Changes should be made to both!
+ * Note: The algorithm in this routine is [basically] the same as for
+ * H5VM_opvv(). Changes should be made to both!
*
- * Return: Non-negative # of bytes copied on success/Negative on failure
+ * Return: Non-negative # of bytes copied on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Friday, May 2, 2003
+ * Programmer: Quincey Koziol
+ * Friday, May 2, 2003
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index 2fea2fc..0d3bd0f 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -105,7 +105,7 @@ H5_DLL herr_t H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_
const hssize_t *dst_stride, void *_dst, const hssize_t *src_stride,
const void *_src);
H5_DLL herr_t H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count);
-H5_DLL herr_t H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down);
+H5_DLL void H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down);
H5_DLL hsize_t H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset);
H5_DLL hsize_t H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset);
H5_DLL herr_t H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *coords);
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index d8fed41..d29d8e5 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -48,7 +48,7 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{
H5Z__filter_deflate, /* The actual filter function */
}};
-#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * (double)1.001f) + 12)
+#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * 1.001) + 12)
/*-------------------------------------------------------------------------
* Function: H5Z__filter_deflate
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 25acc05..97678b0 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -1116,7 +1116,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu
unsigned filavail; /* flag indicating if fill value is defined or not */
H5Z_SO_scale_type_t scale_type = H5Z_SO_FLOAT_DSCALE; /* scale type */
int scale_factor = 0; /* scale factor */
- double D_val = 0.0f; /* decimal scale factor */
+ double D_val = 0.0; /* decimal scale factor */
uint32_t minbits = 0; /* minimum number of bits to store values */
unsigned long long minval = 0; /* minimum value of input buffer */
enum H5Z_scaleoffset_t type; /* memory type corresponding to dataset datatype */
diff --git a/src/H5private.h b/src/H5private.h
index 6b29a44..56ded14 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -363,7 +363,6 @@
*/
#define SUCCEED 0
#define FAIL (-1)
-#define UFAIL (unsigned)(-1)
/* The HDF5 library uses the symbol `ERR` frequently. So do
* header files for libraries such as curses(3), terminfo(3), etc.
diff --git a/src/H5timer.c b/src/H5timer.c
index 54a3365..b2cc5f0 100644
--- a/src/H5timer.c
+++ b/src/H5timer.c
@@ -42,9 +42,9 @@
#define H5TIMER_TIME_STRING_LEN 1536
/* Conversion factors */
-#define H5_SEC_PER_DAY (double)(24.0F * 60.0F * 60.0F)
-#define H5_SEC_PER_HOUR (double)(60.0F * 60.0F)
-#define H5_SEC_PER_MIN (double)(60.0F)
+#define H5_SEC_PER_DAY (24.0 * 60.0 * 60.0)
+#define H5_SEC_PER_HOUR (60.0 * 60.0)
+#define H5_SEC_PER_MIN (60.0)
/******************/
/* Local Typedefs */
@@ -100,13 +100,13 @@ H5_bandwidth(char *buf /*out*/, double nbytes, double nseconds)
{
double bw;
- if (nseconds <= (double)0.0F)
+ if (nseconds <= 0.0)
HDstrcpy(buf, " NaN");
else {
bw = nbytes / nseconds;
- if (H5_DBL_ABS_EQUAL(bw, (double)0.0F))
+ if (H5_DBL_ABS_EQUAL(bw, 0.0))
HDstrcpy(buf, "0.000 B/s");
- else if (bw < (double)1.0F)
+ else if (bw < 1.0)
HDsprintf(buf, "%10.4e", bw);
else if (bw < (double)H5_KB) {
HDsprintf(buf, "%05.4f", bw);
@@ -224,7 +224,7 @@ H5_now_usec(void)
double
H5_get_time(void)
{
- double ret_value = (double)0.0f;
+ double ret_value = 0.0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -233,14 +233,14 @@ H5_get_time(void)
struct timespec ts;
HDclock_gettime(CLOCK_MONOTONIC, &ts);
- ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / (double)1000000000.0f);
+ ret_value = (double)ts.tv_sec + ((double)ts.tv_nsec / 1000000000.0);
}
#elif defined(H5_HAVE_GETTIMEOFDAY)
{
struct timeval now_tv;
HDgettimeofday(&now_tv, NULL);
- ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / (double)1000000.0f);
+ ret_value = (double)now_tv.tv_sec + ((double)now_tv.tv_usec / 1000000.0);
}
#else
ret_value = (double)HDtime(NULL);
@@ -289,8 +289,8 @@ H5__timer_get_timevals(H5_timevals_t *times /*in,out*/)
if (HDgetrusage(RUSAGE_SELF, &res) < 0)
return -1;
- times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / (double)1.0E6F);
- times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / (double)1.0E6F);
+ times->system = (double)res.ru_stime.tv_sec + ((double)res.ru_stime.tv_usec / 1.0E6);
+ times->user = (double)res.ru_utime.tv_sec + ((double)res.ru_utime.tv_usec / 1.0E6);
}
#else
/* No suitable way to get system/user times */
@@ -589,7 +589,7 @@ H5_timer_get_time_string(double seconds)
double remainder_sec = 0.0;
/* Extract larger time units from count of seconds */
- if (seconds > (double)60.0F) {
+ if (seconds > 60.0) {
/* Set initial # of seconds */
remainder_sec = seconds;
@@ -617,19 +617,19 @@ H5_timer_get_time_string(double seconds)
* time unit. Perhaps this could be passed as an integer.
* (name? round_up_size? ?)
*/
- if (seconds < (double)0.0F)
+ if (seconds < 0.0)
HDsprintf(s, "N/A");
- else if (H5_DBL_ABS_EQUAL((double)0.0F, seconds))
+ else if (H5_DBL_ABS_EQUAL(0.0, seconds))
HDsprintf(s, "0.0 s");
- else if (seconds < (double)1.0E-6F)
+ else if (seconds < 1.0E-6)
/* t < 1 us, Print time in ns */
- HDsprintf(s, "%.f ns", seconds * (double)1.0E9F);
- else if (seconds < (double)1.0E-3F)
+ HDsprintf(s, "%.f ns", seconds * 1.0E9);
+ else if (seconds < 1.0E-3)
/* t < 1 ms, Print time in us */
- HDsprintf(s, "%.1f us", seconds * (double)1.0E6F);
- else if (seconds < (double)1.0F)
+ HDsprintf(s, "%.1f us", seconds * 1.0E6);
+ else if (seconds < 1.0)
/* t < 1 s, Print time in ms */
- HDsprintf(s, "%.1f ms", seconds * (double)1.0E3F);
+ HDsprintf(s, "%.1f ms", seconds * 1.0E3);
else if (seconds < H5_SEC_PER_MIN)
/* t < 1 m, Print time in s */
HDsprintf(s, "%.2f s", seconds);
diff --git a/src/H5trace.c b/src/H5trace.c
index 7ae96b3..71675aa 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -3718,5 +3718,5 @@ error:
if (H5_debug_g.ttimes)
return function_times.elapsed;
else
- return (double)0.0F;
+ return 0.0;
} /* end H5_trace() */