From 8a27e4f4a6a624931ba0b86444e8f21e8d735888 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 20 Apr 2010 15:20:35 -0500 Subject: [svn-r18601] Description: Bring r18581:18600 from trunk to revise_chunks branch. Tested on: Mac OS X/32 10.6.3 (amazon) w/debug (h5committest not required on this branch) --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 20 +-- configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5A.c | 2 +- src/H5Aint.c | 6 +- src/H5B.c | 10 +- src/H5C.c | 7 +- src/H5D.c | 8 +- src/H5Dchunk.c | 14 +- src/H5Dcompact.c | 6 +- src/H5Dcontig.c | 6 +- src/H5Dfill.c | 10 +- src/H5Dint.c | 28 ++-- src/H5E.c | 4 +- src/H5EA.c | 4 +- src/H5EAhdr.c | 2 +- src/H5F.c | 30 +++- src/H5FA.c | 2 +- src/H5FL.c | 8 +- src/H5FO.c | 4 +- src/H5FSsection.c | 2 +- src/H5G.c | 22 +-- src/H5Goh.c | 2 +- src/H5Groot.c | 2 +- src/H5I.c | 4 +- src/H5MFsection.c | 2 +- src/H5O.c | 7 +- src/H5Oainfo.c | 4 +- src/H5Oalloc.c | 30 ++-- src/H5Oattr.c | 25 +++- src/H5Oattribute.c | 8 +- src/H5Ochunk.c | 17 ++- src/H5Ocont.c | 2 +- src/H5Ocopy.c | 2 +- src/H5Odtype.c | 236 ++++++++++++++++++++++++++++--- src/H5Ofill.c | 8 +- src/H5Ofsinfo.c | 2 +- src/H5Oginfo.c | 4 +- src/H5Olayout.c | 4 +- src/H5Olinfo.c | 6 +- src/H5Olink.c | 4 +- src/H5Omessage.c | 4 +- src/H5Omtime.c | 2 +- src/H5Opkg.h | 2 +- src/H5Opline.c | 2 +- src/H5Orefcount.c | 4 +- src/H5Osdspace.c | 4 +- src/H5Ostab.c | 6 +- src/H5Ounknown.c | 2 +- src/H5Pint.c | 8 +- src/H5RC.c | 4 +- src/H5RS.c | 6 +- src/H5S.c | 4 +- src/H5SL.c | 28 ++-- src/H5SM.c | 6 +- src/H5SMcache.c | 2 +- src/H5ST.c | 6 +- src/H5Shyper.c | 25 ++-- src/H5T.c | 337 +++++++++++++++++++++++---------------------- src/H5WB.c | 2 +- src/H5private.h | 2 +- src/H5public.h | 4 +- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +- windows/src/H5pubconf.h | 6 +- 72 files changed, 666 insertions(+), 390 deletions(-) diff --git a/README.txt b/README.txt index 6aa99a4..2065a85 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.67-FA_a4 currently under development +HDF5 version 1.9.68-FA_a4 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index e599563..94fb618 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -390,7 +390,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 57 +LT_VERS_REVISION = 58 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index e08ea85..38463e8 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 57 +LT_VERS_REVISION = 58 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 7ce44c7..00e6d19 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Id: configure.in 18534 2010-04-08 15:30:10Z koziol . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for HDF5 1.9.67-FA_a4. +# Generated by GNU Autoconf 2.65 for HDF5 1.9.68-FA_a4. # # Report bugs to . # @@ -702,8 +702,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.67-FA_a4' -PACKAGE_STRING='HDF5 1.9.67-FA_a4' +PACKAGE_VERSION='1.9.68-FA_a4' +PACKAGE_STRING='HDF5 1.9.68-FA_a4' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1574,7 +1574,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.67-FA_a4 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.68-FA_a4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1644,7 +1644,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.67-FA_a4:";; + short | recursive ) echo "Configuration of HDF5 1.9.68-FA_a4:";; esac cat <<\_ACEOF @@ -1831,7 +1831,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.67-FA_a4 +HDF5 configure 1.9.68-FA_a4 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2915,7 +2915,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.67-FA_a4, which was +It was created by HDF5 $as_me 1.9.68-FA_a4, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -3728,7 +3728,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.67-FA_a4' + VERSION='1.9.68-FA_a4' cat >>confdefs.h <<_ACEOF @@ -28874,7 +28874,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.67-FA_a4, which was +This file was extended by HDF5 $as_me 1.9.68-FA_a4, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -28940,7 +28940,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.67-FA_a4 +HDF5 config.status 1.9.68-FA_a4 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index 2f31df9..dbffabf 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.67-FA_a4], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.68-FA_a4], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index d608a21..6a3e60f 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -424,7 +424,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 57 +LT_VERS_REVISION = 58 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index f58a07b..b04341a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -380,7 +380,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 57 +LT_VERS_REVISION = 58 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 195acf2..be78e05 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -389,7 +389,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 57 +LT_VERS_REVISION = 58 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index ef8dc41..8f6f1fd 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -380,7 +380,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 57 +LT_VERS_REVISION = 58 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cc51a6b..44b68d4 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.67-FA_a4 currently under development +HDF5 version 1.9.68-FA_a4 currently under development ================================================================================ diff --git a/src/H5A.c b/src/H5A.c index a556a27..ac102bb 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -2442,7 +2442,7 @@ H5A_close(H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release group hier. path") attr->shared = NULL; - (void)H5FL_FREE(H5A_t, attr); + attr = H5FL_FREE(H5A_t, attr); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Aint.c b/src/H5Aint.c index 63f7e60..613ea77 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -1162,10 +1162,10 @@ H5A_dense_copy_file_cb(const H5A_t *attr_src, void *_udata) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to add to dense storage") done: - if (attr_dst) { + if(attr_dst) { (void)H5A_free(attr_dst); - (void)H5FL_FREE(H5A_t, attr_dst); - } + attr_dst = H5FL_FREE(H5A_t, attr_dst); + } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_dense_copy_file_cb() */ diff --git a/src/H5B.c b/src/H5B.c index 278d689..e50c620 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -1188,9 +1188,9 @@ done: if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") if(native) - (void)H5FL_BLK_FREE(native_block, native); + native = H5FL_BLK_FREE(native_block, native); if(child) - (void)H5FL_SEQ_FREE(haddr_t, child); + child = H5FL_SEQ_FREE(haddr_t, child); FUNC_LEAVE_NOAPI(ret_value) } /* end H5B_iterate_helper() */ @@ -1773,13 +1773,13 @@ H5B_shared_free(void *_shared) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_shared_free) /* Free the raw B-tree node buffer */ - (void)H5FL_BLK_FREE(page, shared->page); + shared->page = H5FL_BLK_FREE(page, shared->page); /* Free the B-tree native key offsets buffer */ - (void)H5FL_SEQ_FREE(size_t, shared->nkey); + shared->nkey = H5FL_SEQ_FREE(size_t, shared->nkey); /* Free the shared B-tree info */ - (void)H5FL_FREE(H5B_shared_t, shared); + shared = H5FL_FREE(H5B_shared_t, shared); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5B_shared_free() */ diff --git a/src/H5C.c b/src/H5C.c index 7f15026..8fb25e6 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -5951,8 +5951,8 @@ H5C_adjust_flush_dependency_rc(H5C_cache_entry_t * cache_entry, * Function: H5C_create_flush_dependency() * * Purpose: Initiates a parent<->child entry flush dependency. The parent - * entry must be protected at the time of call, and must have all - * dependencies removed before the cache can shut down. + * entry must be pinned or protected at the time of call, and must + * have all dependencies removed before the cache can shut down. * * Note: Flush dependencies in the cache indicate that a child entry * must be flushed to the file before its parent. (This is @@ -5965,8 +5965,7 @@ H5C_adjust_flush_dependency_rc(H5C_cache_entry_t * cache_entry, * dependency height of its children. * * Creating a flush dependency between two entries will also pin - * the parent entry. (The parent entry must _not_ be pinned - * through some other mechanism) + * the parent entry. * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5D.c b/src/H5D.c index 597ca77..388f159 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -622,7 +622,7 @@ H5Dget_create_plist(hid_t dset_id) H5I_dec_ref(src_id, FALSE); H5I_dec_ref(dst_id, FALSE); if(bkg_buf) - (void)H5FL_BLK_FREE(type_conv, bkg_buf); + bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") } /* end if */ @@ -630,7 +630,7 @@ H5Dget_create_plist(hid_t dset_id) H5I_dec_ref(src_id, FALSE); H5I_dec_ref(dst_id, FALSE); if(bkg_buf) - (void)H5FL_BLK_FREE(type_conv, bkg_buf); + bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); } /* end if */ } /* end if */ @@ -1038,9 +1038,9 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") } /* end if */ if(vlen_bufsize.fl_tbuf != NULL) - (void)H5FL_BLK_FREE(vlen_fl_buf, vlen_bufsize.fl_tbuf); + vlen_bufsize.fl_tbuf = H5FL_BLK_FREE(vlen_fl_buf, vlen_bufsize.fl_tbuf); if(vlen_bufsize.vl_tbuf != NULL) - (void)H5FL_BLK_FREE(vlen_vl_buf, vlen_bufsize.vl_tbuf); + vlen_bufsize.vl_tbuf = H5FL_BLK_FREE(vlen_vl_buf, vlen_bufsize.vl_tbuf); if(vlen_bufsize.xfer_pid > 0) { if(H5I_dec_ref(vlen_bufsize.xfer_pid, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement ref count on property list") diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 8e0f387..68d8781 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -906,7 +906,7 @@ H5D_chunk_xfree(void *chk, const H5O_pline_t *pline) if(pline->nused > 0) H5MM_xfree(chk); else - (void)H5FL_BLK_FREE(chunk, chk); + chk = H5FL_BLK_FREE(chunk, chk); } /* end if */ FUNC_LEAVE_NOAPI(NULL) @@ -950,7 +950,7 @@ H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) (void)H5S_close(chunk_info->mspace); /* Free the actual chunk info */ - (void)H5FL_FREE(H5D_chunk_info_t, chunk_info); + chunk_info = H5FL_FREE(H5D_chunk_info_t, chunk_info); FUNC_LEAVE_NOAPI(0) } /* H5D_free_chunk_info() */ @@ -1382,14 +1382,14 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const /* Create a dataspace for the chunk */ if((fspace = H5S_create_simple(fm->f_ndims,fm->chunk_dim,NULL))==NULL) { - (void)H5FL_FREE(H5D_chunk_info_t,chunk_info); + chunk_info = H5FL_FREE(H5D_chunk_info_t, chunk_info); HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace for chunk") } /* end if */ /* De-select the chunk space */ if(H5S_select_none(fspace) < 0) { (void)H5S_close(fspace); - (void)H5FL_FREE(H5D_chunk_info_t,chunk_info); + chunk_info = H5FL_FREE(H5D_chunk_info_t, chunk_info); HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to de-select dataspace") } /* end if */ @@ -2561,7 +2561,7 @@ H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * --rdcc->nused; /* Free */ - (void)H5FL_FREE(H5D_rdcc_ent_t, ent); + ent = H5FL_FREE(H5D_rdcc_ent_t, ent); done: FUNC_LEAVE_NOAPI(ret_value) @@ -3979,7 +3979,7 @@ done: while(tmp_stack) { /* Free the stack node and advance the stack pointer */ tmp_stack = tmp_stack->next; - (void)H5FL_FREE(H5D_chunk_prune_stack_t, fill_stack); + fill_stack = H5FL_FREE(H5D_chunk_prune_stack_t, fill_stack); fill_stack = tmp_stack; } /* end while */ @@ -3988,7 +3988,7 @@ done: while(tmp_stack) { /* Free the stack node and advance the stack pointer */ tmp_stack = tmp_stack->next; - (void)H5FL_FREE(H5D_chunk_prune_stack_t, udata.rm_stack); + udata.rm_stack = H5FL_FREE(H5D_chunk_prune_stack_t, udata.rm_stack); udata.rm_stack = tmp_stack; } /* end while */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index c87d94a..5018ca1 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -565,11 +565,11 @@ done: if(H5I_dec_ref(tid_mem, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(buf) - (void)H5FL_BLK_FREE(type_conv, buf); + buf = H5FL_BLK_FREE(type_conv, buf); if(reclaim_buf) - (void)H5FL_BLK_FREE(type_conv, reclaim_buf); + reclaim_buf = H5FL_BLK_FREE(type_conv, reclaim_buf); if(bkg) - (void)H5FL_BLK_FREE(type_conv, bkg); + bkg = H5FL_BLK_FREE(type_conv, bkg); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_copy() */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 7c1b87c..567f4c9 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -1462,11 +1462,11 @@ done: if(H5I_dec_ref(tid_mem, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(buf) - (void)H5FL_BLK_FREE(type_conv, buf); + buf = H5FL_BLK_FREE(type_conv, buf); if(reclaim_buf) - (void)H5FL_BLK_FREE(type_conv, reclaim_buf); + reclaim_buf = H5FL_BLK_FREE(type_conv, reclaim_buf); if(bkg) - (void)H5FL_BLK_FREE(type_conv, bkg); + bkg = H5FL_BLK_FREE(type_conv, bkg); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_contig_copy() */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 2f3f112..f418a81 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -337,13 +337,13 @@ done: if(dst_id != (-1) && H5I_dec_ref(dst_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tmp_buf) - (void)H5FL_BLK_FREE(type_conv, tmp_buf); + tmp_buf = H5FL_BLK_FREE(type_conv, tmp_buf); if(elem_wb && H5WB_unwrap(elem_wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") if(bkg_elem_wb && H5WB_unwrap(bkg_elem_wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") if(bkg_buf) - (void)H5FL_BLK_FREE(type_conv, bkg_buf); + bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); FUNC_LEAVE_NOAPI(ret_value) } /* H5D_fill() */ @@ -641,9 +641,9 @@ H5D_fill_release(H5D_fill_buf_info_t *fb_info) fb_info->fill_free_func(fb_info->fill_buf, fb_info->fill_free_info); else { if(fb_info->fill->buf) - (void)H5FL_BLK_FREE(non_zero_fill, fb_info->fill_buf); + fb_info->fill_buf = H5FL_BLK_FREE(non_zero_fill, fb_info->fill_buf); else - (void)H5FL_BLK_FREE(zero_fill, fb_info->fill_buf); + fb_info->fill_buf = H5FL_BLK_FREE(zero_fill, fb_info->fill_buf); } /* end else */ fb_info->fill_buf = NULL; } /* end if */ @@ -682,7 +682,7 @@ H5D_fill_term(H5D_fill_buf_info_t *fb_info) else if(fb_info->mem_type) H5T_close(fb_info->mem_type); if(fb_info->bkg_buf) - (void)H5FL_BLK_FREE(type_conv, fb_info->bkg_buf); + fb_info->bkg_buf = H5FL_BLK_FREE(type_conv, fb_info->bkg_buf); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Dint.c b/src/H5Dint.c index d252a03..ac1252c 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -562,7 +562,7 @@ done: if(new_dset != NULL) { if(new_dset->dcpl_id != 0) (void)H5I_dec_ref(new_dset->dcpl_id, FALSE); - (void)H5FL_FREE(H5D_shared_t, new_dset); + new_dset = H5FL_FREE(H5D_shared_t, new_dset); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1077,10 +1077,10 @@ done: } /* end if */ if(new_dset->shared->dcpl_id != 0 && H5I_dec_ref(new_dset->shared->dcpl_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") - (void)H5FL_FREE(H5D_shared_t, new_dset->shared); + new_dset->shared = H5FL_FREE(H5D_shared_t, new_dset->shared); } /* end if */ new_dset->oloc.file = NULL; - (void)H5FL_FREE(H5D_t, new_dset); + new_dset = H5FL_FREE(H5D_t, new_dset); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1172,12 +1172,12 @@ done: /* Free the location--casting away const*/ if(dataset) { if(shared_fo == NULL) /* Need to free shared fo */ - (void)H5FL_FREE(H5D_shared_t, dataset->shared); + dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); H5O_loc_free(&(dataset->oloc)); H5G_name_free(&(dataset->path)); - (void)H5FL_FREE(H5D_t, dataset); + dataset = H5FL_FREE(H5D_t, dataset); } /* end if */ if(shared_fo) shared_fo->fo_count--; @@ -1276,6 +1276,8 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) fill_prop->alloc_time = H5D_ALLOC_TIME_INCR; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "not implemented yet") } /* end switch */ /*lint !e788 All appropriate cases are covered */ @@ -1400,7 +1402,7 @@ H5D_close(H5D_t *dataset) /* Check for cached single element chunk info */ if(dataset->shared->cache.chunk.single_chunk_info) { - (void)H5FL_FREE(H5D_chunk_info_t, dataset->shared->cache.chunk.single_chunk_info); + dataset->shared->cache.chunk.single_chunk_info = H5FL_FREE(H5D_chunk_info_t, dataset->shared->cache.chunk.single_chunk_info); dataset->shared->cache.chunk.single_chunk_info = NULL; } /* end if */ @@ -1414,6 +1416,8 @@ H5D_close(H5D_t *dataset) dataset->shared->layout.storage.u.compact.buf = H5MM_xfree(dataset->shared->layout.storage.u.compact.buf); break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HDassert("not implemented yet" && 0); #ifdef NDEBUG @@ -1447,7 +1451,7 @@ H5D_close(H5D_t *dataset) */ dataset->oloc.file = NULL; - (void)H5FL_FREE(H5D_shared_t, dataset->shared); + dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); } /* end if */ else { /* Decrement the ref. count for this object in the top file */ @@ -1465,7 +1469,7 @@ H5D_close(H5D_t *dataset) free_failed = TRUE; /* Free the dataset's memory structure */ - (void)H5FL_FREE(H5D_t, dataset); + dataset = H5FL_FREE(H5D_t, dataset); /* Check if anything failed in the middle... */ if(free_failed) @@ -1639,6 +1643,8 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al } /* end if */ break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HDassert("not implemented yet" && 0); #ifdef NDEBUG @@ -1754,6 +1760,8 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], break; } /* end block */ + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HDassert("not implemented yet" && 0); #ifdef NDEBUG @@ -1810,6 +1818,8 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) ret_value = dset->shared->layout.storage.u.compact.size; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset type") } /*lint !e788 All appropriate cases are covered */ @@ -1856,6 +1866,8 @@ H5D_get_offset(const H5D_t *dset) ret_value = dset->shared->layout.storage.u.contig.addr + H5F_BASE_ADDR(dset->oloc.file); break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "unknown dataset layout type") } /*lint !e788 All appropriate cases are covered */ diff --git a/src/H5E.c b/src/H5E.c index 4591223..7c34add 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -991,7 +991,7 @@ H5E_get_current_stack(void) done: if(ret_value == NULL) if(estack_copy) - (void)H5FL_FREE(H5E_t, estack_copy); + estack_copy = H5FL_FREE(H5E_t, estack_copy); FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_get_current_stack() */ @@ -1158,7 +1158,7 @@ H5E_close_stack(H5E_t *estack) H5E_clear_stack(estack); /* Free the stack structure */ - (void)H5FL_FREE(H5E_t, estack); + estack = H5FL_FREE(H5E_t, estack); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5E_close_stack() */ diff --git a/src/H5EA.c b/src/H5EA.c index 8a8cee6..5ebd2a8 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -824,7 +824,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Set the shared array header's file context for this operation */ hdr->f = ea->f; - /* Set up flush dependency between child_entry and metadata array 'thing' */ + /* Set up flush dependency between parent entry and extensible array header */ if(H5EA__create_flush_depend(parent_entry, (H5AC_info_t *)hdr) < 0) H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency on file metadata") @@ -867,7 +867,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Set the shared array header's file context for this operation */ hdr->f = ea->f; - /* Remove flush dependency between child_entry and metadata array 'thing' */ + /* Remove flush dependency between parent entry and extensible array header */ if(H5EA__destroy_flush_depend(parent_entry, (H5AC_info_t *)hdr) < 0) H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency on file metadata") diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 769ad30..1f6c79c 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -309,7 +309,7 @@ HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", CATCH if(!ret_value) if(elmts) - (void)H5FL_FAC_FREE(hdr->elmt_fac.fac[idx], elmts); + elmts = H5FL_FAC_FREE(hdr->elmt_fac.fac[idx], elmts); END_FUNC(PKG) /* end H5EA__hdr_alloc_elmts() */ diff --git a/src/H5F.c b/src/H5F.c index 274ec72..90a8cee 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -663,6 +663,18 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) oloc = NULL; break; + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object") } /* end switch */ @@ -942,8 +954,8 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) done: if(!ret_value && f) { if(!shared) - (void)H5FL_FREE(H5F_file_t, f->shared); - (void)H5FL_FREE(H5F_t, f); + f->shared = H5FL_FREE(H5F_file_t, f->shared); + f = H5FL_FREE(H5F_t, f); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1090,7 +1102,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) if(H5FO_top_dest(f) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "problems closing file") f->shared = NULL; - (void)H5FL_FREE(H5F_t, f); + f = H5FL_FREE(H5F_t, f); FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_dest() */ @@ -1586,6 +1598,17 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) } break; + case H5I_UNINIT: + case H5I_BADID: + case H5I_DATASPACE: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") } /* end switch */ @@ -1828,6 +1851,7 @@ H5F_try_close(H5F_t *f) /* If we've gotten this far (ie. there are no open file IDs in the file/mount hierarchy), fall through to flush & close */ break; + case H5F_CLOSE_DEFAULT: default: HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file, unknown file close degree") } /* end switch */ diff --git a/src/H5FA.c b/src/H5FA.c index 35b7a5b..e119df2 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -734,7 +734,7 @@ H5FA_iterate(H5FA_t *fa, hid_t dxpl_id, H5FA_operator_t op, void *udata)) CATCH if(elmt) - (void)H5FL_BLK_FREE(native_elmt, elmt); + elmt = H5FL_BLK_FREE(native_elmt, elmt); END_FUNC(PRIV) /* end H5FA_iterate() */ diff --git a/src/H5FL.c b/src/H5FL.c index 2f5c2e1..a41da2a 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -1188,7 +1188,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) } /* end while */ /* Free the free list node */ - (void)H5FL_FREE(H5FL_blk_node_t, head->head); + head->head = H5FL_FREE(H5FL_blk_node_t, head->head); /* Advance to the next free list */ head->head = (H5FL_blk_node_t *)temp; @@ -2338,14 +2338,14 @@ H5FL_fac_term(H5FL_fac_head_t *factory) HDassert(last->next->list == factory); tmp = last->next->next; - (void)H5FL_FREE(H5FL_fac_gc_node_t, last->next); + last->next = H5FL_FREE(H5FL_fac_gc_node_t, last->next); last->next = tmp; if(tmp) tmp->list->prev_gc = last; } else { HDassert(H5FL_fac_gc_head.first->list == factory); tmp = H5FL_fac_gc_head.first->next; - (void)H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); + H5FL_fac_gc_head.first = H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); H5FL_fac_gc_head.first = tmp; if(tmp) tmp->list->prev_gc = NULL; @@ -2396,7 +2396,7 @@ printf("H5FL_fac_term: head->size=%d, head->allocated=%d\n", (int)H5FL_fac_gc_he H5FL_fac_gc_head.first->list->init = 0; /* Free the node from the garbage collection list */ - (void)H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); + H5FL_fac_gc_head.first = H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); H5FL_fac_gc_head.first = tmp; } /* end while */ diff --git a/src/H5FO.c b/src/H5FO.c index bbc3b7d..8e1b98c 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -234,7 +234,7 @@ H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) } /* end if */ /* Release the object information */ - (void)H5FL_FREE(H5FO_open_obj_t, open_obj); + open_obj = H5FL_FREE(H5FO_open_obj_t, open_obj); done: FUNC_LEAVE_NOAPI(ret_value) @@ -506,7 +506,7 @@ H5FO_top_decr(const H5F_t *f, haddr_t addr) HGOTO_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "can't remove object from container") /* Release the object information */ - (void)H5FL_FREE(H5FO_obj_count_t, obj_count); + obj_count = H5FL_FREE(H5FO_obj_count_t, obj_count); } /* end if */ } /* end if */ else diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 79baac0..ad622f0 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -712,7 +712,7 @@ HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bi HGOTO_ERROR(H5E_FSPACE, H5E_CANTCLOSEOBJ, FAIL, "can't destroy size tracking node's skip list") /* Release free space list node */ - (void)H5FL_FREE(H5FS_node_t, fspace_node); + fspace_node = H5FL_FREE(H5FS_node_t, fspace_node); /* Decrement total number of section sizes managed */ sinfo->tot_size_count--; diff --git a/src/H5G.c b/src/H5G.c index de501ea..bfad876 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -898,8 +898,8 @@ done: } /* end if */ if(grp != NULL) { if(grp->shared != NULL) - (void)H5FL_FREE(H5G_shared_t, grp->shared); - (void)H5FL_FREE(H5G_t,grp); + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); + grp = H5FL_FREE(H5G_t, grp); } /* end if */ } /* end if */ @@ -1020,7 +1020,7 @@ H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) /* Add group to list of open objects in file */ if(H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, FALSE) < 0) { - (void)H5FL_FREE(H5G_shared_t, grp->shared); + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group into list of open objects") } /* end if */ @@ -1057,7 +1057,7 @@ done: if(!ret_value && grp) { H5O_loc_free(&(grp->oloc)); H5G_name_free(&(grp->path)); - (void)H5FL_FREE(H5G_t,grp); + grp = H5FL_FREE(H5G_t, grp); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1109,7 +1109,7 @@ done: if(obj_opened) H5O_close(&(grp->oloc)); if(grp->shared) - (void)H5FL_FREE(H5G_shared_t, grp->shared); + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1151,7 +1151,7 @@ H5G_close(H5G_t *grp) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't remove group from list of open objects") if(H5O_close(&(grp->oloc)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") - (void)H5FL_FREE(H5G_shared_t, grp->shared); + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); } else { /* Decrement the ref. count for this object in the top file */ if(H5FO_top_decr(grp->oloc.file, grp->oloc.addr) < 0) @@ -1173,11 +1173,11 @@ H5G_close(H5G_t *grp) } /* end else */ if(H5G_name_free(&(grp->path)) < 0) { - (void)H5FL_FREE(H5G_t, grp); + grp = H5FL_FREE(H5G_t, grp); HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name") } /* end if */ - (void)H5FL_FREE(H5G_t, grp); + grp = H5FL_FREE(H5G_t, grp); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1208,8 +1208,8 @@ H5G_free(H5G_t *grp) HDassert(grp && grp->shared); - (void)H5FL_FREE(H5G_shared_t, grp->shared); - (void)H5FL_FREE(H5G_t, grp); + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); + grp = H5FL_FREE(H5G_t, grp); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1562,7 +1562,7 @@ H5G_free_visit_visited(void *item, void UNUSED *key, void UNUSED *operator_data/ { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_free_visit_visited) - (void)H5FL_FREE(H5_obj_t, item); + item = H5FL_FREE(H5_obj_t, item); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5G_free_visit_visited() */ diff --git a/src/H5Goh.c b/src/H5Goh.c index ea51179..d6e3a55 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -148,7 +148,7 @@ H5O_group_free_copy_file_udata(void *_udata) H5O_msg_free(H5O_PLINE_ID, udata->common.src_pline); /* Release space for 'copy file' user data (ginfo struct) */ - (void)H5FL_FREE(H5G_copy_file_ud_t, udata); + udata = H5FL_FREE(H5G_copy_file_ud_t, udata); FUNC_LEAVE_NOAPI_VOID } /* end H5O_group_free_copy_file_udata() */ diff --git a/src/H5Groot.c b/src/H5Groot.c index 1110b19..7470853 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -123,7 +123,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) if(NULL == (f->shared->root_grp = H5FL_CALLOC(H5G_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") if(NULL == (f->shared->root_grp->shared = H5FL_CALLOC(H5G_shared_t))) { - (void)H5FL_FREE(H5G_t, f->shared->root_grp); + f->shared->root_grp = H5FL_FREE(H5G_t, f->shared->root_grp); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ diff --git a/src/H5I.c b/src/H5I.c index c986f1c..d6655e0 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -671,7 +671,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) } /* end else */ /* Free the node */ - (void)H5FL_FREE(H5I_id_info_t, cur); + cur = H5FL_FREE(H5I_id_info_t, cur); } /* end if */ else { /* Advance to next node */ @@ -1288,7 +1288,7 @@ H5I_remove(hid_t id) } /* (Casting away const OK -QAK) */ ret_value = (void *)curr_id->obj_ptr; - (void)H5FL_FREE(H5I_id_info_t, curr_id); + curr_id = H5FL_FREE(H5I_id_info_t, curr_id); } else { /* couldn't find the ID in the proper place */ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "invalid ID") diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 888ce62..3f011ec 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -459,7 +459,7 @@ H5MF_sect_simple_free(H5FS_section_info_t *_sect) HDassert(sect); /* Release the section */ - (void)H5FL_FREE(H5MF_free_section_t, sect); + sect = H5FL_FREE(H5MF_free_section_t, sect); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5MF_sect_simple_free() */ diff --git a/src/H5O.c b/src/H5O.c index c7809c9..dae8954 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1792,7 +1792,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Unprotect chunk, marking it dirty */ - if(H5O_chunk_unprotect(loc->file, dxpl_id, oh, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(loc->file, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -1810,10 +1810,9 @@ H5O_assert(oh); ret_value = oh; done: - if(ret_value == NULL && oh) { + if(ret_value == NULL && oh) if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_protect() */ @@ -2026,7 +2025,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 1d9caaa..158f795 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -159,7 +159,7 @@ H5O_ainfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, done: if(ret_value == NULL && ainfo != NULL) - (void)H5FL_FREE(H5O_ainfo_t, ainfo); + ainfo = H5FL_FREE(H5O_ainfo_t, ainfo); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_ainfo_decode() */ @@ -314,7 +314,7 @@ H5O_ainfo_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_ainfo_t, mesg); + mesg = H5FL_FREE(H5O_ainfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_ainfo_free() */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 764ce54..90e86d6 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -415,7 +415,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -673,7 +673,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, chk_flags2 |= H5AC__DIRTIED_FLAG; /* Release chunk containing continuation message */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy2, chk_flags2) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy2, chk_flags2) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -686,7 +686,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -981,7 +981,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size) oh->chunk[chunkno - 1].gap = 0; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, UFAIL, "unable to unprotect object header chunk") } else if(found_null < 0) { /* Move message (that will be replaced with continuation message) @@ -1047,7 +1047,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size) null_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, UFAIL, "unable to unprotect object header chunk") } /* end if */ HDassert(found_null >= 0); @@ -1243,7 +1243,7 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1402,7 +1402,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1488,7 +1488,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Set the flag to indicate that the null message @@ -1563,7 +1563,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) null_chk_flags |= H5AC__DIRTIED_FLAG; /* Release current chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, curr_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Check for gap in null message's chunk */ @@ -1576,7 +1576,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end if */ /* Release null chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, null_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ else { @@ -1623,7 +1623,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end else */ /* Release null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, null_chk_proxy, null_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Initialize new null message to take over non-null message's location */ @@ -1647,7 +1647,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end if */ /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, curr_chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end else */ @@ -1772,7 +1772,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, curr_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Remove second message from list of messages */ @@ -2245,7 +2245,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, cont_chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, cont_chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -2258,7 +2258,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) done: /* Release chunk, marking it dirty */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 35f02a8..ce8e4af 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -205,7 +205,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_fl HDmemcpy(&(attr->shared->ds->extent), extent, sizeof(H5S_extent_t)); /* Release temporary extent information */ - (void)H5FL_FREE(H5S_extent_t, extent); + extent = H5FL_FREE(H5S_extent_t, extent); /* Default to entire dataspace being selected */ if(H5S_select_all(attr->shared->ds, FALSE) < 0) @@ -810,13 +810,34 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in case H5T_CSET_ASCII: s = "ASCII"; break; + case H5T_CSET_UTF8: s = "UTF-8"; break; - default: + + case H5T_CSET_RESERVED_2: + case H5T_CSET_RESERVED_3: + case H5T_CSET_RESERVED_4: + case H5T_CSET_RESERVED_5: + case H5T_CSET_RESERVED_6: + case H5T_CSET_RESERVED_7: + case H5T_CSET_RESERVED_8: + case H5T_CSET_RESERVED_9: + case H5T_CSET_RESERVED_10: + case H5T_CSET_RESERVED_11: + case H5T_CSET_RESERVED_12: + case H5T_CSET_RESERVED_13: + case H5T_CSET_RESERVED_14: + case H5T_CSET_RESERVED_15: sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(mesg->shared->encoding)); s = buf; break; + + case H5T_CSET_ERROR: + default: + sprintf(buf, "Unknown character set: %d", (int)(mesg->shared->encoding)); + s = buf; + break; } /* end switch */ fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Character Set of Name:", diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index bfa9ba0..d2b5811 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -865,7 +865,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, chk_flags |= H5AC__DIRTIED_FLAG; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -886,7 +886,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1066,7 +1066,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, chk_flags |= H5AC__DIRTIED_FLAG; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -1130,7 +1130,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 59102b6..03865fb 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -161,6 +161,10 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") + /* Increment reference count on object header */ + if(H5O_inc_rc(oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "can't increment reference count on object header") + /* Set chunk proxy fields */ chk_proxy->oh = oh; chk_proxy->chunkno = idx; @@ -207,7 +211,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_chunk_proxy_t *chk_proxy, +H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, unsigned chk_flags) { herr_t ret_value = SUCCEED; /* Return value */ @@ -216,7 +220,6 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_chunk_proxy_t *chk_p /* check args */ HDassert(f); - HDassert(oh); HDassert(chk_proxy); HDassert(!(chk_flags & (unsigned)~(H5AC__DIRTIED_FLAG | H5AC__SIZE_CHANGED_FLAG))); @@ -225,13 +228,13 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_chunk_proxy_t *chk_p /* Check for resizing the first chunk */ if(chk_flags & H5AC__SIZE_CHANGED_FLAG) { /* Resize object header in cache */ - if(H5AC_resize_pinned_entry(oh, oh->chunk[0].size) < 0) + if(H5AC_resize_pinned_entry(chk_proxy->oh, chk_proxy->oh->chunk[0].size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize chunk in cache") } /* end if */ /* Check for dirtying the first chunk */ else if(chk_flags & H5AC__DIRTIED_FLAG) { /* Mark object header as dirty in cache */ - if(H5AC_mark_pinned_or_protected_entry_dirty(oh) < 0) + if(H5AC_mark_pinned_or_protected_entry_dirty(chk_proxy->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end else/if */ else { @@ -239,12 +242,16 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_chunk_proxy_t *chk_p HDassert(0 && "Unknown chunk proxy flag(s)?!?"); } /* end else */ + /* Decrement reference count of object header */ + if(H5O_dec_rc(chk_proxy->oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "can't decrement reference count on object header") + /* Free fake chunk proxy */ chk_proxy = H5FL_FREE(H5O_chunk_proxy_t, chk_proxy); } /* end if */ else { /* Release the chunk proxy from the cache, marking it dirty */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[chk_proxy->chunkno].addr, chk_proxy, chk_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, chk_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") } /* end else */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 7f9dd47..8ba22cc 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -205,7 +205,7 @@ H5O_cont_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_cont_t, mesg); + mesg = H5FL_FREE(H5O_cont_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_cont_free() */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 163e525..08ee56b 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -872,7 +872,7 @@ H5O_copy_free_addrmap_cb(void *item, void UNUSED *key, void UNUSED *op_data) HDassert(item); /* Release the item */ - (void)H5FL_FREE(H5O_addr_map_t, item); + item = H5FL_FREE(H5O_addr_map_t, item); FUNC_LEAVE_NOAPI(0) } /* H5O_copy_free_addrmap_cb() */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index fc71d65..fec695e 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -552,6 +552,8 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p dt->shared->force_conv = TRUE; break; + case H5T_NO_CLASS: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown datatype class found") } /* end switch */ @@ -589,7 +591,7 @@ static herr_t H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) { unsigned flags = 0; - char *hdr = (char *)*pp; + uint8_t *hdr = (uint8_t *)*pp; unsigned i; size_t n, z; herr_t ret_value = SUCCEED; /* Return value */ @@ -612,9 +614,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.order) { case H5T_ORDER_LE: break; /*nothing */ + case H5T_ORDER_BE: flags |= 0x01; break; + + case H5T_ORDER_ERROR: + case H5T_ORDER_VAX: + case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "byte order is not supported in file format yet") } /* end switch */ @@ -622,9 +629,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.lsb_pad) { case H5T_PAD_ZERO: break; /*nothing */ + case H5T_PAD_ONE: flags |= 0x02; break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "bit padding is not supported in file format yet") } /* end switch */ @@ -632,9 +644,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.msb_pad) { case H5T_PAD_ZERO: break; /*nothing */ + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: case H5T_PAD_ONE: flags |= 0x04; break; + default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "bit padding is not supported in file format yet") } /* end switch */ @@ -642,9 +659,13 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.u.i.sign) { case H5T_SGN_NONE: break; /*nothing */ + case H5T_SGN_2: flags |= 0x08; break; + + case H5T_SGN_ERROR: + case H5T_NSGN: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "sign scheme is not supported in file format yet") } /* end switch */ @@ -660,13 +681,18 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.order) { case H5T_ORDER_LE: break; /*nothing*/ + case H5T_ORDER_BE: flags |= 0x01; break; + case H5T_ORDER_VAX: /*turn on 1st and 6th (reserved before adding VAX) bits*/ flags |= 0x41; HDassert(dt->shared->version >= H5O_DTYPE_VERSION_3); break; + + case H5T_ORDER_ERROR: + case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "byte order is not supported in file format yet") } /* end switch */ @@ -674,9 +700,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.lsb_pad) { case H5T_PAD_ZERO: break; /*nothing */ + case H5T_PAD_ONE: flags |= 0x02; break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "bit padding is not supported in file format yet") } /* end switch */ @@ -684,9 +715,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.msb_pad) { case H5T_PAD_ZERO: break; /*nothing */ + case H5T_PAD_ONE: flags |= 0x04; break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "bit padding is not supported in file format yet") } /* end switch */ @@ -694,9 +730,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.u.f.pad) { case H5T_PAD_ZERO: break; /*nothing */ + case H5T_PAD_ONE: flags |= 0x08; break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "bit padding is not supported in file format yet") } /* end switch */ @@ -704,12 +745,16 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.u.f.norm) { case H5T_NORM_NONE: break; /*nothing */ + case H5T_NORM_MSBSET: flags |= 0x10; break; + case H5T_NORM_IMPLIED: flags |= 0x20; break; + + case H5T_NORM_ERROR: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "normalization scheme is not supported in file format yet") } /* end switch */ @@ -732,9 +777,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.order) { case H5T_ORDER_LE: break; /*nothing */ + case H5T_ORDER_BE: flags |= 0x01; break; + + case H5T_ORDER_ERROR: + case H5T_ORDER_VAX: + case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "byte order is not supported in file format yet") } /* end switch */ @@ -762,9 +812,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.order) { case H5T_ORDER_LE: break; /*nothing */ + case H5T_ORDER_BE: flags |= 0x01; break; + + case H5T_ORDER_ERROR: + case H5T_ORDER_VAX: + case H5T_ORDER_NONE: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "byte order is not supported in file format yet") } /* end switch */ @@ -772,9 +827,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.lsb_pad) { case H5T_PAD_ZERO: break; /*nothing */ + case H5T_PAD_ONE: flags |= 0x02; break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "bit padding is not supported in file format yet") } /* end switch */ @@ -782,9 +842,14 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) switch (dt->shared->u.atomic.msb_pad) { case H5T_PAD_ZERO: break; /*nothing */ + case H5T_PAD_ONE: flags |= 0x04; break; + + case H5T_PAD_ERROR: + case H5T_PAD_BACKGROUND: + case H5T_NPAD: default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "bit padding is not supported in file format yet") } /* end switch */ @@ -931,7 +996,7 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) flags |= (dt->shared->u.vlen.type & 0x0f); if(dt->shared->u.vlen.type == H5T_VLEN_STRING) { flags |= (dt->shared->u.vlen.pad & 0x0f) << 4; - flags |= (dt->shared->u.vlen.cset & 0x0f) << 8; + flags |= ((unsigned)dt->shared->u.vlen.cset & 0x0f) << 8; } /* end if */ /* Encode base type of VL information */ @@ -950,7 +1015,8 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) HDassert(dt->shared->version >= dt->shared->parent->shared->version); /* Encode the number of dimensions */ - *(*pp)++ = dt->shared->u.array.ndims; + HDassert(dt->shared->u.array.ndims <= UCHAR_MAX); + *(*pp)++ = (uint8_t)dt->shared->u.array.ndims; /* Drop this information for Version 3 of the format */ if(dt->shared->version < H5O_DTYPE_VERSION_3) { @@ -976,16 +1042,18 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode VL parent type") break; + case H5T_NO_CLASS: + case H5T_NCLASSES: default: /*nothing */ break; } /* end switch */ /* Encode the type's class, version and bit field */ - *hdr++ = ((unsigned)(dt->shared->type) & 0x0f) | (dt->shared->version << 4); - *hdr++ = (flags >> 0) & 0xff; - *hdr++ = (flags >> 8) & 0xff; - *hdr++ = (flags >> 16) & 0xff; + *hdr++ = (uint8_t)(((unsigned)(dt->shared->type) & 0x0f) | (dt->shared->version << 4)); + *hdr++ = (uint8_t)((flags >> 0) & 0xff); + *hdr++ = (uint8_t)((flags >> 8) & 0xff); + *hdr++ = (uint8_t)((flags >> 16) & 0xff); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1114,7 +1182,7 @@ H5O_dtype_copy(const void *_src, void *_dst) /* Was result already allocated? */ if(_dst) { *((H5T_t *) _dst) = *dst; - (void)H5FL_FREE(H5T_t, dst); + dst = H5FL_FREE(H5T_t, dst); dst = (H5T_t *) _dst; } /* end if */ @@ -1249,6 +1317,10 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) ret_value += H5O_dtype_size(f, dt->shared->parent); break; + case H5T_NO_CLASS: + case H5T_STRING: + case H5T_REFERENCE: + case H5T_NCLASSES: default: /*no properties */ break; @@ -1308,8 +1380,8 @@ H5O_dtype_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5T_shared_t, ((H5T_t *) mesg)->shared); - (void)H5FL_FREE(H5T_t, mesg); + ((H5T_t *) mesg)->shared = H5FL_FREE(H5T_shared_t, ((H5T_t *) mesg)->shared); + mesg = H5FL_FREE(H5T_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_dtype_free() */ @@ -1585,6 +1657,8 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, s = "vlen"; break; + case H5T_NO_CLASS: + case H5T_NCLASSES: default: sprintf(buf, "H5T_CLASS_%d", (int)(dt->shared->type)); s = buf; @@ -1646,13 +1720,34 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_CSET_ASCII: s = "ASCII"; break; + case H5T_CSET_UTF8: s = "UTF-8"; break; - default: + + case H5T_CSET_RESERVED_2: + case H5T_CSET_RESERVED_3: + case H5T_CSET_RESERVED_4: + case H5T_CSET_RESERVED_5: + case H5T_CSET_RESERVED_6: + case H5T_CSET_RESERVED_7: + case H5T_CSET_RESERVED_8: + case H5T_CSET_RESERVED_9: + case H5T_CSET_RESERVED_10: + case H5T_CSET_RESERVED_11: + case H5T_CSET_RESERVED_12: + case H5T_CSET_RESERVED_13: + case H5T_CSET_RESERVED_14: + case H5T_CSET_RESERVED_15: sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(dt->shared->u.atomic.u.s.cset)); s = buf; break; + + case H5T_CSET_ERROR: + default: + sprintf(buf, "Unknown character set: %d", (int)(dt->shared->u.atomic.u.s.cset)); + s = buf; + break; } /* end switch */ fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Character Set:", @@ -1662,16 +1757,37 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_STR_NULLTERM: s = "NULL Terminated"; break; + case H5T_STR_NULLPAD: s = "NULL Padded"; break; + case H5T_STR_SPACEPAD: s = "Space Padded"; break; - default: + + case H5T_STR_RESERVED_3: + case H5T_STR_RESERVED_4: + case H5T_STR_RESERVED_5: + case H5T_STR_RESERVED_6: + case H5T_STR_RESERVED_7: + case H5T_STR_RESERVED_8: + case H5T_STR_RESERVED_9: + case H5T_STR_RESERVED_10: + case H5T_STR_RESERVED_11: + case H5T_STR_RESERVED_12: + case H5T_STR_RESERVED_13: + case H5T_STR_RESERVED_14: + case H5T_STR_RESERVED_15: sprintf(buf, "H5T_STR_RESERVED_%d", (int)(dt->shared->u.atomic.u.s.pad)); s = buf; break; + + case H5T_STR_ERROR: + default: + sprintf(buf, "Unknown string padding: %d", (int)(dt->shared->u.atomic.u.s.pad)); + s = buf; + break; } /* end switch */ fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "String Padding:", @@ -1681,9 +1797,13 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_VLEN_SEQUENCE: s = "sequence"; break; + case H5T_VLEN_STRING: s = "string"; break; + + case H5T_VLEN_BADTYPE: + case H5T_VLEN_MAXTYPE: default: sprintf(buf, "H5T_VLEN_%d", dt->shared->u.vlen.type); s = buf; @@ -1696,9 +1816,13 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_LOC_MEMORY: s = "memory"; break; + case H5T_LOC_DISK: s = "disk"; break; + + case H5T_LOC_BADLOC: + case H5T_LOC_MAXLOC: default: sprintf(buf, "H5T_LOC_%d", (int)dt->shared->u.vlen.loc); s = buf; @@ -1713,13 +1837,34 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_CSET_ASCII: s = "ASCII"; break; + case H5T_CSET_UTF8: s = "UTF-8"; break; - default: + + case H5T_CSET_RESERVED_2: + case H5T_CSET_RESERVED_3: + case H5T_CSET_RESERVED_4: + case H5T_CSET_RESERVED_5: + case H5T_CSET_RESERVED_6: + case H5T_CSET_RESERVED_7: + case H5T_CSET_RESERVED_8: + case H5T_CSET_RESERVED_9: + case H5T_CSET_RESERVED_10: + case H5T_CSET_RESERVED_11: + case H5T_CSET_RESERVED_12: + case H5T_CSET_RESERVED_13: + case H5T_CSET_RESERVED_14: + case H5T_CSET_RESERVED_15: sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(dt->shared->u.vlen.cset)); s = buf; break; + + case H5T_CSET_ERROR: + default: + sprintf(buf, "Unknown character set: %d", (int)(dt->shared->u.vlen.cset)); + s = buf; + break; } /* end switch */ fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Character Set:", @@ -1729,16 +1874,37 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_STR_NULLTERM: s = "NULL Terminated"; break; + case H5T_STR_NULLPAD: s = "NULL Padded"; break; + case H5T_STR_SPACEPAD: s = "Space Padded"; break; - default: + + case H5T_STR_RESERVED_3: + case H5T_STR_RESERVED_4: + case H5T_STR_RESERVED_5: + case H5T_STR_RESERVED_6: + case H5T_STR_RESERVED_7: + case H5T_STR_RESERVED_8: + case H5T_STR_RESERVED_9: + case H5T_STR_RESERVED_10: + case H5T_STR_RESERVED_11: + case H5T_STR_RESERVED_12: + case H5T_STR_RESERVED_13: + case H5T_STR_RESERVED_14: + case H5T_STR_RESERVED_15: sprintf(buf, "H5T_STR_RESERVED_%d", (int)(dt->shared->u.vlen.pad)); s = buf; break; + + case H5T_STR_ERROR: + default: + sprintf(buf, "Unknown string padding: %d", (int)(dt->shared->u.vlen.pad)); + s = buf; + break; } /* end switch */ fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "String Padding:", @@ -1759,15 +1925,20 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_ORDER_LE: s = "little endian"; break; + case H5T_ORDER_BE: s = "big endian"; break; + case H5T_ORDER_VAX: s = "VAX"; break; + case H5T_ORDER_NONE: s = "none"; break; + + case H5T_ORDER_ERROR: default: sprintf(buf, "H5T_ORDER_%d", dt->shared->u.atomic.order); s = buf; @@ -1791,9 +1962,17 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_PAD_ZERO: s = "zero"; break; + case H5T_PAD_ONE: s = "one"; break; + + case H5T_PAD_BACKGROUND: + s = "background"; + break; + + case H5T_PAD_ERROR: + case H5T_NPAD: default: s = "pad?"; break; @@ -1805,9 +1984,17 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_PAD_ZERO: s = "zero"; break; + case H5T_PAD_ONE: s = "one"; break; + + case H5T_PAD_BACKGROUND: + s = "background"; + break; + + case H5T_PAD_ERROR: + case H5T_NPAD: default: s = "pad?"; break; @@ -1820,15 +2007,22 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_PAD_ZERO: s = "zero"; break; + case H5T_PAD_ONE: s = "one"; break; + + case H5T_PAD_BACKGROUND: + s = "background"; + break; + + case H5T_PAD_ERROR: + case H5T_NPAD: default: - if (dt->shared->u.atomic.u.f.pad < 0) { + if (dt->shared->u.atomic.u.f.pad < 0) sprintf(buf, "H5T_PAD_%d", -(dt->shared->u.atomic.u.f.pad)); - } else { + else sprintf(buf, "bit-%d", dt->shared->u.atomic.u.f.pad); - } s = buf; break; } /* end switch */ @@ -1839,12 +2033,16 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_NORM_IMPLIED: s = "implied"; break; + case H5T_NORM_MSBSET: s = "msb set"; break; + case H5T_NORM_NONE: s = "none"; break; + + case H5T_NORM_ERROR: default: sprintf(buf, "H5T_NORM_%d", (int) (dt->shared->u.atomic.u.f.norm)); s = buf; @@ -1881,9 +2079,13 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, case H5T_SGN_NONE: s = "none"; break; + case H5T_SGN_2: s = "2's comp"; break; + + case H5T_SGN_ERROR: + case H5T_NSGN: default: sprintf(buf, "H5T_SGN_%d", (int) (dt->shared->u.atomic.u.i.sign)); s = buf; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index f403b81..ffea9e6 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -275,7 +275,7 @@ done: if(!ret_value && fill) { if(fill->buf) H5MM_xfree(fill->buf); - (void)H5FL_FREE(H5O_fill_t, fill); + fill = H5FL_FREE(H5O_fill_t, fill); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -335,7 +335,7 @@ done: if(!ret_value && fill) { if(fill->buf) H5MM_xfree(fill->buf); - (void)H5FL_FREE(H5O_fill_t, fill); + fill = H5FL_FREE(H5O_fill_t, fill); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -581,7 +581,7 @@ done: if(dst->type) H5T_close(dst->type); if(!_dst) - (void)H5FL_FREE(H5O_fill_t, dst); + dst = H5FL_FREE(H5O_fill_t, dst); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -783,7 +783,7 @@ H5O_fill_free(void *fill) HDassert(fill); - (void)H5FL_FREE(H5O_fill_t, fill); + fill = H5FL_FREE(H5O_fill_t, fill); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_fill_free() */ diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 0e4fe75..49a46fa 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -259,7 +259,7 @@ H5O_fsinfo_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_fsinfo_t, mesg); + mesg = H5FL_FREE(H5O_fsinfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_fsinfo_free() */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 83a6085..622edb3 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -148,7 +148,7 @@ H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, done: if(ret_value == NULL) if(ginfo != NULL) - (void)H5FL_FREE(H5O_ginfo_t, ginfo); + ginfo = H5FL_FREE(H5O_ginfo_t, ginfo); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_ginfo_decode() */ @@ -304,7 +304,7 @@ H5O_ginfo_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_ginfo_t, mesg); + mesg = H5FL_FREE(H5O_ginfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_ginfo_free() */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 7a15947..2b55f53 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -373,7 +373,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, done: if(ret_value == NULL) if(mesg) - (void)H5FL_FREE(H5O_layout_t, mesg); + mesg = H5FL_FREE(H5O_layout_t, mesg); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_layout_decode() */ @@ -693,7 +693,7 @@ H5O_layout_free(void *_mesg) if(H5O_layout_reset(mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free message resources") - (void)H5FL_FREE(H5O_layout_t, mesg); + mesg = H5FL_FREE(H5O_layout_t, mesg); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index ba5ec56..891631f 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -166,7 +166,7 @@ H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, done: if(ret_value == NULL) if(linfo != NULL) - (void)H5FL_FREE(H5O_linfo_t, linfo); + linfo = H5FL_FREE(H5O_linfo_t, linfo); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_linfo_decode() */ @@ -321,7 +321,7 @@ H5O_linfo_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_linfo_t, mesg); + mesg = H5FL_FREE(H5O_linfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_linfo_free() */ @@ -424,7 +424,7 @@ H5O_linfo_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t *file_dst, done: if(!ret_value) if(linfo_dst) - (void)H5FL_FREE(H5O_linfo_t, linfo_dst); + linfo_dst = H5FL_FREE(H5O_linfo_t, linfo_dst); FUNC_LEAVE_NOAPI(ret_value) } /* H5O_linfo_copy_file() */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 7ddb1e9..ed65ee7 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -254,7 +254,7 @@ done: H5MM_xfree(lnk->u.soft.name); if(lnk->type >= H5L_TYPE_UD_MIN && lnk->u.ud.size > 0 && lnk->u.ud.udata != NULL) H5MM_xfree(lnk->u.ud.udata); - (void)H5FL_FREE(H5O_link_t, lnk); + lnk = H5FL_FREE(H5O_link_t, lnk); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -578,7 +578,7 @@ H5O_link_free(void *_mesg) /* Free information for link */ H5O_link_reset(lnk); - (void)H5FL_FREE(H5O_link_t, lnk); + lnk = H5FL_FREE(H5O_link_t, lnk); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_link_free() */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index e2355ae..9123b4a 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1987,7 +1987,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, chk_flags |= H5AC__DIRTIED_FLAG; /* Release chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") chk_proxy = NULL; @@ -1998,7 +1998,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, done: /* Release chunk, if not already released */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, oh, chk_proxy, chk_flags) < 0) + if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 1bbcfe3..e71fb50 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -502,7 +502,7 @@ H5O_mtime_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(time_t, mesg); + mesg = H5FL_FREE(time_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_mtime_free() */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 69f9ff1..2699add 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -556,7 +556,7 @@ H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *t H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); H5_DLL H5O_chunk_proxy_t *H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); -H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, +H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, unsigned chk_flags); H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); diff --git a/src/H5Opline.c b/src/H5Opline.c index 0a50963..89bdd36 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -546,7 +546,7 @@ H5O_pline_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_pline_t, mesg); + mesg = H5FL_FREE(H5O_pline_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_pline_free() */ diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index 2f00e86..e3c6981 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -118,7 +118,7 @@ H5O_refcount_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh done: if(ret_value == NULL && refcount != NULL) - (void)H5FL_FREE(H5O_refcount_t, refcount); + refcount = H5FL_FREE(H5O_refcount_t, refcount); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_refcount_decode() */ @@ -250,7 +250,7 @@ H5O_refcount_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_refcount_t, mesg); + mesg = H5FL_FREE(H5O_refcount_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_refcount_free() */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 231de3b..f4cac40 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -191,7 +191,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, done: if(!ret_value && sdim) { H5S_extent_release(sdim); - (void)H5FL_FREE(H5S_extent_t, sdim); + sdim = H5FL_FREE(H5S_extent_t, sdim); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -419,7 +419,7 @@ H5O_sdspace_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5S_extent_t, mesg); + mesg = H5FL_FREE(H5S_extent_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_sdspace_free() */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index a93a46d..abc4739 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -120,7 +120,7 @@ H5O_stab_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, done: if(ret_value == NULL) { if(stab != NULL) - (void)H5FL_FREE(H5O_stab_t,stab); + stab = H5FL_FREE(H5O_stab_t, stab); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -253,7 +253,7 @@ H5O_stab_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_stab_t, mesg); + mesg = H5FL_FREE(H5O_stab_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_stab_free() */ @@ -339,7 +339,7 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, done: if(!ret_value) if(stab_dst) - (void)H5FL_FREE(H5O_stab_t, stab_dst); + stab_dst = H5FL_FREE(H5O_stab_t, stab_dst); FUNC_LEAVE_NOAPI(ret_value) } /* H5O_stab_copy_file() */ diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index fe31a6d..d4a3801 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -82,7 +82,7 @@ H5O_unknown_free(void *mesg) HDassert(mesg); - (void)H5FL_FREE(H5O_unknown_t, mesg); + mesg = H5FL_FREE(H5O_unknown_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_unknown_free() */ diff --git a/src/H5Pint.c b/src/H5Pint.c index 46a4ee3..67bb101 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -906,7 +906,7 @@ done: H5MM_xfree(prop->name); if(prop->value != NULL) H5MM_xfree(prop->value); - (void)H5FL_FREE(H5P_genprop_t, prop); + prop = H5FL_FREE(H5P_genprop_t, prop); } /* end if */ } /* end if */ @@ -1005,7 +1005,7 @@ done: H5MM_xfree(prop->name); if(prop->value!=NULL) H5MM_xfree(prop->value); - (void)H5FL_FREE(H5P_genprop_t, prop); + prop = H5FL_FREE(H5P_genprop_t, prop); } /* end if */ } /* end if */ @@ -1641,7 +1641,7 @@ done: H5SL_close(plist->del); /* Release the property list itself */ - (void)H5FL_FREE(H5P_genplist_t, plist); + plist = H5FL_FREE(H5P_genplist_t, plist); } /* end if */ } /* end if */ @@ -4414,7 +4414,7 @@ H5P_close(void *_plist) H5SL_destroy(plist->props,H5P_free_prop_cb,&make_cb); /* Destroy property list object */ - (void)H5FL_FREE(H5P_genplist_t, plist); + plist = H5FL_FREE(H5P_genplist_t, plist); done: /* Release the skip list of 'seen' properties */ diff --git a/src/H5RC.c b/src/H5RC.c index d9f62c3..ecec03a 100644 --- a/src/H5RC.c +++ b/src/H5RC.c @@ -115,10 +115,10 @@ H5RC_decr(H5RC_t *rc) /* Check if we should delete this object now */ if(rc->n == 0) { if((rc->free_func)(rc->o) < 0) { - (void)H5FL_FREE(H5RC_t, rc); + rc = H5FL_FREE(H5RC_t, rc); HGOTO_ERROR(H5E_RS, H5E_CANTFREE, FAIL, "memory release failed") } /* end if */ - (void)H5FL_FREE(H5RC_t, rc); + rc = H5FL_FREE(H5RC_t, rc); } /* end if */ done: diff --git a/src/H5RS.c b/src/H5RS.c index 6456ac8..0a3f134 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -148,7 +148,7 @@ H5RS_wrap(const char *s) HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = (char*)s; /* (Cast away const OK - QAK) */ + ret_value->s = (char *)s; /* (Cast away const OK - QAK) */ ret_value->wrapped = 1; ret_value->n = 1; @@ -230,8 +230,8 @@ H5RS_decr(H5RS_str_t *rs) /* Decrement reference count for string */ if((--rs->n) == 0) { if(!rs->wrapped) - (void)H5FL_BLK_FREE(str_buf, rs->s); - (void)H5FL_FREE(H5RS_str_t, rs); + rs->s = (char *)H5FL_BLK_FREE(str_buf, rs->s); + rs = H5FL_FREE(H5RS_str_t, rs); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5S.c b/src/H5S.c index 83ee11c..46d5445 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1056,7 +1056,7 @@ H5S_read(const H5O_loc_t *loc, hid_t dxpl_id) done: if(ret_value == NULL) { if(ds != NULL) - (void)H5FL_FREE(H5S_t, ds); + ds = H5FL_FREE(H5S_t, ds); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1617,7 +1617,7 @@ H5S_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy object") if(H5S_extent_release(extent) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTDELETE, NULL, "can't release previous dataspace") - (void)H5FL_FREE(H5S_extent_t, extent); + extent = H5FL_FREE(H5S_extent_t, extent); /* Initialize to "all" selection. Deserialization relies on valid existing selection. */ if(H5S_select_all(ds, FALSE) < 0) diff --git a/src/H5SL.c b/src/H5SL.c index d28e5be..c3788b4 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -176,7 +176,7 @@ if(NULL == (_tmp = (H5SL_node_t **)H5FL_FAC_MALLOC(H5SL_fac_g[X->log_nalloc]))) \ HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, NULL, "memory allocation failed") \ HDmemcpy((void *)_tmp, (const void *)X->forward, (LVL + 1) * sizeof(H5SL_node_t *)); \ - (void)H5FL_FAC_FREE(H5SL_fac_g[X->log_nalloc-1], (void *)X->forward); \ + X->forward = (H5SL_node_t **)H5FL_FAC_FREE(H5SL_fac_g[X->log_nalloc-1], (void *)X->forward); \ X->forward = _tmp; \ } /* end if */ \ \ @@ -198,7 +198,7 @@ if(NULL == (_tmp = (H5SL_node_t **)H5FL_FAC_MALLOC(H5SL_fac_g[X->log_nalloc]))) \ HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, NULL, "memory allocation failed") \ HDmemcpy((void *)_tmp, (const void *)X->forward, (LVL) * sizeof(H5SL_node_t *)); \ - (void)H5FL_FAC_FREE(H5SL_fac_g[X->log_nalloc+1], (void *)X->forward); \ + X->forward = (H5SL_node_t **)H5FL_FAC_FREE(H5SL_fac_g[X->log_nalloc+1], (void *)X->forward); \ X->forward = _tmp; \ } /* end if */ \ \ @@ -451,8 +451,8 @@ else \ X->forward[0]->backward = X->backward; \ SLIST->nobjs--; \ - (void)H5FL_FAC_FREE(H5SL_fac_g[0], X->forward); \ - (void)H5FL_FREE(H5SL_node_t, X); \ + X->forward = (H5SL_node_t **)H5FL_FAC_FREE(H5SL_fac_g[0], X->forward); \ + X = H5FL_FREE(H5SL_node_t, X); \ \ HGOTO_DONE(tmp); \ } /* end if */ \ @@ -749,13 +749,13 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* Casting away const OK -QAK */ (void)(op)(node->item,(void *)node->key,op_data); - (void)H5FL_FAC_FREE(H5SL_fac_g[node->log_nalloc], node->forward); - (void)H5FL_FREE(H5SL_node_t, node); - node=next_node; + node->forward = (H5SL_node_t **)H5FL_FAC_FREE(H5SL_fac_g[node->log_nalloc], node->forward); + node = H5FL_FREE(H5SL_node_t, node); + node = next_node; } /* end while */ /* Reset the header pointers */ - (void)H5FL_FAC_FREE(H5SL_fac_g[slist->header->log_nalloc], slist->header->forward); + slist->header->forward = (H5SL_node_t **)H5FL_FAC_FREE(H5SL_fac_g[slist->header->log_nalloc], slist->header->forward); if(NULL == (slist->header->forward = (H5SL_node_t **) H5FL_FAC_MALLOC(H5SL_fac_g[0]))) HGOTO_ERROR(H5E_SLIST, H5E_NOSPACE, FAIL, "memory allocation failed") slist->header->forward[0] = NULL; @@ -815,11 +815,11 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") /* Release header node */ - (void)H5FL_FAC_FREE(H5SL_fac_g[slist->header->log_nalloc], slist->header->forward); - (void)H5FL_FREE(H5SL_node_t, slist->header); + slist->header->forward = (H5SL_node_t **)H5FL_FAC_FREE(H5SL_fac_g[slist->header->log_nalloc], slist->header->forward); + slist->header = H5FL_FREE(H5SL_node_t, slist->header); /* Free skip list object */ - (void)H5FL_FREE(H5SL_t, slist); + slist = H5FL_FREE(H5SL_t, slist); done: FUNC_LEAVE_NOAPI(ret_value) @@ -887,7 +887,7 @@ done: /* Error cleanup */ if(ret_value == NULL) { if(new_slist != NULL) - (void)H5FL_FREE(H5SL_t, new_slist); + new_slist = H5FL_FREE(H5SL_t, new_slist); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1151,8 +1151,8 @@ H5SL_remove_first(H5SL_t *slist) tmp->forward[0]->backward = head; slist->nobjs--; /* Free memory */ - (void)H5FL_FAC_FREE(H5SL_fac_g[0], tmp->forward); - (void)H5FL_FREE(H5SL_node_t, tmp); + tmp->forward = (H5SL_node_t **)H5FL_FAC_FREE(H5SL_fac_g[0], tmp->forward); + tmp = H5FL_FREE(H5SL_node_t, tmp); /* Reshape the skip list as necessary to maintain 1-2-3 condition */ for(i=0; i < level; i++) { diff --git a/src/H5SM.c b/src/H5SM.c index 79e756b..04fad5d 100755 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -662,7 +662,7 @@ done: if(list != NULL) { if(list->messages != NULL) H5FL_ARR_FREE(H5SM_sohm_t, list->messages); - (void)H5FL_FREE(H5SM_list_t, list); + list = H5FL_FREE(H5SM_list_t, list); } /* end if */ if(addr != HADDR_UNDEF) H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, dxpl_id, addr, size); @@ -2312,7 +2312,7 @@ H5SM_table_free(H5SM_master_table_t *table) H5FL_ARR_FREE(H5SM_index_header_t, table->indexes); - H5FL_FREE(H5SM_master_table_t, table); + table = H5FL_FREE(H5SM_master_table_t, table); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SM_table_free() */ @@ -2340,7 +2340,7 @@ H5SM_list_free(H5SM_list_t *list) H5FL_ARR_FREE(H5SM_sohm_t, list->messages); - H5FL_FREE(H5SM_list_t, list); + list = H5FL_FREE(H5SM_list_t, list); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SM_list_free() */ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 428cd38..d649e48 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -551,7 +551,7 @@ done: if(!ret_value && list) { if(list->messages) H5FL_ARR_FREE(H5SM_sohm_t, list->messages); - (void)H5FL_FREE(H5SM_list_t, list); + list = H5FL_FREE(H5SM_list_t, list); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5ST.c b/src/H5ST.c index 6d14115..77e4bb4 100644 --- a/src/H5ST.c +++ b/src/H5ST.c @@ -95,7 +95,7 @@ H5ST_close_internal(H5ST_ptr_t p) if(p->splitchar) H5ST_close_internal(p->eqkid); H5ST_close_internal(p->hikid); - (void)H5FL_FREE(H5ST_node_t, p); + p = H5FL_FREE(H5ST_node_t, p); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -136,7 +136,7 @@ H5ST_close(H5ST_tree_t *tree) HGOTO_ERROR(H5E_TST, H5E_CANTFREE, FAIL, "can't free TST") /* Free root node itself */ - (void)H5FL_FREE(H5ST_tree_t, tree); + tree = H5FL_FREE(H5ST_tree_t, tree); done: FUNC_LEAVE_NOAPI(ret_value) @@ -632,7 +632,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) *root = newp; } /* end else */ - (void)H5FL_FREE(H5ST_node_t, p); + p = H5FL_FREE(H5ST_node_t, p); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5ST_delete_internal() */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 0565cf3..74402b1 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1543,7 +1543,7 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info) } /* end while */ /* Free this span info */ - (void)H5FL_FREE(H5S_hyper_span_info_t, span_info); + span_info = H5FL_FREE(H5S_hyper_span_info_t, span_info); } /* end if */ done: @@ -1586,7 +1586,7 @@ H5S_hyper_free_span (H5S_hyper_span_t *span) } /* end if */ /* Free this span */ - (void)H5FL_FREE(H5S_hyper_span_t, span); + span = H5FL_FREE(H5S_hyper_span_t, span); done: FUNC_LEAVE_NOAPI(ret_value); @@ -3174,30 +3174,29 @@ H5S_hyper_is_regular(const H5S_t *space) * when closing some other data space. --------------------------------------------------------------------------*/ herr_t -H5S_hyper_release (H5S_t *space) +H5S_hyper_release(H5S_t *space) { - herr_t ret_value=SUCCEED; + herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5S_hyper_release, FAIL); + FUNC_ENTER_NOAPI(H5S_hyper_release, FAIL) /* Check args */ - assert (space && H5S_SEL_HYPERSLABS==H5S_GET_SELECT_TYPE(space)); + HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); /* Reset the number of points selected */ - space->select.num_elem=0; + space->select.num_elem = 0; /* Release irregular hyperslab information */ - if(space->select.sel_info.hslab->span_lst!=NULL) { - if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans"); + if(space->select.sel_info.hslab->span_lst != NULL) { + if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") } /* end if */ /* Release space for the hyperslab selection information */ - (void)H5FL_FREE(H5S_hyper_sel_t, space->select.sel_info.hslab); - space->select.sel_info.hslab=NULL; + space->select.sel_info.hslab = H5FL_FREE(H5S_hyper_sel_t, space->select.sel_info.hslab); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_release() */ diff --git a/src/H5T.c b/src/H5T.c index 7dfe0f2..d21a453 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -250,10 +250,10 @@ double H5T_NATIVE_DOUBLE_NEG_INF_g = 0.0; */ static struct { int npaths; /*number of paths defined */ - int apaths; /*number of paths allocated */ + size_t apaths; /*number of paths allocated */ H5T_path_t **path; /*sorted array of path pointers */ int nsoft; /*number of soft conversions defined */ - int asoft; /*number of soft conversions allocated */ + size_t asoft; /*number of soft conversions allocated */ H5T_soft_t *soft; /*unsorted array of soft conversions */ } H5T_g; @@ -559,8 +559,8 @@ H5T_init_inf(void) FUNC_ENTER_NOAPI_NOINIT(H5T_init_inf) /* Get the float datatype */ - if (NULL==(dst_p=H5I_object(H5T_NATIVE_FLOAT_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if(NULL == (dst_p = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") dst = &dst_p->shared->u.atomic; /* Check that we can re-order the bytes correctly */ @@ -600,13 +600,13 @@ H5T_init_inf(void) } /* end if */ /* Get the double datatype */ - if (NULL==(dst_p=H5I_object(H5T_NATIVE_DOUBLE_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if(NULL == (dst_p = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") dst = &dst_p->shared->u.atomic; /* Check that we can re-order the bytes correctly */ - if (H5T_ORDER_LE!=H5T_native_order_g && H5T_ORDER_BE!=H5T_native_order_g) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order"); + if(H5T_ORDER_LE != H5T_native_order_g && H5T_ORDER_BE != H5T_native_order_g) + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order") /* +Inf */ d = (uint8_t *)&H5T_NATIVE_DOUBLE_POS_INF_g; @@ -757,36 +757,36 @@ H5T_init_interface(void) * Initialize pre-defined native datatypes from code generated during * the library configuration by H5detect. */ - if(H5TN_init_interface()<0) + if(H5TN_init_interface() < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Get the atomic datatype structures needed by the initialization code below */ - if(NULL==(native_schar=H5I_object(H5T_NATIVE_SCHAR_g))) + if(NULL == (native_schar = (H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_uchar=H5I_object(H5T_NATIVE_UCHAR_g))) + if(NULL == (native_uchar = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_short=H5I_object(H5T_NATIVE_SHORT_g))) + if(NULL == (native_short = (H5T_t *)H5I_object(H5T_NATIVE_SHORT_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_ushort=H5I_object(H5T_NATIVE_USHORT_g))) + if(NULL == (native_ushort = (H5T_t *)H5I_object(H5T_NATIVE_USHORT_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_int=H5I_object(H5T_NATIVE_INT_g))) + if(NULL == (native_int = (H5T_t *)H5I_object(H5T_NATIVE_INT_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_uint=H5I_object(H5T_NATIVE_UINT_g))) + if(NULL == (native_uint = (H5T_t *)H5I_object(H5T_NATIVE_UINT_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_long=H5I_object(H5T_NATIVE_LONG_g))) + if(NULL == (native_long = (H5T_t *)H5I_object(H5T_NATIVE_LONG_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_ulong=H5I_object(H5T_NATIVE_ULONG_g))) + if(NULL == (native_ulong = (H5T_t *)H5I_object(H5T_NATIVE_ULONG_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_llong=H5I_object(H5T_NATIVE_LLONG_g))) + if(NULL == (native_llong = (H5T_t *)H5I_object(H5T_NATIVE_LLONG_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_ullong=H5I_object(H5T_NATIVE_ULLONG_g))) + if(NULL == (native_ullong = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_float=H5I_object(H5T_NATIVE_FLOAT_g))) + if(NULL == (native_float = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") - if(NULL==(native_double=H5I_object(H5T_NATIVE_DOUBLE_g))) + if(NULL == (native_double = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") #if H5_SIZEOF_LONG_DOUBLE !=0 - if(NULL==(native_ldouble=H5I_object(H5T_NATIVE_LDOUBLE_g))) + if(NULL == (native_ldouble = (H5T_t *)H5I_object(H5T_NATIVE_LDOUBLE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") #endif @@ -1331,13 +1331,13 @@ H5T_init_interface(void) done: /* General cleanup */ - if (compound!=NULL) + if(compound != NULL) H5T_close(compound); - if (enum_type!=NULL) + if(enum_type != NULL) H5T_close(enum_type); - if (vlen!=NULL) + if(vlen != NULL) H5T_close(vlen); - if (array!=NULL) + if(array != NULL) H5T_close(array); /* Error cleanup */ @@ -1347,8 +1347,8 @@ done: if(copied_dtype) H5T_close(dt); else { - (void)H5FL_FREE(H5T_shared_t, dt->shared); - (void)H5FL_FREE(H5T_t,dt); + dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); + dt = H5FL_FREE(H5T_t, dt); } /* end else */ } /* end if */ } /* end if */ @@ -1410,45 +1410,46 @@ H5T_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_term_interface) - if (H5_interface_initialize_g) { + if(H5_interface_initialize_g) { /* Unregister all conversion functions */ - for (i=0; ifunc) { + HDassert(path); + if(path->func) { H5T_print_stats(path, &nprint/*in,out*/); path->cdata.command = H5T_CONV_FREE; - if ((path->func)(FAIL, FAIL, &(path->cdata), - (size_t)0, (size_t)0, (size_t)0, - NULL, NULL,H5AC_dxpl_id)<0) { + if((path->func)(FAIL, FAIL, &(path->cdata), (size_t)0, + (size_t)0, (size_t)0, NULL, NULL,H5AC_dxpl_id) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { - fprintf (H5DEBUG(T), "H5T: conversion function " + fprintf(H5DEBUG(T), "H5T: conversion function " "0x%08lx failed to free private data for " "%s (ignored)\n", (unsigned long)(path->func), path->name); - } + } /* end if */ #endif H5E_clear_stack(NULL); /*ignore the error*/ - } - } + } /* end if */ + } /* end if */ if(path->src) - H5T_close (path->src); + H5T_close(path->src); if(path->dst) - H5T_close (path->dst); - H5FL_FREE(H5T_path_t,path); + H5T_close(path->dst); + path = H5FL_FREE(H5T_path_t, path); H5T_g.path[i] = NULL; - } + } /* end for */ /* Clear conversion tables */ - H5T_g.path = H5MM_xfree(H5T_g.path); - H5T_g.npaths = H5T_g.apaths = 0; - H5T_g.soft = H5MM_xfree(H5T_g.soft); - H5T_g.nsoft = H5T_g.asoft = 0; + H5T_g.path = (H5T_path_t **)H5MM_xfree(H5T_g.path); + H5T_g.npaths = 0; + H5T_g.apaths = 0; + H5T_g.soft = (H5T_soft_t *)H5MM_xfree(H5T_g.soft); + H5T_g.nsoft = 0; + H5T_g.asoft = 0; /* Unlock all datatypes, then free them */ - H5I_search (H5I_DATATYPE, H5T_unlock_cb, NULL, FALSE); + H5I_search(H5I_DATATYPE, H5T_unlock_cb, NULL, FALSE); H5I_dec_type_ref(H5I_DATATYPE); /* Reset all the datatype IDs */ @@ -1657,6 +1658,20 @@ H5Tcopy(hid_t type_id) } break; + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_GROUP: + case H5I_DATASPACE: + case H5I_ATTR: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype or dataset") } /* end switch */ @@ -1943,12 +1958,12 @@ htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) { unsigned i; - htri_t ret_value=FALSE; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5T_detect_class, FAIL); + FUNC_ENTER_NOAPI(H5T_detect_class, FAIL) - assert(dt); - assert(cls>H5T_NO_CLASS && cls H5T_NO_CLASS && cls < H5T_NCLASSES); /* Consider VL string as a string for API, as a VL for internal use. */ /* (note that this check must be performed before checking if the VL @@ -1959,22 +1974,22 @@ H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) HGOTO_DONE(H5T_STRING == cls); /* Check if this type is the correct type */ - if(dt->shared->type==cls) + if(dt->shared->type == cls) HGOTO_DONE(TRUE); /* check for types that might have the correct type as a component */ switch(dt->shared->type) { case H5T_COMPOUND: - for (i=0; ishared->u.compnd.nmembs; i++) { + for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { htri_t nested_ret; /* Return value from nested call */ /* Check if this field's type is the correct type */ - if(dt->shared->u.compnd.memb[i].type->shared->type==cls) + if(dt->shared->u.compnd.memb[i].type->shared->type == cls) HGOTO_DONE(TRUE); /* Recurse if it's VL, compound, enum or array */ if(H5T_IS_COMPLEX(dt->shared->u.compnd.memb[i].type->shared->type)) - if((nested_ret=H5T_detect_class(dt->shared->u.compnd.memb[i].type, cls, from_api))!=FALSE) + if((nested_ret = H5T_detect_class(dt->shared->u.compnd.memb[i].type, cls, from_api)) != FALSE) HGOTO_DONE(nested_ret); } /* end for */ break; @@ -1984,13 +1999,22 @@ H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) case H5T_ENUM: HGOTO_DONE(H5T_detect_class(dt->shared->parent, cls, from_api)); + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_NCLASSES: default: break; } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_detect_class() */ /*------------------------------------------------------------------------- @@ -2265,12 +2289,12 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, assert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); assert(name && *name); - if (H5T_PERS_HARD==pers) { + if(H5T_PERS_HARD == pers) { /* Only bother to register the path if it's not a no-op path (for this machine) */ if(H5T_cmp(src, dst, FALSE)) { /* Locate or create a new conversion path */ - if (NULL==(new_path=H5T_path_find(src, dst, name, func, dxpl_id, api_call))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to locate/allocate conversion path"); + if(NULL == (new_path = H5T_path_find(src, dst, name, func, dxpl_id, api_call))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to locate/allocate conversion path") /* * Notify all other functions to recalculate private data since some @@ -2279,24 +2303,24 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, * functions for the members, so adding a new function should cause * the list to be recalculated to use the new function. */ - for (i=0; icdata.recalc = TRUE; - } /* end for */ } /* end if */ - } else { + } /* end if */ + else { /* Add function to end of soft list */ - if (H5T_g.nsoft>=H5T_g.asoft) { - size_t na = MAX(32, 2*H5T_g.asoft); - H5T_soft_t *x = H5MM_realloc(H5T_g.soft, na*sizeof(H5T_soft_t)); + if((size_t)H5T_g.nsoft >= H5T_g.asoft) { + size_t na = MAX(32, 2 * H5T_g.asoft); + H5T_soft_t *x; - if (!x) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - H5T_g.asoft = (int)na; + if(NULL == (x = (H5T_soft_t *)H5MM_realloc(H5T_g.soft, na * sizeof(H5T_soft_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + H5T_g.asoft = na; H5T_g.soft = x; } /* end if */ - HDstrncpy (H5T_g.soft[H5T_g.nsoft].name, name, (size_t)H5T_NAMELEN); - H5T_g.soft[H5T_g.nsoft].name[H5T_NAMELEN-1] = '\0'; + HDstrncpy(H5T_g.soft[H5T_g.nsoft].name, name, (size_t)H5T_NAMELEN); + H5T_g.soft[H5T_g.nsoft].name[H5T_NAMELEN - 1] = '\0'; H5T_g.soft[H5T_g.nsoft].src = src->shared->type; H5T_g.soft[H5T_g.nsoft].dst = dst->shared->type; H5T_g.soft[H5T_g.nsoft].func = func; @@ -2410,8 +2434,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2420,29 +2442,29 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, { H5T_t *src; /*source data type descriptor */ H5T_t *dst; /*destination data type desc */ - herr_t ret_value=SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_API(H5Tregister, FAIL); + FUNC_ENTER_API(H5Tregister, FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); /* Check args */ - if (H5T_PERS_HARD!=pers && H5T_PERS_SOFT!=pers) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid function persistence"); - if (!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conversion must have a name for debugging"); - if (NULL==(src=H5I_object_verify(src_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); - if (NULL==(dst=H5I_object_verify(dst_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); - if (!func) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified"); + if(H5T_PERS_HARD != pers && H5T_PERS_SOFT != pers) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid function persistence") + if(!name || !*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "conversion must have a name for debugging") + if(NULL == (src = (H5T_t *)H5I_object_verify(src_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + if(NULL == (dst = (H5T_t *)H5I_object_verify(dst_id,H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") + if(!func) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") /* Go register the function */ - if(H5T_register(pers,name,src,dst,func,H5AC_ind_dxpl_id,TRUE)<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function"); + if(H5T_register(pers, name, src, dst, func, H5AC_ind_dxpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Tregister() */ @@ -2490,7 +2512,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, if(func && func != soft->func) continue; - HDmemmove(H5T_g.soft + i, H5T_g.soft + i + 1, (H5T_g.nsoft - (i + 1)) * sizeof(H5T_soft_t)); + HDmemmove(H5T_g.soft + i, H5T_g.soft + i + 1, (size_t)(H5T_g.nsoft - (i + 1)) * sizeof(H5T_soft_t)); --H5T_g.nsoft; } /* end for */ } /* end if */ @@ -2518,7 +2540,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, } /* end if */ else { /* Remove from table */ - HDmemmove(H5T_g.path + i, H5T_g.path + i + 1, (H5T_g.npaths - (i + 1)) * sizeof(H5T_path_t*)); + HDmemmove(H5T_g.path + i, H5T_g.path + i + 1, (size_t)(H5T_g.npaths - (i + 1)) * sizeof(H5T_path_t*)); --H5T_g.npaths; /* Shut down path */ @@ -2559,33 +2581,30 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, * Programmer: Robb Matzke * Tuesday, January 13, 1998 * - * Modifications: - * Changed to use H5T_unregister wrapper function - QAK, 11/17/99 - * *------------------------------------------------------------------------- */ herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func) { - H5T_t *src=NULL, *dst=NULL; /*data type descriptors */ - herr_t ret_value=SUCCEED; /* Return value */ + H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tunregister, FAIL); + FUNC_ENTER_API(H5Tunregister, FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); /* Check arguments */ - if (src_id>0 && (NULL==(src=H5I_object_verify(src_id,H5I_DATATYPE)))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src is not a data type"); - if (dst_id>0 && (NULL==(dst=H5I_object_verify(dst_id,H5I_DATATYPE)))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst is not a data type"); + if(src_id > 0 && (NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src is not a data type") + if(dst_id > 0 && (NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE)))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst is not a data type") - if (H5T_unregister(pers,name,src,dst,func,H5AC_ind_dxpl_id)<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "internal unregister function failed"); + if(H5T_unregister(pers, name, src, dst, func, H5AC_ind_dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "internal unregister function failed") done: - FUNC_LEAVE_API(ret_value); -} + FUNC_LEAVE_API(ret_value) +} /* end H5Tunregister() */ /*------------------------------------------------------------------------- @@ -2604,40 +2623,38 @@ done: * Programmer: Robb Matzke * Tuesday, January 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) { - H5T_conv_t ret_value; - H5T_t *src = NULL, *dst = NULL; - H5T_path_t *path = NULL; + H5T_t *src, *dst; + H5T_path_t *path; + H5T_conv_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tfind, NULL); + FUNC_ENTER_API(H5Tfind, NULL) H5TRACE3("x", "ii**x", src_id, dst_id, pcdata); /* Check args */ - if (NULL == (src = H5I_object_verify(src_id,H5I_DATATYPE)) || - NULL == (dst = H5I_object_verify(dst_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type"); - if (!pcdata) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer"); + if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || + NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") + if(!pcdata) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer") /* Find it */ - if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found"); + if(NULL == (path = H5T_path_find(src, dst, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") - if (pcdata) + if(pcdata) *pcdata = &(path->cdata); /* Set return value */ ret_value = path->func; done: - FUNC_LEAVE_API(ret_value); -} + FUNC_LEAVE_API(ret_value) +} /* end H5Tfind() */ /*------------------------------------------------------------------------- @@ -2655,31 +2672,29 @@ done: * Programmer: Raymond Lu * Friday, Sept 2, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id) { - htri_t ret_value; - H5T_t *src = NULL, *dst = NULL; + H5T_t *src, *dst; + htri_t ret_value; /* Return value */ FUNC_ENTER_API(H5Tcompiler_conv, FAIL) H5TRACE2("t", "ii", src_id, dst_id); /* Check args */ - if (NULL == (src = H5I_object_verify(src_id,H5I_DATATYPE)) || - NULL == (dst = H5I_object_verify(dst_id,H5I_DATATYPE))) + if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || + NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") /* Find it */ - if((ret_value=H5T_compiler_conv(src, dst))<0) + if((ret_value = H5T_compiler_conv(src, dst)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Tcompiler_conv() */ /*------------------------------------------------------------------------- @@ -2703,43 +2718,39 @@ done: * Programmer: Robb Matzke * Wednesday, June 10, 1998 * - * Modifications: - * Added xfer_parms argument to pass VL datatype custom allocation - * information down the chain. - QAK, 7/1/99 - * *------------------------------------------------------------------------- */ herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, hid_t dxpl_id) { - H5T_path_t *tpath=NULL; /*type conversion info */ - H5T_t *src=NULL, *dst=NULL; /*unatomized types */ - herr_t ret_value=SUCCEED; /* Return value */ + H5T_path_t *tpath; /*type conversion info */ + H5T_t *src, *dst; /*unatomized types */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tconvert, FAIL); + FUNC_ENTER_API(H5Tconvert, FAIL) H5TRACE6("e", "iiz*x*xi", src_id, dst_id, nelmts, buf, background, dxpl_id); /* Check args */ - if (NULL==(src=H5I_object_verify(src_id,H5I_DATATYPE)) || - NULL==(dst=H5I_object_verify(dst_id,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); + if(NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || + NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list") /* Find the conversion function */ - if (NULL==(tpath=H5T_path_find(src, dst, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types"); + if(NULL == (tpath = H5T_path_find(src, dst, NULL, NULL, dxpl_id, FALSE))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") - if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background, dxpl_id)<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") done: - FUNC_LEAVE_API(ret_value); -} + FUNC_LEAVE_API(ret_value) +} /* end H5Tconvert() */ /*------------------------------------------------------------------------- @@ -2756,8 +2767,6 @@ done: * slu@ncsa.uiuc.edu * July 14, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2770,13 +2779,13 @@ H5Tencode(hid_t obj_id, void *buf, size_t *nalloc) H5TRACE3("e", "i*x*z", obj_id, buf, nalloc); /* Check argument and retrieve object */ - if(NULL == (dtype = H5I_object_verify(obj_id, H5I_DATATYPE))) + if(NULL == (dtype = (H5T_t *)H5I_object_verify(obj_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(nalloc == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL pointer for buffer size") /* Go encode the datatype */ - if(H5T_encode(dtype, buf, nalloc) < 0) + if(H5T_encode(dtype, (unsigned char *)buf, nalloc) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") done: @@ -2804,7 +2813,7 @@ hid_t H5Tdecode(const void *buf) { H5T_t *dt; - hid_t ret_value; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5Tdecode, FAIL) H5TRACE1("i", "*x", buf); @@ -2814,7 +2823,7 @@ H5Tdecode(const void *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer") /* Create datatype by decoding buffer */ - if((dt = H5T_decode(buf)) == NULL) + if(NULL == (dt = H5T_decode((const unsigned char *)buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") /* Register the type and return the ID */ @@ -2908,7 +2917,7 @@ static H5T_t * H5T_decode(const unsigned char *buf) { H5F_t *f = NULL; /* Fake file structure*/ - H5T_t *ret_value; + H5T_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5T_decode) @@ -2925,7 +2934,7 @@ H5T_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") /* Decode the serialized datatype message */ - if((ret_value = H5O_msg_decode(f, H5AC_dxpl_id, NULL, H5O_DTYPE_ID, buf)) == NULL) + if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_dxpl_id, NULL, H5O_DTYPE_ID, buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ @@ -3024,6 +3033,9 @@ H5T_create(H5T_class_t type, size_t size) case H5T_ARRAY: /* Array datatype */ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, NULL, "base type required - use H5Tarray_create2()") + case H5T_NO_CLASS: + case H5T_REFERENCE: + case H5T_NCLASSES: default: HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, NULL, "unknown data type class") } /* end switch */ @@ -3131,7 +3143,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) */ if(old_dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED) { /* Check if the object is already open */ - if(NULL == (reopened_fo = H5FO_opened(old_dt->sh_loc.file, old_dt->sh_loc.u.loc.oh_addr))) { + if(NULL == (reopened_fo = (H5T_shared_t *)H5FO_opened(old_dt->sh_loc.file, old_dt->sh_loc.u.loc.oh_addr))) { /* Clear any errors from H5FO_opened() */ H5E_clear_stack(NULL); @@ -3148,7 +3160,8 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINC, NULL, "can't increment object count") new_dt->shared->fo_count = 1; - } else { + } /* end if */ + else { /* The object is already open. Free the H5T_shared_t struct * we had been using and use the one that already exists. * Not terribly efficient. */ @@ -4482,13 +4495,13 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_g.path[md] = path; } else if(path != table) { HDassert(cmp); - if(H5T_g.npaths >= H5T_g.apaths) { + if((size_t)H5T_g.npaths >= H5T_g.apaths) { size_t na = MAX(128, 2 * H5T_g.apaths); - H5T_path_t **x = H5MM_realloc (H5T_g.path, na * sizeof(H5T_path_t*)); + H5T_path_t **x; - if(!x) + if(NULL == (x = H5MM_realloc(H5T_g.path, na * sizeof(H5T_path_t*)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - H5T_g.apaths = (int)na; + H5T_g.apaths = na; H5T_g.path = x; } /* end if */ if(cmp > 0) diff --git a/src/H5WB.c b/src/H5WB.c index c3e3a6f..f624abc 100644 --- a/src/H5WB.c +++ b/src/H5WB.c @@ -137,7 +137,7 @@ H5WB_wrap(void *buf, size_t buf_size) done: /* Release resources on error */ if(!ret_value && wb) - (void)H5FL_FREE(H5WB_t, wb); + wb = H5FL_FREE(H5WB_t, wb); FUNC_LEAVE_NOAPI(ret_value) } /* end H5WB_wrap() */ diff --git a/src/H5private.h b/src/H5private.h index c8de6bf..386a3e2 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1637,7 +1637,7 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ /* `S' is the name of a function which is being tested to check if its */ /* an API function */ -#define H5_IS_API(S) ('_'!=((char*)S)[2] && '_'!=((char*)S)[3] && (!((char*)S)[4] || '_'!=((char*)S)[4])) +#define H5_IS_API(S) ('_'!=((const char *)S)[2] && '_'!=((const char *)S)[3] && (!((const char *)S)[4] || '_'!=((const char *)S)[4])) /* global library version information string */ extern char H5_lib_vers_info_g[]; diff --git a/src/H5public.h b/src/H5public.h index 687c665..a4ae973 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -71,10 +71,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 67 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 68 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "FA_a4" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.67-FA_a4" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.68-FA_a4" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index d55f175..ad97133 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -445,7 +445,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 57 +LT_VERS_REVISION = 58 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 462408d..cfe9655 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -489,13 +489,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.67-FA_a4" +#define H5_PACKAGE_STRING "HDF5 1.9.68-FA_a4" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.67-FA_a4" +#define H5_PACKAGE_VERSION "1.9.68-FA_a4" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -651,7 +651,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.67-FA_a4" +#define H5_VERSION "1.9.68-FA_a4" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index a55c5d5..7911c11 100755 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -479,13 +479,13 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.67-FA_a4" +#define H5_PACKAGE_STRING "HDF5 1.9.68-FA_a4" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.67-FA_a4" +#define H5_PACKAGE_VERSION "1.9.68-FA_a4" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -642,7 +642,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.67-FA_a4" +#define H5_VERSION "1.9.68-FA_a4" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12