Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Made HGOTO_ERROR a do-while loop changes from develop #3334

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ StatementMacros:
- H5_GCC_DIAG_ON
- H5_LEAVE
- HGOTO_DONE
- HGOTO_ERROR
- HMPI_DONE_ERROR
- HMPI_ERROR
- HMPI_GOTO_ERROR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
- uses: actions/checkout@v3
- uses: codespell-project/actions-codespell@master
with:
skip: ./bin/trace,./hl/tools/h5watch/h5watch.c,./tools/test/h5jam/tellub.c,./config/sanitizer/LICENSE,./config/sanitizer/sanitizers.cmake,./tools/test/h5repack/testfiles/*.dat,./test/API/driver
ignore_words_list: isnt,inout,nd,parms,parm,ba,offsetP,ser,ois,had,fiter,fo,clude,refere,minnum,offsetp,creat,ans:,eiter,lastr,ans,isn't,ifset,sur,trun,dne,tthe,hda,filname,te,htmp,minnum,ake,gord,numer,ro,oce,msdos
skip: ./.github/workflows/codespell.yml,./bin/trace,./hl/tools/h5watch/h5watch.c,./tools/test/h5jam/tellub.c,./config/sanitizer/LICENSE,./config/sanitizer/sanitizers.cmake,./tools/test/h5repack/testfiles/*.dat,./test/API/driver,./configure,./bin/ltmain.sh,./bin/depcomp,./bin/config.guess,./bin/config.sub,./autom4te.cache,./m4/libtool.m4,./c++/src/*.html
ignore_words_list: ot,isnt,inout,nd,parms,parm,ba,offsetP,ser,ois,had,fiter,fo,clude,refere,minnum,offsetp,creat,ans:,eiter,lastr,ans,isn't,ifset,sur,trun,dne,tthe,hda,filname,te,htmp,ake,gord,numer,ro,oce,msdos
8 changes: 4 additions & 4 deletions bin/make_err
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ sub create_init ($) {
foreach $name (keys %major) {
print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MAJOR, \"${major{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\");\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\")\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\");\n";
}

# Iterate over all the minor error sections
Expand All @@ -259,9 +259,9 @@ sub create_init ($) {
for $name ( @{$section_list{$sect_name}}) {
print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MINOR, \"${minor{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\");\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\")\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\");\n";
}
}

Expand Down
6 changes: 3 additions & 3 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ tar2cmakezip()
cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmziptmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.3-Source.zip $cmziptmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_1.zip $cmziptmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_2.zip $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpsubdir
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmziptmpsubdir
Expand Down Expand Up @@ -298,7 +298,7 @@ tar2cmaketgz()
cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.3-Source.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_1.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_2.tar.gz $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpsubdir
Expand Down Expand Up @@ -377,7 +377,7 @@ tar2hpccmaketgz()
cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.3-Source.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_1.tar.gz $cmgztmpsubdir
cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_2.tar.gz $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir

Expand Down
13 changes: 10 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,21 @@ AM_MAINTAINER_MODE([enable])
## This allows multiple src-dir builds within one host.
AC_PREFIX_DEFAULT([`pwd`/hdf5])

## Run post processing on files created by configure.
## Run post processing on files created by configure
##
## src/H5pubconf.h:
## Generate src/H5pubconf.h from src/H5config.h by prepending H5_ to all
## macro names. This avoid name conflict between HDF5 macro names and those
## generated by another software package that uses the HDF5 library.
##
## src/libhdf5.settings:
## Remove all lines begun with "#" which are generated by CONDITIONAL's of
## configure.
## Remove all lines beginning with "#" which are generated by CONDITIONAL's
## of configure.
##
## src/H5build_settings.c
## Remove all lines beginning with "#" which are generated by CONDITIONAL's
## of configure. This uses a check for whitespace after the pound sign
## to avoid clobbering include statements.
AC_CONFIG_COMMANDS([pubconf], [
echo "creating src/H5pubconf.h"
sed 's/#define /#define H5_/' <src/H5config.h |\
Expand Down
8 changes: 4 additions & 4 deletions doc/getting-started-with-hdf5-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ H5X_do_stuff(/*parameters*/)
HDassert(/*parameter check*/);

if (H5X_other_call() < 0)
HGOTO_ERROR(H5E_MAJ, H5E_MIN, FAIL, "badness")
HGOTO_ERROR(H5E_MAJ, H5E_MIN, FAIL, "badness");

done:
if (ret_value < 0)
Expand Down Expand Up @@ -329,12 +329,12 @@ H5Xdo_api_stuff(/*parameters*/)
H5TRACE3(/*stuff*/)

if (/*parameter check*/)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "badness")
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "badness");

/* VOL setup */

if (H5VL_call() < 0)
HGOTO_ERROR(H5E_FOO, H5E_BAR, FAIL, "badness")
HGOTO_ERROR(H5E_FOO, H5E_BAR, FAIL, "badness");

done:
if (ret_value < 0)
Expand Down Expand Up @@ -483,7 +483,7 @@ fail. The general format is this:

```c
if (function_that_could_fail(foo, bar) < 0)
HGOTO_ERROR(H5E_<major>, H5E_<minor>, <bad value>, "tell me about badness")
HGOTO_ERROR(H5E_<major>, H5E_<minor>, <bad value>, "tell me about badness");
```

`HGOTO_ERROR` is one of a set of macros defined in `H5Eprivate.h`. This macro
Expand Down
14 changes: 7 additions & 7 deletions src/H5.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ H5_default_vfd_init(void)
* it has of initializing the default VFD.
*/
if (H5FD_sec2_init() == H5I_INVALID_HID) {
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to load default VFD ID")
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to load default VFD ID");
}
done:
FUNC_LEAVE_NOAPI(ret_value)
Expand Down Expand Up @@ -267,7 +267,7 @@ H5_init_library(void)
for (i = 0; i < NELMTS(initializer); i++) {
if (initializer[i].func() < 0) {
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize %s interface", initializer[i].descr)
"unable to initialize %s interface", initializer[i].descr);
}
}
/* clang-format on */
Expand Down Expand Up @@ -576,7 +576,7 @@ H5garbage_collect(void)

/* Call the garbage collection routines in the library */
if (H5FL_garbage_coll() < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect objects")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect objects");

done:
FUNC_LEAVE_API(ret_value)
Expand Down Expand Up @@ -622,7 +622,7 @@ H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim,
/* Call the free list function to actually set the limits */
if (H5FL_set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim,
blk_list_lim, blk_global_lim, blk_list_lim) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "can't set garbage collection limits")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "can't set garbage collection limits");

done:
FUNC_LEAVE_API(ret_value)
Expand Down Expand Up @@ -658,7 +658,7 @@ H5get_free_list_sizes(size_t *reg_size /*out*/, size_t *arr_size /*out*/, size_t

/* Call the free list function to actually get the sizes */
if (H5FL_get_free_list_sizes(reg_size, arr_size, blk_size, fac_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get garbage collection sizes")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get garbage collection sizes");

done:
FUNC_LEAVE_API(ret_value)
Expand Down Expand Up @@ -1052,11 +1052,11 @@ H5atclose(H5_atclose_func_t func, void *ctx)

/* Check arguments */
if (NULL == func)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL func pointer")
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL func pointer");

/* Allocate space for the 'atclose' node */
if (NULL == (new_atclose = H5FL_MALLOC(H5_atclose_node_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate 'atclose' node")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate 'atclose' node");

/* Set up 'atclose' node */
new_atclose->func = func;
Expand Down
Loading