Commit Graph

75 Commits

Author SHA1 Message Date
Dana Robinson
44a00ef876
Strip HD prefix from string/char C API calls (#3540)
* Strip HD prefix from string/char C API calls

* HD(f)(put|get)(s|c)
* HDstr*
* HDv*printf
* HD(s)(print|scan)f
* HDperror

But NOT:

* HDstrcase*
* HDvasprintf
* HDstrtok_r
* HDstrndup

As those are not C99 and have portability work-around
implementations. They will be handled later.

* Fix th5_system.c screwup
2023-09-15 15:13:18 -07:00
Scot Breitenfeld
117d579c32
Consistent initialization of hid_t in the tests (#3521) 2023-09-08 18:06:23 -05:00
Sean McBride
07df0d252c
Fixes the last of the -Wextra-semi-stmt warnings (#3326)
* Fixed extra semi warning by adjusting alternative macro definitions

* Find-replace H5E_END_TRY; -> H5E_END_TRY

* Made H5Epush_goto a do-while loop, fixed indentation

* Made GOTOERROR and ERRMSG do-while loops

* Made Hgoto_error and Hgoto_done  do-while loops

* Made vrfy_cint_type and vrfy_ctype  do-while loops

* Made TEST_TYPE_CONTIG and others do-while loops

* Removed extraneous semi-colons

* Committing clang-format changes

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-02 17:46:26 -05:00
Dana Robinson
aebac33a1f
Remove HD from memory allocate/free calls (#3195)
* HDcalloc
* HDfree
* HDmalloc
* HDrealloc
2023-06-28 15:48:12 -07:00
Dana Robinson
187ea8a9ae
Rename HD(f)printf() to (f)printf() (#3194) 2023-06-28 08:31:32 -07:00
Sean McBride
68eba3da69
Many clang -Wextra-semi-stmt fixes (#2537)
* Adds semicolons to function-like macros
* Adds a do..while(0) loop to some macros
* Removes semicolons when inappropriate, especially H5E_TRY_BEGIN/END
2023-06-15 21:49:02 -07:00
Larry Knox
11dfa25910
Update copyright headers (#2184)
* Updated source file copyright headers to remove "Copyright by the Board of Trustees
of the University of Illinois", which is kept in the top-level COPYING file.
2022-11-01 16:02:27 -05:00
Allen Byrne
ae414872f5
Develop clang 13 format (#1933)
* Update format source to clang 13

* More format changes
2022-07-26 14:45:46 -07:00
Dana Robinson
838d050a63
h5test.h testing macros get enclosed in do..while loops (#1721)
* h5test.h testing macros get enclosed in do..while loops

* Adds missed macro in hl C++ code

* Fixes macro in Windows code
2022-05-04 08:49:01 -07:00
Dana Robinson
180a7f9c71
Fixes stack size warnings in dtransform (#1696) 2022-04-26 21:52:00 -05:00
Allen Byrne
c9347450c1
Implemented suggestion in #1381 for dtransform test (#1415)
* Implemented suggestion in #1380

* fix typo

* Use differently named files in tests

* format fix

* Revise comments

* fic typos

* Change test display and file name
2022-02-04 16:50:45 -06:00
Scot Breitenfeld
f859cb732b
Fixed Spelling Errors (#1166)
* 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

* switched from using MPI_count, to actual bytes written for H5FD_mpio_debug rw debugging

* Committing clang-format changes

* changed size_i in printf to reflect the I/O.

* Committing clang-format changes

* Fixed seg fault with xlf on BE with -qintsize=8

* fixed error function string

* spelling corrections via codespell, added new spell check github actions

* Committing clang-format changes

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* misc

* Committing clang-format changes

* misc

* misc

* misc

* misc

* misc

* misc

* Committing clang-format changes

* misc

* work around for https://github.com/codespell-project/codespell/issues/2137

* misc

* added missing file

* misc

* misc.

* misc

* switch to using Codespell with GitHub Actions

* misc.

* misc.

* fixed more sp errors

* Fix new typos found by codespell.

* fixed proceed with precede

* fixed variable in fortran test

* fixed minnum

* updated spelling list

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
2021-12-07 08:27:29 -06:00
Sean McBride
9cea7c9bb9
Assume C99 fixed sized ints exist, use them (#470)
* Committing clang-format changes

* Assume C99 fixed sized ints exist, use them

* Assume H5_SIZEOF_LONG_DOUBLE != 0, `long double` has existed since C89

Note, this is only assuming that `long double` exists, no assumptions about its size have been touched.  Didn't remove any code that does things like test if `long double` and `double` have different sizes.

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-11-08 12:44:06 -06:00
jhendersonHDF
3da0802c40
VFD plugins (#602)
* Implement support for loading of Virtual File Drivers as plugins

Fix plugin caching for VOL connector and VFD plugins

Fix plugin iteration to skip paths that can't be opened

* Enable dynamic loading of VFDs with HDF5_DRIVER environment variable

* Temporarily disable error reporting during H5F_open double file open

* Default to using HDstat in h5_get_file_size for unknown VFDs

* Use macros for some environment variables that HDF5 interprets

* Update "null" and "ctl testing" VFDs
2021-09-29 13:28:12 -05:00
Jan-Willem Blokland
7c973deaf1
H5Ztrans: (feature) Improved H5Z_xform_noop() and H5Z_xform_create() … (#933)
* H5Ztrans: (feature) Improved H5Z_xform_noop() and H5Z_xform_create() function

- Made a small improvement for H5Z_xform_noop() function. Now,
  the function will also return TRUE if the data transform function
  expression = "x". For this case, the HDF5 library behaves in a
  similar fashion as the case when no data transform function has been
  specified.
- Improved the inline documentation of the function
  H5Z_xform_create() such it is more inline with the rest of the
  code.

* Committing clang-format changes

* H5Ztrans: (feature) Added 3 tests for improved H5Z_xform_noop() function

- Added serial test with data transform expression = "x" to
  verify the improved H5Z_xform_noop() function behaves as expected.
- Added 2 parallel tests with data transform expression = "x"
  in combination with a filter. Before, these tests will fail but
  with the improved H5Z_xform_noop() function they work and result
  in the expected behavior.
- Small bug fix for one of parallel filter tests.

* Committing clang-format changes

* H5Ztrans: (feature) Added release note about detection of the
           simple data transform function "x".

- Added a brief explanation about the implemented improvement
  of the detection of the simple data transform function "x"
  to the RELEASE.txt file.

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-09-13 15:05:19 -05:00
Sean McBride
f6c49fe891
More clang tidy (#908)
* Pacify clang-analyzer-unix.cstring.NullArg

* Apply some bugprone-suspicious-string-compare

* Apply some readability-simplify-boolean-expr

* Apply some readability-make-member-function-const

* Apple some bugprone-macro-parentheses

* Changed an f suffix to L for `long double`

* Applied some readability-uppercase-literal-suffix automatically

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-08-23 16:14:53 -05:00
Quincey Koziol
c6e4e53546
Update clang config (#473)
* Update clang config to put H5E_BEGIN_TRY / H5E_END_TRY on separate lines, empty C++ methods on separate lines, understand that ALL_MEMBERS / UNIQUE_MEMBERS are foreach macros, and properly skip the 'config' directory in the find command without emiting a warning

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-17 10:25:39 -05:00
Sean McBride
c41a1cb209
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>
2021-03-09 10:59:44 -06:00
Larry Knox
4819f89d3f
Update license url (#332)
* Modify temporary rpath for testing in java example scripts.

* Update URL in source file Copyright headers for web copy of COPYING
file - src and test directories.
2021-02-17 08:52:04 -06:00
jwsblokland
82c0cb122f
(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>
2020-12-01 22:27:24 -06:00
Allen Byrne
b2d661b508 Clang-format of source files 2020-09-30 09:27:10 -05:00
David Young
3e93aa9514 So that I can use PASSED(); anywhere a statement can go, #define PASSED() with
a do-while wrapper.
2020-02-28 16:51:55 -06:00
Allen Byrne
64e6665b54 Add HD prefix to tests 2019-08-15 16:46:15 -05:00
Binh-Minh Ribler
ec31438afd Fixed HDFFV-10404
Description:
    Applied the typo fixes from user's report.
    The previous pull request couldn't be merged because it was too old,
    and it was too complicated for me to resolve conflicts.
Platform tested:
    Linux/64 (jelly) - very minor
2018-07-13 13:40:22 -05:00
Larry Knox
89fbe00dec Merge pull request #426 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to hdf5_1_10
* commit '54957d37f5aa73912763dbb6e308555e863c43f4':
  Commit copyright header change for src/H5PLpkg.c which was added after running script to make changes.
  Add new files in release_docs to MANIFEST. Cimmit changes to Makefile.in(s) and H5PL.c that resulted from running autogen.sh.
  Merge pull request #407 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10_1 to hdf5_1_10_1
  Change copyright headers to replace url referring to file to be removed and replace it with new url for COPYING file.
2017-04-25 16:05:36 -05:00
Dana Robinson
2385b2b0ad [svn-r27800] Minor warning fixes in the library tests.
Tested on: jam (too minor for h5committest)
2015-09-16 08:54:23 -05:00
Quincey Koziol
27dd4e0f05 [svn-r26597] Description:
Bring r26500 from autotools_rework branch to trunk:

    Remove the LLONG_TO_FP_CAST_WORKS macro/define, as it targets problems with
the Visual Studio 6 compilers.

Tested on:
    Linux/32 2.6.18 (jam) w/serial & parallel
    (Daily tested on branch for 2+ days)
2015-03-25 21:25:32 -05:00
Quincey Koziol
b03d04742d [svn-r26596] Description:
Bring r26499 from autotools_rework branch to trunk:

    Remove ULLONG_TO_FP_CAST_WORKS macro/define, as it only applies to older
platforms we aren't supporting any longer.

Tested on:
    Linux/32 2.6.18 (jam) w/serial & parallel
    (Daily tested on branch for 2+ days)
2015-03-25 20:47:41 -05:00
Dana Robinson
d8e3d8e908 [svn-r26333] Eliminates gcc warnings due to -Wunsuffixed-float-constants.
- Adds 'F' suffixes for most float constants.

- A few constants MUST be of type double. These now receive the long
  double L suffix and are then cast to double. I do this via a new
  H5_DOUBLE() macro which was added to H5private.h.

Fixes: HDFFV-9148

Tested on: h5committest
2015-03-01 13:48:54 -05:00
Quincey Koziol
482a9c28e7 [svn-r24030] Description:
Clean up more compiler warnings.

Tested on:
    Mac OSX/64 10.8.4 (amazon) w/gcc, C++ & FORTRAN
    (too minor to require h5committest)
2013-08-19 17:13:15 -05:00
Raymond Lu
b337ae979d [svn-r22076] #Issue 7922 - H5Pset_data_transform had seg fault with some operations like x*-100.
The parser mistaked "-" as substraction.  I fixed it and also fixed another problem
with some special cases like 100-x and 2/x.

Tested on jam, koala, and ostrich.
2012-03-15 15:53:14 -05:00
Raymond Lu
1c61b6fe13 [svn-r19481] I'm backing out my fix for bug 1707 because there're some unresolved issues - r19441 and 19467.
Bug 1707 is that H5Eset_auto causes a seg fault when an application uses -DH5_USE_16_API with 
the 1.8 library to compile.  

I created a branch off the trunk called set_auto to continue working on the problem.

Tested on jam - backing out, simple.
2010-09-27 14:02:48 -05:00
Raymond Lu
d6c6a34a8f [svn-r19457] Bug fix for 1707 - H5Eset_auto causes a seg fault when an application uses -DH5_USE_16_API with the 1.8 library to compile. The cause is from the mismatch of H5Eprint1 and H5Eprint2 set
through H5Eset_auto.  I changed the union in the structure H5E_auto_t.  Another change is to 
make H5Eget_auto fail if H5Eset_auto is called to set the printing function.  I'll write a 
document for it.

Tested on heiwa, jam, and amani.

The property change in configure.in, config, and Makefile.am came from the merge of the 1.8 
library change.
2010-09-21 11:46:38 -05:00
Quincey Koziol
52839cdf69 [svn-r19297] Description:
Whack a few more memory errors exposed by valgrind.

    Make the debugging dump output a little bit prettier.

Tested on:
    Mac OS X/32 10.6.4 (amazon) w/debug
    (h5committest forthcoming)
2010-08-25 15:27:07 -05:00
Quincey Koziol
d3a9b81fd0 [svn-r18346] Description:
Bring Coverity fixes back from branch to trunk:

r18336:
Fix coverity issues 275, 276, 277, 323, 432, 433, and 434

r18337:
Fix Coverity issue #106: release free space section node on error

r18338:
Fixed Coverity #94 - In H5P_register, new_class wasn't closed when there's an
error after it's created.

r18339:
Fix Coverity #185 - In test_conv_str_1, BUF wasn't freed when there's an error
in this function.

r18340:
Correct error in r18337 that wasn't releasing indirect fractal heap block
early enough.

r18341:
Close nodes if any failed in the middle of allocating new nodes. Coverity 140
and 141

r18342:
Correct [another] problem w/r18337.

r18343:
Fix coverity items 185, 20, and 21.

r18344:
Fix Coverity 213 - In H5FD_family_close, the double pointer file->memb was
dereferenced without NULL checking 
(We believe).

r18345:
Fix Coverity issue # 210;  removed NULL check after pointer dereferenced in
H5HFdblock.c.   Also assigned NULL to pointer in H5Pint.c to fix segmentation
fault.

Tested on:
    FreeBSD/32 6.3 (duty) in debug mode
    FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
    Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
        w/C++ & FORTRAN, w/threadsafe, in debug mode
    Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
        w/C++ & FORTRAN, in production mode
    Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
        w/szip filter, in production mode
    Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
        in production mode
    Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
    Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
    Mac OS X/32 10.6.2 (amazon) in debug mode
    Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
        in production mode
2010-02-27 15:08:03 -05:00
Quincey Koziol
0c39a78927 [svn-r18300] Description:
Bring Coverity fixes from branch to trunk:

r18282:
   Fix Coverity issue #428 by wrapping testing calls with if(pass) {} block.

r18283:
   Fix Coverity issue #425 by wrapping test calls in if(pass) {} block

r18284:
Issue 166:  init_error() malloc'd 3 pointers in initialization and never freed 
inc ase of errors. Init pointers to NULL, check allocation results and free
allocations in error block

r18285:
   Fix Coverity issue #410 by wrapping test calls with if(pass) {} block.

r18286:
Issue 165:  custom_print_cb() needed allocations freed in error block.

r18287:
Fix coverity issue # 409

Added if (pass) checks around calls to flush_cache. Additionally, 
added a check for file_ptr = NULL after call to setup_cache.

r18288:
Fix coverity# 107 free fh in H5HF_close() correctly before exit the function
even when failure occurs.

r18289:
   Fix Coverity issue #429: correct failure return values to match return type
from routine.

r18290:
   Fix Coverity issue #103: release allocated indirect section  on error

r18294:
Issue 153, 152:  Check allocations and free allocations in error block. Also
cleaned up hid_t identifer that were opened in error block.

r18295:
Fix coverity# 101 free new_loc in H5HF_man_iter_start_entry() correctly before
exit the function even when failure occurs

r18296:
Fix coverity# 100 free down_loc in H5HF_man_iter_down() before exit the function
when failure occurs

r18297:
Fixed coverity issues 54, 55 and 216.  Correctly handle the various ways that
allocation of attr_name can fail in test_attr_basic_write.

r18298:
Fix coverity# 119 free object in H5HG_read() before exit the function when
failure occurs

r18299:
Fix coverity issue #112:

Add cleanup during error handling of H5MP_create.


Tested on:
    Mac OS X/32 10.6.2 (amazon) w/debug & production
    Misc. Linux configurations (on original checkins)
2010-02-19 21:23:44 -05:00
Neil Fortner
c7aa94f4ec [svn-r16803] Purpose: Fix bug 1548
Description:
When writing data to a dataset, the data transform was performed after type conversion.
This caused an error if the file type was non-native.  This has been changed so data
transforms are always performed on the memory type.

Tested: jam, linew. smirom (h5committest)
2009-04-20 11:54:52 -05:00
Quincey Koziol
b4ff3e6e79 [svn-r16560] Description:
Remove another call to H5E_clear_stack() from within the library.

    Clean up lots of compiler warnings.

Tested on:
    Mac OS X/32 10.5.6 (amazon)
    (followup on other platforms forthcoming)
2009-03-10 14:00:39 -05:00
Allen Byrne
5d69e87ff0 [svn-r16489] Fixed bug #1459 by eliminating the macro long_long and replacing all instances with long long.
Tested:
   h5comittest
   fedora 10 x64
   Vista 32, VS2005, IVF101
   XP32, Cygwin
2009-02-18 15:02:05 -05:00
Quincey Koziol
bdd7d59902 [svn-r15628] Description:
Remove trailing whitespace from C/C++ source files, with the following
script:

    foreach f (*.[ch] *.cpp)
        sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f
    end

Tested on:
    Mac OS X/32 10.5.5 (amazon)
    No need for h5committest, just whitespace changes...
2008-09-16 10:52:51 -05:00
Quincey Koziol
d9e5ca72f3 [svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2

	Fix thread-safe error stack initialization for API versioned error
stack printing routines.

Tested on:
        FreeBSD/32 6.2 (duty) in debug mode
        FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
        Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
                                in debug mode
        Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
                                in production mode
        Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
                                in production mode
        Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
                                w/szip filter, in production mode
        Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-11 11:24:11 -05:00
Quincey Koziol
d6bb18abbc [svn-r13648] Description:
Rename new error handling API routines from H5E<foo>_stack() to
H5E<foo>2().

Tested on:
    Mac OS X/32 10.4.9 (amazon)
    FreeBSD/32 6.2 (duty)
    FreeBSD/64 6.2 (liberty)
2007-04-11 20:59:45 -05:00
Albert Cheng
ed7d456e51 [svn-r13253] Updated all C and C++ style source code files with the THG copyright notice.
Tested platform:
Kagiso only since it is only a comment block change.  If it works in one
machine, it should work in all, I hope.  Still need to check the parallel
build on copper.
2007-02-07 09:56:24 -05:00
Leon Arber
43e7c6dbed [svn-r12880] Purpose: Bug fix
Description: Fix some memory-related bugs in the data transform code

Tested:
    kagiso w/ valgrind 3.2.1
2006-11-07 20:53:31 -05:00
Quincey Koziol
e40557304f [svn-r12803] Description:
Finish new version of the I/O pipeline message, which is much smaller than
the previous version.  This version is used with the "use the latest version
of the format" flag.

    Closed several memory leaks/overruns (found with valgrind).

    Also, lots of compiler & formatting cleanups.

Tested on:
    Linux/32 2.6 (chicago)
    Linux/64 2.6 (chicago2)
2006-10-23 15:40:14 -05:00
Quincey Koziol
88c15b1617 [svn-r11771] Purpose:
Code cleanup

Description:
    Fix a bunch of warnings flagged by Windows compilers.


Platforms tested:
    FreeBSD 4.11 (sleipnir)
    Too minor to require h5committest
2005-12-08 13:34:51 -05:00
Albert Cheng
3920d718b7 [svn-r11524] Purpose:
Inserted copyright notice.

Platforms tested:
Tested in heping only since only a comment block was added.
2005-10-10 22:27:47 -05:00
Quincey Koziol
6b45f5172c [svn-r11245] Purpose:
Code cleanup

Description:
    Trim trailing whitespace, which is making 'diff'ing the two branches
difficult.

Solution:
    Ran this script in each directory:

foreach f (*.[ch] *.cpp)
    sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f
end


Platforms tested:
    FreeBSD 4.11 (sleipnir)
    Too minor to require h5committest
2005-08-13 15:53:35 -05:00
Quincey Koziol
34bd25f361 [svn-r11144] Purpose:
New port

Description:
    Elena asked me to check in her NEC SX-6 work, so here it is! :-)

Platforms tested:
    FreeBSD 4.11 (sleipnir)
    NEC SX-6 (by Elena)
2005-07-22 20:55:12 -05:00
Quincey Koziol
55f8e19fc7 [svn-r10699] Purpose:
Code cleanup

Description:
    Switch name & logic from H5_LLONG_TO_FP_CAST_BROKEN to
H5_LLONG_TO_FP_CAST_WORKS, to better match the rest of the library.

Platforms tested:
    FreeBSD 4.11 (sleipnir)
    Too minor to require h5committest
2005-04-29 15:31:29 -05:00