summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_str.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-02-08 16:56:16 (GMT)
committerGitHub <noreply@github.com>2021-02-08 16:56:16 (GMT)
commit22c67ff6570f16050f0a5654cf1c84df917bb598 (patch)
tree38fb63aa498b250c2543fe7e22a511706de96a42 /tools/lib/h5tools_str.c
parent551f15f8ae02ca9c995619b216121081eb07633e (diff)
downloadhdf5-hdf5-1_8_22.zip
hdf5-hdf5-1_8_22.tar.gz
hdf5-hdf5-1_8_22.tar.bz2
1.8/master (#317)hdf5-1_8_22
* Revert incorrect bool type * Correct grep text for filter test * Check sizeof type to use correct ref_type * h5dump reg ref chnages has no error file * Fix comment * Remove unneeded files * Verify the decoded version for "all" and "none" selection. * Remove double entry * Add missing include * Snapshot version 1.8 release 22 (snap4) Update version to 1.8-snap5 * Fixes for test failures with --disable-tests --disable-tools options. Don't test ph5diff if tests are disabled. * Correct conditions for parallel builds with and without tests. * Snapshot version 1.8 release 22 (snap5) Update version to 1.8.22-snap6 * TRILAB-192 merging warnings changes from develop * Autotools reconfigure update * Restore page ejects. * Restore page eject chars * Fix orphaned token * Update LT files * Correct extra flags and merge TRILAB-24 * Update release note for CMake warnings * H5repack bug fixes from develop * TRILAB-192 - merge changes from develop Single source, config files, for warnings for both autotools and CMake. Update CMake libraries, tools, tests to use correct flags. * Add missing m4 file * Remove 128bit config check fo 1.8 * TRILAB-192 update LTparse files * A fix in the cleaning up code for datatype when datatype initialization via H5D__init_type() fails. The code to fix the problem is the same as what is done in H5D__open_oid(). * Add missing " and update function calls incorrectly named load_gcc_arguments. Commit changes to gnu-cxxflags to remove unmatched " and to gnu-fflags to not add C warnings flags to H5_FCFLAGS. * TRILAB-192 - cleanup edits and match CMake CXX to autotools * Fix shadowed type * TRILAB-192 correct fortran commands * TRILAB-192 version of std=f2008 special check * Fix shadow variable * Add prefix_relto_examplesdir function to set relative path to h5c++. * TRILAB-192 - parser files cannot handle this warning * Parallel Fortran tests now use the MPI module instead of including mpif.h. * Don't add general warnings flags for unsupported old versions of gcc and g++ (older than gcc/g++ 4.2). Correct gnu-cxxflags to determine warnings flags to be added based on C++ compiler version instead of C compiler version. * Snapshot version 1.8 release 22 (snap6) Update version to 1.8.22-snap7 * TRILAB-244 separate CXX warnings and errors from C * Fix NoFilter build * Move ADD_H5_FLAGS macro from *CompilerFlags.cmake files to config/cmake_ext_mod/HDFMacros.cmake for common use. * Restrict errors to gcc 4.8 and above. * OESS-65 replace szip with aec szip * Correct CMake version * Correct -Werror=unused-variable * Add -Werror= flags to lists displayed in libhdf5.settings. * Fix -Werror=unused-variable * More fixes for unused variable * Resolve warning errors from -Werror= flags: -Werror=bad-function-cast -Werror=bad-function-cast -Werror=implicit-function-declaration -Werror=nested-externs * Remove verbose assignments in smoke_check 3 and 5 functions. * Update to use optimization flags, C++ error flags, and correct libhdf5.settings.in to remove unworkable changes. * Update config/gnu-cxxflags. * Add missing headers * Fix ifort warning flag. Restore AC_DEFUN([PAC_PROG_FC_DEFAULT_REALisDBLE] in m4/aclocal_fc.m4. Add --enable-symbols, --enable-profiling, and --enable-optimization options to autotools configure; all configure flags for --enable-production and --disable-production should match HDF5 1.10 and 1.12 production and debug default flags. * Add github actions file * Correct path * OESS-65 Fix packaging * Update reference name * Correct filename * disable pr action and enable fail fast * Snapshot 1.8.22-snap7 Update version to 1.8.22-snap8. * Correct mingw path * Correct mingw paths * Revise gnu-*flags and cmake/HDF*CompilerFlags.cmake files to add warning flags for GCC compilers version 4.8 and above. Removed files from gnu-warnings that only apply to versions < 4.8. Consolidated warnings from versions < 4.8 that apply to versions >= 4.8 into the 4.8 warnings files. * Update MANIFEST for removal of older warnings files. * Yanked all MPI-1 calls Added batch scripts in bin/batch. * Snapshot 1.8.22-snap8. Update version to 1.8.22-snap9. * Squashed commit of the following: commit 45b0cbc71929930a874e1c09e0770aa64d0ae697 Author: Larry Knox <lrknox@hdfgroup.org> Date: Thu Apr 23 13:14:56 2020 -0500 Add C++ warnings treated as error for autotools builds. commit 6debcddcc766601799d5bd661bd60946f951a07e Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 16:50:03 2020 -0500 Remove tests for develop branch from testh5cc.sh.in. Add @H5_ECXXFLAGS@ to AM_CXXFLAGS. commit fed497e7f207313b2a133d3b68c942b7d7104b90 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 12 15:06:39 2020 -0500 Merge pull request #2646 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '998c6470d78e14228695419c3b514c35ecf3d69e': Remove unnecessary version conditions for Clang compilers. commit 92e52ce5c211bd1d3991a3b8bb67287ac7b652aa Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 18:53:45 2020 -0500 Merge pull request #2639 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'a33667faf226f5d8c9633bf537893e8fce1bf1f6': Add c++ to --enable-sanitize-checks option. commit 2e802534fb997b81fa98fdd1c7d97d4310898e0d Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 15:18:36 2020 -0500 Merge pull request #2633 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '20eab963899841c9a003baebead8e3bc07d9e127': Remove duplicate entries in MANIFEST. Make changes to CMake CompilerFlags.cmake files so extra flags are loaded for non-GNU compilers. Update new clang files to not pick up clang as vendor for pgCC. Add new files to MANIFEST Temporary demotion of 2 -Werror warning flags that fail on macos 10.12 Remove Production flag unknown to Apple clang. commit 96ef60a58a23847a7da89a891f2415055ec2ab60 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 16:24:49 2020 -0500 Merge pull request #2631 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'b942a4d8a3e27317cac50ce37ff5302d477664d8': Clean up code to get clang version in config/linux-gnulibc1 commit 8a7c687da568e8b50b38fa53da1ca63759be6ec4 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 11:42:37 2020 -0500 Merge pull request #2623 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'c7626f79fdee4eee13925e240ef41e61f3367eab': Add flags from config/clang-warnings/*general files to H5 C and CXX flags for all versions of Clang and Clang++ compilers. Switched from cut to awk in testcheck_version.sh.in to avoid dependence on tab vs. " " in version definitions in H5public.h. Add files for adding warning flags for clang compilers in autotools configure. commit db3ef7ff3c1ed79167cecef831501411cff8291f Merge: 5a0f8d7 f9f1310 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 14:46:22 2020 -0500 Merge branch 'hdf5_1_12' of https://bitbucket.hdfgroup.org/scm/~lrknox/hdf5_lrk into hdf5_1_12 commit 5a0f8d7940ae57b445f545a0abd7e303ce6924ee Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 20:15:41 2020 -0500 Merge pull request #2636 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:HDFFV-11000-update-testh5cc.sh.in-for-version to develop * commit '5c0bd670d6e9919c463fbc05de99e2ba55b0761e': Add tests for all version to H5_NO_DEPRECATED_SYMBOLS section and to section for current version, with and without default API version flags. HDFFV-11000: update-testh5cc.sh.in to test sample versioned functions in HDF5 1.10, 1.12 and develop. * Update configure and Makefile.ins after bin/reconfigure. * Fix MANIFEST * Fix HDFFV-10591 Description: h52gif produced a segfault when a buffer overflow occurred because the data size was corrupted and became very large. This commit added a check on the data size against the buffer size to prevent the segfault. It also added error reporting to h52gif to display an error message instead of silently exiting when the failure occurred. Platforms tested: Linux/64 (jelly) * Snapshot 1.8.22-snap9. Update version to 1.8.22-snap10. * Merge pull request #2686 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '800f93f7c994f88dfa716746153ded4b1e690e3a': Remove path to szip header file from AM_CPPFLAGS when configure check of libsz fails. Fix for HDFFV-10830. * Regenerate configure. * Merge from 1.10-1.12-dev - LT parse needs update * Incorporate pull request #2693 from develop for the fix to HDFFV-11080: (1) Patch up the file pointer when reading attribute of variable length datatype (2) Test to verify the fix when doing multiple threads (3) Update MANIFEST (4) Add new test to Cmake * Switch bison and flex update of LT files from bin/genltanalyse to bin/genparser, and from automatically updating the LT files whenever reconfigure is run to running only on man<F12>ual command. * Update hl/sr/H5LT files. Add bin/genparser to MANIFEST; remove bin/genltanalyze. * Fix to the merge of PR #2708 for HDFFV-11080 to the 1.8 branch. Need to checkin test/Makefile.in for the new file added. * Fix HDFFV-11120 and HDFFV-11121 (CVE-2018-13870 and CVE-2018-13869) Description: When a buffer overflow occurred because a name length was corrupted and became very large, h5dump produced a segfault on one file and a memcpy parameter overlap on another file. This commit added checks that detect a read pass the end of the buffer to prevent these error conditions. Platforms tested: Linux/64 (jelly) * Fixed typo * Check for header szlib.h only when libsz passes AC_CHECK_LIB, so that H5_HAVE_SALIB_H is not defined when szip is not enabled, to prevent compile failures for incompatible szlib. * HDFFV-11127 - force RTLD_LOCAL in dlopen * spelling * Remove extra parens * Remove unnecessary assignment freom configure.ac. * Add hypen to subrelease regex * Add special case when H5_VERS_SUBRELEASE is 0 * Revert H5_VERS_SUBRELEASE check * The version string has a second use for packaging * MinGW uses "MinGW Makefiles" * Snapshot 1.8.22-snap10. Update version to 1.8.22-snap11. * Merge clang-format changes from develop * remove stray file * Source formatted * Add options to github actions. * Add back file, remove py file * HDFFV-11096 Correct h5dump usage text * Update formating * remove autogen for 1.8 branch * Fix comment whitespace * Change '==' to 'eq' in test script * Merge from develop github updates bin scripts parser updates * Snapshot 1.8.22-snap11. Update version to 1.8.22-snap12. * Merge from 1.10 Comments, whitespace Simple init and if block brackets. Minimal code changes limited to return value and spelling * Update autotools files * Update FD source * More merges from 1.10 comments and inits * Comment fixes * Fix macro argument * Remove autogen file and cache dir * Revert autotools files to previous version * Correct boolean value and missing define * URL and options corrections * revert autoconf files * Fix compile issues with vfd drivers. * Fix HDFS test * Remove extra #endif * Move init above execution * Multiple changes to bring branch up-to-date (#87) Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * hdf5 1 8 release text (#113) * Multiple changes to bring branch up-to-date Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * release text updates - mostly whitespace * Fixed HDFFV-10480 and HDFFV-11159 (#145) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Update HDF5 1.8 copyright headers with updated copyright URL (#148) * Update URL for COPYING file in copyright headers. * Make fortran copyright headers uniformly spaced. * Update url for Copyright file in c++/src/footer.html. * OESS-98 Update plugin build option (#171) * 1.8 has extra fortran CMake option (#176) * 1.8 has extra fortran CMake option * Update license URL * OESS-98 fix tools test for plugins (#180) * Hdf5 1 8 (#169) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Fixed HDFFV-11150 Description Replaced an HDassert with a check for null pointer in H5O_dec_rc() to catch null pointer in corrupted data situation. Reversed the fix in svn-r24463 in which a check for null pointer prior to calling H5O_dec_rc() Platforms tested: Linux/64 (jelly) * HDF5 1 8 fix fortran build on macs (#186) * Correct fortran and shared libs option * Fix for no shared fortran build * OESS-98 fix hdf5 link target (#191) * Partial changes to RELEASE.txt for release. (#185) * Partial changes to RELEASE.txt for release. * Update supported and tested platforms. * Update version to 1.8.22-12. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Update directory for SZ filter in HDF5PluginMacros.cmake. Updates for release: Switch configure default to production mode. Set HDF5_GENERATE_HEADERS to OFF. * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Restores maintainer mode in the autotools (#200) (#203) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Hdf5 1 8 22 (#212) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Brings ttsafe_attr_vlen.c changes from develop (#214) Fixes exposed pthread problem on Windows. * Update SO numbers for Hdf5 1 8 22 (#215) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Hdf5 1 8 22 (#224) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Update CMake/HDF5Examples version in bin/release * Update CMake/HDF5Examples version number in bin/release (#225) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Fixed typo in an error message. (#228) * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Bring 3 small changes from Hdf5 1.8 to 1.8.22 (#241) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#251) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#256) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. * Updated configure with reconfigure. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * RELEASE.txt cleanup. * Hdf5 1 8 22 (#261) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Hdf5 1 8 22 (#266) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Hdf5 1 8 22 - Reverts lock/unlock callback signature to 1.8.21 version (#267) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Update version in H5public.h * Hdf5 1 8 22 (#269) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Hdf5 1 8 22 (#279) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. * Hdf5 1 8 22 (#281) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org> * Hdf5 1 8 22 (#284) * Fixed typo in an error message. * Updated for HDFFV-11150, HDFFV-10480, and HDFFV-11159 * Update "Support for New Platforms and Compilers" section in RELEASE.txt; add check_version workaround for binary compatibility to "Known Problems". * Add SUSE Linux to tested platforms. * Update numbers in config/lt_vers.am and run bin/reconfigure for so numbers. * Update version in 3 files missed by merge. Co-authored-by: Allen Byrne <byrn@hdfgroup.org> Co-authored-by: Vailin Choi <vchoi@hdfgroup.org> Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org> Co-authored-by: hdftest <hdftest@hdfgroup.org> Co-authored-by: Jordan Henderson <jhenderson@hdfgroup.org> Co-authored-by: Dana Robinson <derobins@hdfgroup.org> Co-authored-by: Binh-Minh Ribler <bmribler@hdfgroup.org> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r--tools/lib/h5tools_str.c1138
1 files changed, 559 insertions, 579 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index fdd88ed..d3b3dc4 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -15,9 +15,9 @@
* Purpose: These are string functions for us to use and abuse.
*/
#include "H5private.h"
-#include "h5tools.h" /* for h5tool_format_t structure */
+#include "h5tools.h" /* for h5tool_format_t structure */
#include "h5tools_ref.h"
-#include "h5tools_str.h" /* function prototypes */
+#include "h5tools_str.h" /* function prototypes */
/*
* If REPEAT_VERBOSE is defined then character strings will be printed so
@@ -33,12 +33,12 @@
#define REPEAT_VERBOSE
/* Variable length string datatype */
-#define STR_INIT_LEN 4096 /*initial length */
+#define STR_INIT_LEN 4096 /*initial length */
-static char *h5tools_escape(char *s, size_t size);
-static hbool_t h5tools_str_is_zero(const void *_mem, size_t size);
-static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch);
-void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx);
+static char * h5tools_escape(char *s, size_t size);
+static hbool_t h5tools_str_is_zero(const void *_mem, size_t size);
+static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch);
+void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx);
/*-------------------------------------------------------------------------
* Function: h5tools_str_close
@@ -96,23 +96,23 @@ h5tools_str_len(h5tools_str_t *str)
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...)
+h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...)
{
- va_list ap;
+ va_list ap;
/* Make sure we have some memory into which to print */
- if(!str->s || str->nalloc <= 0)
+ if (!str->s || str->nalloc <= 0)
h5tools_str_reset(str);
- if(HDstrlen(fmt) == 0)
+ if (HDstrlen(fmt) == 0)
/* nothing to print */
return str->s;
/* Format the arguments and append to the value already in `str' */
- while(1) {
+ while (1) {
/* How many bytes available for new value, counting the new NUL */
int nchars = -1;
- size_t avail = str->nalloc - str->len;
+ size_t avail = str->nalloc - str->len;
HDva_start(ap, fmt);
nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap);
@@ -129,11 +129,11 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...)
* to lack of buffer size, so try one more time after realloc more
* buffer size before return NULL.
*/
- if(nchars < 0)
+ if (nchars < 0)
/* failure, such as bad format */
return NULL;
- if((size_t) nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) {
+ if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) {
/* Truncation return value as documented by C99, or zero return value with either of the
* following conditions, each of which indicates that the proper C99 return value probably
* should have been positive when the format string is
@@ -142,7 +142,7 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...)
*/
size_t newsize = MAX(str->len + (size_t)nchars + 1, 2 * str->nalloc);
HDassert(newsize > str->nalloc); /*overflow*/
- str->s = (char*)HDrealloc(str->s, newsize);
+ str->s = (char *)HDrealloc(str->s, newsize);
HDassert(str->s);
str->nalloc = newsize;
}
@@ -171,16 +171,16 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...)
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_reset(h5tools_str_t *str/*in,out*/)
+h5tools_str_reset(h5tools_str_t *str /*in,out*/)
{
- if(!str->s || str->nalloc <= 0) {
+ if (!str->s || str->nalloc <= 0) {
str->nalloc = STR_INIT_LEN;
- str->s = (char*)HDmalloc(str->nalloc);
+ str->s = (char *)HDmalloc(str->nalloc);
HDassert(str->s);
}
str->s[0] = '\0';
- str->len = 0;
+ str->len = 0;
return str->s;
}
@@ -198,10 +198,10 @@ h5tools_str_reset(h5tools_str_t *str/*in,out*/)
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_trunc(h5tools_str_t *str/*in,out*/, size_t size)
+h5tools_str_trunc(h5tools_str_t *str /*in,out*/, size_t size)
{
- if(size < str->len) {
- str->len = size;
+ if (size < str->len) {
+ str->len = size;
str->s[size] = '\0';
}
@@ -226,26 +226,26 @@ h5tools_str_trunc(h5tools_str_t *str/*in,out*/, size_t size)
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt)
+h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt)
{
- char _temp[1024], *temp = _temp;
+ char _temp[1024], *temp = _temp;
HDassert(str);
HDassert(fmt);
/* If the format string is simply "%s" then don't bother doing anything */
- if(!HDstrcmp(fmt, "%s"))
+ if (!HDstrcmp(fmt, "%s"))
return str->s;
/*
* Save the input value if there is a `%' anywhere in FMT. Otherwise
* don't bother because we don't need a temporary copy.
*/
- if(HDstrchr(fmt, '%')) {
+ if (HDstrchr(fmt, '%')) {
size_t n = sizeof(_temp);
- if(str->len - start + 1 > n) {
- n = str->len - start + 1;
- temp = (char*)HDmalloc(n);
+ if (str->len - start + 1 > n) {
+ n = str->len - start + 1;
+ temp = (char *)HDmalloc(n);
HDassert(temp);
}
@@ -257,7 +257,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt)
h5tools_str_append(str, fmt, temp);
/* Free the temp buffer if we allocated one */
- if(temp != _temp)
+ if (temp != _temp)
HDfree(temp);
return str->s;
@@ -277,37 +277,45 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt)
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
- hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx)
+h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno, unsigned ndims,
+ h5tools_context_t *ctx)
{
- size_t i = 0;
- hsize_t curr_pos = elmtno;
+ size_t i = 0;
+ hsize_t curr_pos = elmtno;
+ H5TOOLS_START_DEBUG("");
+
+ H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims);
h5tools_str_reset(str);
- if(ndims > 0) {
+ H5TOOLS_DEBUG("ndims=%d", ndims);
+ if (ndims > 0) {
/*
* Calculate the number of elements represented by a unit change in a
* certain index position.
*/
- for(i = 0; i < (size_t) ndims; i++) {
+ for (i = 0; i < (size_t)ndims; i++) {
+ H5TOOLS_DEBUG("curr_pos=%ld - ctx->acc[%d]=%ld", curr_pos, i, ctx->acc[i]);
ctx->pos[i] = curr_pos / ctx->acc[i];
curr_pos -= ctx->acc[i] * ctx->pos[i];
+ H5TOOLS_DEBUG("curr_pos=%ld - ctx->pos[%d]=%ld - ctx->acc[%d]=%ld", curr_pos, i, ctx->pos[i], i,
+ ctx->acc[i]);
}
HDassert(curr_pos == 0);
/* Print the index values */
- for(i = 0; i < (size_t) ndims; i++) {
+ for (i = 0; i < (size_t)ndims; i++) {
if (i)
h5tools_str_append(str, "%s", OPT(info->idx_sep, ","));
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT),
- (hsize_t) ctx->pos[i]);
-
+ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)ctx->pos[i]);
}
}
- else /* Scalar */
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) 0);
+ else /* Scalar */
+ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)elmtno);
+ H5TOOLS_DEBUG("str=%s", str->s);
+
+ H5TOOLS_ENDDEBUG("");
/* Add prefix and suffix to the index */
return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
@@ -327,45 +335,43 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info,
- hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t max_idx[],
- h5tools_context_t *ctx)
+h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, hsize_t *ptdata,
+ unsigned ndims, hsize_t max_idx[], h5tools_context_t *ctx)
{
- size_t i = 0;
- hsize_t curr_pos = elmtno;
- hsize_t p_prod[H5S_MAX_RANK];
+ size_t i = 0;
+ hsize_t curr_pos = elmtno;
+ hsize_t p_prod[H5S_MAX_RANK];
h5tools_str_reset(str);
- if(ndims > 0) {
+ if (ndims > 0) {
/*
* Calculate the number of elements represented by a unit change in a
* certain index position.
*/
- for(i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i)
+ for (i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i)
p_prod[i - 1] = (max_idx[i]) * p_prod[i];
- for(i = 0; i < (size_t) ndims; i++) {
- if(curr_pos > 0) {
+ for (i = 0; i < (size_t)ndims; i++) {
+ if (curr_pos > 0) {
ctx->pos[i] = curr_pos / p_prod[i];
curr_pos -= p_prod[i] * ctx->pos[i];
}
else
ctx->pos[i] = 0;
- ctx->pos[i] += (unsigned long) ptdata[ctx->sm_pos+i];
+ ctx->pos[i] += (unsigned long)ptdata[ctx->sm_pos + i];
}
/* Print the index values */
- for(i = 0; i < (size_t) ndims; i++) {
- if(i)
+ for (i = 0; i < (size_t)ndims; i++) {
+ if (i)
h5tools_str_append(str, "%s", OPT(info->idx_sep, ","));
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) ctx->pos[i]);
-
+ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)ctx->pos[i]);
}
- } /* if (ndims > 0) */
- else /* Scalar */
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t) 0);
+ } /* if (ndims > 0) */
+ else /* Scalar */
+ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)0);
/* Add prefix and suffix to the index */
return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
@@ -384,45 +390,43 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info,
*-------------------------------------------------------------------------
*/
void
-h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace,
- const h5tool_format_t *info)
+h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_format_t *info)
{
- hssize_t snblocks;
+ hssize_t snblocks;
/*
* This function fails if the rspace does not have blocks.
*/
- H5E_BEGIN_TRY {
- snblocks = H5Sget_select_hyper_nblocks(rspace);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { snblocks = H5Sget_select_hyper_nblocks(rspace); }
+ H5E_END_TRY;
/* Print block information */
- if(snblocks > 0) {
- hsize_t alloc_size;
- hsize_t nblocks;
- hsize_t *ptdata;
- hsize_t u;
- unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace);
-
- nblocks = (hsize_t)snblocks;
+ if (snblocks > 0) {
+ hsize_t alloc_size;
+ hsize_t nblocks;
+ hsize_t *ptdata;
+ hsize_t u;
+ unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace);
+
+ nblocks = (hsize_t)snblocks;
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
- HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
- ptdata = (hsize_t *)HDmalloc((size_t) alloc_size);
+ HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ ptdata = (hsize_t *)HDmalloc((size_t)alloc_size);
H5Sget_select_hyper_blocklist(rspace, (hsize_t)0, nblocks, ptdata);
- for(u = 0; u < nblocks; u++) {
+ for (u = 0; u < nblocks; u++) {
unsigned v;
- h5tools_str_append(str, info->dset_blockformat_pre, u ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)u);
+ h5tools_str_append(str, info->dset_blockformat_pre, u ? "," OPTIONAL_LINE_BREAK " " : "",
+ (unsigned long)u);
/* Start coordinates and opposite corner */
- for(v = 0; v < ndims; v++)
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(",
- ptdata[u * 2 * ndims + v]);
+ for (v = 0; v < ndims; v++)
+ h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", ptdata[u * 2 * ndims + v]);
- for(v = 0; v < ndims; v++)
+ for (v = 0; v < ndims; v++)
h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : ")-(",
- ptdata[u * 2 * ndims + v + ndims]);
+ ptdata[u * 2 * ndims + v + ndims]);
h5tools_str_append(str, ")");
}
@@ -443,41 +447,38 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace,
*-------------------------------------------------------------------------
*/
void
-h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace,
- const h5tool_format_t *info)
+h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_format_t *info)
{
- hssize_t snpoints;
+ hssize_t snpoints;
/*
* This function fails if the rspace does not have points.
*/
- H5E_BEGIN_TRY {
- snpoints = H5Sget_select_elem_npoints(rspace);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { snpoints = H5Sget_select_elem_npoints(rspace); }
+ H5E_END_TRY;
/* Print point information */
if (snpoints > 0) {
- hsize_t alloc_size;
- hsize_t npoints;
- hsize_t *ptdata;
- hsize_t u;
- unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace);
+ hsize_t alloc_size;
+ hsize_t npoints;
+ hsize_t *ptdata;
+ hsize_t u;
+ unsigned ndims = (unsigned)H5Sget_simple_extent_ndims(rspace);
- npoints = (hsize_t)snpoints;
+ npoints = (hsize_t)snpoints;
alloc_size = npoints * ndims * sizeof(ptdata[0]);
- HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
- ptdata = (hsize_t *)HDmalloc((size_t) alloc_size);
+ HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ ptdata = (hsize_t *)HDmalloc((size_t)alloc_size);
H5Sget_select_elem_pointlist(rspace, (hsize_t)0, npoints, ptdata);
- for(u = 0; u < npoints; u++) {
+ for (u = 0; u < npoints; u++) {
unsigned v;
h5tools_str_append(str, info->dset_ptformat_pre, u ? "," OPTIONAL_LINE_BREAK " " : "",
(unsigned long)u);
- for(v = 0; v < ndims; v++)
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(",
- (ptdata[u * ndims + v]));
+ for (v = 0; v < ndims; v++)
+ h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", (ptdata[u * ndims + v]));
h5tools_str_append(str, ")");
}
@@ -498,78 +499,77 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace,
static void
h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch)
{
- if(info->str_locale == ESCAPE_HTML) {
- if(ch <= ' ' || ch > '~')
+ if (info->str_locale == ESCAPE_HTML) {
+ if (ch <= ' ' || ch > '~')
h5tools_str_append(str, "%%%02x", ch);
else
h5tools_str_append(str, "%c", ch);
}
else {
- switch(ch) {
- case '"':
- if(!info->do_escape)
- h5tools_str_append(str, "\"");
- else
- h5tools_str_append(str, "\\\"");
- break;
- case '\\':
- if (!info->do_escape)
- h5tools_str_append(str, "\\");
- else
- h5tools_str_append(str, "\\\\");
- break;
- case '\b':
- if(!info->do_escape)
- h5tools_str_append(str, "\b");
- else
- h5tools_str_append(str, "\\b");
- break;
- case '\f':
- if(!info->do_escape)
- h5tools_str_append(str, "\f");
- else
- h5tools_str_append(str, "\\f");
- break;
- case '\n':
- if(!info->do_escape) {
- h5tools_str_append(str, "\n");
- h5tools_str_append(str, " ");
- }
- else
- h5tools_str_append(str, "\\n");
- break;
- case '\r':
- if(!info->do_escape) {
- h5tools_str_append(str, "\r");
- h5tools_str_append(str, " ");
- }
- else
- h5tools_str_append(str, "\\r");
- break;
- case '\t':
- if(!info->do_escape)
- h5tools_str_append(str, "\t");
- else
- h5tools_str_append(str, "\\t");
- break;
- default:
- if(isprint(ch))
- h5tools_str_append(str, "%c", ch);
- else
- h5tools_str_append(str, "\\%03o", ch);
+ switch (ch) {
+ case '"':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\"");
+ else
+ h5tools_str_append(str, "\\\"");
+ break;
+ case '\\':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\\");
+ else
+ h5tools_str_append(str, "\\\\");
+ break;
+ case '\b':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\b");
+ else
+ h5tools_str_append(str, "\\b");
+ break;
+ case '\f':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\f");
+ else
+ h5tools_str_append(str, "\\f");
+ break;
+ case '\n':
+ if (!info->do_escape) {
+ h5tools_str_append(str, "\n");
+ h5tools_str_append(str, " ");
+ }
+ else
+ h5tools_str_append(str, "\\n");
+ break;
+ case '\r':
+ if (!info->do_escape) {
+ h5tools_str_append(str, "\r");
+ h5tools_str_append(str, " ");
+ }
+ else
+ h5tools_str_append(str, "\\r");
+ break;
+ case '\t':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\t");
+ else
+ h5tools_str_append(str, "\\t");
+ break;
+ default:
+ if (isprint(ch))
+ h5tools_str_append(str, "%c", ch);
+ else
+ h5tools_str_append(str, "\\%03o", ch);
- break;
+ break;
}
}
}
void
-h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info,
- h5tools_context_t *ctx)
+h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx)
{
unsigned u, indentlevel = 0;
/* Write new prefix */
- if(ctx->indent_level > 0)
+ if (ctx->indent_level > 0)
indentlevel = ctx->indent_level;
else
/*
@@ -580,74 +580,38 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info,
*/
indentlevel = ctx->default_indent_level;
- for(u = 0; u < indentlevel; u++)
+ for (u = 0; u < indentlevel; u++)
h5tools_str_append(str, "%s", OPT(info->line_indent, ""));
}
/*-------------------------------------------------------------------------
* Function: h5tools_str_sprint
*
- * Purpose: Renders the value pointed to by VP of type TYPE into variable
- * length string STR.
- *
- * Return: A pointer to memory containing the result or NULL on error.
- *
- * Programmer: Robb Matzke
- * Thursday, July 23, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-04-26
- * Made this function safe from overflow problems by allowing it
- * to reallocate the output string.
- *
- * Robb Matzke, 1999-06-04
- * Added support for object references. The new `container'
- * argument is the dataset where the reference came from.
- *
- * Robb Matzke, 1999-06-07
- * Added support for printing raw data. If info->raw is non-zero
- * then data is printed in hexadecimal format.
- *
- * Robb Matzke, 2003-01-10
- * Binary output format is dd:dd:... instead of 0xdddd... so it
- * doesn't look like a hexadecimal integer, and thus users will
- * be less likely to complain that HDF5 didn't properly byte
- * swap their data during type conversion.
- *
- * Robb Matzke, LLNL, 2003-06-05
- * If TYPE is a variable length string then the pointer to
- * the value to pring (VP) is a pointer to a `char*'.
- *
- * PVN, 28 March 2006
- * added H5T_NATIVE_LDOUBLE case
- *
- * Raymond Lu, 2011-09-01
- * CLANG compiler complained about the line (about 800):
- * tempint = (tempint >> packed_data_offset) & packed_data_mask;
- * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is
- * 32-bit or more. For every kind of native integers, I changed the code
- * to make it zero if PACKED_DATA_OFFSET is greater than or equal to the
- * size of integer.
+ * Purpose: Renders the value pointed to by VP of type TYPE into variable
+ * length string STR.
*
+ * Return: A pointer to memory containing the result or NULL on error.
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container,
- hid_t type, void *vp, h5tools_context_t *ctx)
+h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, hid_t type, void *vp,
+ h5tools_context_t *ctx)
{
- size_t nsize, offset, size=0, nelmts, start;
+ size_t nsize, offset, size = 0, nelmts, start;
H5T_sign_t nsign;
- char *name = NULL;
+ char * name = NULL;
unsigned char *ucp_vp = (unsigned char *)vp;
- char *cp_vp = (char *)vp;
- hid_t memb = -1;
- hid_t obj = -1;
+ char * cp_vp = (char *)vp;
+ hid_t memb = H5I_INVALID_HID;
+ hid_t obj = H5I_INVALID_HID;
static char fmt_llong[8], fmt_ullong[8];
H5T_str_t pad;
H5T_class_t type_class;
+ char * ret_value = NULL;
+ H5TOOLS_START_DEBUG("");
/* Build default formats for long long types */
- if(!fmt_llong[0]) {
+ if (!fmt_llong[0]) {
HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH);
HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH);
}
@@ -657,39 +621,44 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
nsize = H5Tget_size(type);
nsign = H5Tget_sign(type);
- if(info->raw) {
+ if (info->raw) {
size_t i;
- if(1 == nsize)
+ H5TOOLS_DEBUG("info->raw");
+ if (1 == nsize)
h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]);
else
- for(i = 0; i < nsize; i++) {
- if(i)
+ for (i = 0; i < nsize; i++) {
+ if (i)
h5tools_str_append(str, ":");
h5tools_str_append(str, OPT(info->fmt_raw, "%02x"), ucp_vp[i]);
}
}
else {
- if((type_class = H5Tget_class(type)) < 0)
+ H5TOOLS_DEBUG("H5Tget_class(type)");
+ if ((type_class = H5Tget_class(type)) < 0) {
+ H5TOOLS_ENDDEBUG(" with %s", "NULL");
return NULL;
+ }
switch (type_class) {
case H5T_FLOAT:
- if(sizeof(float) == nsize) {
+ H5TOOLS_DEBUG("H5T_FLOAT");
+ if (sizeof(float) == nsize) {
/* if (H5Tequal(type, H5T_NATIVE_FLOAT)) */
float tempfloat;
HDmemcpy(&tempfloat, vp, sizeof(float));
h5tools_str_append(str, OPT(info->fmt_float, "%g"), (double)tempfloat);
}
- else if(sizeof(double) == nsize) {
+ else if (sizeof(double) == nsize) {
/* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */
double tempdouble;
HDmemcpy(&tempdouble, vp, sizeof(double));
h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble);
-#if H5_SIZEOF_LONG_DOUBLE !=0
+#if H5_SIZEOF_LONG_DOUBLE != 0
}
- else if(sizeof(long double) == nsize) {
+ else if (sizeof(long double) == nsize) {
/* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */
long double templdouble;
@@ -699,96 +668,100 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
}
break;
- case H5T_STRING:
- {
- unsigned int i;
- char quote = '\0';
- char *s;
-
- quote = '\0';
- if(H5Tis_variable_str(type)) {
- /* cp_vp is the pointer into the struct where a `char*' is stored. So we have
- * to dereference the pointer to get the `char*' to pass to HDstrlen(). */
- s = *(char**) cp_vp;
- if(s != NULL) size = HDstrlen(s);
- }
- else {
- s = cp_vp;
- size = H5Tget_size(type);
- }
- pad = H5Tget_strpad(type);
+ case H5T_STRING: {
+ unsigned int i;
+ char quote = '\0';
+ char * s;
+
+ H5TOOLS_DEBUG("H5T_STRING");
+ quote = '\0';
+ if (H5Tis_variable_str(type)) {
+ /* cp_vp is the pointer into the struct where a `char*' is stored. So we have
+ * to dereference the pointer to get the `char*' to pass to HDstrlen(). */
+ s = *(char **)((void *)cp_vp);
+ if (s != NULL)
+ size = HDstrlen(s);
+ }
+ else {
+ s = cp_vp;
+ size = H5Tget_size(type);
+ }
+ pad = H5Tget_strpad(type);
- /* Check for NULL pointer for string */
- if(s == NULL)
- h5tools_str_append(str, "NULL");
- else {
- for(i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
- unsigned j = 1;
-
- /*
- * Count how many times the next character repeats. If the
- * threshold is zero then that means it can repeat any number
- * of times.
- */
- if(info->str_repeat > 0) while (i + j < size && s[i] == s[i + j])
+ /* Check for NULL pointer for string */
+ if (s == NULL)
+ h5tools_str_append(str, "NULL");
+ else {
+ for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
+ unsigned j = 1;
+
+ /*
+ * Count how many times the next character repeats. If the
+ * threshold is zero then that means it can repeat any number
+ * of times.
+ */
+ if (info->str_repeat > 0)
+ while (i + j < size && s[i] == s[i + j])
j++;
- /*
- * Print the opening quote. If the repeat count is high enough to
- * warrant printing the number of repeats instead of enumerating
- * the characters, then make sure the character to be repeated is
- * in it's own quote.
- */
- if(info->str_repeat > 0 && j > info->str_repeat) {
- if(quote)
- h5tools_str_append(str, "%c", quote);
-
- quote = '\'';
- h5tools_str_append(str, "%s%c", i ? " " : "", quote);
- }
- else if(!quote) {
- quote = '"';
- h5tools_str_append(str, "%s%c", i ? " " : "", quote);
- }
-
- /* Print the character */
- h5tools_print_char(str, info, s[i]);
-
- /* Print the repeat count */
- if(info->str_repeat && j > info->str_repeat) {
+ /*
+ * Print the opening quote. If the repeat count is high enough to
+ * warrant printing the number of repeats instead of enumerating
+ * the characters, then make sure the character to be repeated is
+ * in it's own quote.
+ */
+ if (info->str_repeat > 0 && j > info->str_repeat) {
+ if (quote)
+ h5tools_str_append(str, "%c", quote);
+
+ quote = '\'';
+ h5tools_str_append(str, "%s%c", i ? " " : "", quote);
+ }
+ else if (!quote) {
+ quote = '"';
+ h5tools_str_append(str, "%s%c", i ? " " : "", quote);
+ }
+
+ /* Print the character */
+ h5tools_print_char(str, info, s[i]);
+
+ /* Print the repeat count */
+ if (info->str_repeat && j > info->str_repeat) {
#ifdef REPEAT_VERBOSE
- h5tools_str_append(str, "%c repeats %d times", quote, j - 1);
+ h5tools_str_append(str, "%c repeats %d times", quote, j - 1);
#else
- h5tools_str_append(str, "%c*%d", quote, j - 1);
-#endif /* REPEAT_VERBOSE */
- quote = '\0';
- i += j - 1;
- }
+ h5tools_str_append(str, "%c*%d", quote, j - 1);
+#endif /* REPEAT_VERBOSE */
+ quote = '\0';
+ i += j - 1;
}
+ }
- if(quote)
- h5tools_str_append(str, "%c", quote);
+ if (quote)
+ h5tools_str_append(str, "%c", quote);
- if(i == 0)
- /*empty string*/
- h5tools_str_append(str, "\"\"");
- } /* end else */
- }
- break;
+ if (i == 0)
+ /*empty string*/
+ h5tools_str_append(str, "\"\"");
+ } /* end else */
+ } break;
case H5T_INTEGER:
- if(sizeof(char) == nsize) {
- if(info->ascii)
- h5tools_print_char(str, info, (char) (*ucp_vp));
- else if(H5T_SGN_NONE == nsign) {
+ H5TOOLS_DEBUG("H5T_INTEGER");
+ if (sizeof(char) == nsize) {
+ if (info->ascii)
+ h5tools_print_char(str, info, (char)(*ucp_vp));
+ else if (H5T_SGN_NONE == nsign) {
unsigned char tempuchar;
HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(unsigned char))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(unsigned char))
tempuchar = 0;
else
- tempuchar = (unsigned char)((unsigned long long)(tempuchar >> packed_data_offset) & packed_data_mask);
+ tempuchar =
+ (unsigned char)((unsigned long long)(tempuchar >> packed_data_offset) &
+ packed_data_mask);
}
h5tools_str_append(str, OPT(info->fmt_uchar, "%hhu"), tempuchar);
}
@@ -796,22 +769,24 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
signed char tempchar;
HDmemcpy(&tempchar, cp_vp, sizeof(char));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(char))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(char))
tempchar = 0;
else
- tempchar = (signed char)((unsigned long long)(tempchar >> packed_data_offset) & packed_data_mask);
+ tempchar =
+ (signed char)((unsigned long long)(tempchar >> packed_data_offset) &
+ packed_data_mask);
}
h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar);
}
} /* end if (sizeof(char) == nsize) */
- else if(sizeof(int) == nsize) {
- if(H5T_SGN_NONE == nsign) {
+ else if (sizeof(int) == nsize) {
+ if (H5T_SGN_NONE == nsign) {
unsigned int tempuint;
HDmemcpy(&tempuint, vp, sizeof(unsigned int));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(unsigned int))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(unsigned int))
tempuint = 0;
else
tempuint = (unsigned)((tempuint >> packed_data_offset) & packed_data_mask);
@@ -822,25 +797,28 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
int tempint;
HDmemcpy(&tempint, vp, sizeof(int));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(int))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(int))
tempint = 0;
else
- tempint = (int)((unsigned long long)(tempint >> packed_data_offset) & packed_data_mask);
+ tempint = (int)((unsigned long long)(tempint >> packed_data_offset) &
+ packed_data_mask);
}
h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint);
}
} /* end if (sizeof(int) == nsize) */
- else if(sizeof(short) == nsize) {
- if(H5T_SGN_NONE == nsign) {
+ else if (sizeof(short) == nsize) {
+ if (H5T_SGN_NONE == nsign) {
unsigned short tempushort;
HDmemcpy(&tempushort, vp, sizeof(unsigned short));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(unsigned short))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(unsigned short))
tempushort = 0;
else
- tempushort = (unsigned short)((unsigned long long)(tempushort >> packed_data_offset) & packed_data_mask);
+ tempushort =
+ (unsigned short)((unsigned long long)(tempushort >> packed_data_offset) &
+ packed_data_mask);
}
h5tools_str_append(str, OPT(info->fmt_ushort, "%hu"), tempushort);
}
@@ -848,22 +826,23 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
short tempshort;
HDmemcpy(&tempshort, vp, sizeof(short));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(short))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(short))
tempshort = 0;
else
- tempshort = (short)((unsigned long long)(tempshort >> packed_data_offset) & packed_data_mask);
+ tempshort = (short)((unsigned long long)(tempshort >> packed_data_offset) &
+ packed_data_mask);
}
h5tools_str_append(str, OPT(info->fmt_short, "%hd"), tempshort);
}
} /* end if (sizeof(short) == nsize) */
- else if(sizeof(long) == nsize) {
- if(H5T_SGN_NONE == nsign) {
+ else if (sizeof(long) == nsize) {
+ if (H5T_SGN_NONE == nsign) {
unsigned long tempulong;
HDmemcpy(&tempulong, vp, sizeof(unsigned long));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(unsigned long))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(unsigned long))
tempulong = 0;
else
tempulong = (tempulong >> packed_data_offset) & packed_data_mask;
@@ -874,23 +853,24 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
long templong;
HDmemcpy(&templong, vp, sizeof(long));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(long))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(long))
templong = 0;
else
- templong = (long)((unsigned long long)(templong >> packed_data_offset) & packed_data_mask);
+ templong = (long)((unsigned long long)(templong >> packed_data_offset) &
+ packed_data_mask);
}
h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong);
}
} /* end if (sizeof(long) == nsize) */
#if H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG
- else if(sizeof(long long) == nsize) {
- if(H5T_SGN_NONE == nsign) {
+ else if (sizeof(long long) == nsize) {
+ if (H5T_SGN_NONE == nsign) {
unsigned long long tempullong;
HDmemcpy(&tempullong, vp, sizeof(unsigned long long));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(unsigned long long))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(unsigned long long))
tempullong = 0;
else
tempullong = (tempullong >> packed_data_offset) & packed_data_mask;
@@ -901,8 +881,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
long long templlong;
HDmemcpy(&templlong, vp, sizeof(long long));
- if(packed_bits_num) {
- if(packed_data_offset >= 8 * sizeof(long long))
+ if (packed_bits_num) {
+ if (packed_data_offset >= 8 * sizeof(long long))
templlong = 0;
else
templlong = (templlong >> packed_data_offset) & packed_data_mask;
@@ -910,10 +890,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong);
}
} /* end if (sizeof(long long) == nsize) */
-#endif /* H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG */
+#endif /* H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG */
break;
case H5T_COMPOUND:
+ H5TOOLS_DEBUG("H5T_COMPOUND");
{
unsigned nmembs;
unsigned j;
@@ -923,13 +904,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
ctx->indent_level++;
- for(j = 0; j < nmembs; j++) {
- if(j)
- h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK));
+ for (j = 0; j < nmembs; j++) {
+ if (j)
+ h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", " OPTIONAL_LINE_BREAK));
else
h5tools_str_append(str, "%s", OPT(info->cmpd_end, ""));
- if(info->arr_linebreak)
+ if (info->arr_linebreak)
h5tools_str_indent(str, info, ctx);
/* The name */
@@ -939,7 +920,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
/* The value */
offset = H5Tget_member_offset(type, j);
- memb = H5Tget_member_type(type, j);
+ memb = H5Tget_member_type(type, j);
h5tools_str_sprint(str, info, container, memb, cp_vp + offset, ctx);
@@ -947,7 +928,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
}
ctx->indent_level--;
- if(info->arr_linebreak) {
+ if (info->arr_linebreak) {
h5tools_str_append(str, "%s", OPT(info->cmpd_end, ""));
h5tools_str_indent(str, info, ctx);
}
@@ -955,204 +936,198 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
}
break;
- case H5T_ENUM:
- {
- char enum_name[1024];
+ case H5T_ENUM: {
+ char enum_name[1024];
- if(H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0)
- h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name)));
- else {
- size_t i;
- if(1 == nsize)
- h5tools_str_append(str, "0x%02x", ucp_vp[0]);
- else
- for(i = 0; i < nsize; i++)
- h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]);
- }
+ H5TOOLS_DEBUG("H5T_ENUM");
+ if (H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0)
+ h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name)));
+ else {
+ size_t i;
+ if (1 == nsize)
+ h5tools_str_append(str, "0x%02x", ucp_vp[0]);
+ else
+ for (i = 0; i < nsize; i++)
+ h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]);
}
- break;
+ } break;
case H5T_REFERENCE:
- if(h5tools_str_is_zero(vp, nsize))
+ H5TOOLS_DEBUG("H5T_REFERENCE");
+ if (h5tools_str_is_zero(vp, nsize))
h5tools_str_append(str, "NULL");
else {
- if(nsize == H5R_DSET_REG_REF_BUF_SIZE) {
+ if (nsize == H5R_DSET_REG_REF_BUF_SIZE) {
/* if (H5Tequal(type, H5T_STD_REF_DSETREG)) */
- h5tools_str_sprint_region(str, info, container, vp);
+ H5TOOLS_DEBUG("H5T_REFERENCE:H5T_STD_REF_DSETREG");
+ h5tools_str_append(str, H5_TOOLS_DATASET);
+ h5tools_str_sprint_reference(str, container, vp);
}
else if (nsize == H5R_OBJ_REF_BUF_SIZE) {
/* if (H5Tequal(type, H5T_STD_REF_OBJ)) */
- /*
- * Object references -- show the type and OID of the referenced
- * object.
- */
- H5O_info_t oi;
- const char *path;
-
- obj = H5Rdereference(container, H5R_OBJECT, vp);
- H5Oget_info(obj, &oi);
-
- /* Print object type and close object */
- switch(oi.type) {
- case H5O_TYPE_GROUP:
- h5tools_str_append(str, H5_TOOLS_GROUP);
- break;
-
- case H5O_TYPE_DATASET:
- h5tools_str_append(str, H5_TOOLS_DATASET);
- break;
-
- case H5O_TYPE_NAMED_DATATYPE:
- h5tools_str_append(str, H5_TOOLS_DATATYPE);
- break;
-
- case H5O_TYPE_UNKNOWN:
- case H5O_TYPE_NTYPES:
- default:
- h5tools_str_append(str, "%u-", (unsigned) oi.type);
- break;
- } /* end switch */
- H5Oclose(obj);
-
- /* Print OID */
- if(info->obj_hidefileno)
- h5tools_str_append(str, info->obj_format, oi.addr);
- else
- h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr);
-
- /* Print name */
- path = lookup_ref_path(*(haddr_t *) vp);
- if(path) {
- h5tools_str_append(str, " ");
- h5tools_str_append(str, path);
- h5tools_str_append(str, " ");
- } /* end if */
+ /*
+ * Object references -- show the type and OID of the referenced object.
+ */
+ H5O_info_t oi;
+
+ H5TOOLS_DEBUG("H5T_REFERENCE:H5T_STD_REF_OBJ");
+ obj = H5Rdereference(container, H5R_OBJECT, vp);
+ H5Oget_info(obj, &oi);
+
+ /* Print object type and close object */
+ switch (oi.type) {
+ case H5O_TYPE_GROUP:
+ h5tools_str_append(str, H5_TOOLS_GROUP);
+ break;
+
+ case H5O_TYPE_DATASET:
+ h5tools_str_append(str, H5_TOOLS_DATASET);
+ break;
+
+ case H5O_TYPE_NAMED_DATATYPE:
+ h5tools_str_append(str, H5_TOOLS_DATATYPE);
+ break;
+
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ h5tools_str_append(str, "%u-", (unsigned)oi.type);
+ break;
+ } /* end switch */
+ H5Oclose(obj);
+
+ /* Print OID */
+ if (info->obj_hidefileno)
+ h5tools_str_append(str, info->obj_format, oi.addr);
+ else
+ h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr);
+
+ h5tools_str_sprint_reference(str, container, vp);
} /* end else if (H5Tequal(type, H5T_STD_REF_OBJ)) */
}
break;
- case H5T_ARRAY:
- {
- int k, ndims;
- hsize_t i, dims[H5S_MAX_RANK], temp_nelmts;
- static int is_next_arry_elmt = 0;
-
- /* Get the array's base datatype for each element */
- memb = H5Tget_super(type);
- size = H5Tget_size(memb);
- ndims = H5Tget_array_ndims(type);
- H5Tget_array_dims2(type, dims);
- HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK);
-
- /* Calculate the number of array elements */
- for(k = 0, nelmts = 1; k < ndims; k++) {
- temp_nelmts = nelmts;
- temp_nelmts *= dims[k];
- HDassert(temp_nelmts == (hsize_t) ((size_t) temp_nelmts));
- nelmts = (size_t) temp_nelmts;
- }
- /* Print the opening bracket */
- h5tools_str_append(str, "%s", OPT(info->arr_pre, "["));
-
- ctx->indent_level++;
+ case H5T_ARRAY: {
+ int k, ndims;
+ hsize_t i, dims[H5S_MAX_RANK], temp_nelmts;
+ static int is_next_arry_elmt = 0;
+
+ H5TOOLS_DEBUG("H5T_ARRAY");
+ /* Get the array's base datatype for each element */
+ memb = H5Tget_super(type);
+ size = H5Tget_size(memb);
+ ndims = H5Tget_array_ndims(type);
+ H5Tget_array_dims2(type, dims);
+ HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK);
+
+ /* Calculate the number of array elements */
+ for (k = 0, nelmts = 1; k < ndims; k++) {
+ temp_nelmts = nelmts;
+ temp_nelmts *= dims[k];
+ HDassert(temp_nelmts == (hsize_t)((size_t)temp_nelmts));
+ nelmts = (size_t)temp_nelmts;
+ }
+ /* Print the opening bracket */
+ h5tools_str_append(str, "%s", OPT(info->arr_pre, "["));
- for(i = 0; i < nelmts; i++) {
- if(i)
- h5tools_str_append(str, "%s", OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK));
+ ctx->indent_level++;
- if(info->arr_linebreak && i && i % dims[ndims - 1] == 0) {
- h5tools_str_append(str, "%s", "\n");
- h5tools_str_indent(str, info, ctx);
+ for (i = 0; i < nelmts; i++) {
+ if (i)
+ h5tools_str_append(str, "%s", OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK));
- } /* end if */
- else if(i && info->arr_sep) {
- /* if next element begin, add next line with indent */
- if(is_next_arry_elmt) {
- is_next_arry_elmt = 0;
+ if (info->arr_linebreak && i && i % dims[ndims - 1] == 0) {
+ h5tools_str_append(str, "%s", "\n");
+ h5tools_str_indent(str, info, ctx);
- h5tools_str_append(str, "%s", "\n ");
- h5tools_str_indent(str, info, ctx);
+ } /* end if */
+ else if (i && info->arr_sep) {
+ /* if next element begin, add next line with indent */
+ if (is_next_arry_elmt) {
+ is_next_arry_elmt = 0;
- }
- /* otherwise just add space */
- else
- h5tools_str_append(str, " ");
+ h5tools_str_append(str, "%s", "\n ");
+ h5tools_str_indent(str, info, ctx);
+ }
+ /* otherwise just add space */
+ else
+ h5tools_str_append(str, " ");
- } /* end else if */
+ } /* end else if */
- /* Dump values in an array element */
- is_next_arry_elmt = 0; /* dump all values in the array element, so turn it off */
- h5tools_str_sprint(str, info, container, memb, cp_vp + i * size, ctx);
- } /* end for */
+ /* Dump values in an array element */
+ is_next_arry_elmt = 0; /* dump all values in the array element, so turn it off */
+ h5tools_str_sprint(str, info, container, memb, cp_vp + i * size, ctx);
+ } /* end for */
- ctx->indent_level--;
+ ctx->indent_level--;
- /* Print the closing bracket */
- h5tools_str_append(str, "%s", OPT(info->arr_suf, "]"));
- is_next_arry_elmt = 1; /* set for begining of next array element */
- H5Tclose(memb);
- }
- break;
+ /* Print the closing bracket */
+ h5tools_str_append(str, "%s", OPT(info->arr_suf, "]"));
+ is_next_arry_elmt = 1; /* set for begining of next array element */
+ H5Tclose(memb);
+ } break;
- case H5T_VLEN:
- {
- unsigned int i;
+ case H5T_VLEN: {
+ unsigned int i;
- /* Get the VL sequences's base datatype for each element */
- memb = H5Tget_super(type);
- size = H5Tget_size(memb);
+ H5TOOLS_DEBUG("H5T_VLEN");
+ /* Get the VL sequences's base datatype for each element */
+ memb = H5Tget_super(type);
+ size = H5Tget_size(memb);
- /* Print the opening bracket */
- h5tools_str_append(str, "%s", OPT(info->vlen_pre, "("));
+ /* Print the opening bracket */
+ h5tools_str_append(str, "%s", OPT(info->vlen_pre, "("));
- /* Get the number of sequence elements */
- nelmts = ((hvl_t *) cp_vp)->len;
+ /* Get the number of sequence elements */
+ nelmts = ((hvl_t *)((void *)cp_vp))->len;
- for(i = 0; i < nelmts; i++) {
- if(i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK));
+ for (i = 0; i < nelmts; i++) {
+ if (i)
+ h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK));
#ifdef LATER
- /* Need to fix so VL data breaks at correct location on end of line -QAK */
- if(info->arr_linebreak && h5tools_str_len(str)>=info->line_ncols) {
- int x;
+ /* Need to fix so VL data breaks at correct location on end of line -QAK */
+ if (info->arr_linebreak && h5tools_str_len(str) >= info->line_ncols) {
+ int x;
- h5tools_str_append(str, "%s", "\n");
+ h5tools_str_append(str, "%s", "\n");
- /* need to indent some more here */
- if(ctx->indent_level >= 0)
- h5tools_str_append(str, "%s", OPT(info->line_pre, ""));
+ /* need to indent some more here */
+ if (ctx->indent_level >= 0)
+ h5tools_str_append(str, "%s", OPT(info->line_pre, ""));
- for(x = 0; x < ctx->indent_level + 1; x++)
- h5tools_str_append(str,"%s",OPT(info->line_indent,""));
- } /* end if */
-#endif /* LATER */
+ for (x = 0; x < ctx->indent_level + 1; x++)
+ h5tools_str_append(str, "%s", OPT(info->line_indent, ""));
+ } /* end if */
+#endif /* LATER */
- ctx->indent_level++;
+ ctx->indent_level++;
- /* Dump the array element */
- h5tools_str_sprint(str, info, container, memb, ((char *) (((hvl_t *) cp_vp)->p)) + i * size, ctx);
+ /* Dump the array element */
+ h5tools_str_sprint(str, info, container, memb,
+ ((char *)(((hvl_t *)((void *)cp_vp))->p)) + i * size, ctx);
- ctx->indent_level--;
- } /* end for */
+ ctx->indent_level--;
+ } /* end for */
- h5tools_str_append(str, "%s", OPT(info->vlen_suf, ")"));
- H5Tclose(memb);
- }
- break;
+ h5tools_str_append(str, "%s", OPT(info->vlen_suf, ")"));
+ H5Tclose(memb);
+ } break;
case H5T_TIME:
case H5T_BITFIELD:
- case H5T_OPAQUE:
- {
- /* All other types get printed as hexadecimal */
- size_t i;
- if(1 == nsize)
- h5tools_str_append(str, "0x%02x", ucp_vp[0]);
- else
- for(i = 0; i < nsize; i++)
- h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]);
- }
- break;
+ case H5T_OPAQUE: {
+ /* All other types get printed as hexadecimal */
+ size_t i;
+
+ H5TOOLS_DEBUG("OTHER");
+ if (1 == nsize)
+ h5tools_str_append(str, "0x%02x", ucp_vp[0]);
+ else
+ for (i = 0; i < nsize; i++)
+ h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]);
+ } break;
case H5T_NO_CLASS:
case H5T_NCLASSES:
@@ -1161,49 +1136,54 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
break;
} /* end switch */
}
- return h5tools_str_fmt(str, start, OPT(info->elmt_fmt, "%s"));
-}
+ H5TOOLS_DEBUG("switch done");
+ ret_value = h5tools_str_fmt(str, start, OPT(info->elmt_fmt, "%s"));
+
+ H5TOOLS_ENDDEBUG(" with %s", ret_value);
+ return ret_value;
+}
/*-------------------------------------------------------------------------
- * Function: h5tools_str_sprint_region
+ * Function: h5tools_str_sprint_reference
*
- * Purpose: Dataset region reference -- show the type and data of the referenced object.
+ * Purpose: Object reference -- show the name of the referenced object.
*
* Return: Nothing
*-------------------------------------------------------------------------
*/
void
-h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info,
- hid_t container, void *vp)
+h5tools_str_sprint_reference(h5tools_str_t *str, hid_t container, void *vp)
{
- hid_t obj = -1;
- hid_t region = -1;
- char ref_name[1024];
- H5S_sel_type region_type;
+ hid_t obj = H5I_INVALID_HID;
+ hid_t region = H5I_INVALID_HID;
+ char ref_name[1024];
+ const char *path;
+ H5TOOLS_START_DEBUG("");
+
+ h5tools_str_append(str, " \"");
obj = H5Rdereference(container, H5R_DATASET_REGION, vp);
- if(obj >= 0) {
+ if (obj >= 0) {
region = H5Rget_region(container, H5R_DATASET_REGION, vp);
- if(region >= 0) {
- H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*) ref_name, 1024);
-
- h5tools_str_append(str, info->dset_format, ref_name);
-
- h5tools_str_append(str, "{");
-
- region_type = H5Sget_select_type(region);
- if(region_type==H5S_SEL_POINTS)
- h5tools_str_dump_space_points(str, region, info);
- else
- h5tools_str_dump_space_blocks(str, region, info);
-
- h5tools_str_append(str, "}");
+ if (region >= 0) {
+ H5Rget_name(obj, H5R_DATASET_REGION, vp, (char *)ref_name, 1024);
+ h5tools_str_append(str, "%s", ref_name);
H5Sclose(region);
} /* end if (region >= 0) */
H5Dclose(obj);
} /* end if (obj >= 0) */
+ else {
+ /* Print name */
+ path = lookup_ref_path(*(haddr_t *)vp);
+ if (path) {
+ h5tools_str_append(str, path);
+ } /* end if */
+ }
+ h5tools_str_append(str, "\"");
+
+ H5TOOLS_ENDDEBUG("");
}
/*-------------------------------------------------------------------------
@@ -1223,70 +1203,70 @@ h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info,
*-------------------------------------------------------------------------
*/
static char *
-h5tools_escape(char *s/*in,out*/, size_t size)
+h5tools_escape(char *s /*in,out*/, size_t size)
{
- register size_t i;
- const char *escape;
- char octal[8];
- size_t n = HDstrlen(s);
+ register size_t i;
+ const char * escape;
+ char octal[8];
+ size_t n = HDstrlen(s);
- for(i = 0; i < n; i++) {
+ for (i = 0; i < n; i++) {
switch (s[i]) {
- case '\'':
- escape = "\\\'";
- break;
- case '\"':
- escape = "\\\"";
- break;
- case '\\':
- escape = "\\\\";
- break;
- case '\?':
- escape = "\\\?";
- break;
- case '\a':
- escape = "\\a";
- break;
- case '\b':
- escape = "\\b";
- break;
- case '\f':
- escape = "\\f";
- break;
- case '\n':
- escape = "\\n";
- break;
- case '\r':
- escape = "\\r";
- break;
- case '\t':
- escape = "\\t";
- break;
- case '\v':
- escape = "\\v";
- break;
- default:
- if(!isprint(s[i])) {
- HDsnprintf(octal, sizeof(octal), "\\%03o", (unsigned char) s[i]);
- escape = octal;
- }
- else
- escape = NULL;
+ case '\'':
+ escape = "\\\'";
+ break;
+ case '\"':
+ escape = "\\\"";
+ break;
+ case '\\':
+ escape = "\\\\";
+ break;
+ case '\?':
+ escape = "\\\?";
+ break;
+ case '\a':
+ escape = "\\a";
+ break;
+ case '\b':
+ escape = "\\b";
+ break;
+ case '\f':
+ escape = "\\f";
+ break;
+ case '\n':
+ escape = "\\n";
+ break;
+ case '\r':
+ escape = "\\r";
+ break;
+ case '\t':
+ escape = "\\t";
+ break;
+ case '\v':
+ escape = "\\v";
+ break;
+ default:
+ if (!isprint(s[i])) {
+ HDsnprintf(octal, sizeof(octal), "\\%03o", (unsigned char)s[i]);
+ escape = octal;
+ }
+ else
+ escape = NULL;
- break;
+ break;
}
- if(escape) {
+ if (escape) {
size_t esc_size = HDstrlen(escape);
- if(n + esc_size + 1 > size)
+ if (n + esc_size + 1 > size)
/*would overflow*/
return NULL;
HDmemmove(s + i + esc_size, s + i + 1, n - i); /*make room*/
- HDmemcpy(s + i, escape, esc_size); /*insert*/
- n += esc_size - 1; /* adjust total string size */
- i += esc_size; /* adjust string position */
+ HDmemcpy(s + i, escape, esc_size); /*insert*/
+ n += esc_size - 1; /* adjust total string size */
+ i += esc_size; /* adjust string position */
}
}
@@ -1307,10 +1287,10 @@ h5tools_escape(char *s/*in,out*/, size_t size)
static hbool_t
h5tools_str_is_zero(const void *_mem, size_t size)
{
- const unsigned char *mem = (const unsigned char *) _mem;
+ const unsigned char *mem = (const unsigned char *)_mem;
- while(size-- > 0)
- if(mem[size])
+ while (size-- > 0)
+ if (mem[size])
return FALSE;
return TRUE;
@@ -1333,30 +1313,31 @@ h5tools_str_is_zero(const void *_mem, size_t size)
*-------------------------------------------------------------------------
*/
char *
-h5tools_str_replace ( const char *string, const char *substr, const char *replacement )
+h5tools_str_replace(const char *string, const char *substr, const char *replacement)
{
char *tok = NULL;
char *newstr = NULL;
char *head = NULL;
- if(substr == NULL || replacement == NULL)
+ if (substr == NULL || replacement == NULL)
return HDstrdup(string);
newstr = HDstrdup(string);
- head = newstr;
- while((tok = HDstrstr(head, substr))) {
+ head = newstr;
+ while ((tok = HDstrstr(head, substr))) {
char *oldstr;
oldstr = newstr;
newstr = (char *)HDmalloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1);
- if(newstr == NULL) {
+ if (newstr == NULL) {
HDfree(oldstr);
return NULL;
}
HDmemcpy(newstr, oldstr, (size_t)(tok - oldstr));
HDmemcpy(newstr + (tok - oldstr), replacement, HDstrlen(replacement));
- HDmemcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr), HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr));
- HDmemset(newstr + HDstrlen (oldstr) - HDstrlen(substr) + HDstrlen(replacement) , 0, 1);
+ HDmemcpy(newstr + (tok - oldstr) + HDstrlen(replacement), tok + HDstrlen(substr),
+ HDstrlen(oldstr) - HDstrlen(substr) - (size_t)(tok - oldstr));
+ HDmemset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1);
/* move back head right after the last replacement */
head = newstr + (tok - oldstr) + HDstrlen(replacement);
HDfree(oldstr);
@@ -1364,4 +1345,3 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac
return newstr;
}
-