summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-10-13 20:51:06 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-10-15 13:09:48 (GMT)
commit48d171b04730aff7beade684e9afd164f0204b0c (patch)
tree81bb97f196a1f35bc94624ab5f1b8e9fbbccaa81
parent1ce4c8dd7ddaa344ad041514b1d3aa4979497275 (diff)
downloadhdf5-48d171b04730aff7beade684e9afd164f0204b0c.zip
hdf5-48d171b04730aff7beade684e9afd164f0204b0c.tar.gz
hdf5-48d171b04730aff7beade684e9afd164f0204b0c.tar.bz2
Merge from 1.10
Comments, whitespace Simple init and if block brackets. Minimal code changes limited to return value and spelling
-rw-r--r--.github/CODEOWNERS10
-rw-r--r--src/H5.c11
-rw-r--r--src/H5AC.c93
-rw-r--r--src/H5ACprivate.h44
-rw-r--r--src/H5ACpublic.h4
-rw-r--r--src/H5Abtree2.c3
-rw-r--r--src/H5Adense.c142
-rw-r--r--src/H5Adeprec.c2
-rw-r--r--src/H5Aint.c107
-rw-r--r--src/H5B.c390
-rw-r--r--src/H5B2.c16
-rw-r--r--src/H5B2cache.c12
-rw-r--r--src/H5B2dbg.c5
-rw-r--r--src/H5B2hdr.c12
-rw-r--r--src/H5B2int.c57
-rw-r--r--src/H5B2pkg.h2
-rw-r--r--src/H5B2private.h2
-rw-r--r--src/H5B2stat.c2
-rw-r--r--src/H5B2test.c2
-rw-r--r--src/H5Bcache.c2
-rw-r--r--src/H5Bdbg.c31
-rw-r--r--src/H5Bpkg.h2
-rw-r--r--src/H5Bprivate.h4
-rw-r--r--src/H5FD.c13
-rw-r--r--src/H5FDcore.h2
-rw-r--r--src/H5FDdirect.c2
-rw-r--r--src/H5FDdirect.h2
-rw-r--r--src/H5FDfamily.h2
-rw-r--r--src/H5FDhdfs.c1782
-rw-r--r--src/H5FDhdfs.h14
-rw-r--r--src/H5FDint.c6
-rw-r--r--src/H5FDlog.c2
-rw-r--r--src/H5FDlog.h2
-rw-r--r--src/H5FDmpi.c2
-rw-r--r--src/H5FDmpi.h2
-rw-r--r--src/H5FDmpio.c4
-rw-r--r--src/H5FDmpio.h2
-rw-r--r--src/H5FDmulti.c2
-rw-r--r--src/H5FDmulti.h2
-rw-r--r--src/H5FDpkg.h2
-rw-r--r--src/H5FDpublic.h2
-rw-r--r--src/H5FDros3.c1317
-rw-r--r--src/H5FDs3comms.c755
-rw-r--r--src/H5FDs3comms.h5
-rw-r--r--src/H5FDsec2.c3
-rw-r--r--src/H5FDsec2.h2
-rw-r--r--src/H5FDspace.c2
-rw-r--r--src/H5FDstdio.c2
-rw-r--r--src/H5FDstdio.h2
-rw-r--r--src/H5FDwindows.h4
-rw-r--r--src/H5FL.c65
-rw-r--r--src/H5FLprivate.h8
-rw-r--r--src/H5FS.c153
-rw-r--r--src/H5FScache.c8
-rw-r--r--src/H5FSdbg.c55
-rw-r--r--src/H5FSpkg.h42
-rw-r--r--src/H5FSprivate.h8
-rw-r--r--src/H5FSpublic.h2
-rw-r--r--src/H5FSsection.c422
-rw-r--r--src/H5FSstat.c12
-rw-r--r--src/H5FStest.c21
-rw-r--r--src/H5Fefc.c2
-rw-r--r--src/H5Ffake.c2
-rw-r--r--src/H5Fio.c9
-rw-r--r--src/H5Fmount.c82
-rw-r--r--src/H5Fmpi.c64
-rw-r--r--src/H5Fpkg.h2
-rw-r--r--src/H5Fpublic.h4
-rw-r--r--src/H5Fquery.c476
-rw-r--r--src/H5Fsfile.c30
-rw-r--r--src/H5Fsuper.c2
-rw-r--r--src/H5Fsuper_cache.c11
-rw-r--r--src/H5Ftest.c21
-rw-r--r--src/H5G.c132
-rw-r--r--src/H5Gbtree2.c15
-rw-r--r--src/H5Gcache.c2
-rw-r--r--src/H5Gcompact.c20
-rw-r--r--src/H5Gdense.c46
-rw-r--r--src/H5Gdeprec.c48
-rw-r--r--src/H5Gent.c9
-rw-r--r--src/H5Gint.c85
-rw-r--r--src/H5Glink.c23
-rw-r--r--src/H5Gloc.c24
-rw-r--r--src/H5Gname.c78
-rw-r--r--src/H5Gnode.c19
-rw-r--r--src/H5Gobj.c11
-rw-r--r--src/H5Gpkg.h4
-rw-r--r--src/H5Gprivate.h7
-rw-r--r--src/H5Gpublic.h10
-rw-r--r--src/H5Groot.c4
-rw-r--r--src/H5Gstab.c31
-rw-r--r--src/H5Gtest.c24
-rw-r--r--src/H5Gtraverse.c5
-rw-r--r--src/H5HF.c16
-rw-r--r--src/H5HFbtree2.c13
-rw-r--r--src/H5HFcache.c19
-rw-r--r--src/H5HFdbg.c15
-rw-r--r--src/H5HFdblock.c9
-rw-r--r--src/H5HFdtable.c41
-rw-r--r--src/H5HFhdr.c46
-rw-r--r--src/H5HFhuge.c39
-rw-r--r--src/H5HFiblock.c20
-rw-r--r--src/H5HFiter.c13
-rw-r--r--src/H5HFman.c8
-rw-r--r--src/H5HFpkg.h2
-rw-r--r--src/H5HFprivate.h2
-rw-r--r--src/H5HFpublic.h2
-rw-r--r--src/H5HFsection.c71
-rw-r--r--src/H5HFspace.c26
-rw-r--r--src/H5HFstat.c2
-rw-r--r--src/H5HFtest.c33
-rw-r--r--src/H5HFtiny.c88
-rw-r--r--src/H5HG.c15
-rw-r--r--src/H5HGcache.c2
-rw-r--r--src/H5HGdbg.c3
-rw-r--r--src/H5HGpkg.h2
-rw-r--r--src/H5HGprivate.h2
-rw-r--r--src/H5HGpublic.h2
-rw-r--r--src/H5HGquery.c2
-rw-r--r--src/H5HL.c154
-rw-r--r--src/H5HLcache.c28
-rw-r--r--src/H5HLdbg.c24
-rw-r--r--src/H5HLint.c56
-rw-r--r--src/H5HLpkg.h65
-rw-r--r--src/H5HLprivate.h26
-rw-r--r--src/H5HLpublic.h2
-rw-r--r--src/H5I.c942
-rw-r--r--src/H5Ipkg.h2
-rw-r--r--src/H5Ipublic.h34
-rw-r--r--src/H5Itest.c12
-rw-r--r--src/H5Lexternal.c6
-rw-r--r--src/H5Lpkg.h2
-rw-r--r--src/H5MF.c15
-rw-r--r--src/H5MFaggr.c2
-rw-r--r--src/H5MFdbg.c4
-rw-r--r--src/H5MFprivate.h4
-rw-r--r--src/H5MFsection.c23
-rw-r--r--src/H5MM.c6
-rw-r--r--src/H5MMprivate.h2
-rw-r--r--src/H5MMpublic.h6
-rw-r--r--src/H5MP.c32
-rw-r--r--src/H5MPpkg.h2
-rw-r--r--src/H5MPprivate.h2
-rw-r--r--src/H5MPtest.c20
-rw-r--r--src/H5O.c302
-rw-r--r--src/H5Oainfo.c9
-rw-r--r--src/H5Oalloc.c21
-rw-r--r--src/H5Oattr.c4
-rw-r--r--src/H5Oattribute.c60
-rw-r--r--src/H5Obogus.c8
-rw-r--r--src/H5Obtreek.c2
-rw-r--r--src/H5Ocache.c15
-rw-r--r--src/H5Ochunk.c52
-rw-r--r--src/H5Ocont.c10
-rw-r--r--src/H5Ocopy.c13
-rw-r--r--src/H5Odbg.c12
-rw-r--r--src/H5Odrvinfo.c17
-rw-r--r--src/H5Odtype.c22
-rw-r--r--src/H5Oefl.c4
-rw-r--r--src/H5Ofill.c142
-rw-r--r--src/H5Oginfo.c25
-rw-r--r--src/H5Olayout.c20
-rw-r--r--src/H5Olinfo.c8
-rw-r--r--src/H5Olink.c7
-rw-r--r--src/H5Omessage.c90
-rw-r--r--src/H5Omtime.c148
-rw-r--r--src/H5Oname.c39
-rw-r--r--src/H5Onull.c1
-rw-r--r--src/H5Opline.c151
-rw-r--r--src/H5Oprivate.h4
-rw-r--r--src/H5Opublic.h29
-rw-r--r--src/H5Orefcount.c15
-rw-r--r--src/H5Osdspace.c14
-rw-r--r--src/H5Oshared.c21
-rw-r--r--src/H5Oshared.h10
-rw-r--r--src/H5Oshmesg.c8
-rw-r--r--src/H5Ostab.c30
-rw-r--r--src/H5Otest.c12
-rw-r--r--src/H5Ounknown.c8
-rw-r--r--src/H5P.c97
-rw-r--r--src/H5PL.c105
-rw-r--r--src/H5PLextern.h4
-rw-r--r--src/H5PLprivate.h4
-rw-r--r--src/H5PLpublic.h10
-rw-r--r--src/H5Pacpl.c32
-rw-r--r--src/H5Pdapl.c102
-rw-r--r--src/H5Pdcpl.c71
-rw-r--r--src/H5Pdeprec.c6
-rw-r--r--src/H5Pdxpl.c23
-rw-r--r--src/H5Pfapl.c455
-rw-r--r--src/H5Pfcpl.c43
-rw-r--r--src/H5Pfmpl.c2
-rw-r--r--src/H5Pgcpl.c14
-rw-r--r--src/H5Pint.c228
-rw-r--r--src/H5Plapl.c59
-rw-r--r--src/H5Plcpl.c16
-rw-r--r--src/H5Pocpl.c415
-rw-r--r--src/H5Pocpypl.c10
-rw-r--r--src/H5Ppkg.h12
-rw-r--r--src/H5Ppublic.h2
-rw-r--r--src/H5Pstrcpl.c2
-rw-r--r--src/H5Ptest.c22
-rw-r--r--src/H5R.c26
-rw-r--r--src/H5Rdeprec.c6
-rw-r--r--src/H5Rpkg.h6
-rw-r--r--src/H5Rpublic.h10
-rw-r--r--src/H5S.c684
-rw-r--r--src/H5SL.c32
-rw-r--r--src/H5SM.c7
-rw-r--r--src/H5SMbtree2.c6
-rw-r--r--src/H5SMcache.c12
-rw-r--r--src/H5SMmessage.c4
-rw-r--r--src/H5SMpkg.h4
-rw-r--r--src/H5SMprivate.h2
-rw-r--r--src/H5ST.c16
-rw-r--r--src/H5Sall.c26
-rw-r--r--src/H5Sdbg.c31
-rw-r--r--src/H5Shyper.c4
-rw-r--r--src/H5Smpio.c43
-rw-r--r--src/H5Snone.c62
-rw-r--r--src/H5Spkg.h6
-rw-r--r--src/H5Spoint.c72
-rw-r--r--src/H5Spublic.h8
-rw-r--r--src/H5Sselect.c137
-rw-r--r--src/H5Stest.c2
-rw-r--r--src/H5T.c245
-rw-r--r--src/H5TS.c6
-rw-r--r--src/H5TSprivate.h2
-rw-r--r--src/H5Tarray.c42
-rw-r--r--src/H5Tbit.c200
-rw-r--r--src/H5Tcommit.c110
-rw-r--r--src/H5Tcompound.c41
-rw-r--r--src/H5Tconv.c426
-rw-r--r--src/H5Tcset.c8
-rw-r--r--src/H5Tdbg.c63
-rw-r--r--src/H5Tdeprec.c24
-rw-r--r--src/H5Tenum.c44
-rw-r--r--src/H5Tfields.c17
-rw-r--r--src/H5Tfixed.c9
-rw-r--r--src/H5Tfloat.c4
-rw-r--r--src/H5Tnative.c25
-rw-r--r--src/H5Toffset.c26
-rw-r--r--src/H5Toh.c14
-rw-r--r--src/H5Topaque.c4
-rw-r--r--src/H5Torder.c4
-rw-r--r--src/H5Tpad.c8
-rw-r--r--src/H5Tpkg.h50
-rw-r--r--src/H5Tprecis.c14
-rw-r--r--src/H5Tprivate.h8
-rw-r--r--src/H5Tstrpad.c8
-rw-r--r--src/H5Tvisit.c2
-rw-r--r--src/H5Tvlen.c61
-rw-r--r--src/H5VM.c50
-rw-r--r--src/H5VMprivate.h64
-rw-r--r--src/H5WB.c6
-rw-r--r--src/H5WBprivate.h2
-rw-r--r--src/H5Z.c478
-rw-r--r--src/H5Zdeflate.c6
-rw-r--r--src/H5Zfletcher32.c16
-rw-r--r--src/H5Znbit.c56
-rw-r--r--src/H5Zprivate.h2
-rw-r--r--src/H5Zpublic.h22
-rw-r--r--src/H5Zscaleoffset.c86
-rw-r--r--src/H5Zshuffle.c15
-rw-r--r--src/H5Zszip.c14
-rw-r--r--src/H5Ztrans.c131
-rw-r--r--src/H5make_libsettings.c30
-rw-r--r--src/H5private.h10
-rw-r--r--src/H5public.h14
-rw-r--r--src/H5timer.c7
-rw-r--r--src/H5trace.c354
-rw-r--r--src/hdf5.h56
-rw-r--r--src/hdf5.lnt2
-rw-r--r--test/hdfs.c109
-rw-r--r--test/ros3.c24
-rw-r--r--test/s3comms.c2
276 files changed, 6670 insertions, 9578 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 2c31664..7d7bcdd 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -11,11 +11,11 @@
CMakeLists.txt @byrnHDF @derobins
CMakeTests.* @byrnHDF @derobins
-/bin/ @lrknox @derobins @qkoziol
+/bin/ @lrknox @derobins
/c++/ @bmribler @byrnHDF
-/config/ @lrknox @derobins @qkoziol @byrnHDF
+/config/ @lrknox @derobins @byrnHDF
/doc/ @gnuoyd @jrmainzer
@@ -29,11 +29,11 @@ CMakeTests.* @byrnHDF @derobins
/release_docs/ @lrknox @bljhdf @byrnHDF
-/src/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup @jrmainzer
+/src/ @jhendersonHDF @derobins @fortnern @soumagne @vchoi-hdfgroup @jrmainzer
-/test/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup @jrmainzer
+/test/ @jhendersonHDF @derobins @fortnern @soumagne @vchoi-hdfgroup @jrmainzer
-/testpar/ @jhendersonHDF @rawarren @jrmainzer @qkoziol
+/testpar/ @jhendersonHDF @rawarren @jrmainzer
/tools/ @byrnHDF @bmribler
diff --git a/src/H5.c b/src/H5.c
index 749f7af..4a60858 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -71,7 +71,7 @@ hbool_t H5_MPEinit_g = FALSE; /* MPE Library hasn't been initialized */
char H5_lib_vers_info_g[] = H5_VERS_INFO;
static hbool_t H5_dont_atexit_g = FALSE;
-H5_debug_t H5_debug_g; /*debugging info */
+H5_debug_t H5_debug_g; /* debugging info */
/*******************/
/* Local Variables */
@@ -223,11 +223,6 @@ done:
*
* Return: void
*
- * Programmer: Robb Matzke
- * Friday, November 20, 1998
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
@@ -264,6 +259,7 @@ H5_term_library(void)
do {
pending = 0;
+
/* Try to organize these so the "higher" level components get shut
* down before "lower" level components that they might rely on. -QAK
*/
@@ -739,7 +735,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
HDsnprintf(lib_str, sizeof(lib_str), "HDF5 library version: %d.%d.%d", H5_VERS_MAJOR, H5_VERS_MINOR,
H5_VERS_RELEASE);
if (*substr) {
- HDstrncat(lib_str, "-", 1);
+ HDstrncat(lib_str, "-", (size_t)1);
HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1);
} /* end if */
if (HDstrcmp(lib_str, H5_lib_vers_info_g)) {
@@ -782,6 +778,7 @@ H5open(void)
FUNC_ENTER_API_NOCLEAR(FAIL)
H5TRACE0("e", "");
/* all work is done by FUNC_ENTER() */
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5open() */
diff --git a/src/H5AC.c b/src/H5AC.c
index db8fe10..3cafb85 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -15,7 +15,7 @@
*
* Created: H5AC.c
* Jul 9 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Functions in this file implement a cache for
* things which exist on disk. All "things" associated
@@ -175,7 +175,7 @@ static herr_t H5AC_run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op);
*
* Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 18, 2003
*
*-------------------------------------------------------------------------
@@ -195,11 +195,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_init_interface
*
- * Purpose: Initialize interface-specific information
+ * Purpose: Initialize interface-specific information
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -272,7 +272,7 @@ done:
*
* Failure: Negative.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -350,7 +350,6 @@ static const char *H5AC_entry_type_names[H5AC_NTYPES] = {
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -366,6 +365,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr)
FUNC_ENTER_NOAPI(FAIL)
+ /* Check arguments */
HDassert(f);
HDassert(NULL == f->shared->cache);
HDassert(config_ptr != NULL);
@@ -488,13 +488,10 @@ done:
if (aux_ptr != NULL) {
if (aux_ptr->d_slist_ptr != NULL)
H5SL_close(aux_ptr->d_slist_ptr);
-
if (aux_ptr->c_slist_ptr != NULL)
H5SL_close(aux_ptr->c_slist_ptr);
-
if (aux_ptr->candidate_slist_ptr != NULL)
H5SL_close(aux_ptr->candidate_slist_ptr);
-
aux_ptr->magic = 0;
aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr);
} /* end if */
@@ -514,7 +511,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -569,6 +565,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
H5SL_close(aux_ptr->candidate_slist_ptr);
aux_ptr->magic = 0;
aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr);
+
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -649,19 +646,18 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_flush
*
- * Purpose: Flush (and possibly destroy) the metadata cache associated
- * with the specified file.
+ * Purpose: Flush (and possibly destroy) the metadata cache associated
+ * with the specified file.
*
- * If the cache contains protected entries, the function will
- * fail, as protected entries cannot be flushed. However
- * all unprotected entries should be flushed before the
- * function returns failure.
+ * If the cache contains protected entries, the function will
+ * fail, as protected entries cannot be flushed. However
+ * all unprotected entries should be flushed before the
+ * function returns failure.
*
* Return: Non-negative on success/Negative on failure if there was a
* request to flush all items and something was protected.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -713,15 +709,15 @@ done:
* Function: H5AC_get_entry_status
*
* Purpose: Given a file address, determine whether the metadata
- * cache contains an entry at that location. If it does,
- * also determine whether the entry is dirty, protected,
- * pinned, etc. and return that information to the caller
- * in *status_ptr.
+ * cache contains an entry at that location. If it does,
+ * also determine whether the entry is dirty, protected,
+ * pinned, etc. and return that information to the caller
+ * in *status.
*
- * If the specified entry doesn't exist, set *status_ptr
- * to zero.
+ * If the specified entry doesn't exist, set *status_ptr
+ * to zero.
*
- * On error, the value of *status_ptr is undefined.
+ * On error, the value of *status is undefined.
*
* Return: Non-negative on success/Negative on failure
*
@@ -775,7 +771,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -862,8 +857,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_dirty
*
- * Purpose: Mark a pinned or protected entry as dirty. The target
- * entry MUST be either pinned, protected, or both.
+ * Purpose: Mark a pinned or protected entry as dirty. The target
+ * entry MUST be either pinned, protected, or both.
*
* Return: Non-negative on success/Negative on failure
*
@@ -932,7 +927,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -1002,7 +996,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_pin_protected_entry()
*
- * Purpose: Pin a protected cache entry. The entry must be protected
+ * Purpose: Pin a protected cache entry. The entry must be protected
* at the time of call, and must be unpinned.
*
* Return: Non-negative on success/Negative on failure
@@ -1304,7 +1298,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Sep 2 1997
*
*-------------------------------------------------------------------------
@@ -1628,9 +1621,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t *
#endif /* H5_HAVE_PARALLEL */
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_get_cache_auto_resize_config() */
/*-------------------------------------------------------------------------
@@ -1663,9 +1654,7 @@ H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_s
}
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_get_cache_size() */
/*-------------------------------------------------------------------------
@@ -1722,9 +1711,7 @@ H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr)
}
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5AC_reset_cache_hit_rate_stats() */
/*-------------------------------------------------------------------------
@@ -1868,16 +1855,16 @@ done:
* Function: H5AC_validate_config()
*
* Purpose: Run a sanity check on the contents of the supplied
- * instance of H5AC_cache_config_t.
+ * instance of H5AC_cache_config_t.
*
* Do nothing and return SUCCEED if no errors are detected,
* and flag an error and return FAIL otherwise.
*
- * At present, this function operates by packing the data
- * from the instance of H5AC_cache_config_t into an instance
- * of H5C_auto_size_ctl_t, and then calling
- * H5C_validate_resize_config(). As H5AC_cache_config_t and
- * H5C_auto_size_ctl_t diverge, we may have to change this.
+ * At present, this function operates by packing the data
+ * from the instance of H5AC_cache_config_t into an instance
+ * of H5C_auto_size_ctl_t, and then calling
+ * H5C_validate_resize_config(). As H5AC_cache_config_t and
+ * H5C_auto_size_ctl_t diverge, we may have to change this.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2476,13 +2463,13 @@ done:
* Function: H5AC_check_if_write_permitted
*
* Purpose: Determine if a write is permitted under the current
- * circumstances, and set *write_permitted_ptr accordingly.
- * As a general rule it is, but when we are running in parallel
- * mode with collective I/O, we must ensure that a read cannot
- * cause a write.
+ * circumstances, and set *write_permitted_ptr accordingly.
+ * As a general rule it is, but when we are running in parallel
+ * mode with collective I/O, we must ensure that a read cannot
+ * cause a write.
*
- * In the event of failure, the value of *write_permitted_ptr
- * is undefined.
+ * In the event of failure, the value of *write_permitted_ptr
+ * is undefined.
*
* Return: Non-negative on success/Negative on failure.
*
@@ -2747,12 +2734,12 @@ done:
* Function: H5AC_ext_config_2_int_config()
*
* Purpose: Utility function to translate an instance of
- * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
+ * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
*
- * Places translation in *int_conf_ptr and returns SUCCEED
- * if successful. Returns FAIL on failure.
+ * Places translation in *int_conf_ptr and returns SUCCEED
+ * if successful. Returns FAIL on failure.
*
- * Does only minimal sanity checking.
+ * Does only minimal sanity checking.
*
* Return: Non-negative on success/Negative on failure
*
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index aac4209..4f65a3d 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5ACprivate.h
+ * Created: H5ACprivate.h
* Jul 9 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
- * Purpose: Constants and typedefs available to the rest of the
+ * Purpose: Constants and typedefs available to the rest of the
* library.
*
*-------------------------------------------------------------------------
@@ -196,27 +196,27 @@ extern hid_t H5AC_ind_dxpl_id;
/* hbool_t evictions_enabled = */ TRUE, \
/* hbool_t set_initial_size = */ TRUE, \
/* size_t initial_size = */ ( 2 * 1024 * 1024), \
- /* double min_clean_fraction = */ 0.3, \
+ /* double min_clean_fraction = */ 0.3f, \
/* size_t max_size = */ (32 * 1024 * 1024), \
/* size_t min_size = */ (1 * 1024 * 1024), \
/* long int epoch_length = */ 50000, \
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \
- /* double lower_hr_threshold = */ 0.9F, \
- /* double increment = */ 2.0F, \
+ /* double lower_hr_threshold = */ 0.9f, \
+ /* double increment = */ 2.0f, \
/* hbool_t apply_max_increment = */ TRUE, \
/* size_t max_increment = */ (4 * 1024 * 1024), \
/* enum H5C_cache_flash_incr_mode */ \
/* flash_incr_mode = */ H5C_flash_incr__add_space, \
- /* double flash_multiple = */ 1.0F, \
- /* double flash_threshold = */ 0.25F, \
+ /* double flash_multiple = */ 1.0f, \
+ /* double flash_threshold = */ 0.25f, \
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, \
- /* double upper_hr_threshold = */ H5_DOUBLE(0.999), \
- /* double decrement = */ 0.9F, \
+ /* double upper_hr_threshold = */ 0.999f, \
+ /* double decrement = */ 0.9f, \
/* hbool_t apply_max_decrement = */ TRUE, \
/* size_t max_decrement = */ (1 * 1024 * 1024), \
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
- /* double empty_reserve = */ 0.1F, \
+ /* double empty_reserve = */ 0.1f, \
/* int dirty_bytes_threshold = */ (256 * 1024), \
/* int metadata_write_strategy = */ \
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
@@ -232,34 +232,33 @@ extern hid_t H5AC_ind_dxpl_id;
/* hbool_t evictions_enabled = */ TRUE, \
/* hbool_t set_initial_size = */ TRUE, \
/* size_t initial_size = */ ( 2 * 1024 * 1024), \
- /* double min_clean_fraction = */ 0.01F, \
+ /* double min_clean_fraction = */ 0.01f, \
/* size_t max_size = */ (32 * 1024 * 1024), \
/* size_t min_size = */ ( 1 * 1024 * 1024), \
/* long int epoch_length = */ 50000, \
/* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \
- /* double lower_hr_threshold = */ 0.9F, \
- /* double increment = */ 2.0F, \
+ /* double lower_hr_threshold = */ 0.9f, \
+ /* double increment = */ 2.0f, \
/* hbool_t apply_max_increment = */ TRUE, \
/* size_t max_increment = */ (4 * 1024 * 1024), \
/* enum H5C_cache_flash_incr_mode */ \
/* flash_incr_mode = */ H5C_flash_incr__add_space, \
- /* double flash_multiple = */ 1.4F, \
- /* double flash_threshold = */ 0.25F, \
+ /* double flash_multiple = */ 1.4f, \
+ /* double flash_threshold = */ 0.25f, \
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,\
- /* double upper_hr_threshold = */ H5_DOUBLE(0.999), \
- /* double decrement = */ 0.9F, \
+ /* double upper_hr_threshold = */ 0.999f, \
+ /* double decrement = */ 0.9f, \
/* hbool_t apply_max_decrement = */ TRUE, \
/* size_t max_decrement = */ (1 * 1024 * 1024), \
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
- /* double empty_reserve = */ 0.1F, \
+ /* double empty_reserve = */ 0.1f, \
/* int dirty_bytes_threshold = */ (256 * 1024), \
/* int metadata_write_strategy = */ \
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
#endif /* H5_HAVE_PARALLEL */
/* clang-format on */
-
/*
* Library prototypes.
*/
@@ -324,16 +323,11 @@ H5_DLL herr_t H5AC_stats(const H5F_t *f);
H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr);
-
H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_size_ptr,
size_t *cur_size_ptr, int32_t *cur_num_entries_ptr);
-
H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr);
-
H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr);
-
H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr);
-
H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_close_trace_file(H5AC_t *cache_ptr);
diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h
index 3323407..2cd628c 100644
--- a/src/H5ACpublic.h
+++ b/src/H5ACpublic.h
@@ -15,12 +15,10 @@
*
* Created: H5ACpublic.h
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Public include file for cache functions.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5ACpublic_H
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c
index 34359d6..56514d6 100644
--- a/src/H5Abtree2.c
+++ b/src/H5Abtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5Abtree2.c
* Dec 4 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for indexing attributes on objects
*
@@ -144,7 +144,6 @@ const H5B2_class_t H5A_BT2_CORDER[1] = {{
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Adense.c b/src/H5Adense.c
index 8e6d0e9..27731ca 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -15,7 +15,7 @@
*
* Created: H5Adense.c
* Dec 4 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for operating on "dense" attribute storage
* for an object.
@@ -158,14 +158,13 @@ typedef struct H5A_bt2_ud_rmbi_t {
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5A_dense_create
+ * Function: H5A_dense_create
*
- * Purpose: Creates dense attribute storage structures for an object
+ * Purpose: Creates dense attribute storage structures for an object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
*-------------------------------------------------------------------------
@@ -204,9 +203,6 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo)
/* Retrieve the heap's address in the file */
if (H5HF_get_heap_addr(fheap, &ainfo->fheap_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap address")
-#ifdef QAK
- HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr);
-#endif /* QAK */
#ifndef NDEBUG
{
@@ -216,9 +212,6 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo)
if (H5HF_get_id_len(fheap, &fheap_id_len) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length")
HDassert(fheap_id_len == H5O_FHEAP_ID_LEN);
-#ifdef QAK
- HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
-#endif /* QAK */
}
#endif /* NDEBUG */
@@ -238,9 +231,6 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo)
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_name, &ainfo->name_bt2_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index")
-#ifdef QAK
- HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr);
-#endif /* QAK */
/* Check if we should create a creation order index v2 B-tree */
if (ainfo->index_corder) {
@@ -259,10 +249,7 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo)
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_corder, &ainfo->corder_bt2_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index")
-#ifdef QAK
- HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_addr);
-#endif /* QAK */
- } /* end if */
+ } /* end if */
done:
/* Release resources */
@@ -281,11 +268,10 @@ done:
*
* Purpose: Callback when an attribute is located in an index
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 11 2006
+ * Programmer: Quincey Koziol
+ * Dec 11 2006
*
*-------------------------------------------------------------------------
*/
@@ -310,15 +296,14 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr)
} /* end H5A__dense_fnd_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_open
+ * Function: H5A_dense_open
*
* Purpose: Open an attribute in dense storage structures for an object
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 11 2006
+ * Programmer: Quincey Koziol
+ * Dec 11 2006
*
*-------------------------------------------------------------------------
*/
@@ -399,15 +384,14 @@ done:
} /* end H5A_dense_open() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_insert
+ * Function: H5A_dense_insert
*
* Purpose: Insert an attribute into dense storage structures for an object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 4 2006
+ * Programmer: Quincey Koziol
+ * Dec 4 2006
*
*-------------------------------------------------------------------------
*/
@@ -563,7 +547,7 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, February 20, 2007
*
*-------------------------------------------------------------------------
@@ -596,7 +580,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed)
*
* Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, December 5, 2006
*
*-------------------------------------------------------------------------
@@ -704,15 +688,14 @@ done:
} /* end H5A__dense_write_bt2_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_write
+ * Function: H5A_dense_write
*
* Purpose: Modify an attribute in dense storage structures for an object
*
* Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 4 2006
+ * Programmer: Quincey Koziol
+ * Dec 4 2006
*
*-------------------------------------------------------------------------
*/
@@ -808,9 +791,8 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 5 2006
+ * Programmer: Quincey Koziol
+ * Dec 5 2006
*
*-------------------------------------------------------------------------
*/
@@ -845,15 +827,14 @@ done:
} /* end H5A__dense_copy_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_rename
+ * Function: H5A_dense_rename
*
* Purpose: Rename an attribute in dense storage structures for an object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Jan 3 2007
+ * Programmer: Quincey Koziol
+ * Jan 3 2007
*
*-------------------------------------------------------------------------
*/
@@ -1034,9 +1015,8 @@ done:
*
* Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 5 2006
+ * Programmer: Quincey Koziol
+ * Dec 5 2006
*
*-------------------------------------------------------------------------
*/
@@ -1126,15 +1106,14 @@ done:
} /* end H5A__dense_iterate_bt2_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_iterate
+ * Function: H5A_dense_iterate
*
* Purpose: Iterate over attributes in dense storage structures for an object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 5 2006
+ * Programmer: Quincey Koziol
+ * Dec 5 2006
*
*-------------------------------------------------------------------------
*/
@@ -1265,11 +1244,10 @@ done:
*
* Purpose: v2 B-tree callback for dense attribute storage record removal
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 11 2006
+ * Programmer: Quincey Koziol
+ * Dec 11 2006
*
*-------------------------------------------------------------------------
*/
@@ -1326,15 +1304,14 @@ done:
} /* end H5A__dense_remove_bt2_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_remove
+ * Function: H5A_dense_remove
*
* Purpose: Remove an attribute from the dense storage of an object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 11 2006
+ * Programmer: Quincey Koziol
+ * Dec 11 2006
*
*-------------------------------------------------------------------------
*/
@@ -1418,11 +1395,10 @@ done:
*
* Purpose: v2 B-tree callback for dense attribute storage record removal by index
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Feb 14 2007
+ * Programmer: Quincey Koziol
+ * Feb 14 2007
*
*-------------------------------------------------------------------------
*/
@@ -1542,16 +1518,15 @@ done:
} /* end H5A__dense_remove_by_idx_bt2_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_remove_by_idx
+ * Function: H5A_dense_remove_by_idx
*
* Purpose: Remove an attribute from the dense storage of an object,
* according to the order within an index
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Feb 14 2007
+ * Programmer: Quincey Koziol
+ * Feb 14 2007
*
*-------------------------------------------------------------------------
*/
@@ -1670,16 +1645,15 @@ done:
} /* end H5A_dense_remove_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_exists
+ * Function: H5A_dense_exists
*
* Purpose: Check if an attribute exists in dense storage structures for
* an object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 11 2006
+ * Programmer: Quincey Koziol
+ * Dec 11 2006
*
*-------------------------------------------------------------------------
*/
@@ -1761,11 +1735,10 @@ done:
*
* Purpose: v2 B-tree callback for dense attribute storage deletion
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Jan 3 2007
+ * Programmer: Quincey Koziol
+ * Jan 3 2007
*
*-------------------------------------------------------------------------
*/
@@ -1822,15 +1795,14 @@ done:
} /* end H5A__dense_delete_bt2_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_delete
+ * Function: H5A_dense_delete
*
* Purpose: Delete all dense storage structures for attributes on an object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 6 2006
+ * Programmer: Quincey Koziol
+ * Dec 6 2006
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index b240b93..418f2b2 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Adeprec.c
* November 27 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5A interface. These
* functions are here for compatibility purposes and may be
diff --git a/src/H5Aint.c b/src/H5Aint.c
index e60427d..46d545e 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Aint.c
- * Dec 18 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Aint.c
+ * Dec 18 2006
+ * Quincey Koziol
*
- * Purpose: Internal routines for managing attributes.
+ * Purpose: Internal routines for managing attributes.
*
*-------------------------------------------------------------------------
*/
@@ -279,20 +279,19 @@ done:
} /* H5A_create() */
/*-------------------------------------------------------------------------
- * Function: H5A_open_common
+ * Function: H5A_open_common
*
- * Purpose:
- * Finishes initializing an attributes the open
+ * Purpose: Finishes initializing an attributes the open
*
* Usage:
* herr_t H5A_open_common(loc, name, dxpl_id)
* const H5G_loc_t *loc; IN: Pointer to group location for object
* H5A_t *attr; IN/OUT: Pointer to attribute to initialize
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * December 18, 2006
+ * Programmer: Quincey Koziol
+ * December 18, 2006
*
*-------------------------------------------------------------------------
*/
@@ -398,11 +397,11 @@ done:
} /* H5A_open_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5A_open_by_name
+ * Function: H5A_open_by_name
*
* Purpose: Open an attribute in an object header, according to it's name
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* December 11, 2006
@@ -685,9 +684,7 @@ done:
} /* H5A_read() */
/*-------------------------------------------------------------------------
- * Function: H5A_get_space
- *
- * Purpose: Returns dataspace of the attribute.
+ * Function: H5A_get_space
*
* Return: Success: dataspace
*
@@ -895,12 +892,11 @@ H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo)
} /* end H5A_get_info() */
/*-------------------------------------------------------------------------
- * Function: H5A_copy
+ * Function: H5A_copy
*
* Purpose: Copies attribute OLD_ATTR.
*
* Return: Success: Pointer to a new copy of the OLD_ATTR argument.
- *
* Failure: NULL
*
* Programmer: Robb Matzke
@@ -957,7 +953,7 @@ done:
} /* end H5A_copy() */
/*-------------------------------------------------------------------------
- * Function: H5A_free
+ * Function: H5A_free
*
* Purpose: Frees all memory associated with an attribute, but does not
* free the H5A_t structure (which should be done in H5T_close).
@@ -967,8 +963,6 @@ done:
* Programmer: Quincey Koziol
* Monday, November 15, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1055,7 +1049,7 @@ done:
} /* end H5A_close() */
/*-------------------------------------------------------------------------
- * Function: H5A_oloc
+ * Function: H5A_oloc
*
* Purpose: Return the object location for an attribute. It's the
* object location for the object to which the attribute
@@ -1085,7 +1079,7 @@ H5A_oloc(H5A_t *attr)
} /* end H5A_oloc() */
/*-------------------------------------------------------------------------
- * Function: H5A_nameof
+ * Function: H5A_nameof
*
* Purpose: Return the group hier. path for an attribute. It's the
* group hier. path for the object to which the attribute
@@ -1197,7 +1191,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
* Modification:Raymond Lu
@@ -1259,8 +1252,8 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Dec 18, 2006
+ * Programmer: Quincey Koziol
+ * Dec 18, 2006
*
*-------------------------------------------------------------------------
*/
@@ -1317,11 +1310,9 @@ done:
* Purpose: Callback routine for building table of attributes from dense
* attribute storage.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
*-------------------------------------------------------------------------
@@ -1355,14 +1346,14 @@ done:
} /* end H5A_dense_build_table_cb() */
/*-------------------------------------------------------------------------
- * Function: H5A_dense_build_table
+ * Function: H5A_dense_build_table
*
* Purpose: Builds a table containing a sorted list of attributes for
* an object
*
- * Note: Used for building table of attributes in non-native iteration
+ * Note: Used for building table of attributes in non-native iteration
* order for an index. Uses the "name" index to retrieve records,
- * but the 'idx_type' index for sorting them.
+ * but the 'idx_type' index for sorting them.
*
* Return: SUCCEED/FAIL
*
@@ -1439,19 +1430,18 @@ done:
} /* end H5A_dense_build_table() */
/*-------------------------------------------------------------------------
- * Function: H5A__attr_cmp_name_inc
+ * Function: H5A__attr_cmp_name_inc
*
- * Purpose: Callback routine for comparing two attribute names, in
+ * Purpose: Callback routine for comparing two attribute names, in
* increasing alphabetic order
*
- * Return: An integer less than, equal to, or greater than zero if the
+ * Return: An integer less than, equal to, or greater than zero if the
* first argument is considered to be respectively less than,
* equal to, or greater than the second. If two members compare
* as equal, their order in the sorted array is undefined.
* (i.e. same as strcmp())
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
*-------------------------------------------------------------------------
@@ -1478,7 +1468,6 @@ H5A__attr_cmp_name_inc(const void *attr1, const void *attr2)
* (i.e. opposite of strcmp())
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 8 2007
*
*-------------------------------------------------------------------------
@@ -1504,7 +1493,6 @@ H5A__attr_cmp_name_dec(const void *attr1, const void *attr2)
* as equal, their order in the sorted array is undefined.
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 8 2007
*
*-------------------------------------------------------------------------
@@ -1528,19 +1516,18 @@ H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2)
} /* end H5A__attr_cmp_corder_inc() */
/*-------------------------------------------------------------------------
- * Function: H5A__attr_cmp_corder_dec
+ * Function: H5A__attr_cmp_corder_dec
*
- * Purpose: Callback routine for comparing two attributes, in
+ * Purpose: Callback routine for comparing two attributes, in
* decreasing creation order
*
- * Return: An integer less than, equal to, or greater than zero if the
+ * Return: An integer less than, equal to, or greater than zero if the
* second argument is considered to be respectively less than,
* equal to, or greater than the first. If two members compare
* as equal, their order in the sorted array is undefined.
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Feb 8 2007
+ * Programmer: Quincey Koziol
+ * Feb 8 2007
*
*-------------------------------------------------------------------------
*/
@@ -1563,15 +1550,14 @@ H5A__attr_cmp_corder_dec(const void *attr1, const void *attr2)
} /* end H5A__attr_cmp_corder_dec() */
/*-------------------------------------------------------------------------
- * Function: H5A__attr_sort_table
+ * Function: H5A__attr_sort_table
*
* Purpose: Sort table containing a list of attributes for an object
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Dec 11, 2006
+ * Programmer: Quincey Koziol
+ * Dec 11, 2006
*
*-------------------------------------------------------------------------
*/
@@ -1606,16 +1592,15 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, H5_iter_orde
} /* end H5A__attr_sort_table() */
/*-------------------------------------------------------------------------
- * Function: H5A_attr_iterate_table
+ * Function: H5A_attr_iterate_table
*
* Purpose: Iterate over table containing a list of attributes for an object,
* making appropriate callbacks
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Dec 18, 2006
+ * Programmer: Quincey Koziol
+ * Dec 18, 2006
*
*-------------------------------------------------------------------------
*/
@@ -1686,15 +1671,14 @@ done:
} /* end H5A_attr_iterate_table() */
/*-------------------------------------------------------------------------
- * Function: H5A_attr_release_table
+ * Function: H5A_attr_release_table
*
* Purpose: Release table containing a list of attributes for an object
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Dec 11, 2006
+ * Programmer: Quincey Koziol
+ * Dec 11, 2006
*
*-------------------------------------------------------------------------
*/
@@ -1736,7 +1720,6 @@ done:
* Failure: FAIL if error occurred
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 11 2007
*
*-------------------------------------------------------------------------
@@ -1796,11 +1779,9 @@ done:
* Chooses the oldest version possible, unless the "use the
* latest format" flag is set.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 17 2007
*
*-------------------------------------------------------------------------
@@ -2243,7 +2224,6 @@ done:
* Failure: Negative
*
* Programmer: Peter Cao
- * xcao@hdfgroup.org
* July 20, 2007
*
*-------------------------------------------------------------------------
@@ -2296,7 +2276,6 @@ done:
* Failure: Negative
*
* Programmer: Peter Cao
- * xcao@hdfgroup.org
* July 20, 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5B.c b/src/H5B.c
index 4ffd8f7..3e963da 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -13,79 +13,79 @@
/*-------------------------------------------------------------------------
*
- * Created: H5B.c
- * Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5B.c
+ * Jul 10 1997
+ * Robb Matzke
*
- * Purpose: Implements balanced, sibling-linked, N-ary trees
- * capable of storing any type of data with unique key
- * values.
+ * Purpose: Implements balanced, sibling-linked, N-ary trees
+ * capable of storing any type of data with unique key
+ * values.
*
- * A B-link-tree is a balanced tree where each node has
- * a pointer to its left and right siblings. A
- * B-link-tree is a rooted tree having the following
- * properties:
+ * A B-link-tree is a balanced tree where each node has
+ * a pointer to its left and right siblings. A
+ * B-link-tree is a rooted tree having the following
+ * properties:
*
- * 1. Every node, x, has the following fields:
+ * 1. Every node, x, has the following fields:
*
- * a. level[x], the level in the tree at which node
- * x appears. Leaf nodes are at level zero.
+ * a. level[x], the level in the tree at which node
+ * x appears. Leaf nodes are at level zero.
*
- * b. n[x], the number of children pointed to by the
- * node. Internal nodes point to subtrees while
- * leaf nodes point to arbitrary data.
+ * b. n[x], the number of children pointed to by the
+ * node. Internal nodes point to subtrees while
+ * leaf nodes point to arbitrary data.
*
- * c. The child pointers themselves, child[x,i] such
- * that 0 <= i < n[x].
+ * c. The child pointers themselves, child[x,i] such
+ * that 0 <= i < n[x].
*
- * d. n[x]+1 key values stored in increasing
- * order:
+ * d. n[x]+1 key values stored in increasing
+ * order:
*
- * key[x,0] < key[x,1] < ... < key[x,n[x]].
+ * key[x,0] < key[x,1] < ... < key[x,n[x]].
*
- * e. left[x] is a pointer to the node's left sibling
- * or the null pointer if this is the left-most
- * node at this level in the tree.
+ * e. left[x] is a pointer to the node's left sibling
+ * or the null pointer if this is the left-most
+ * node at this level in the tree.
*
- * f. right[x] is a pointer to the node's right
- * sibling or the null pointer if this is the
- * right-most node at this level in the tree.
+ * f. right[x] is a pointer to the node's right
+ * sibling or the null pointer if this is the
+ * right-most node at this level in the tree.
*
- * 3. The keys key[x,i] partition the key spaces of the
- * children of x:
+ * 3. The keys key[x,i] partition the key spaces of the
+ * children of x:
*
- * key[x,i] <= key[child[x,i],j] <= key[x,i+1]
+ * key[x,i] <= key[child[x,i],j] <= key[x,i+1]
*
- * for any valid combination of i and j.
+ * for any valid combination of i and j.
*
- * 4. There are lower and upper bounds on the number of
- * child pointers a node can contain. These bounds
- * can be expressed in terms of a fixed integer k>=2
- * called the `minimum degree' of the B-tree.
+ * 4. There are lower and upper bounds on the number of
+ * child pointers a node can contain. These bounds
+ * can be expressed in terms of a fixed integer k>=2
+ * called the `minimum degree' of the B-tree.
*
- * a. Every node other than the root must have at least
- * k child pointers and k+1 keys. If the tree is
- * nonempty, the root must have at least one child
- * pointer and two keys.
+ * a. Every node other than the root must have at least
+ * k child pointers and k+1 keys. If the tree is
+ * nonempty, the root must have at least one child
+ * pointer and two keys.
*
- * b. Every node can contain at most 2k child pointers
- * and 2k+1 keys. A node is `full' if it contains
- * exactly 2k child pointers and 2k+1 keys.
+ * b. Every node can contain at most 2k child pointers
+ * and 2k+1 keys. A node is `full' if it contains
+ * exactly 2k child pointers and 2k+1 keys.
*
- * 5. When searching for a particular value, V, and
- * key[V] = key[x,i] for some node x and entry i,
- * then:
+ * 5. When searching for a particular value, V, and
+ * key[V] = key[x,i] for some node x and entry i,
+ * then:
*
- * a. If i=0 the child[0] is followed.
+ * a. If i=0 the child[0] is followed.
*
- * b. If i=n[x] the child[n[x]-1] is followed.
+ * b. If i=n[x] the child[n[x]-1] is followed.
*
- * c. Otherwise, the child that is followed
- * (either child[x,i-1] or child[x,i]) is
- * determined by the type of object to which the
- * leaf nodes of the tree point and is controlled
- * by the key comparison function registered for
- * that type of B-tree.
+ * c. Otherwise, the child that is followed
+ * (either child[x,i-1] or child[x,i]) is
+ * determined by the type of object to which the
+ * leaf nodes of the tree point and is controlled
+ * by the key comparison function registered for
+ * that type of B-tree.
*
*
*-------------------------------------------------------------------------
@@ -95,26 +95,26 @@
/* Module Setup */
/****************/
-#define H5B_PACKAGE /*suppress error about including H5Bpkg */
+#define H5B_PACKAGE /*suppress error about including H5Bpkg */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Bpkg.h" /* B-link trees */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MFprivate.h" /* File memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Bpkg.h" /* B-link trees */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MFprivate.h" /* File memory management */
#include "H5Pprivate.h" /* Property lists */
/****************/
/* Local Macros */
/****************/
#define H5B_SIZEOF_HDR(F) \
- (H5_SIZEOF_MAGIC + /*magic number */ \
- 4 + /*type, level, num entries */ \
- 2 * H5F_SIZEOF_ADDR(F)) /*left and right sibling addresses */
+ (H5_SIZEOF_MAGIC + /*magic number */ \
+ 4 + /*type, level, num entries */ \
+ 2 * H5F_SIZEOF_ADDR(F)) /*left and right sibling addresses */
/* Default initializer for H5B_ins_ud_t */
#define H5B_INS_UD_T_NULL \
@@ -184,20 +184,19 @@ H5FL_BLK_DEFINE_STATIC(page);
H5FL_SEQ_DEFINE_STATIC(size_t);
/*-------------------------------------------------------------------------
- * Function: H5B_create
+ * Function: H5B_create
*
- * Purpose: Creates a new empty B-tree leaf node. The UDATA pointer is
- * passed as an argument to the sizeof_rkey() method for the
- * B-tree.
+ * Purpose: Creates a new empty B-tree leaf node. The UDATA pointer is
+ * passed as an argument to the sizeof_rkey() method for the
+ * B-tree.
*
- * Return: Success: Non-negative, and the address of new node is
- * returned through the ADDR_P argument.
+ * Return: Success: Non-negative, and the address of new node is
+ * returned through the ADDR_P argument.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -263,25 +262,24 @@ done:
} /* end H5B_create() */ /*lint !e818 Can't make udata a pointer to const */
/*-------------------------------------------------------------------------
- * Function: H5B_find
+ * Function: H5B_find
*
- * Purpose: Locate the specified information in a B-tree and return
- * that information by filling in fields of the caller-supplied
- * UDATA pointer depending on the type of leaf node
- * requested. The UDATA can point to additional data passed
- * to the key comparison function.
+ * Purpose: Locate the specified information in a B-tree and return
+ * that information by filling in fields of the caller-supplied
+ * UDATA pointer depending on the type of leaf node
+ * requested. The UDATA can point to additional data passed
+ * to the key comparison function.
*
- * Note: This function does not follow the left/right sibling
- * pointers since it assumes that all nodes can be reached
- * from the parent node.
+ * Note: This function does not follow the left/right sibling
+ * pointers since it assumes that all nodes can be reached
+ * from the parent node.
*
- * Return: Non-negative (TRUE/FALSE) on success (if found, values returned
+ * Return: Non-negative (TRUE/FALSE) on success (if found, values returned
* through the UDATA argument). Negative on failure (if not found,
* UDATA is undefined).
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -359,24 +357,23 @@ done:
} /* end H5B_find() */
/*-------------------------------------------------------------------------
- * Function: H5B_split
+ * Function: H5B_split
*
- * Purpose: Split a single node into two nodes. The old node will
- * contain the left children and the new node will contain the
- * right children.
+ * Purpose: Split a single node into two nodes. The old node will
+ * contain the left children and the new node will contain the
+ * right children.
*
- * The UDATA pointer is passed to the sizeof_rkey() method but is
- * otherwise unused.
+ * The UDATA pointer is passed to the sizeof_rkey() method but is
+ * otherwise unused.
*
- * The BT_UD argument is a pointer to a protected B-tree
- * node.
+ * The BT_UD argument is a pointer to a protected B-tree
+ * node.
*
- * Return: Non-negative on success (The address of the new node is
+ * Return: Non-negative on success (The address of the new node is
* returned through the NEW_ADDR argument). Negative on failure.
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 3 1997
+ * Programmer: Robb Matzke
+ * Jul 3 1997
*
*-------------------------------------------------------------------------
*/
@@ -526,15 +523,14 @@ done:
} /* end H5B_split() */
/*-------------------------------------------------------------------------
- * Function: H5B_insert
+ * Function: H5B_insert
*
- * Purpose: Adds a new item to the B-tree.
+ * Purpose: Adds a new item to the B-tree.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -681,17 +677,16 @@ done:
} /* end H5B_insert() */
/*-------------------------------------------------------------------------
- * Function: H5B_insert_child
+ * Function: H5B_insert_child
*
- * Purpose: Insert a child to the left or right of child[IDX] depending
- * on whether ANCHOR is H5B_INS_LEFT or H5B_INS_RIGHT. The BT
- * argument is a pointer to a protected B-tree node.
+ * Purpose: Insert a child to the left or right of child[IDX] depending
+ * on whether ANCHOR is H5B_INS_LEFT or H5B_INS_RIGHT. The BT
+ * argument is a pointer to a protected B-tree node.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 8 1997
+ * Programmer: Robb Matzke
+ * Jul 8 1997
*
*-------------------------------------------------------------------------
*/
@@ -751,33 +746,32 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B
} /* end H5B_insert_child() */
/*-------------------------------------------------------------------------
- * Function: H5B_insert_helper
+ * Function: H5B_insert_helper
*
- * Purpose: Inserts the item UDATA into the tree rooted at ADDR and having
- * the specified type.
+ * Purpose: Inserts the item UDATA into the tree rooted at ADDR and having
+ * the specified type.
*
- * On return, if LT_KEY_CHANGED is non-zero, then LT_KEY is
- * the new native left key. Similarly for RT_KEY_CHANGED
- * and RT_KEY.
+ * On return, if LT_KEY_CHANGED is non-zero, then LT_KEY is
+ * the new native left key. Similarly for RT_KEY_CHANGED
+ * and RT_KEY.
*
- * If the node splits, then MD_KEY contains the key that
- * was split between the two nodes (that is, the key that
- * appears as the max key in the left node and the min key
- * in the right node).
+ * If the node splits, then MD_KEY contains the key that
+ * was split between the two nodes (that is, the key that
+ * appears as the max key in the left node and the min key
+ * in the right node).
*
- * Return: Success: A B-tree operation. The address of the new
- * node, if the node splits, is returned through
- * the NEW_NODE_P argument. The new node is always
- * to the right of the previous node. This
- * function is called recursively and the return
- * value influences the behavior of the caller.
- * See also, declaration of H5B_ins_t.
+ * Return: Success: A B-tree operation. The address of the new
+ * node, if the node splits, is returned through
+ * the NEW_NODE_P argument. The new node is always
+ * to the right of the previous node. This
+ * function is called recursively and the return
+ * value influences the behavior of the caller.
+ * See also, declaration of H5B_ins_t.
*
- * Failure: H5B_INS_ERROR
+ * Failure: H5B_INS_ERROR
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 9 1997
+ * Programmer: Robb Matzke
+ * Jul 9 1997
*
*-------------------------------------------------------------------------
*/
@@ -1108,16 +1102,15 @@ done:
} /* end H5B_insert_helper() */
/*-------------------------------------------------------------------------
- * Function: H5B_iterate_helper
+ * Function: H5B_iterate_helper
*
- * Purpose: Calls the list callback for each leaf node of the
- * B-tree, passing it the caller's UDATA structure.
+ * Purpose: Calls the list callback for each leaf node of the
+ * B-tree, passing it the caller's UDATA structure.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -1175,16 +1168,15 @@ done:
} /* end H5B_iterate_helper() */
/*-------------------------------------------------------------------------
- * Function: H5B_iterate
+ * Function: H5B_iterate
*
- * Purpose: Calls the list callback for each leaf node of the
- * B-tree, passing it the UDATA structure.
+ * Purpose: Calls the list callback for each leaf node of the
+ * B-tree, passing it the UDATA structure.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
@@ -1212,25 +1204,25 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_
} /* end H5B_iterate() */
/*-------------------------------------------------------------------------
- * Function: H5B_remove_helper
+ * Function: H5B_remove_helper
*
- * Purpose: The recursive part of removing an item from a B-tree. The
- * sub B-tree that is being considered is located at ADDR and
- * the item to remove is described by UDATA. If the removed
- * item falls at the left or right end of the current level then
- * it might be necessary to adjust the left and/or right keys
- * (LT_KEY and/or RT_KEY) to to indicate that they changed by
- * setting LT_KEY_CHANGED and/or RT_KEY_CHANGED.
+ * Purpose: The recursive part of removing an item from a B-tree. The
+ * sub B-tree that is being considered is located at ADDR and
+ * the item to remove is described by UDATA. If the removed
+ * item falls at the left or right end of the current level then
+ * it might be necessary to adjust the left and/or right keys
+ * (LT_KEY and/or RT_KEY) to to indicate that they changed by
+ * setting LT_KEY_CHANGED and/or RT_KEY_CHANGED.
*
- * Return: Success: A B-tree operation, see comments for
- * H5B_ins_t declaration. This function is
- * called recursively and the return value
- * influences the actions of the caller. It is
- * also called by H5B_remove().
+ * Return: Success: A B-tree operation, see comments for
+ * H5B_ins_t declaration. This function is
+ * called recursively and the return value
+ * influences the actions of the caller. It is
+ * also called by H5B_remove().
*
- * Failure: H5B_INS_ERROR, a negative value.
+ * Failure: H5B_INS_ERROR, a negative value.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, September 16, 1998
*
*-------------------------------------------------------------------------
@@ -1551,17 +1543,17 @@ done:
} /* end H5B_remove_helper() */
/*-------------------------------------------------------------------------
- * Function: H5B_remove
+ * Function: H5B_remove
*
- * Purpose: Removes an item from a B-tree.
+ * Purpose: Removes an item from a B-tree.
*
- * Note: The current version does not attempt to rebalance the tree.
+ * Note: The current version does not attempt to rebalance the tree.
* (Read the paper Yao & Lehman paper for details on why)
*
- * Return: Non-negative on success/Negative on failure (failure includes
- * not being able to find the object which is to be removed).
+ * Return: Non-negative on success/Negative on failure (failure includes
+ * not being able to find the object which is to be removed).
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, September 16, 1998
*
*-------------------------------------------------------------------------
@@ -1598,14 +1590,14 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5B_delete
+ * Function: H5B_delete
*
- * Purpose: Deletes an entire B-tree from the file, calling the 'remove'
+ * Purpose: Deletes an entire B-tree from the file, calling the 'remove'
* callbacks for each node.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, March 20, 2003
*
*-------------------------------------------------------------------------
@@ -1672,16 +1664,15 @@ done:
} /* end H5B_delete() */
/*-------------------------------------------------------------------------
- * Function: H5B_shared_new
+ * Function: H5B_shared_new
*
- * Purpose: Allocates & constructs a shared v1 B-tree struct for client.
+ * Purpose: Allocates & constructs a shared v1 B-tree struct for client.
*
- * Return: Success: non-NULL pointer to struct allocated
- * Failure: NULL
+ * Return: Success: non-NULL pointer to struct allocated
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * May 27 2008
+ * Programmer: Quincey Koziol
+ * May 27 2008
*
*-------------------------------------------------------------------------
*/
@@ -1711,9 +1702,9 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey)
shared->sizeof_rkey = sizeof_rkey;
HDassert(shared->sizeof_rkey);
shared->sizeof_keys = (shared->two_k + 1) * type->sizeof_nkey;
- shared->sizeof_rnode = ((size_t)H5B_SIZEOF_HDR(f) + /*node header */
+ shared->sizeof_rnode = ((size_t)H5B_SIZEOF_HDR(f) + /*node header */
shared->two_k * H5F_SIZEOF_ADDR(f) + /*child pointers */
- (shared->two_k + 1) * shared->sizeof_rkey); /*keys */
+ (shared->two_k + 1) * shared->sizeof_rkey); /*keys */
HDassert(shared->sizeof_rnode);
/* Allocate shared buffers */
@@ -1746,13 +1737,13 @@ done:
} /* end H5B_shared_new() */
/*-------------------------------------------------------------------------
- * Function: H5B_shared_free
+ * Function: H5B_shared_free
*
- * Purpose: Free B-tree shared info
+ * Purpose: Free B-tree shared info
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 27, 2008
*
*-------------------------------------------------------------------------
@@ -1777,17 +1768,16 @@ H5B_shared_free(void *_shared)
} /* end H5B_shared_free() */
/*-------------------------------------------------------------------------
- * Function: H5B_copy
+ * Function: H5B_copy
*
- * Purpose: Deep copies an existing H5B_t node.
+ * Purpose: Deep copies an existing H5B_t node.
*
- * Return: Success: Pointer to H5B_t object.
+ * Return: Success: Pointer to H5B_t object.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Apr 18 2000
+ * Programmer: Quincey Koziol
+ * Apr 18 2000
*
*-------------------------------------------------------------------------
*/
@@ -1844,15 +1834,14 @@ done:
} /* end H5B_copy() */
/*-------------------------------------------------------------------------
- * Function: H5B_get_info_helper
+ * Function: H5B_get_info_helper
*
- * Purpose: Walks the B-tree nodes, getting information for all of them.
+ * Purpose: Walks the B-tree nodes, getting information for all of them.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Jun 3 2008
+ * Programmer: Quincey Koziol
+ * Jun 3 2008
*
*-------------------------------------------------------------------------
*/
@@ -1864,8 +1853,8 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad
H5RC_t * rc_shared; /* Ref-counted shared info */
H5B_shared_t * shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- unsigned level; /* Node level */
- size_t sizeof_rnode; /* Size of raw (disk) node */
+ unsigned level; /* Node level */
+ size_t sizeof_rnode; /* Size of raw (disk) node */
haddr_t next_addr; /* Address of next node to the right */
haddr_t left_child; /* Address of left-most child in node */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2064,7 +2053,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2.c b/src/H5B2.c
index 32cc218..1d18488 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -15,7 +15,7 @@
*
* Created: H5B2.c
* Jan 31 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implements a B-tree, with several modifications from
* the "standard" methods.
@@ -109,7 +109,6 @@ H5FL_DEFINE_STATIC(H5B2_t);
* filled in), negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 31 2005
*
*-------------------------------------------------------------------------
@@ -185,7 +184,6 @@ done:
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 15 2009
*
*-------------------------------------------------------------------------
@@ -253,7 +251,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -315,7 +312,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 5 2009
*
*-------------------------------------------------------------------------
@@ -349,7 +345,6 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p)
* Return: Value from callback: non-negative on success, negative on error
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 11 2005
*
*-------------------------------------------------------------------------
@@ -400,7 +395,6 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data)
* Return: Non-negative (TRUE/FALSE) on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 23 2005
*
*-------------------------------------------------------------------------
@@ -625,7 +619,6 @@ done:
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 23 2005
*
*-------------------------------------------------------------------------
@@ -787,7 +780,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 25 2005
*
*-------------------------------------------------------------------------
@@ -861,7 +853,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -944,7 +935,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 25 2005
*
*-------------------------------------------------------------------------
@@ -984,7 +974,6 @@ H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec)
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 8 2005
*
*-------------------------------------------------------------------------
@@ -1041,7 +1030,6 @@ done:
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 10 2005
*
*-------------------------------------------------------------------------
@@ -1257,7 +1245,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 15 2009
*
*-------------------------------------------------------------------------
@@ -1370,7 +1357,6 @@ done:
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index f32b195..0d2bb56 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -15,7 +15,7 @@
*
* Created: H5B2cache.c
* Jan 31 2005
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement v2 B-tree metadata cache methods.
*
@@ -132,7 +132,6 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 1 2005
*
*-------------------------------------------------------------------------
@@ -254,7 +253,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 1 2005
*
*-------------------------------------------------------------------------
@@ -468,7 +466,6 @@ H5B2__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_hdr_t *hdr, size_
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -604,7 +601,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -760,9 +756,7 @@ H5B2__cache_internal_clear(H5F_t *f, H5B2_internal_t *internal, hbool_t destroy)
FUNC_ENTER_STATIC
- /*
- * Check arguments.
- */
+ /* Check arguments */
HDassert(internal);
/* Reset the dirty flag. */
@@ -816,7 +810,6 @@ H5B2__cache_internal_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_internal_t *
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1009,7 +1002,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index 9c1b380..757d333 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -15,7 +15,7 @@
*
* Created: H5B2dbg.c
* Feb 2 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Dump debugging information about a v2 B-tree.
*
@@ -72,7 +72,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -169,7 +168,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 4 2005
*
*-------------------------------------------------------------------------
@@ -288,7 +286,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 7 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c
index af457cd..d71cf3b 100644
--- a/src/H5B2hdr.c
+++ b/src/H5B2hdr.c
@@ -15,7 +15,7 @@
*
* Created: H5B2int.c
* Feb 27 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Internal routines for managing v2 B-trees.
*
@@ -91,7 +91,6 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -223,7 +222,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 27 2009
*
*-------------------------------------------------------------------------
@@ -268,7 +266,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
@@ -322,7 +319,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 13 2009
*
*-------------------------------------------------------------------------
@@ -357,7 +353,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 13 2009
*
*-------------------------------------------------------------------------
@@ -393,7 +388,6 @@ done:
* Return: SUCCEED (Can't fail)
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 27 2009
*
*-------------------------------------------------------------------------
@@ -420,7 +414,6 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr)
* Return: The file's reference count after the decrement. (Can't fail)
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 27 2009
*
*-------------------------------------------------------------------------
@@ -448,7 +441,6 @@ H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 13 2009
*
*-------------------------------------------------------------------------
@@ -479,7 +471,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -554,7 +545,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 15 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2int.c b/src/H5B2int.c
index 73db537..601399d 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -15,7 +15,7 @@
*
* Created: H5B2int.c
* Feb 27 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Internal routines for managing v2 B-trees.
*
@@ -119,7 +119,6 @@ H5FL_SEQ_EXTERN(H5B2_node_info_t);
* record to locate is greater than all records to search).
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -162,7 +161,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 28 2006
*
*-------------------------------------------------------------------------
@@ -362,7 +360,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -446,7 +443,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 9 2005
*
*-------------------------------------------------------------------------
@@ -704,7 +700,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 9 2005
*
*-------------------------------------------------------------------------
@@ -1059,52 +1054,6 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_internal
/* Mark parent as dirty */
*internal_flags_ptr |= H5AC__DIRTIED_FLAG;
-#ifdef QAK
- {
- unsigned u;
-
- HDfprintf(stderr, "%s: Internal records:\n", FUNC);
- for (u = 0; u < internal->nrec; u++) {
- HDfprintf(stderr, "%s: u = %u\n", FUNC, u);
- (hdr->cls->debug)(stderr, hdr->f, dxpl_id, 3, 4, H5B2_INT_NREC(internal, hdr, u), NULL);
- } /* end for */
-
- HDfprintf(stderr, "%s: Left Child records:\n", FUNC);
- for (u = 0; u < *left_nrec; u++) {
- HDfprintf(stderr, "%s: u = %u\n", FUNC, u);
- (hdr->cls->debug)(stderr, hdr->f, dxpl_id, 3, 4, H5B2_NAT_NREC(left_native, hdr, u), NULL);
- } /* end for */
-
- HDfprintf(stderr, "%s: Middle Child records:\n", FUNC);
- for (u = 0; u < *middle_nrec; u++) {
- HDfprintf(stderr, "%s: u = %u\n", FUNC, u);
- (hdr->cls->debug)(stderr, hdr->f, dxpl_id, 3, 4, H5B2_NAT_NREC(middle_native, hdr, u), NULL);
- } /* end for */
-
- HDfprintf(stderr, "%s: Right Child records:\n", FUNC);
- for (u = 0; u < *right_nrec; u++) {
- HDfprintf(stderr, "%s: u = %u\n", FUNC, u);
- (hdr->cls->debug)(stderr, hdr->f, dxpl_id, 3, 4, H5B2_NAT_NREC(right_native, hdr, u), NULL);
- } /* end for */
-
- for (u = 0; u < internal->nrec + 1; u++)
- HDfprintf(stderr, "%s: internal->node_ptrs[%u] = (%Hu/%u/%a)\n", FUNC, u,
- internal->node_ptrs[u].all_nrec, internal->node_ptrs[u].node_nrec,
- internal->node_ptrs[u].addr);
- if (depth > 1) {
- for (u = 0; u < *left_nrec + 1; u++)
- HDfprintf(stderr, "%s: left_node_ptr[%u] = (%Hu/%u/%a)\n", FUNC, u,
- left_node_ptrs[u].all_nrec, left_node_ptrs[u].node_nrec, left_node_ptrs[u].addr);
- for (u = 0; u < *middle_nrec + 1; u++)
- HDfprintf(stderr, "%s: middle_node_ptr[%u] = (%Hu/%u/%a)\n", FUNC, u,
- middle_node_ptrs[u].all_nrec, middle_node_ptrs[u].node_nrec,
- middle_node_ptrs[u].addr);
- for (u = 0; u < *right_nrec + 1; u++)
- HDfprintf(stderr, "%s: right_node_ptr[%u] = (%Hu/%u/%a)\n", FUNC, u,
- right_node_ptrs[u].all_nrec, right_node_ptrs[u].node_nrec, right_node_ptrs[u].addr);
- } /* end if */
- }
-#endif /* QAK */
#ifdef H5B2_DEBUG
H5B2_assert_internal((hsize_t)0, hdr, internal);
if (depth > 1) {
@@ -1149,7 +1098,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -1316,7 +1264,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -2152,7 +2099,6 @@ done:
* Return: Value from callback, non-negative on success, negative on error
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 11 2005
*
*-------------------------------------------------------------------------
@@ -3148,7 +3094,6 @@ done:
* Return: Value from callback, non-negative on success, negative on error
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h
index 92b2975..4e12416 100644
--- a/src/H5B2pkg.h
+++ b/src/H5B2pkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Monday, January 31, 2005
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5B2private.h b/src/H5B2private.h
index 46c7843..b1e6dd0 100644
--- a/src/H5B2private.h
+++ b/src/H5B2private.h
@@ -15,7 +15,7 @@
*
* Created: H5B2private.h
* Jan 31 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Private header for library accessible B-tree routines.
*
diff --git a/src/H5B2stat.c b/src/H5B2stat.c
index 23f9e84..0d9d2f7 100644
--- a/src/H5B2stat.c
+++ b/src/H5B2stat.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Monday, March 6, 2006
*
* Purpose: v2 B-tree metadata statistics functions.
diff --git a/src/H5B2test.c b/src/H5B2test.c
index 14b01e6..0a11a75 100644
--- a/src/H5B2test.c
+++ b/src/H5B2test.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Thursday, February 3, 2005
*
* Purpose: v2 B-tree testing functions.
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index e6d7e48..0711a0e 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -15,7 +15,7 @@
*
* Created: H5Bcache.c
* Oct 31 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implement B-tree metadata cache methods.
*
diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c
index 127e7eb..6b8e2f7 100644
--- a/src/H5Bdbg.c
+++ b/src/H5Bdbg.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Bdbg.c
- * Dec 11 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Bdbg.c
+ * Dec 11 2008
+ * Quincey Koziol
*
- * Purpose: Debugging routines for B-link tree package.
+ * Purpose: Debugging routines for B-link tree package.
*
*-------------------------------------------------------------------------
*/
@@ -37,15 +37,14 @@
#include "H5MMprivate.h" /* Memory management */
/*-------------------------------------------------------------------------
- * Function: H5B_debug
+ * Function: H5B_debug
*
- * Purpose: Prints debugging info about a B-tree.
+ * Purpose: Prints debugging info about a B-tree.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 4 1997
+ * Programmer: Robb Matzke
+ * Aug 4 1997
*
*-------------------------------------------------------------------------
*/
@@ -134,16 +133,16 @@ done:
} /* end H5B_debug() */
/*-------------------------------------------------------------------------
- * Function: H5B_assert
+ * Function: H5B_assert
*
- * Purpose: Verifies that the tree is structured correctly.
+ * Purpose: Verifies that the tree is structured correctly.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: aborts if something is wrong.
+ * Failure: aborts if something is wrong.
*
- * Programmer: Robb Matzke
- * Tuesday, November 4, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, November 4, 1997
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h
index 1a3906c..9039004 100644
--- a/src/H5Bpkg.h
+++ b/src/H5Bpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, May 15, 2003
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index c4c7bf2..e2c71f2 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -15,12 +15,10 @@
*
* Created: H5Bprivate.h
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Private non-prototype header.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
diff --git a/src/H5FD.c b/src/H5FD.c
index 7b2bdd2..4e9528e 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -12,14 +12,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Monday, July 26, 1999
- *
- * Purpose: The Virtual File Layer as described in documentation.
- * This is the greatest common denominator for all types of
- * storage access whether a file, memory, network, etc. This
- * layer usually just dispatches the request to an actual
- * file driver layer.
+ * Purpose: The Virtual File Layer as described in documentation.
+ * This is the greatest common denominator for all types of
+ * storage access whether a file, memory, network, etc. This
+ * layer usually just dispatches the request to an actual
+ * file driver layer.
*/
/****************/
diff --git a/src/H5FDcore.h b/src/H5FDcore.h
index a733dd5..f524571 100644
--- a/src/H5FDcore.h
+++ b/src/H5FDcore.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the core driver.
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index cd3767b..104ac27 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <slu@hdfgroup.uiuc.edu>
+ * Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
* Purpose: The Direct I/O file driver forces the data to be written to
diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h
index e0d5c30..6db3238 100644
--- a/src/H5FDdirect.h
+++ b/src/H5FDdirect.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <slu@hdfgroup.uiuc.edu>
+ * Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
* Purpose: The public header file for the direct driver.
diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h
index 6300767..1faf6df 100644
--- a/src/H5FDfamily.h
+++ b/src/H5FDfamily.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 4, 1999
*
* Purpose: The public header file for the family driver.
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index 0f18318..02981d5 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -34,8 +34,20 @@
#include "H5Pprivate.h" /* Property lists */
#ifdef H5_HAVE_LIBHDFS
-#include "hdfs.h"
-#endif
+
+/* HDFS routines
+ * Have to turn off -Wstrict-prototypes as this header contains functions
+ * defined as foo() instead of foo(void), which triggers warnings that HDF5
+ * then interprets as errors.
+ * -Wundef isn't interpreted as an error by HDF5, but the header does do
+ * some bad symbol interpretation that raises a warning that is out of our
+ * control.
+ */
+H5_GCC_DIAG_OFF(strict - prototypes)
+H5_GCC_DIAG_OFF(undef)
+#include <hdfs.h>
+H5_GCC_DIAG_ON(strict - prototypes)
+H5_GCC_DIAG_ON(undef)
/* toggle function call prints: 1 turns on */
#define HDFS_DEBUG 0
@@ -117,8 +129,6 @@ static unsigned long long hdfs_stats_boundaries[HDFS_STATS_BIN_COUNT];
*
* Programmer: Jacob Smith
*
- * Changes: None
- *
***************************************************************************/
typedef struct {
unsigned long long count;
@@ -129,8 +139,6 @@ typedef struct {
#endif /* HDFS_STATS */
-#ifdef H5_HAVE_LIBHDFS
-
/* "unique" identifier for `hdfs_t` structures.
* Randomly generated by unweighted dice rolls.
*/
@@ -144,9 +152,7 @@ typedef struct {
*
* Contain/retain information associated with a file hosted on Hadoop
* Distributed File System (HDFS). Instantiated and populated via
- * `H5FD_hdfs_handle_open()` and cleaned up via `H5FD_hdfs_handle_close()`.
- *
- *
+ * `H5FD__hdfs_handle_open()` and cleaned up via `H5FD_hdfs_handle_close()`.
*
* `magic` (unisgned long)
*
@@ -173,8 +179,6 @@ typedef struct {
* Programmer: Jacob Smith
* May 2018
*
- * Changes: None
- *
***************************************************************************
*/
typedef struct {
@@ -184,168 +188,6 @@ typedef struct {
hdfsFile file;
} hdfs_t;
-/*--------------------------------------------------------------------------
- * Function: H5FD_hdfs_handle_open
- *
- * Purpose: Create a HDFS file handle, 'opening' the target file.
- *
- * Return: Success: Pointer to HDFS container/handle of opened file.
- * Failure: NULL
- *
- * Programmer: Gerd Herber
- * May 2018
- *
- * Changes: None.
- *--------------------------------------------------------------------------
- */
-static hdfs_t *
-H5FD_hdfs_handle_open(const char *path, const char *namenode_name, const int32_t namenode_port,
- const char *user_name, const char *kerberos_ticket_cache,
- const int32_t stream_buffer_size)
-{
- struct hdfsBuilder *builder = NULL;
- hdfs_t * handle = NULL;
- hdfs_t * ret_value = NULL;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "called H5FD_hdfs_handle_open.\n");
-#endif
-
- if (path == NULL || path[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "path cannot be null.\n")
- }
- if (namenode_name == NULL /* || namenode_name[0] == '\0' */) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode name cannot be null.\n")
- }
- if (namenode_port < 0 || namenode_port > 65535) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode port must be non-negative and <= 65535.\n")
- }
- if (stream_buffer_size < 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "buffer size must non-negative.\n")
- }
-
- handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t));
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle.\n")
- }
-
- handle->magic = (unsigned long)HDFS_HDFST_MAGIC;
- handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */
- handle->fileinfo = NULL;
- handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */
-
- builder = hdfsNewBuilder();
- if (!builder) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) failed to create builder")
- }
- hdfsBuilderSetNameNode(builder, namenode_name);
- hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port);
- if (user_name != NULL && user_name[0] != '\0') {
- hdfsBuilderSetUserName(builder, user_name);
- }
- if (kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0') {
- hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache);
- }
- /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */
- handle->filesystem = hdfsBuilderConnect(builder);
- if (!handle->filesystem) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) could not connect to default namenode")
- }
- handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path);
- if (!handle->fileinfo) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "hdfsGetPathInfo failed")
- }
- handle->file = hdfsOpenFile(handle->filesystem, path, O_RDONLY, stream_buffer_size, 0, 0);
- if (!handle->file) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "(hdfs) could not open")
- }
-
- ret_value = handle;
-
-done:
- if (ret_value == NULL && handle != NULL) {
- /* error; clean up */
- HDassert(handle->magic == HDFS_HDFST_MAGIC);
- handle->magic++;
- if (handle->file != NULL) {
- if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close hdfs file handle")
- }
- }
- if (handle->fileinfo != NULL) {
- hdfsFreeFileInfo(handle->fileinfo, 1);
- }
- if (handle->filesystem != NULL) {
- if (FAIL == (hdfsDisconnect(handle->filesystem))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to disconnect from hdfs")
- }
- }
- H5MM_xfree(handle);
- }
-
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_hdfs_handle_open() */
-
-/*--------------------------------------------------------------------------
- * Function: H5FD_hdfs_handle_close
- *
- * Purpose: 'Close' an HDFS file container/handle, releasing underlying
- * resources.
- *
- * Return: Success: `SUCCEED` (0)
- * Failure: `FAIL` (-1)
- *
- * Programmer: Gerd Herber
- * May 2018
- *
- * Changes: None.
- *--------------------------------------------------------------------------
- */
-static herr_t
-H5FD_hdfs_handle_close(hdfs_t *handle)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "called H5FD_hdfs_close.\n");
-#endif
-
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.\n")
- }
- if (handle->magic != HDFS_HDFST_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.\n")
- }
-
- handle->magic++;
- if (handle->file != NULL) {
- if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close hdfs file handle")
- }
- }
- if (handle->fileinfo != NULL) {
- hdfsFreeFileInfo(handle->fileinfo, 1);
- }
- if (handle->filesystem != NULL) {
- if (FAIL == (hdfsDisconnect(handle->filesystem))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to disconnect hdfs file system")
- }
- }
-
- H5MM_xfree(handle);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_hdfs_close() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/***************************************************************************
*
* Structure: H5FD_hdfs_t
@@ -402,17 +244,13 @@ done:
*
* Programmer: Jacob Smith
*
- * Changes: None.
- *
***************************************************************************
*/
typedef struct H5FD_hdfs_t {
H5FD_t pub;
H5FD_hdfs_fapl_t fa;
haddr_t eoa;
-#ifdef H5_HAVE_LIBHDFS
- hdfs_t *hdfs_handle;
-#endif
+ hdfs_t * hdfs_handle;
#if HDFS_STATS
hdfs_statsbin meta[HDFS_STATS_BIN_COUNT + 1];
hdfs_statsbin raw[HDFS_STATS_BIN_COUNT + 1];
@@ -429,10 +267,8 @@ typedef struct H5FD_hdfs_t {
* Only included if HDFS code should compile.
*
*/
-#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
-#ifdef H5_HAVE_LIBHDFS
+#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR))
-#endif /* H5_HAVE_LIBHDFS */
/* Prototypes */
static void * H5FD_hdfs_fapl_get(H5FD_t *_file);
@@ -489,10 +325,8 @@ static const H5FD_class_t H5FD_hdfs_g = {
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
-#ifdef H5_HAVE_LIBHDFS
/* Declare a free list to manage the H5FD_hdfs_t struct */
H5FL_DEFINE_STATIC(H5FD_hdfs_t);
-#endif /* H5_HAVE_LIBHDFS */
/*-------------------------------------------------------------------------
* Function: H5FD_hdfs_init_interface
@@ -521,21 +355,22 @@ H5FD_hdfs_init_interface(void)
* Return: Success: The driver ID for the hdfs driver.
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, July 29, 1999
+ * Programmer: Jacob Smith, 2018
*
*-------------------------------------------------------------------------
*/
hid_t
H5FD_hdfs_init(void)
{
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+#if HDFS_STATS
unsigned int bin_i;
+#endif
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_init() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
if (H5I_VFL != H5I_get_type(H5FD_HDFS_g))
@@ -546,6 +381,7 @@ H5FD_hdfs_init(void)
*/
for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;
+
HDFS_STATS_POW(bin_i, &value)
hdfs_stats_boundaries[bin_i] = value;
}
@@ -558,7 +394,7 @@ done:
} /* end H5FD_hdfs_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_log_term
+ * Function: H5FD_hdfs_term
*
* Purpose: Shut down the VFD
*
@@ -574,7 +410,7 @@ H5FD_hdfs_term(void)
FUNC_ENTER_NOAPI_NOINIT_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_term() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
/* Reset VFL ID */
@@ -583,6 +419,180 @@ H5FD_hdfs_term(void)
FUNC_LEAVE_NOAPI_VOID
} /* end H5FD_hdfs_term() */
+/*--------------------------------------------------------------------------
+ * Function: H5FD_hdfs_handle_open
+ *
+ * Purpose: Create a HDFS file handle, 'opening' the target file.
+ *
+ * Return: Success: Pointer to HDFS container/handle of opened file.
+ * Failure: NULL
+ *
+ * Programmer: Gerd Herber
+ * May 2018
+ *
+ *--------------------------------------------------------------------------
+ */
+static hdfs_t *
+H5FD_hdfs_handle_open(const char *path, const char *namenode_name, const int32_t namenode_port,
+ const char *user_name, const char *kerberos_ticket_cache,
+ const int32_t stream_buffer_size)
+{
+ struct hdfsBuilder *builder = NULL;
+ hdfs_t * handle = NULL;
+ hdfs_t * ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "called %s.\n", FUNC);
+#endif
+
+ if (path == NULL || path[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "path cannot be null")
+ if (namenode_name == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode name cannot be null")
+ if (namenode_port < 0 || namenode_port > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode port must be non-negative and <= 65535")
+ if (stream_buffer_size < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "buffer size must non-negative")
+
+ handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t));
+ if (handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle")
+
+ handle->magic = (unsigned long)HDFS_HDFST_MAGIC;
+ handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */
+ handle->fileinfo = NULL;
+ handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */
+
+ builder = hdfsNewBuilder();
+ if (!builder)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) failed to create builder")
+ hdfsBuilderSetNameNode(builder, namenode_name);
+ hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port);
+ if (user_name != NULL && user_name[0] != '\0')
+ hdfsBuilderSetUserName(builder, user_name);
+ if (kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0')
+ hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache);
+
+ /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */
+ handle->filesystem = hdfsBuilderConnect(builder);
+ if (!handle->filesystem)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) could not connect to default namenode")
+ handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path);
+ if (!handle->fileinfo)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "hdfsGetPathInfo failed")
+ handle->file = hdfsOpenFile(handle->filesystem, path, O_RDONLY, stream_buffer_size, 0, 0);
+ if (!handle->file)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "(hdfs) could not open")
+
+ ret_value = handle;
+
+done:
+ if (ret_value == NULL && handle != NULL) {
+ /* error; clean up */
+ HDassert(handle->magic == HDFS_HDFST_MAGIC);
+ handle->magic++;
+ if (handle->file != NULL)
+ if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close hdfs file handle")
+ if (handle->fileinfo != NULL)
+ hdfsFreeFileInfo(handle->fileinfo, 1);
+ if (handle->filesystem != NULL)
+ if (FAIL == (hdfsDisconnect(handle->filesystem)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to disconnect from hdfs")
+ H5MM_xfree(handle);
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD__hdfs_handle_open() */
+
+/*--------------------------------------------------------------------------
+ * Function: H5FD_hdfs_handle_close
+ *
+ * Purpose: 'Close' an HDFS file container/handle, releasing underlying
+ * resources.
+ *
+ * Return: Success: `SUCCEED` (0)
+ * Failure: `FAIL` (-1)
+ *
+ * Programmer: Gerd Herber
+ * May 2018
+ *
+ *--------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_handle_close(hdfs_t *handle)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "called %s.\n", FUNC);
+#endif
+
+ if (handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null")
+ if (handle->magic != HDFS_HDFST_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic")
+
+ handle->magic++;
+ if (handle->file != NULL)
+ if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close hdfs file handle")
+ if (handle->fileinfo != NULL)
+ hdfsFreeFileInfo(handle->fileinfo, 1);
+ if (handle->filesystem != NULL)
+ if (FAIL == (hdfsDisconnect(handle->filesystem)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to disconnect hdfs file system")
+
+ H5MM_xfree(handle);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD__hdfs_handle_close() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_validate_config()
+ *
+ * Purpose: Test to see if the supplied instance of H5FD_hdfs_fapl_t
+ * contains internally consistant data. Return SUCCEED if so,
+ * and FAIL otherwise.
+ *
+ * Note the difference between internally consistant and
+ * correct. As we will have to try to access the target
+ * object to determine whether the supplied data is correct,
+ * we will settle for internal consistancy at this point
+ *
+ * Return: SUCCEED if instance of H5FD_hdfs_fapl_t contains internally
+ * consistant data, FAIL otherwise.
+ *
+ * Programmer: Jacob Smith
+ * 9/10/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t *fa)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HDassert(fa != NULL);
+
+ if (fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_hdfs_fapl_t version");
+ if (fa->namenode_port > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number");
+ if (fa->namenode_port < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_hdfs_validate_config() */
+
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_hdfs
*
@@ -609,12 +619,12 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa)
HDassert(fa != NULL);
#if HDFS_DEBUG
- HDfprintf(stdout, "H5Pset_fapl_hdfs() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
-
if (FAIL == H5FD_hdfs_validate_config(fa))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid hdfs config")
@@ -625,35 +635,246 @@ done:
} /* H5Pset_fapl_hdfs() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_open()
+ * Function: H5Pget_fapl_hdfs
+ *
+ * Purpose: Returns information about the hdfs file access property
+ * list though the function arguments.
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: John Mainzer
+ * 9/10/17
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out)
+{
+ const H5FD_hdfs_fapl_t *fa = NULL;
+ H5P_genplist_t * plist = NULL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", fapl_id, fa_out);
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "called %s.\n", FUNC);
+#endif
+
+ if (fa_out == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
+ if (H5FD_HDFS != H5P_get_driver(plist))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
+
+ fa = (const H5FD_hdfs_fapl_t *)H5P_get_driver_info(plist);
+ if (fa == NULL)
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
+
+ /* Copy the hdfs fapl data out */
+ HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t));
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* H5Pget_fapl_hdfs() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_fapl_get
+ *
+ * Purpose: Gets a file access property list which could be used to
+ * create an identical file.
+ *
+ * Return: Success: Ptr to new file access property list value.
+ *
+ * Failure: NULL
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_hdfs_fapl_get(H5FD_t *_file)
+{
+ H5FD_hdfs_t * file = (H5FD_hdfs_t *)_file;
+ H5FD_hdfs_fapl_t *fa = NULL;
+ void * ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ fa = (H5FD_hdfs_fapl_t *)H5MM_calloc(sizeof(H5FD_hdfs_fapl_t));
+ if (fa == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed")
+
+ /* Copy the fields of the structure */
+ HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t));
+
+ ret_value = fa;
+
+done:
+ if (ret_value == NULL && fa != NULL)
+ H5MM_xfree(fa); /* clean up on error */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_hdfs_fapl_get() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_fapl_copy
+ *
+ * Purpose: Copies the hdfs-specific file access properties.
*
- * Purpose: Create and/or opens a file as an HDF5 file.
+ * Return: Success: Ptr to a new property list
*
- * Any flag except H5F_ACC_RDONLY will cause an error.
+ * Failure: NULL
*
- * Return: Success: A pointer to a new file data structure.
- * The public fields will be initialized by the caller, which is
- * always H5FD_open().
- * Failure: NULL
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_hdfs_fapl_copy(const void *_old_fa)
+{
+ const H5FD_hdfs_fapl_t *old_fa = (const H5FD_hdfs_fapl_t *)_old_fa;
+ H5FD_hdfs_fapl_t * new_fa = NULL;
+ void * ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ new_fa = (H5FD_hdfs_fapl_t *)H5MM_malloc(sizeof(H5FD_hdfs_fapl_t));
+ if (new_fa == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed")
+
+ HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t));
+ ret_value = new_fa;
+
+done:
+ if (ret_value == NULL && new_fa != NULL)
+ H5MM_xfree(new_fa); /* clean up on error */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD_hdfs_fapl_copy() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_hdfs_fapl_free
+ *
+ * Purpose: Frees the hdfs-specific file access properties.
+ *
+ * Return: SUCCEED (cannot fail)
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_hdfs_fapl_free(void *_fa)
+{
+ H5FD_hdfs_fapl_t *fa = (H5FD_hdfs_fapl_t *)_fa;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(fa != NULL); /* sanity check */
+
+ H5MM_xfree(fa);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5FD_hdfs_fapl_free() */
+
+#if HDFS_STATS
+/*----------------------------------------------------------------------------
+ *
+ * Function: hdfs_reset_stats()
+ *
+ * Purpose:
+ *
+ * Reset the stats collection elements in this virtual file structure.
+ *
+ * Clears any set data in stats bins; initializes/zeroes values.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - Occurs if the file is invalid somehow
+ *
+ * Programmer: Jacob Smith
+ * 2017-12-08
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+hdfs_reset_stats(H5FD_hdfs_t *file)
+{
+ unsigned i = 0;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if HDFS_DEBUG
+ HDprintf("hdfs_reset_stats() called\n");
+#endif
+
+ if (file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null")
+
+ for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ file->raw[i].bytes = 0;
+ file->raw[i].count = 0;
+ file->raw[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ file->raw[i].max = 0;
+
+ file->meta[i].bytes = 0;
+ file->meta[i].count = 0;
+ file->meta[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ file->meta[i].max = 0;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* hdfs_reset_stats */
+#endif /* HDFS_STATS */
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5FD_hdfs_open()
+ *
+ * Purpose:
+ *
+ * Create and/or opens a file as an HDF5 file.
+ *
+ * Any flag except H5F_ACC_RDONLY will cause an error.
+ *
+ * Return:
+ *
+ * Success: A pointer to a new file data structure.
+ * The public fields will be initialized by the caller, which is
+ * always H5FD_open().
+ *
+ * Failure: NULL
*
* Programmer: Jacob Smith
* 2017-11-02
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
static H5FD_t *
H5FD_hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
- H5FD_hdfs_t * file = NULL;
- hdfs_t * handle = NULL;
- H5FD_hdfs_fapl_t fa;
H5FD_t * ret_value = NULL;
+ H5FD_hdfs_t * file = NULL;
+ hdfs_t * handle = NULL;
+ H5FD_hdfs_fapl_t fa;
FUNC_ENTER_NOAPI_NOINIT
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_open() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
/* Sanity check on file offsets */
@@ -666,7 +887,6 @@ H5FD_hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
if (ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
-
if (flags != H5F_ACC_RDONLY)
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed")
if (fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT)
@@ -676,16 +896,15 @@ H5FD_hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
handle = H5FD_hdfs_handle_open(path, fa.namenode_name, fa.namenode_port, fa.user_name,
fa.kerberos_ticket_cache, fa.stream_buffer_size);
-
if (handle == NULL)
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open")
HDassert(handle->magic == HDFS_HDFST_MAGIC);
- /* Create the new file struct */
- if (NULL == (file = H5FL_CALLOC(H5FD_hdfs_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
-
+ /* Create new file struct */
+ file = H5FL_CALLOC(H5FD_hdfs_t);
+ if (file == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct")
file->hdfs_handle = handle;
HDmemcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t));
@@ -697,62 +916,304 @@ H5FD_hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
ret_value = (H5FD_t *)file;
done:
- if (NULL == ret_value) {
- if (handle != NULL) {
+ if (ret_value == NULL) {
+ if (handle != NULL)
if (FAIL == H5FD_hdfs_handle_close(handle))
HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close HDFS file handle")
- }
- if (file != NULL) {
+ if (file != NULL)
file = H5FL_FREE(H5FD_hdfs_t, file);
- }
} /* end if null return value (error) */
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5FD_hdfs_open() */
-#else /* H5_HAVE_LIBHDFS not defined */
+#if HDFS_STATS
-static H5FD_t *
-H5FD_hdfs_open(const char H5_ATTR_UNUSED *path, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id,
- haddr_t H5_ATTR_UNUSED maxaddr)
+/*----------------------------------------------------------------------------
+ *
+ * Function: hdfs_fprint_stats()
+ *
+ * Purpose:
+ *
+ * Tabulate and pretty-print statistics for this virtual file.
+ *
+ * Should be called upon file close.
+ *
+ * Shows number of reads and bytes read, broken down by
+ * "raw" (H5FD_MEM_DRAW)
+ * or "meta" (any other flag)
+ *
+ * Prints filename and listing of total number of reads and bytes read,
+ * both as a grand total and separate meta- and rawdata reads.
+ *
+ * If any reads were done, prints out two tables:
+ *
+ * 1. overview of raw- and metadata reads
+ * - min (smallest size read)
+ * - average of size read
+ * - k,M,G suffixes by powers of 1024 (2^10)
+ * - max (largest size read)
+ * 2. tabulation of "bins", sepraring reads into exponentially-larger
+ * ranges of size.
+ * - columns for number of reads, total bytes, and average size, with
+ * separate sub-colums for raw- and metadata reads.
+ * - each row represents one bin, identified by the top of its range
+ *
+ * Bin ranges can be modified with pound-defines at the top of this file.
+ *
+ * Bins without any reads in their bounds are not printed.
+ *
+ * An "overflow" bin is also present, to catch "big" reads.
+ *
+ * Output for all bins (and range ceiling and average size report)
+ * is divied by powers of 1024. By corollary, four digits before the decimal
+ * is valid.
+ *
+ * - 41080 bytes is represented by 40.177k, not 41.080k
+ * - 1004.831M represents approx. 1052642000 bytes
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - occurs if the file passed in is invalid
+ * - TODO: if stream is invalid? how can we check this?
+ *
+ * Programmer: Jacob Smith
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+hdfs_fprint_stats(FILE *stream, const H5FD_hdfs_t *file)
{
- H5FD_t *ret_value = NULL;
+ herr_t ret_value = SUCCEED;
+ parsed_url_t * purl = NULL;
+ unsigned i = 0;
+ unsigned long count_meta = 0;
+ unsigned long count_raw = 0;
+ double average_meta = 0.0;
+ double average_raw = 0.0;
+ unsigned long long min_meta = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ unsigned long long min_raw = (unsigned long long)HDFS_STATS_STARTING_MIN;
+ unsigned long long max_meta = 0;
+ unsigned long long max_raw = 0;
+ unsigned long long bytes_raw = 0;
+ unsigned long long bytes_meta = 0;
+ double re_dub = 0.0; /* re-usable double variable */
+ unsigned suffix_i = 0;
+ const char suffixes[] = {' ', 'K', 'M', 'G', 'T', 'P'};
FUNC_ENTER_NOAPI_NOINIT
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "Illegal open of unsupported virtual file (hdfs)");
+ if (stream == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null")
+ if (file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null")
+ if (file->hdfs_handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle cannot be null")
+ if (file->hdfs_handle->magic != HDFS_HDFST_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle has invalid magic")
+
+ /*******************
+ * AGGREGATE STATS *
+ *******************/
+
+ for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ const hdfs_statsbin *r = &file->raw[i];
+ const hdfs_statsbin *m = &file->meta[i];
+
+ if (m->min < min_meta)
+ min_meta = m->min;
+ if (r->min < min_raw)
+ min_raw = r->min;
+ if (m->max > max_meta)
+ max_meta = m->max;
+ if (r->max > max_raw)
+ max_raw = r->max;
+
+ count_raw += r->count;
+ count_meta += m->count;
+ bytes_raw += r->bytes;
+ bytes_meta += m->bytes;
+ }
+ if (count_raw > 0)
+ average_raw = (double)bytes_raw / (double)count_raw;
+ if (count_meta > 0)
+ average_meta = (double)bytes_meta / (double)count_meta;
+
+ /******************
+ * PRINT OVERVIEW *
+ ******************/
+
+ HDfprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n", count_raw + count_meta, count_meta,
+ count_raw);
+ HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta,
+ bytes_raw);
+
+ if (count_raw + count_meta == 0)
+ goto done;
+
+ /*************************
+ * PRINT AGGREGATE STATS *
+ *************************/
+
+ HDfprintf(stream, "SIZES meta raw\n");
+ HDfprintf(stream, " min ");
+ if (count_meta == 0)
+ HDfprintf(stream, " 0.000 ");
+ else {
+ re_dub = (double)min_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+ }
+
+ if (count_raw == 0)
+ HDfprintf(stream, " 0.000 \n");
+ else {
+ re_dub = (double)min_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+ }
+
+ HDfprintf(stream, " avg ");
+ re_dub = (double)average_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)average_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ HDfprintf(stream, " max ");
+ re_dub = (double)max_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)max_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ /******************************
+ * PRINT INDIVIDUAL BIN STATS *
+ ******************************/
+
+ HDfprintf(stream, "BINS # of reads total bytes average size\n");
+ HDfprintf(stream, " up-to meta raw meta raw meta raw\n");
+
+ for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ const hdfs_statsbin *m;
+ const hdfs_statsbin *r;
+ unsigned long long range_end = 0;
+ char bm_suffix = ' '; /* bytes-meta */
+ double bm_val = 0.0;
+ char br_suffix = ' '; /* bytes-raw */
+ double br_val = 0.0;
+ char am_suffix = ' '; /* average-meta */
+ double am_val = 0.0;
+ char ar_suffix = ' '; /* average-raw */
+ double ar_val = 0.0;
+
+ m = &file->meta[i];
+ r = &file->raw[i];
+ if (r->count == 0 && m->count == 0)
+ continue;
+
+ range_end = hdfs_stats_boundaries[i];
+
+ if (i == HDFS_STATS_BIN_COUNT) {
+ range_end = hdfs_stats_boundaries[i - 1];
+ HDfprintf(stream, ">");
+ }
+ else
+ HDfprintf(stream, " ");
+
+ bm_val = (double)m->bytes;
+ for (suffix_i = 0; bm_val >= 1024.0; suffix_i++)
+ bm_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ bm_suffix = suffixes[suffix_i];
+
+ br_val = (double)r->bytes;
+ for (suffix_i = 0; br_val >= 1024.0; suffix_i++)
+ br_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ br_suffix = suffixes[suffix_i];
+
+ if (m->count > 0)
+ am_val = (double)(m->bytes) / (double)(m->count);
+ for (suffix_i = 0; am_val >= 1024.0; suffix_i++)
+ am_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ am_suffix = suffixes[suffix_i];
+
+ if (r->count > 0)
+ ar_val = (double)(r->bytes) / (double)(r->count);
+ for (suffix_i = 0; ar_val >= 1024.0; suffix_i++)
+ ar_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ ar_suffix = suffixes[suffix_i];
+
+ re_dub = (double)range_end;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+
+ HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub,
+ suffixes[suffix_i], /* bin ceiling */
+ m->count, /* metadata reads */
+ r->count, /* rawdata reads */
+ bm_val, bm_suffix, /* metadata bytes */
+ br_val, br_suffix, /* rawdata bytes */
+ am_val, am_suffix, /* metadata average */
+ ar_val, ar_suffix); /* rawdata average */
+ HDfflush(stream);
+ }
done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_open() */
-#endif /* H5_HAVE_LIBHDFS */
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* hdfs_fprint_stats */
+#endif /* HDFS_STATS */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_close
*
- * Purpose: Closes an HDF5 file.
+ * Function: H5FD_hdfs_close
+ *
+ * Purpose:
*
- * Return: Success: SUCCEED
- * Failure: FAIL, file not closed.
+ * Close an HDF5 file.
+ *
+ * Return:
+ *
+ * Success: SUCCEED
+ * Failure: FAIL, file not closed.
*
* Programmer: Jacob Smith
* 2017-11-02
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
H5FD_hdfs_close(H5FD_t *_file)
{
- H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
herr_t ret_value = SUCCEED;
+ H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
FUNC_ENTER_NOAPI_NOINIT
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_close() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
/* Sanity checks */
@@ -762,9 +1223,8 @@ H5FD_hdfs_close(H5FD_t *_file)
/* Close the underlying request handle */
if (file->hdfs_handle != NULL)
- if (FAIL == H5FD_hdfs_handle_close(file->hdfs_handle)) {
+ if (FAIL == H5FD_hdfs_handle_close(file->hdfs_handle))
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close HDFS file handle")
- }
#if HDFS_STATS
/* TODO: mechanism to re-target stats printout */
@@ -779,52 +1239,37 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_hdfs_close() */
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_close(H5FD_t H5_ATTR_UNUSED *_file)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "Illegal close of unsupported Virtual File (hdfs)")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_close() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_cmp()
*
- * Purpose: Compares two files using this driver by their HDFS-provided file info,
- * field-by-field.
+ * Function: H5FD_hdfs_cmp()
*
- * Return: Equivalent: 0
- * Not Equivalent: -1
+ * Purpose:
+ *
+ * Compares two files using this driver by their HDFS-provided file info,
+ * field-by-field.
+ *
+ * Return:
+ * Equivalent: 0
+ * Not Equivalent: -1
*
* Programmer: Gerd Herber
* May 2018
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static int
H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
+ int ret_value = 0;
const H5FD_hdfs_t *f1 = (const H5FD_hdfs_t *)_f1;
const H5FD_hdfs_t *f2 = (const H5FD_hdfs_t *)_f2;
hdfsFileInfo * finfo1 = NULL;
hdfsFileInfo * finfo2 = NULL;
- int ret_value = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_cmp() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
HDassert(f1->hdfs_handle != NULL);
@@ -855,10 +1300,10 @@ H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
if (finfo1->mBlockSize != finfo2->mBlockSize) {
HGOTO_DONE(-1);
}
- if (strcmp(finfo1->mOwner, finfo2->mOwner)) {
+ if (HDstrcmp(finfo1->mOwner, finfo2->mOwner)) {
HGOTO_DONE(-1);
}
- if (strcmp(finfo1->mGroup, finfo2->mGroup)) {
+ if (HDstrcmp(finfo1->mGroup, finfo2->mGroup)) {
HGOTO_DONE(-1);
}
if (finfo1->mPermissions != finfo2->mPermissions) {
@@ -872,20 +1317,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_hdfs_cmp() */
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static int
-H5FD_hdfs_cmp(const H5FD_t H5_ATTR_UNUSED *_f1, const H5FD_t H5_ATTR_UNUSED *_f2)
-{
- int ret_value = 0;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_cmp() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/*-------------------------------------------------------------------------
* Function: H5FD_hdfs_query
*
@@ -911,7 +1342,7 @@ H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) /* out
FUNC_ENTER_NOAPI_NOINIT_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_query() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
if (flags) {
@@ -923,21 +1354,24 @@ H5FD_hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) /* out
} /* H5FD_hdfs_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_get_eoa()
*
- * Purpose: Gets the end-of-address marker for the file. The EOA marker
- * is the first address past the last byte allocated in the
- * format address space.
+ * Function: H5FD_hdfs_get_eoa()
+ *
+ * Purpose:
+ *
+ * Gets the end-of-address marker for the file. The EOA marker
+ * is the first address past the last byte allocated in the
+ * format address space.
*
- * Return: The end-of-address marker.
+ * Return:
+ *
+ * The end-of-address marker.
*
* Programmer: Jacob Smith
* 2017-11-02
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static haddr_t
H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
@@ -946,42 +1380,29 @@ H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
FUNC_ENTER_NOAPI_NOINIT_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
FUNC_LEAVE_NOAPI(file->eoa)
} /* end H5FD_hdfs_get_eoa() */
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static haddr_t
-H5FD_hdfs_get_eoa(const H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n");
-#endif
-
- FUNC_LEAVE_NOAPI(0)
-} /* end H5FD_hdfs_get_eoa() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_set_eoa()
*
- * Purpose: Set the end-of-address marker for the file.
+ * Function: H5FD_hdfs_set_eoa()
*
- * Return: SUCCEED (Can't fail)
+ * Purpose:
+ *
+ * Set the end-of-address marker for the file.
+ *
+ * Return:
+ *
+ * SUCCEED (can't fail)
*
* Programmer: Jacob Smith
* 2017-11-03
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
@@ -990,7 +1411,7 @@ H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
FUNC_ENTER_NOAPI_NOINIT_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
file->eoa = addr;
@@ -998,37 +1419,24 @@ H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5FD_hdfs_set_eoa() */
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n");
-#endif
-
- FUNC_LEAVE_NOAPI(FAIL)
-} /* H5FD_hdfs_set_eoa() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_get_eof()
*
- * Purpose: Returns the end-of-file marker.
+ * Function: H5FD_hdfs_get_eof()
+ *
+ * Purpose:
+ *
+ * Returns the end-of-file marker.
*
- * Return: EOF: the first address past the end of the "file", either the
- * filesystem file or the HDF5 file.
+ * Return:
+ *
+ * EOF: the first address past the end of the "file", either the
+ * filesystem file or the HDF5 file.
*
* Programmer: Jacob Smith
* 2017-11-02
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static haddr_t
H5FD_hdfs_get_eof(const H5FD_t *_file)
{
@@ -1037,7 +1445,7 @@ H5FD_hdfs_get_eof(const H5FD_t *_file)
FUNC_ENTER_NOAPI_NOINIT_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
HDassert(file->hdfs_handle != NULL);
@@ -1046,46 +1454,33 @@ H5FD_hdfs_get_eof(const H5FD_t *_file)
FUNC_LEAVE_NOAPI((size_t)file->hdfs_handle->fileinfo->mSize)
} /* end H5FD_hdfs_get_eof() */
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static haddr_t
-H5FD_hdfs_get_eof(const H5FD_t H5_ATTR_UNUSED *_file)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n");
-#endif
-
- FUNC_LEAVE_NOAPI((size_t)0)
-} /* end H5FD_hdfs_get_eof() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_get_handle
*
- * Purpose: Returns the HDFS handle (hdfs_t) of hdfs file driver.
+ * Function: H5FD_hdfs_get_handle
*
- * Returns: SUCCEED/FAIL
+ * Purpose:
+ *
+ * Returns the HDFS handle (hdfs_t) of hdfs file driver.
+ *
+ * Returns:
+ *
+ * SUCCEED/FAIL
*
* Programmer: Jacob Smith
* 2017-11-02
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
H5FD_hdfs_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
- H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
herr_t ret_value = SUCCEED;
+ H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
FUNC_ENTER_NOAPI_NOINIT
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
if (!file_handle)
@@ -1097,53 +1492,34 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_hdfs_get_handle() */
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_get_handle(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED fapl,
- void H5_ATTR_UNUSED **file_handle)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n");
-#endif /* HDFS_DEBUG */
-
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "Illegal get-handle of unsupported virtual file (hdfs)");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_get_handle() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_read
*
- * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
- * into buffer BUF according to data transfer properties in DXPL_ID.
+ * Function: H5FD_hdfs_read
+ *
+ * Purpose:
+ *
+ * Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in DXPL_ID.
+ *
+ * Return:
*
- * Return: Success: SUCCEED
- * - Result is stored in caller-supplied buffer BUF.
- * Failure: FAIL
- * - Unable to complete read.
- * - Contents of buffer `buf` are undefined.
+ * Success: `SUCCEED`
+ * - Result is stored in caller-supplied buffer BUF.
+ * Failure: `FAIL`
+ * - Unable to complete read.
+ * - Contents of buffer `buf` are undefined.
*
* Programmer: Jacob Smith
* 2017-11-??
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
- size_t size, void *buf /*out*/)
+ size_t size, void *buf)
{
- H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
herr_t ret_value = SUCCEED;
+ H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
size_t filesize = 0;
#if HDFS_STATS
/* working variables for storing stats */
@@ -1154,7 +1530,7 @@ H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
FUNC_ENTER_NOAPI_NOINIT
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_read() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
HDassert(file != NULL);
@@ -1173,13 +1549,10 @@ H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
#if HDFS_STATS
- /* Find which "bin" this read fits in. Can be "overflow" bin.
- */
- for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) {
- if ((unsigned long long)size < hdfs_stats_boundaries[bin_i]) {
+ /* Find which "bin" this read fits in. Can be "overflow" bin. */
+ for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++)
+ if ((unsigned long long)size < hdfs_stats_boundaries[bin_i])
break;
- }
- }
bin = (type == H5FD_MEM_DRAW) ? &file->raw[bin_i] : &file->meta[bin_i];
/* Store collected stats in appropriate bin */
@@ -1188,12 +1561,10 @@ H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
bin->max = size;
}
else {
- if (size < bin->min) {
+ if (size < bin->min)
bin->min = size;
- }
- if (size > bin->max) {
+ if (size > bin->max)
bin->max = size;
- }
}
bin->count++;
bin->bytes += (unsigned long long)size;
@@ -1204,35 +1575,18 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_hdfs_read() */
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_read() called.\n");
-#endif /* HDFS_DEBUG */
-
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "Illegal get-handle of unsupported virtual file (hdfs)");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_read() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_write
*
- * Purpose: Write bytes to file.
- * UNSUPPORTED IN READ-ONLY HDFS VFD.
+ * Function: H5FD_hdfs_write
+ *
+ * Purpose:
+ *
+ * Write bytes to file.
+ * UNSUPPORTED IN READ-ONLY HDFS VFD.
*
- * Return: FAIL (Not possible with Read-Only S3 file.)
+ * Return:
+ *
+ * FAIL (Not possible with Read-Only S3 file.)
*
* Programmer: Jacob Smith
* 2017-10-23
@@ -1248,24 +1602,29 @@ H5FD_hdfs_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hi
FUNC_ENTER_NOAPI_NOINIT
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_write() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file.")
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_hdfs_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_truncate
*
- * Purpose: Makes sure that the true file size is the same (or larger)
- * than the end-of-address.
+ * Function: H5FD_hdfs_truncate
+ *
+ * Purpose:
+ *
+ * Makes sure that the true file size is the same (or larger)
+ * than the end-of-address.
+ *
+ * NOT POSSIBLE ON READ-ONLY S3 FILES.
*
- * NOT POSSIBLE ON READ-ONLY S3 FILES.
+ * Return:
*
- * Return: FAIL (Not possible on Read-Only S3 files.)
+ * FAIL (Not possible on Read-Only S3 files.)
*
* Programmer: Jacob Smith
* 2017-10-23
@@ -1280,25 +1639,30 @@ H5FD_hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, h
FUNC_ENTER_NOAPI_NOINIT
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_truncate() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file.")
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_hdfs_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_lock
*
- * Purpose: Place an advisory lock on a file.
- * No effect on Read-Only S3 file.
+ * Function: H5FD_hdfs_lock
*
- * Suggestion: remove lock/unlock from class
- * would result in error at H5FD_[un]lock() (H5FD.c)
+ * Purpose:
+ *
+ * Place an advisory lock on a file.
+ * No effect on Read-Only S3 file.
+ *
+ * Suggestion: remove lock/unlock from class
+ * would result in error at H5FD_[un]lock() (H5FD.c)
*
- * Return: SUCCEED (No-op always succeeds)
+ * Return:
+ *
+ * SUCCEED (No-op always succeeds)
*
* Programmer: Jacob Smith
* 2017-11-03
@@ -1313,12 +1677,17 @@ H5FD_hdfs_lock(H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw)
} /* end H5FD_hdfs_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_unlock
*
- * Purpose: Remove the existing lock on the file.
- * No effect on Read-Only S3 file.
+ * Function: H5FD_hdfs_unlock
+ *
+ * Purpose:
+ *
+ * Remove the existing lock on the file.
+ * No effect on Read-Only S3 file.
+ *
+ * Return:
*
- * Return: SUCCEED (No-op always succeeds)
+ * SUCCEED (No-op always succeeds)
*
* Programmer: Jacob Smith
* 2017-11-03
@@ -1332,519 +1701,54 @@ H5FD_hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_hdfs_unlock() */
-/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_validate_config()
- *
- * Purpose: Test to see if the supplied instance of H5FD_hdfs_fapl_t
- * contains internally consistant data. Return SUCCEED if so,
- * and FAIL otherwise.
- *
- * Note the difference between internally consistant and
- * correct. As we will have to try to access the target
- * object to determine whether the supplied data is correct,
- * we will settle for internal consistancy at this point
- *
- * Return: SUCCEED if instance of H5FD_hdfs_fapl_t contains internally
- * consistant data, FAIL otherwise.
- *
- * Programmer: Jacob Smith
- * 9/10/17
- *
- *-------------------------------------------------------------------------
+#else /* H5_HAVE_LIBHDFS */
+
+/* No-op stubs to avoid binary compatibility problems with previous
+ * HDF5 1.8 versions. Non-functional versions of these API calls were
+ * erroneously included in the library even when the HDFS VFD was not
+ * configured.
*/
-static herr_t
-H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t *fa)
+hid_t
+H5FD_hdfs_init(void)
{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- HDassert(fa != NULL);
-
- if (fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_hdfs_fapl_t version");
-
- if (fa->namenode_port > 65535)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number");
- if (fa->namenode_port < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number");
+ /* This should never be called since the header doesn't invoke it */
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_LEAVE_NOAPI(H5I_INVALID_HID)
+}
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_validate_config() */
+void
+H5FD_hdfs_term(void)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5FD_hdfs_term() */
-/*-------------------------------------------------------------------------
- * Function: H5Pget_fapl_hdfs
- *
- * Purpose: Returns information about the hdfs file access property
- * list though the function arguments.
- *
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: John Mainzer
- * 9/10/17
- *
- *-------------------------------------------------------------------------
- */
herr_t
H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out)
{
- const H5FD_hdfs_fapl_t *fa = NULL;
- H5P_genplist_t * plist = NULL;
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*x", fapl_id, fa_out);
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5Pget_fapl_hdfs() called.\n");
-#endif
-
- if (fa_out == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
- plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- if (H5FD_HDFS != H5P_get_driver(plist))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
-
- fa = (const H5FD_hdfs_fapl_t *)H5P_get_driver_info(plist);
- if (fa == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
-
- /* Copy the hdfs fapl data out */
- HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t));
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* H5Pget_fapl_hdfs() */
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_fapl_get
- *
- * Purpose: Gets a file access property list which could be used to
- * create an identical file.
- *
- * Return: Success: Ptr to new file access property list value.
- * Failure: NULL
- *
- * Programmer: John Mainzer
- * 9/8/17
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5FD_hdfs_fapl_get(H5FD_t *_file)
-{
- H5FD_hdfs_t * file = (H5FD_hdfs_t *)_file;
- H5FD_hdfs_fapl_t *fa = NULL;
- void * ret_value = NULL;
+ herr_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT
+ H5TRACE2("e", "i*x", fapl_id, fa_out);
- fa = (H5FD_hdfs_fapl_t *)H5MM_calloc(sizeof(H5FD_hdfs_fapl_t));
- if (fa == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
-
- /* Copy the fields of the structure */
- HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t));
-
- ret_value = fa;
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "HDFS VFD not included in the HDF5 library")
done:
- if (ret_value == NULL && fa != NULL) {
- H5MM_xfree(fa); /* clean up on error */
- }
-
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_fapl_get() */
+}
-/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_fapl_copy
- *
- * Purpose: Copies the hdfs-specific file access properties.
- *
- * Return: Success: Ptr to a new property list
- * Failure: NULL
- *
- * Programmer: John Mainzer
- * 9/8/17
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5FD_hdfs_fapl_copy(const void *_old_fa)
+herr_t
+H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa)
{
- const H5FD_hdfs_fapl_t *old_fa = (const H5FD_hdfs_fapl_t *)_old_fa;
- H5FD_hdfs_fapl_t * new_fa = NULL;
- void * ret_value = NULL;
+ herr_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT
+ H5TRACE2("e", "i*x", fapl_id, fa);
- new_fa = (H5FD_hdfs_fapl_t *)H5MM_malloc(sizeof(H5FD_hdfs_fapl_t));
- if (new_fa == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
-
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t));
- ret_value = new_fa;
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "HDFS VFD not included in the HDF5 library")
done:
- if (ret_value == NULL && new_fa != NULL)
- H5MM_xfree(new_fa); /* clean up on error */
-
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_fapl_copy() */
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_fapl_free
- *
- * Purpose: Frees the hdfs-specific file access properties.
- *
- * Return: SUCCEED (cannot fail)
- *
- * Programmer: John Mainzer
- * 9/8/17
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_hdfs_fapl_free(void *_fa)
-{
- H5FD_hdfs_fapl_t *fa = (H5FD_hdfs_fapl_t *)_fa;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- HDassert(fa != NULL); /* sanity check */
-
- H5MM_xfree(fa);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5FD_hdfs_fapl_free() */
-
-#if HDFS_STATS
-
-/*----------------------------------------------------------------------------
- * Function: hdfs_reset_stats()
- *
- * Purpose: Reset the stats collection elements in this virtual file structure.
- * Clears any set data in stats bins; initializes/zeroes values.
- *
- * Return: - SUCCESS: `SUCCEED`
- * - FAILURE: `FAIL`
- * - Occurs if the file is invalid somehow
- *
- * Programmer: Jacob Smith
- * 2017-12-08
- *
- *----------------------------------------------------------------------------
- */
-static herr_t
-hdfs_reset_stats(H5FD_hdfs_t *file)
-{
- unsigned i = 0;
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDprintf("hdfs_reset_stats() called\n");
-#endif
-
- if (file == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null")
-
- for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
- file->raw[i].bytes = 0;
- file->raw[i].count = 0;
- file->raw[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN;
- file->raw[i].max = 0;
-
- file->meta[i].bytes = 0;
- file->meta[i].count = 0;
- file->meta[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN;
- file->meta[i].max = 0;
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* hdfs_reset_stats */
-#endif /* HDFS_STATS */
-
-#if HDFS_STATS
-
-/*----------------------------------------------------------------------------
- * Function: hdfs_fprint_stats()
- *
- * Purpose: Tabulate and pretty-print statistics for this virtual file.
- *
- * Should be called upon file close.
- *
- * Shows number of reads and bytes read, broken down by
- * "raw" (H5FD_MEM_DRAW)
- * or "meta" (any other flag)
- *
- * Prints filename and listing of total number of reads and bytes read,
- * both as a grand total and separate meta- and rawdata reads.
- *
- * If any reads were done, prints out two tables:
- *
- * 1. overview of raw- and metadata reads
- * - min (smallest size read)
- * - average of size read
- * - k,M,G suffixes by powers of 1024 (2^10)
- * - max (largest size read)
- * 2. tabulation of "bins", sepraring reads into exponentially-larger
- * ranges of size.
- * - columns for number of reads, total bytes, and average size, with
- * separate sub-colums for raw- and metadata reads.
- * - each row represents one bin, identified by the top of its range
- *
- * Bin ranges can be modified with pound-defines at the top of this file.
- *
- * Bins without any reads in their bounds are not printed.
- *
- * An "overflow" bin is also present, to catch "big" reads.
- *
- * Output for all bins (and range ceiling and average size report)
- * is divied by powers of 1024. By corollary, four digits before the decimal
- * is valid.
- *
- * - 41080 bytes is represented by 40.177k, not 41.080k
- * - 1004.831M represents approx. 1052642000 bytes
- *
- * Return: - SUCCESS: `SUCCEED`
- * - FAILURE: `FAIL`
- * - occurs if the file passed in is invalid
- * - TODO: if stream is invalid? how can we check this?
- *
- * Programmer: Jacob Smith
- *
- *----------------------------------------------------------------------------
- */
-static herr_t
-hdfs_fprint_stats(FILE *stream, const H5FD_hdfs_t *file)
-{
- herr_t ret_value = SUCCEED;
- parsed_url_t * purl = NULL;
- unsigned i = 0;
- unsigned long count_meta = 0;
- unsigned long count_raw = 0;
- double average_meta = 0.0;
- double average_raw = 0.0;
- unsigned long long min_meta = (unsigned long long)HDFS_STATS_STARTING_MIN;
- unsigned long long min_raw = (unsigned long long)HDFS_STATS_STARTING_MIN;
- unsigned long long max_meta = 0;
- unsigned long long max_raw = 0;
- unsigned long long bytes_raw = 0;
- unsigned long long bytes_meta = 0;
- double re_dub = 0.0; /* re-usable double variable */
- unsigned suffix_i = 0;
- const char suffixes[] = {' ', 'K', 'M', 'G', 'T', 'P'};
-
- FUNC_ENTER_NOAPI_NOINIT
-
- if (stream == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null")
- if (file == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null")
- if (file->hdfs_handle == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle cannot be null")
- if (file->hdfs_handle->magic != HDFS_HDFST_MAGIC)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle has invalid magic")
-
- /*******************
- * AGGREGATE STATS *
- *******************/
-
- for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
- const hdfs_statsbin *r = &file->raw[i];
- const hdfs_statsbin *m = &file->meta[i];
-
- if (m->min < min_meta) {
- min_meta = m->min;
- }
- if (r->min < min_raw) {
- min_raw = r->min;
- }
- if (m->max > max_meta) {
- max_meta = m->max;
- }
- if (r->max > max_raw) {
- max_raw = r->max;
- }
-
- count_raw += r->count;
- count_meta += m->count;
- bytes_raw += r->bytes;
- bytes_meta += m->bytes;
- }
- if (count_raw > 0) {
- average_raw = (double)bytes_raw / (double)count_raw;
- }
- if (count_meta > 0) {
- average_meta = (double)bytes_meta / (double)count_meta;
- }
-
- /******************
- * PRINT OVERVIEW *
- ******************/
-
- HDfprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n", count_raw + count_meta, count_meta,
- count_raw);
- HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta,
- bytes_raw);
-
- if (count_raw + count_meta == 0) {
- goto done;
- }
-
- /*************************
- * PRINT AGGREGATE STATS *
- *************************/
-
- HDfprintf(stream, "SIZES meta raw\n");
- HDfprintf(stream, " min ");
- if (count_meta == 0) {
- HDfprintf(stream, " 0.000 ");
- }
- else {
- re_dub = (double)min_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
- re_dub /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
- }
-
- if (count_raw == 0) {
- HDfprintf(stream, " 0.000 \n");
- }
- else {
- re_dub = (double)min_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
- re_dub /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
- }
-
- HDfprintf(stream, " avg ");
- re_dub = (double)average_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
- re_dub /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
-
- re_dub = (double)average_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
- re_dub /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
-
- HDfprintf(stream, " max ");
- re_dub = (double)max_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
- re_dub /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
-
- re_dub = (double)max_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
- re_dub /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
-
- /******************************
- * PRINT INDIVIDUAL BIN STATS *
- ******************************/
-
- HDfprintf(stream, "BINS # of reads total bytes average size\n");
- HDfprintf(stream, " up-to meta raw meta raw meta raw\n");
-
- for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
- const hdfs_statsbin *m;
- const hdfs_statsbin *r;
- unsigned long long range_end = 0;
- char bm_suffix = ' '; /* bytes-meta */
- double bm_val = 0.0;
- char br_suffix = ' '; /* bytes-raw */
- double br_val = 0.0;
- char am_suffix = ' '; /* average-meta */
- double am_val = 0.0;
- char ar_suffix = ' '; /* average-raw */
- double ar_val = 0.0;
-
- m = &file->meta[i];
- r = &file->raw[i];
- if (r->count == 0 && m->count == 0) {
- continue;
- }
-
- range_end = hdfs_stats_boundaries[i];
-
- if (i == HDFS_STATS_BIN_COUNT) {
- range_end = hdfs_stats_boundaries[i - 1];
- HDfprintf(stream, ">");
- }
- else {
- HDfprintf(stream, " ");
- }
-
- bm_val = (double)m->bytes;
- for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) {
- bm_val /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- bm_suffix = suffixes[suffix_i];
-
- br_val = (double)r->bytes;
- for (suffix_i = 0; br_val >= 1024.0; suffix_i++) {
- br_val /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- br_suffix = suffixes[suffix_i];
-
- if (m->count > 0) {
- am_val = (double)(m->bytes) / (double)(m->count);
- }
- for (suffix_i = 0; am_val >= 1024.0; suffix_i++) {
- am_val /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- am_suffix = suffixes[suffix_i];
-
- if (r->count > 0) {
- ar_val = (double)(r->bytes) / (double)(r->count);
- }
- for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) {
- ar_val /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
- ar_suffix = suffixes[suffix_i];
-
- re_dub = (double)range_end;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
- re_dub /= 1024.0;
- }
- HDassert(suffix_i < sizeof(suffixes));
+}
- HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub,
- suffixes[suffix_i], /* bin ceiling */
- m->count, /* metadata reads */
- r->count, /* rawdata reads */
- bm_val, bm_suffix, /* metadata bytes */
- br_val, br_suffix, /* rawdata bytes */
- am_val, am_suffix, /* metadata average */
- ar_val, ar_suffix); /* rawdata average */
- fflush(stream);
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* hdfs_fprint_stats */
-#endif /* HDFS_STATS */
+#endif /* H5_HAVE_LIBHDFS */
diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h
index dd7b27e..cd8a893 100644
--- a/src/H5FDhdfs.h
+++ b/src/H5FDhdfs.h
@@ -22,11 +22,11 @@
#ifndef H5FDhdfs_H
#define H5FDhdfs_H
+#ifdef H5_HAVE_LIBHDFS
#define H5FD_HDFS (H5FD_hdfs_init())
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#else /* H5_HAVE_LIBHDFS */
+#define H5FD_HDFS (-1)
+#endif /* H5_HAVE_LIBHDFS */
/****************************************************************************
*
@@ -90,8 +90,6 @@ extern "C" {
* Programmer: Jacob Smith
* 2018-04-23
*
- * Changes: None
- *
****************************************************************************/
#define H5FD__CURR_HDFS_FAPL_T_VERSION 1
@@ -109,6 +107,10 @@ typedef struct H5FD_hdfs_fapl_t {
int32_t stream_buffer_size;
} H5FD_hdfs_fapl_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
H5_DLL hid_t H5FD_hdfs_init(void);
H5_DLL void H5FD_hdfs_term(void);
H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out);
diff --git a/src/H5FDint.c b/src/H5FDint.c
index 9313952..7ae710e 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5FDint.c
- * Jan 17 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5FDint.c
*
- * Purpose: Internal routine for VFD operations
+ * Purpose: Internal routine for VFD operations
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 155bfb6..beb08af 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Monday, April 17, 2000
*
* Purpose: The POSIX unbuffered file driver using only the HDF5 public
diff --git a/src/H5FDlog.h b/src/H5FDlog.h
index 4655bf6..d0c5e0c 100644
--- a/src/H5FDlog.h
+++ b/src/H5FDlog.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Monday, April 17, 2000
*
* Purpose: The public header file for the log driver.
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c
index 100c012..3215fd2 100644
--- a/src/H5FDmpi.c
+++ b/src/H5FDmpi.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, January 30, 2004
*
* Purpose: Common routines for all MPI-based VFL drivers.
diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h
index d33105e..f22cc67 100644
--- a/src/H5FDmpi.h
+++ b/src/H5FDmpi.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, January 30, 2004
*
* Purpose: The public header file for common items for all MPI VFL drivers
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index b086aab..83b800b 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Thursday, July 29, 1999
*
- * Purpose: This is the MPI-2 I/O driver.
+ * Purpose: This is the MPI-2 I/O driver.
*
*/
diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h
index c056ce5..597eec6 100644
--- a/src/H5FDmpio.h
+++ b/src/H5FDmpio.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the mpio driver.
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index b5826c4..1a5a5c0 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, November 10, 1997
*
* Purpose: Implements a file driver which dispatches I/O requests to
diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h
index 6c6e505..f93e2fa 100644
--- a/src/H5FDmulti.h
+++ b/src/H5FDmulti.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the "multi" driver.
diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h
index aef56f9..d480882 100644
--- a/src/H5FDpkg.h
+++ b/src/H5FDpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Thursday, January 3, 2008
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index 18fcfa2..f943108 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, July 26, 1999
*/
#ifndef _H5FDpublic_H
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index 002b858..13ced31 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -13,11 +13,13 @@
/*
* Read-Only S3 Virtual File Driver (VFD)
*
- * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * Programmer: Jacob Smith
* 2017-10-13
*
- * Purpose: Provide read-only access to files hosted on Amazon's S3 service.
- * Relies on "s3comms" utility layer to implement the AWS REST API.
+ * Purpose:
+ *
+ * Provide read-only access to files hosted on Amazon's S3 service.
+ * Relies on "s3comms" utility layer to implement the AWS REST API.
*/
/* Interface initialization */
@@ -305,8 +307,10 @@ H5FD_ros3_init_interface(void)
hid_t
H5FD_ros3_init(void)
{
- hid_t ret_value = H5I_INVALID_HID;
+ hid_t ret_value = H5I_INVALID_HID;
+#if ROS3_STATS
unsigned int bin_i;
+#endif
FUNC_ENTER_NOAPI(FAIL)
@@ -322,6 +326,7 @@ H5FD_ros3_init(void)
*/
for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;
+
ROS3_STATS_POW(bin_i, &value)
ros3_stats_boundaries[bin_i] = value;
}
@@ -390,7 +395,8 @@ H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa)
HDfprintf(stdout, "H5Pset_fapl_ros3() called.\n");
#endif
- if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
if (FAIL == H5FD_ros3_validate_config(fa))
@@ -403,12 +409,266 @@ done:
} /* end H5Pset_fapl_ros3() */
/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_validate_config()
+ *
+ * Purpose: Test to see if the supplied instance of H5FD_ros3_fapl_t
+ * contains internally consistant data. Return SUCCEED if so,
+ * and FAIL otherwise.
+ *
+ * Note the difference between internally consistant and
+ * correct. As we will have to try to access the target
+ * object to determine whether the supplied data is correct,
+ * we will settle for internal consistancy at this point
+ *
+ * Return: SUCCEED if instance of H5FD_ros3_fapl_t contains internally
+ * consistant data, FAIL otherwise.
+ *
+ * Programmer: Jacob Smith
+ * 9/10/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_validate_config(const H5FD_ros3_fapl_t *fa)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HDassert(fa != NULL);
+
+ if (fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version");
+
+ /* if set to authenticate, region and id cannot be empty strings */
+ if (fa->authenticate == TRUE)
+ if ((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0'))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Inconsistent authentication information");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_ros3_validate_config() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_fapl_ros3
+ *
+ * Purpose: Returns information about the ros3 file access property
+ * list though the function arguments.
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: John Mainzer
+ * 9/10/17
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out)
+{
+ const H5FD_ros3_fapl_t *fa = NULL;
+ H5P_genplist_t * plist = NULL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", fapl_id, fa_out);
+
+#if ROS3_DEBUG
+ HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n");
+#endif
+
+ if (fa_out == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
+
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if (plist == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
+
+ if (H5FD_ROS3 != H5P_get_driver(plist))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
+
+ fa = (const H5FD_ros3_fapl_t *)H5P_get_driver_info(plist);
+ if (fa == NULL)
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
+
+ /* Copy the ros3 fapl data out */
+ HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t));
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pget_fapl_ros3() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_fapl_get
+ *
+ * Purpose: Gets a file access property list which could be used to
+ * create an identical file.
+ *
+ * Return: Success: Ptr to new file access property list value.
+ *
+ * Failure: NULL
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_ros3_fapl_get(H5FD_t *_file)
+{
+ H5FD_ros3_t * file = (H5FD_ros3_t *)_file;
+ H5FD_ros3_fapl_t *fa = NULL;
+ void * ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ fa = (H5FD_ros3_fapl_t *)H5MM_calloc(sizeof(H5FD_ros3_fapl_t));
+ if (fa == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+
+ /* Copy the fields of the structure */
+ HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
+
+ /* Set return value */
+ ret_value = fa;
+
+done:
+ if (ret_value == NULL)
+ if (fa != NULL)
+ H5MM_xfree(fa);
+
+} /* end H5FD_ros3_fapl_get() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_fapl_copy
+ *
+ * Purpose: Copies the ros3-specific file access properties.
+ *
+ * Return: Success: Ptr to a new property list
+ *
+ * Failure: NULL
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_ros3_fapl_copy(const void *_old_fa)
+{
+ const H5FD_ros3_fapl_t *old_fa = (const H5FD_ros3_fapl_t *)_old_fa;
+ H5FD_ros3_fapl_t * new_fa = NULL;
+ void * ret_value = NULL;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ new_fa = (H5FD_ros3_fapl_t *)H5MM_malloc(sizeof(H5FD_ros3_fapl_t));
+ if (new_fa == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+
+ HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
+ ret_value = new_fa;
+
+done:
+ if (ret_value == NULL)
+ if (new_fa != NULL)
+ H5MM_xfree(new_fa);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_ros3_fapl_copy() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_ros3_fapl_free
+ *
+ * Purpose: Frees the ros3-specific file access properties.
+ *
+ * Return: SUCCEED (cannot fail)
+ *
+ * Programmer: John Mainzer
+ * 9/8/17
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_ros3_fapl_free(void *_fa)
+{
+ H5FD_ros3_fapl_t *fa = (H5FD_ros3_fapl_t *)_fa;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ HDassert(fa != NULL); /* sanity check */
+
+ H5MM_xfree(fa);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD_ros3_fapl_free() */
+
+#if ROS3_STATS
+/*----------------------------------------------------------------------------
+ *
+ * Function: ros3_reset_stats()
+ *
+ * Purpose:
+ *
+ * Reset the stats collection elements in this virtual file structure.
+ *
+ * Clears any set data in stats bins; initializes/zeroes values.
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - Occurs if the file is invalid somehow
+ *
+ * Programmer: Jacob Smith
+ * 2017-12-08
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+ros3_reset_stats(H5FD_ros3_t *file)
+{
+ unsigned i = 0;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#if ROS3_DEBUG
+ HDprintf("ros3_reset_stats() called\n");
+#endif
+
+ if (file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null");
+
+ for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ file->raw[i].bytes = 0;
+ file->raw[i].count = 0;
+ file->raw[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ file->raw[i].max = 0;
+
+ file->meta[i].bytes = 0;
+ file->meta[i].count = 0;
+ file->meta[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ file->meta[i].max = 0;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end ros3_reset_stats() */
+#endif /* ROS3_STATS */
+
+/*-------------------------------------------------------------------------
+ *
* Function: H5FD_ros3_open()
*
- * Purpose: Create and/or opens a file as an HDF5 file.
- * Any flag except H5F_ACC_RDONLY will cause an error.
+ * Purpose:
+ *
+ * Create and/or opens a file as an HDF5 file.
+ *
+ * Any flag except H5F_ACC_RDONLY will cause an error.
*
- * Name (as received from `H5FD_open()`) must conform to web url:
+ * Name (as received from `H5FD_open()`) must conform to web url:
* NAME :: HTTP "://" DOMAIN [PORT] ["/" [URI] [QUERY] ]
* HTTP :: "http" [ "s" ]
* DOMAIN :: e.g., "mybucket.host.org"
@@ -416,10 +676,13 @@ done:
* URI :: <string> (e.g., "path/to/resource.hd5" )
* QUERY :: "?" <string> (e.g., "arg1=param1&arg2=param2")
*
- * Return: Success: A pointer to a new file data structure.
- * The public fields will be initialized by the caller, which is
- * always H5FD_open().
- * Failure: NULL
+ * Return:
+ *
+ * Success: A pointer to a new file data structure.
+ * The public fields will be initialized by the caller, which is
+ * always H5FD_open().
+ *
+ * Failure: NULL
*
* Programmer: Jacob Smith
* 2017-11-02
@@ -475,27 +738,23 @@ H5FD_ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while writing iso8601 timestamp")
if (FAIL == H5FD_s3comms_signing_key(signing_key, (const char *)fa.secret_key,
- (const char *)fa.aws_region, (const char *)iso8601now)) {
+ (const char *)fa.aws_region, (const char *)iso8601now))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while computing signing key")
- }
handle = H5FD_s3comms_s3r_open(url, (const char *)fa.aws_region, (const char *)fa.secret_id,
(const unsigned char *)signing_key);
}
- else {
+ else
handle = H5FD_s3comms_s3r_open(url, NULL, NULL, NULL);
- } /* if/else should authenticate */
- if (handle == NULL) {
+ if (handle == NULL)
/* If we want to check CURL's say on the matter in a controlled
* fashion, this is the place to do it, but would need to make a
* few minor changes to s3comms `s3r_t` and `s3r_read()`.
*/
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open");
- }
- /* create new file struct
- */
+ /* create new file struct */
file = H5FL_CALLOC(H5FD_ros3_t);
if (file == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
@@ -512,19 +771,297 @@ H5FD_ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
done:
if (ret_value == NULL) {
- if (handle != NULL) {
+ if (handle != NULL)
if (FAIL == H5FD_s3comms_s3r_close(handle))
HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close s3 file handle")
- }
- if (file != NULL) {
+ if (file != NULL)
file = H5FL_FREE(H5FD_ros3_t, file);
- }
curl_global_cleanup(); /* early cleanup because open failed */
} /* end if null return value (error) */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_ros3_open() */
+#if ROS3_STATS
+/*----------------------------------------------------------------------------
+ *
+ * Function: ros3_fprint_stats()
+ *
+ * Purpose:
+ *
+ * Tabulate and pretty-print statistics for this virtual file.
+ *
+ * Should be called upon file close.
+ *
+ * Shows number of reads and bytes read, broken down by
+ * "raw" (H5FD_MEM_DRAW)
+ * or "meta" (any other flag)
+ *
+ * Prints filename and listing of total number of reads and bytes read,
+ * both as a grand total and separate meta- and rawdata reads.
+ *
+ * If any reads were done, prints out two tables:
+ *
+ * 1. overview of raw- and metadata reads
+ * - min (smallest size read)
+ * - average of size read
+ * - k,M,G suffixes by powers of 1024 (2^10)
+ * - max (largest size read)
+ * 2. tabulation of "bins", sepraring reads into exponentially-larger
+ * ranges of size.
+ * - columns for number of reads, total bytes, and average size, with
+ * separate sub-colums for raw- and metadata reads.
+ * - each row represents one bin, identified by the top of its range
+ *
+ * Bin ranges can be modified with pound-defines at the top of this file.
+ *
+ * Bins without any reads in their bounds are not printed.
+ *
+ * An "overflow" bin is also present, to catch "big" reads.
+ *
+ * Output for all bins (and range ceiling and average size report)
+ * is divied by powers of 1024. By corollary, four digits before the decimal
+ * is valid.
+ *
+ * - 41080 bytes is represented by 40.177k, not 41.080k
+ * - 1004.831M represents approx. 1052642000 bytes
+ *
+ * Return:
+ *
+ * - SUCCESS: `SUCCEED`
+ * - FAILURE: `FAIL`
+ * - occurs if the file passed in is invalid
+ * - TODO: if stream is invalid? how can we check this?
+ *
+ * Programmer: Jacob Smith
+ *
+ *----------------------------------------------------------------------------
+ */
+static herr_t
+ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
+{
+ herr_t ret_value = SUCCEED;
+ parsed_url_t * purl = NULL;
+ unsigned i = 0;
+ unsigned long count_meta = 0;
+ unsigned long count_raw = 0;
+ double average_meta = 0.0;
+ double average_raw = 0.0;
+ unsigned long long min_meta = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ unsigned long long min_raw = (unsigned long long)ROS3_STATS_STARTING_MIN;
+ unsigned long long max_meta = 0;
+ unsigned long long max_raw = 0;
+ unsigned long long bytes_raw = 0;
+ unsigned long long bytes_meta = 0;
+ double re_dub = 0.0; /* re-usable double variable */
+ unsigned suffix_i = 0;
+ const char suffixes[] = {' ', 'K', 'M', 'G', 'T', 'P'};
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ if (stream == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null");
+ if (file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null");
+ if (file->s3r_handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "s3 request handle cannot be null");
+ if (file->s3r_handle->purl == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "parsed url structure cannot be null");
+ purl = file->s3r_handle->purl;
+
+ /******************
+ * PRINT FILENAME *
+ ******************/
+
+ HDfprintf(stream, "stats for %s://%s", purl->scheme, purl->host);
+ if (purl->port != NULL && purl->port[0] != '\0')
+ HDfprintf(stream, ":%s", purl->port);
+ if (purl->query != NULL && purl->query[0] != '\0') {
+ if (purl->path != NULL && purl->path[0] != '\0')
+ HDfprintf(stream, "/%s", purl->path);
+ else
+ HDfprintf(stream, "/");
+ HDfprintf(stream, "?%s", purl->query);
+ }
+ else if (purl->path != NULL && purl->path[0] != '\0') {
+ HDfprintf(stream, "/%s", purl->path);
+ }
+ HDfprintf(stream, "\n");
+
+ /*******************
+ * AGGREGATE STATS *
+ *******************/
+
+ for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ const ros3_statsbin *r = &file->raw[i];
+ const ros3_statsbin *m = &file->meta[i];
+
+ if (m->min < min_meta)
+ min_meta = m->min;
+ if (r->min < min_raw)
+ min_raw = r->min;
+ if (m->max > max_meta)
+ max_meta = m->max;
+ if (r->max > max_raw)
+ max_raw = r->max;
+
+ count_raw += r->count;
+ count_meta += m->count;
+ bytes_raw += r->bytes;
+ bytes_meta += m->bytes;
+ }
+ if (count_raw > 0)
+ average_raw = (double)bytes_raw / (double)count_raw;
+ if (count_meta > 0)
+ average_meta = (double)bytes_meta / (double)count_meta;
+
+ /******************
+ * PRINT OVERVIEW *
+ ******************/
+
+ HDfprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n", count_raw + count_meta, count_meta,
+ count_raw);
+ HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta,
+ bytes_raw);
+
+ if (count_raw + count_meta == 0)
+ goto done;
+
+ /*************************
+ * PRINT AGGREGATE STATS *
+ *************************/
+
+ HDfprintf(stream, "SIZES meta raw\n");
+ HDfprintf(stream, " min ");
+ if (count_meta == 0)
+ HDfprintf(stream, " 0.000 ");
+ else {
+ re_dub = (double)min_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+ }
+
+ if (count_raw == 0)
+ HDfprintf(stream, " 0.000 \n");
+ else {
+ re_dub = (double)min_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+ }
+
+ HDfprintf(stream, " avg ");
+ re_dub = (double)average_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)average_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ HDfprintf(stream, " max ");
+ re_dub = (double)max_meta;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
+
+ re_dub = (double)max_raw;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
+
+ /******************************
+ * PRINT INDIVIDUAL BIN STATS *
+ ******************************/
+
+ HDfprintf(stream, "BINS # of reads total bytes average size\n");
+ HDfprintf(stream, " up-to meta raw meta raw meta raw\n");
+
+ for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ const ros3_statsbin *m;
+ const ros3_statsbin *r;
+ unsigned long long range_end = 0;
+ char bm_suffix = ' '; /* bytes-meta */
+ double bm_val = 0.0;
+ char br_suffix = ' '; /* bytes-raw */
+ double br_val = 0.0;
+ char am_suffix = ' '; /* average-meta */
+ double am_val = 0.0;
+ char ar_suffix = ' '; /* average-raw */
+ double ar_val = 0.0;
+
+ m = &file->meta[i];
+ r = &file->raw[i];
+ if (r->count == 0 && m->count == 0)
+ continue;
+
+ range_end = ros3_stats_boundaries[i];
+
+ if (i == ROS3_STATS_BIN_COUNT) {
+ range_end = ros3_stats_boundaries[i - 1];
+ HDfprintf(stream, ">");
+ }
+ else
+ HDfprintf(stream, " ");
+
+ bm_val = (double)m->bytes;
+ for (suffix_i = 0; bm_val >= 1024.0; suffix_i++)
+ bm_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ bm_suffix = suffixes[suffix_i];
+
+ br_val = (double)r->bytes;
+ for (suffix_i = 0; br_val >= 1024.0; suffix_i++)
+ br_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ br_suffix = suffixes[suffix_i];
+
+ if (m->count > 0)
+ am_val = (double)(m->bytes) / (double)(m->count);
+ for (suffix_i = 0; am_val >= 1024.0; suffix_i++)
+ am_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ am_suffix = suffixes[suffix_i];
+
+ if (r->count > 0)
+ ar_val = (double)(r->bytes) / (double)(r->count);
+ for (suffix_i = 0; ar_val >= 1024.0; suffix_i++)
+ ar_val /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+ ar_suffix = suffixes[suffix_i];
+
+ re_dub = (double)range_end;
+ for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ re_dub /= 1024.0;
+ HDassert(suffix_i < sizeof(suffixes));
+
+ HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub,
+ suffixes[suffix_i], /* bin ceiling */
+ m->count, /* metadata reads */
+ r->count, /* rawdata reads */
+ bm_val, bm_suffix, /* metadata bytes */
+ br_val, br_suffix, /* rawdata bytes */
+ am_val, am_suffix, /* metadata average */
+ ar_val, ar_suffix); /* rawdata average */
+
+ HDfflush(stream);
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+
+} /* ros3_fprint_stats */
+#endif /* ROS3_STATS */
+
/*-------------------------------------------------------------------------
*
* Function: H5FD_ros3_close()
@@ -554,33 +1091,28 @@ H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
HDfprintf(stdout, "H5FD_ros3_close() called.\n");
#endif
- /* Sanity checks
- */
+ /* Sanity checks */
HDassert(file != NULL);
HDassert(file->s3r_handle != NULL);
/* Close the underlying request handle
*/
- if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) {
+ if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle))
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle")
- }
#if ROS3_STATS
/* TODO: mechanism to re-target stats printout */
- if (ros3_fprint_stats(stdout, file) == FAIL) {
+ if (ros3_fprint_stats(stdout, file) == FAIL)
HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics")
- }
#endif /* ROS3_STATS */
- /* Release the file info
- */
+ /* Release the file info */
file = H5FL_FREE(H5FD_ros3_t, file);
done:
curl_global_cleanup(); /* cleanup to answer init on open */
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD_ros3_close() */
/*-------------------------------------------------------------------------
@@ -641,96 +1173,75 @@ H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
HDassert(purl2->host != NULL);
/* URL: SCHEME */
- if (HDstrcmp(purl1->scheme, purl2->scheme)) {
- HGOTO_DONE(-1);
- }
+ if (HDstrcmp(purl1->scheme, purl2->scheme))
+ HGOTO_DONE(-1)
/* URL: HOST */
- if (HDstrcmp(purl1->host, purl2->host)) {
- HGOTO_DONE(-1);
- }
+ if (HDstrcmp(purl1->host, purl2->host))
+ HGOTO_DONE(-1)
/* URL: PORT */
if (purl1->port && purl2->port) {
- if (HDstrcmp(purl1->port, purl2->port)) {
- HGOTO_DONE(-1);
- }
- }
- else if (purl1->port) {
- HGOTO_DONE(-1);
- }
- else if (purl2->port) {
- HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->port, purl2->port))
+ HGOTO_DONE(-1)
}
+ else if (purl1->port)
+ HGOTO_DONE(-1)
+ else if (purl2->port)
+ HGOTO_DONE(-1)
/* URL: PATH */
if (purl1->path && purl2->path) {
- if (HDstrcmp(purl1->path, purl2->path)) {
- HGOTO_DONE(-1);
- }
- }
- else if (purl1->path && !purl2->path) {
- HGOTO_DONE(-1);
- }
- else if (purl2->path && !purl1->path) {
- HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->path, purl2->path))
+ HGOTO_DONE(-1)
}
+ else if (purl1->path && !purl2->path)
+ HGOTO_DONE(-1)
+ else if (purl2->path && !purl1->path)
+ HGOTO_DONE(-1)
/* URL: QUERY */
if (purl1->query && purl2->query) {
- if (HDstrcmp(purl1->query, purl2->query)) {
- HGOTO_DONE(-1);
- }
- }
- else if (purl1->query && !purl2->query) {
- HGOTO_DONE(-1);
- }
- else if (purl2->query && !purl1->query) {
- HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->query, purl2->query))
+ HGOTO_DONE(-1)
}
+ else if (purl1->query && !purl2->query)
+ HGOTO_DONE(-1)
+ else if (purl2->query && !purl1->query)
+ HGOTO_DONE(-1)
/* FAPL: AWS_REGION */
- if (f1->fa.aws_region[0] != '\0' && f1->fa.aws_region[0] != '\0') {
- if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) {
- HGOTO_DONE(-1);
- }
- }
- else if (f1->fa.aws_region[0] != '\0') {
- HGOTO_DONE(-1);
- }
- else if (f2->fa.aws_region[0] != '\0') {
- HGOTO_DONE(-1);
+ if (f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') {
+ if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region))
+ HGOTO_DONE(-1)
}
+ else if (f1->fa.aws_region[0] != '\0')
+ HGOTO_DONE(-1)
+ else if (f2->fa.aws_region[0] != '\0')
+ HGOTO_DONE(-1)
/* FAPL: SECRET_ID */
- if (f1->fa.secret_id[0] != '\0' && f1->fa.secret_id[0] != '\0') {
- if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) {
- HGOTO_DONE(-1);
- }
- }
- else if (f1->fa.secret_id[0] != '\0') {
- HGOTO_DONE(-1);
- }
- else if (f2->fa.secret_id[0] != '\0') {
- HGOTO_DONE(-1);
+ if (f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') {
+ if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id))
+ HGOTO_DONE(-1)
}
+ else if (f1->fa.secret_id[0] != '\0')
+ HGOTO_DONE(-1)
+ else if (f2->fa.secret_id[0] != '\0')
+ HGOTO_DONE(-1)
/* FAPL: SECRET_KEY */
- if (f1->fa.secret_key[0] != '\0' && f1->fa.secret_key[0] != '\0') {
- if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) {
- HGOTO_DONE(-1);
- }
- }
- else if (f1->fa.secret_key[0] != '\0') {
- HGOTO_DONE(-1);
- }
- else if (f2->fa.secret_key[0] != '\0') {
- HGOTO_DONE(-1);
+ if (f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') {
+ if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key))
+ HGOTO_DONE(-1)
}
+ else if (f1->fa.secret_key[0] != '\0')
+ HGOTO_DONE(-1)
+ else if (f2->fa.secret_key[0] != '\0')
+ HGOTO_DONE(-1)
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5FD_ros3_cmp() */
/*-------------------------------------------------------------------------
@@ -769,7 +1280,6 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-
} /* H5FD_ros3_query() */
/*-------------------------------------------------------------------------
@@ -803,7 +1313,6 @@ H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
#endif
FUNC_LEAVE_NOAPI(file->eoa)
-
} /* end H5FD_ros3_get_eoa() */
/*-------------------------------------------------------------------------
@@ -837,7 +1346,6 @@ H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-
} /* H5FD_ros3_set_eoa() */
/*-------------------------------------------------------------------------
@@ -870,7 +1378,6 @@ H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
#endif
FUNC_LEAVE_NOAPI(H5FD_s3comms_s3r_get_filesize(file->s3r_handle))
-
} /* end H5FD_ros3_get_eof() */
/*-------------------------------------------------------------------------
@@ -902,15 +1409,13 @@ H5FD_ros3_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handl
HDfprintf(stdout, "H5FD_ros3_get_handle() called.\n");
#endif
- if (!file_handle) {
+ if (!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
- }
*file_handle = file->s3r_handle;
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD_ros3_get_handle() */
/*-------------------------------------------------------------------------
@@ -936,10 +1441,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t addr, /* start offset */
- size_t size, /* length of read */
- void * buf) /* out */
+H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
+ size_t size, void *buf)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
size_t filesize = 0;
@@ -962,38 +1465,30 @@ H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle);
- if ((addr > filesize) || ((addr + size) > filesize)) {
+ if ((addr > filesize) || ((addr + size) > filesize))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address")
- }
- if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) {
+ if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read")
- }
#if ROS3_STATS
- /* Find which "bin" this read fits in. Can be "overflow" bin.
- */
- for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
- if ((unsigned long long)size < ros3_stats_boundaries[bin_i]) {
+ /* Find which "bin" this read fits in. Can be "overflow" bin. */
+ for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++)
+ if ((unsigned long long)size < ros3_stats_boundaries[bin_i])
break;
- }
- }
bin = (type == H5FD_MEM_DRAW) ? &file->raw[bin_i] : &file->meta[bin_i];
- /* Store collected stats in appropriate bin
- */
+ /* Store collected stats in appropriate bin */
if (bin->count == 0) {
bin->min = size;
bin->max = size;
}
else {
- if (size < bin->min) {
+ if (size < bin->min)
bin->min = size;
- }
- if (size > bin->max) {
+ if (size > bin->max)
bin->max = size;
- }
}
bin->count++;
bin->bytes += (unsigned long long)size;
@@ -1002,7 +1497,6 @@ H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD_ros3_read() */
/*-------------------------------------------------------------------------
@@ -1039,7 +1533,6 @@ H5FD_ros3_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hi
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5FD_ros3_write() */
/*-------------------------------------------------------------------------
@@ -1077,7 +1570,6 @@ H5FD_ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, h
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD_ros3_truncate() */
/*-------------------------------------------------------------------------
@@ -1105,8 +1597,8 @@ static herr_t
H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_ros3_lock() */
/*-------------------------------------------------------------------------
@@ -1131,575 +1623,8 @@ static herr_t
H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_unlock() */
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_validate_config()
- *
- * Purpose: Test to see if the supplied instance of H5FD_ros3_fapl_t
- * contains internally consistant data. Return SUCCEED if so,
- * and FAIL otherwise.
- *
- * Note the difference between internally consistant and
- * correct. As we will have to try to access the target
- * object to determine whether the supplied data is correct,
- * we will settle for internal consistancy at this point
- *
- * Return: SUCCEED if instance of H5FD_ros3_fapl_t contains internally
- * consistant data, FAIL otherwise.
- *
- * Programmer: Jacob Smith
- * 9/10/17
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_ros3_validate_config(const H5FD_ros3_fapl_t *fa)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- HDassert(fa != NULL);
-
- if (fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version");
- }
-
- /* if set to authenticate, region and id cannot be empty strings
- */
- if (fa->authenticate == TRUE) {
- if ((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0')) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Inconsistent authentication information");
- }
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_validate_config() */
-
-/*-------------------------------------------------------------------------
- * Function: H5Pget_fapl_ros3
- *
- * Purpose: Returns information about the ros3 file access property
- * list though the function arguments.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: John Mainzer
- * 9/10/17
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out)
-{
- const H5FD_ros3_fapl_t *fa = NULL;
- H5P_genplist_t * plist = NULL;
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*x", fapl_id, fa_out);
-
-#if ROS3_DEBUG
- HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n");
-#endif
-
- if (fa_out == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
- }
-
- plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- }
-
- if (H5FD_ROS3 != H5P_get_driver(plist)) {
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
- }
-
- fa = (const H5FD_ros3_fapl_t *)H5P_get_driver_info(plist);
- if (fa == NULL) {
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
- }
-
- /* Copy the ros3 fapl data out */
- HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t));
-
-done:
- FUNC_LEAVE_API(ret_value)
-
-} /* end H5Pget_fapl_ros3() */
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_get
- *
- * Purpose: Gets a file access property list which could be used to
- * create an identical file.
- *
- * Return: Success: Ptr to new file access property list value.
- *
- * Failure: NULL
- *
- * Programmer: John Mainzer
- * 9/8/17
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5FD_ros3_fapl_get(H5FD_t *_file)
-{
- H5FD_ros3_t * file = (H5FD_ros3_t *)_file;
- H5FD_ros3_fapl_t *fa = NULL;
- void * ret_value = NULL;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- fa = (H5FD_ros3_fapl_t *)H5MM_calloc(sizeof(H5FD_ros3_fapl_t));
- if (fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- }
-
- /* Copy the fields of the structure */
- HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
-
- /* Set return value */
- ret_value = fa;
-
-done:
- if (ret_value == NULL) {
- if (fa != NULL) {
- H5MM_xfree(fa);
- }
- }
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_fapl_get() */
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_copy
- *
- * Purpose: Copies the ros3-specific file access properties.
- *
- * Return: Success: Ptr to a new property list
- *
- * Failure: NULL
- *
- * Programmer: John Mainzer
- * 9/8/17
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5FD_ros3_fapl_copy(const void *_old_fa)
-{
- const H5FD_ros3_fapl_t *old_fa = (const H5FD_ros3_fapl_t *)_old_fa;
- H5FD_ros3_fapl_t * new_fa = NULL;
- void * ret_value = NULL;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- new_fa = (H5FD_ros3_fapl_t *)H5MM_malloc(sizeof(H5FD_ros3_fapl_t));
- if (new_fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
- }
-
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
- ret_value = new_fa;
-
-done:
- if (ret_value == NULL) {
- if (new_fa != NULL) {
- H5MM_xfree(new_fa);
- }
- }
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_fapl_copy() */
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_free
- *
- * Purpose: Frees the ros3-specific file access properties.
- *
- * Return: SUCCEED (cannot fail)
- *
- * Programmer: John Mainzer
- * 9/8/17
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_ros3_fapl_free(void *_fa)
-{
- H5FD_ros3_fapl_t *fa = (H5FD_ros3_fapl_t *)_fa;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- HDassert(fa != NULL); /* sanity check */
-
- H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_fapl_free() */
-
-#if ROS3_STATS
-
-/*----------------------------------------------------------------------------
- *
- * Function: ros3_reset_stats()
- *
- * Purpose:
- *
- * Reset the stats collection elements in this virtual file structure.
- *
- * Clears any set data in stats bins; initializes/zeroes values.
- *
- * Return:
- *
- * - SUCCESS: `SUCCEED`
- * - FAILURE: `FAIL`
- * - Occurs if the file is invalid somehow
- *
- * Programmer: Jacob Smith
- * 2017-12-08
- *
- *----------------------------------------------------------------------------
- */
-static herr_t
-ros3_reset_stats(H5FD_ros3_t *file)
-{
- unsigned i = 0;
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if ROS3_DEBUG
- HDprintf("ros3_reset_stats() called\n");
-#endif
-
- if (file == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null");
- }
-
- for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
- file->raw[i].bytes = 0;
- file->raw[i].count = 0;
- file->raw[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN;
- file->raw[i].max = 0;
-
- file->meta[i].bytes = 0;
- file->meta[i].count = 0;
- file->meta[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN;
- file->meta[i].max = 0;
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-
-} /* end ros3_reset_stats() */
-
-#endif /* ROS3_STATS */
-#if ROS3_STATS
-
-/*----------------------------------------------------------------------------
- *
- * Function: ros3_fprint_stats()
- *
- * Purpose:
- *
- * Tabulate and pretty-print statistics for this virtual file.
- *
- * Should be called upon file close.
- *
- * Shows number of reads and bytes read, broken down by
- * "raw" (H5FD_MEM_DRAW)
- * or "meta" (any other flag)
- *
- * Prints filename and listing of total number of reads and bytes read,
- * both as a grand total and separate meta- and rawdata reads.
- *
- * If any reads were done, prints out two tables:
- *
- * 1. overview of raw- and metadata reads
- * - min (smallest size read)
- * - average of size read
- * - k,M,G suffixes by powers of 1024 (2^10)
- * - max (largest size read)
- * 2. tabulation of "bins", sepraring reads into exponentially-larger
- * ranges of size.
- * - columns for number of reads, total bytes, and average size, with
- * separate sub-colums for raw- and metadata reads.
- * - each row represents one bin, identified by the top of its range
- *
- * Bin ranges can be modified with pound-defines at the top of this file.
- *
- * Bins without any reads in their bounds are not printed.
- *
- * An "overflow" bin is also present, to catch "big" reads.
- *
- * Output for all bins (and range ceiling and average size report)
- * is divied by powers of 1024. By corollary, four digits before the decimal
- * is valid.
- *
- * - 41080 bytes is represented by 40.177k, not 41.080k
- * - 1004.831M represents approx. 1052642000 bytes
- *
- * Return:
- *
- * - SUCCESS: `SUCCEED`
- * - FAILURE: `FAIL`
- * - occurs if the file passed in is invalid
- * - TODO: if stream is invalid? how can we check this?
- *
- * Programmer: Jacob Smith
- *
- *----------------------------------------------------------------------------
- */
-static herr_t
-ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
-{
- herr_t ret_value = SUCCEED;
- parsed_url_t * purl = NULL;
- unsigned i = 0;
- unsigned long count_meta = 0;
- unsigned long count_raw = 0;
- double average_meta = 0.0;
- double average_raw = 0.0;
- unsigned long long min_meta = (unsigned long long)ROS3_STATS_STARTING_MIN;
- unsigned long long min_raw = (unsigned long long)ROS3_STATS_STARTING_MIN;
- unsigned long long max_meta = 0;
- unsigned long long max_raw = 0;
- unsigned long long bytes_raw = 0;
- unsigned long long bytes_meta = 0;
- double re_dub = 0.0; /* re-usable double variable */
- unsigned suffix_i = 0;
- const char suffixes[] = {' ', 'K', 'M', 'G', 'T', 'P'};
-
- FUNC_ENTER_NOAPI_NOINIT
-
- if (stream == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null");
- }
- if (file == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null");
- }
- if (file->s3r_handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "s3 request handle cannot be null");
- }
- if (file->s3r_handle->purl == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "parsed url structure cannot be null");
- }
- purl = file->s3r_handle->purl;
-
- /******************
- * PRINT FILENAME *
- ******************/
-
- HDfprintf(stream, "stats for %s://%s", purl->scheme, purl->host);
- if (purl->port != NULL && purl->port[0] != '\0')
- HDfprintf(stream, ":%s", purl->port);
- if (purl->query != NULL && purl->query[0] != '\0') {
- if (purl->path != NULL && purl->path[0] != '\0')
- HDfprintf(stream, "/%s", purl->path);
- else
- HDfprintf(stream, "/");
- HDfprintf(stream, "?%s", purl->query);
- }
- else if (purl->path != NULL && purl->path[0] != '\0') {
- HDfprintf(stream, "/%s", purl->path);
- }
- HDfprintf(stream, "\n");
-
- /*******************
- * AGGREGATE STATS *
- *******************/
-
- for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
- const ros3_statsbin *r = &file->raw[i];
- const ros3_statsbin *m = &file->meta[i];
-
- if (m->min < min_meta)
- min_meta = m->min;
- if (r->min < min_raw)
- min_raw = r->min;
- if (m->max > max_meta)
- max_meta = m->max;
- if (r->max > max_raw)
- max_raw = r->max;
-
- count_raw += r->count;
- count_meta += m->count;
- bytes_raw += r->bytes;
- bytes_meta += m->bytes;
- }
- if (count_raw > 0)
- average_raw = (double)bytes_raw / (double)count_raw;
- if (count_meta > 0)
- average_meta = (double)bytes_meta / (double)count_meta;
-
- /******************
- * PRINT OVERVIEW *
- ******************/
-
- HDfprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n", count_raw + count_meta, count_meta,
- count_raw);
- HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta,
- bytes_raw);
-
- if (count_raw + count_meta == 0)
- goto done;
-
- /*************************
- * PRINT AGGREGATE STATS *
- *************************/
-
- HDfprintf(stream, "SIZES meta raw\n");
- HDfprintf(stream, " min ");
- if (count_meta == 0) {
- HDfprintf(stream, " 0.000 ");
- }
- else {
- re_dub = (double)min_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
- re_dub /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
- }
-
- if (count_raw == 0) {
- HDfprintf(stream, " 0.000 \n");
- }
- else {
- re_dub = (double)min_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
- re_dub /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
- }
-
- HDfprintf(stream, " avg ");
- re_dub = (double)average_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
- re_dub /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
-
- re_dub = (double)average_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
- re_dub /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
-
- HDfprintf(stream, " max ");
- re_dub = (double)max_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
- re_dub /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
-
- re_dub = (double)max_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
- re_dub /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
-
- /******************************
- * PRINT INDIVIDUAL BIN STATS *
- ******************************/
-
- HDfprintf(stream, "BINS # of reads total bytes average size\n");
- HDfprintf(stream, " up-to meta raw meta raw meta raw\n");
-
- for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
- const ros3_statsbin *m;
- const ros3_statsbin *r;
- unsigned long long range_end = 0;
- char bm_suffix = ' '; /* bytes-meta */
- double bm_val = 0.0;
- char br_suffix = ' '; /* bytes-raw */
- double br_val = 0.0;
- char am_suffix = ' '; /* average-meta */
- double am_val = 0.0;
- char ar_suffix = ' '; /* average-raw */
- double ar_val = 0.0;
-
- m = &file->meta[i];
- r = &file->raw[i];
- if (r->count == 0 && m->count == 0)
- continue;
-
- range_end = ros3_stats_boundaries[i];
-
- if (i == ROS3_STATS_BIN_COUNT) {
- range_end = ros3_stats_boundaries[i - 1];
- HDfprintf(stream, ">");
- }
- else {
- HDfprintf(stream, " ");
- }
-
- bm_val = (double)m->bytes;
- for (suffix_i = 0; bm_val >= 1024.0; suffix_i++)
- bm_val /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- bm_suffix = suffixes[suffix_i];
-
- br_val = (double)r->bytes;
- for (suffix_i = 0; br_val >= 1024.0; suffix_i++)
- br_val /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- br_suffix = suffixes[suffix_i];
-
- if (m->count > 0)
- am_val = (double)(m->bytes) / (double)(m->count);
- for (suffix_i = 0; am_val >= 1024.0; suffix_i++)
- am_val /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- am_suffix = suffixes[suffix_i];
-
- if (r->count > 0)
- ar_val = (double)(r->bytes) / (double)(r->count);
- for (suffix_i = 0; ar_val >= 1024.0; suffix_i++)
- ar_val /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
- ar_suffix = suffixes[suffix_i];
-
- re_dub = (double)range_end;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
- re_dub /= 1024.0;
- HDassert(suffix_i < sizeof(suffixes));
-
- HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub,
- suffixes[suffix_i], /* bin ceiling */
- m->count, /* metadata reads */
- r->count, /* rawdata reads */
- bm_val, bm_suffix, /* metadata bytes */
- br_val, br_suffix, /* rawdata bytes */
- am_val, am_suffix, /* metadata average */
- ar_val, ar_suffix); /* rawdata average */
-
- fflush(stream);
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-
-} /* ros3_fprint_stats */
-#endif /* ROS3_STATS */
+} /* end H5FD_ros3_unlock() */
#endif /* H5_HAVE_ROS3_VFD */
diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c
index 378791c..4a0c007 100644
--- a/src/H5FDs3comms.c
+++ b/src/H5FDs3comms.c
@@ -111,20 +111,26 @@ herr_t H5FD_s3comms_s3r_getsize(s3r_t *handle);
/*************/
/*----------------------------------------------------------------------------
+ *
* Function: curlwritecallback()
*
* Purpose:
+ *
* Function called by CURL to write received data.
+ *
* Writes bytes to `userdata`.
+ *
* Internally manages number of bytes processed.
*
* Return:
+ *
* - Number of bytes processed.
* - Should equal number of bytes passed to callback.
* - Failure will result in curl error: CURLE_WRITE_ERROR.
*
* Programmer: Jacob Smith
* 2017-08-17
+ *
*----------------------------------------------------------------------------
*/
size_t
@@ -147,10 +153,13 @@ curlwritecallback(char *ptr, size_t size, size_t nmemb, void *userdata)
} /* end curlwritecallback() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_hrb_node_set()
*
* Purpose:
+ *
* Create, insert, modify, and remove elements in a field node list.
+ *
* `name` cannot be null; will return FAIL and list will be unaltered.
*
* Entries are accessed via the lowercase representation of their name:
@@ -162,6 +171,7 @@ curlwritecallback(char *ptr, size_t size, size_t nmemb, void *userdata)
* - NULL, if list is empty
*
* Types of operations:
+ *
* - CREATE
* - If `L` is NULL and `name` and `value` are not NULL,
* a new node is created at `L`, starting a list.
@@ -182,6 +192,7 @@ curlwritecallback(char *ptr, size_t size, size_t nmemb, void *userdata)
* alphabetically by lowercase name.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - List was successfully modified
* - FAILURE: `FAIL`
@@ -191,6 +202,7 @@ curlwritecallback(char *ptr, size_t size, size_t nmemb, void *userdata)
*
* Programmer: Jacob Smith
* 2017-09-22
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -210,39 +222,37 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
FUNC_ENTER_NOAPI_NOINIT
#if S3COMMS_DEBUG
- HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.\n");
+ HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.");
HDprintf("NAME: %s\n", name);
HDprintf("VALUE: %s\n", value);
HDprintf("LIST:\n->");
- for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) {
+ for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next)
HDfprintf(stdout, "{%s}\n->", node_ptr->cat);
- }
HDprintf("(null)\n");
- fflush(stdout);
+ HDfflush(stdout);
node_ptr = NULL;
#endif
if (name == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to operate on null name.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to operate on null name");
namelen = HDstrlen(name);
/***********************
* PREPARE ALL STRINGS *
**********************/
- /* copy and lowercase name */
+ /* copy and lowercase name
+ */
lowername = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
if (lowername == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy.\n");
-
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy.");
for (i = 0; i < namelen; i++)
- lowername[i] = (char)tolower((int)name[i]);
-
+ lowername[i] = (char)HDtolower((int)name[i]);
lowername[namelen] = 0;
/* If value supplied, copy name, value, and concatenated "name: value".
- * If NULL, we will be removing a node or doing nothing, so no need for copies
+ * If NULL, we will be removing a node or doing nothing, so no need for
+ * copies
*/
if (value != NULL) {
int ret = 0;
@@ -252,30 +262,27 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
if (namecpy == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy.\n");
-
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy.");
HDmemcpy(namecpy, name, (namelen + 1));
valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1));
if (valuecpy == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy.\n");
-
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy.");
HDmemcpy(valuecpy, value, (valuelen + 1));
nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite);
if (nvcat == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for concatenated string.\n");
-
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for concatenated string.");
ret = HDsnprintf(nvcat, catwrite, "%s: %s", name, value);
if (ret < 0 || (size_t)ret > catlen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot concatenate `%s: %s", name, value);
-
HDassert(catlen == HDstrlen(nvcat));
- /* create new_node, should we need it */
+ /* create new_node, should we need it
+ */
new_node = (hrb_node_t *)H5MM_malloc(sizeof(hrb_node_t));
if (new_node == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for new set.\n");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for new set.");
new_node->magic = S3COMMS_HRB_NODE_MAGIC;
new_node->name = NULL;
@@ -290,13 +297,12 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
***************/
if (*L == NULL) {
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list")
else {
#if S3COMMS_DEBUG
HDprintf("CREATE NEW\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* CREATE NEW LIST *
@@ -312,60 +318,64 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
}
}
- /* sanity-check pointer passed in */
+ /* sanity-check pointer passed in
+ */
HDassert((*L) != NULL);
HDassert((*L)->magic == S3COMMS_HRB_NODE_MAGIC);
node_ptr = (*L);
- /* Check whether to modify/remove first node in list */
- if (strcmp(lowername, node_ptr->lowername) == 0) {
+ /* Check whether to modify/remove first node in list
+ */
+ if (HDstrcmp(lowername, node_ptr->lowername) == 0) {
+
is_looking = FALSE;
if (value == NULL) {
#if S3COMMS_DEBUG
HDprintf("REMOVE HEAD\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/***************
* REMOVE HEAD *
***************/
+
*L = node_ptr->next;
#if S3COMMS_DEBUG
HDprintf("FREEING CAT (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->cat);
#if S3COMMS_DEBUG
HDprintf("FREEING LOWERNAME (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->lowername);
#if S3COMMS_DEBUG
HDprintf("FREEING NAME (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->name);
#if S3COMMS_DEBUG
HDprintf("FREEING VALUE (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->value);
#if S3COMMS_DEBUG
HDprintf("MAGIC OK? %s\n", (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO");
- fflush(stdout);
+ HDfflush(stdout);
#endif
HDassert(node_ptr->magic == S3COMMS_HRB_NODE_MAGIC);
node_ptr->magic += 1ul;
#if S3COMMS_DEBUG
HDprintf("FREEING POINTER\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr);
#if S3COMMS_DEBUG
HDprintf("FREEING WORKING LOWERNAME\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(lowername);
lowername = NULL;
@@ -373,7 +383,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
else {
#if S3COMMS_DEBUG
HDprintf("MODIFY HEAD\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/***************
* MODIFY HEAD *
@@ -394,20 +404,21 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
new_node = NULL;
}
}
- else if (strcmp(lowername, node_ptr->lowername) < 0) {
+ else if (HDstrcmp(lowername, node_ptr->lowername) < 0) {
+
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head")
else {
#if S3COMMS_DEBUG
HDprintf("PREPEND NEW HEAD\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* INSERT NEW HEAD *
*******************/
+
new_node->name = namecpy;
new_node->value = valuecpy;
new_node->lowername = lowername;
@@ -420,23 +431,24 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
/***************
* SEARCH LIST *
***************/
+
while (is_looking) {
if (node_ptr->next == NULL) {
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node")
else {
#if S3COMMS_DEBUG
HDprintf("APPEND A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* APPEND NEW NODE *
*******************/
- HDassert(strcmp(lowername, node_ptr->lowername) > 0);
+
+ HDassert(HDstrcmp(lowername, node_ptr->lowername) > 0);
new_node->name = namecpy;
new_node->value = valuecpy;
new_node->lowername = lowername;
@@ -444,21 +456,22 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
node_ptr->next = new_node;
}
}
- else if (strcmp(lowername, node_ptr->next->lowername) < 0) {
+ else if (HDstrcmp(lowername, node_ptr->next->lowername) < 0) {
+
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node")
else {
#if S3COMMS_DEBUG
HDprintf("INSERT A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* INSERT NEW NODE *
*******************/
- HDassert(strcmp(lowername, node_ptr->lowername) > 0);
+
+ HDassert(HDstrcmp(lowername, node_ptr->lowername) > 0);
new_node->name = namecpy;
new_node->value = valuecpy;
new_node->lowername = lowername;
@@ -467,19 +480,21 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
node_ptr->next = new_node;
}
}
- else if (strcmp(lowername, node_ptr->next->lowername) == 0) {
+ else if (HDstrcmp(lowername, node_ptr->next->lowername) == 0) {
+
is_looking = FALSE;
if (value == NULL) {
/*****************
* REMOVE A NODE *
*****************/
+
hrb_node_t *tmp = node_ptr->next;
node_ptr->next = tmp->next;
#if S3COMMS_DEBUG
HDprintf("REMOVE A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(tmp->cat);
H5MM_xfree(tmp->lowername);
@@ -496,11 +511,12 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
else {
#if S3COMMS_DEBUG
HDprintf("MODIFY A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*****************
* MODIFY A NODE *
*****************/
+
node_ptr = node_ptr->next;
H5MM_xfree(node_ptr->name);
H5MM_xfree(node_ptr->value);
@@ -522,6 +538,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
/****************
* KEEP LOOKING *
****************/
+
node_ptr = node_ptr->next;
}
} /* end while is_looking */
@@ -531,16 +548,12 @@ done:
/* clean up */
if (nvcat != NULL)
H5MM_xfree(nvcat);
-
if (namecpy != NULL)
H5MM_xfree(namecpy);
-
if (lowername != NULL)
H5MM_xfree(lowername);
-
if (valuecpy != NULL)
H5MM_xfree(valuecpy);
-
if (new_node != NULL) {
HDassert(new_node->magic == S3COMMS_HRB_NODE_MAGIC);
new_node->magic += 1ul;
@@ -552,9 +565,11 @@ done:
} /* end H5FD_s3comms_hrb_node_set() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_hrb_destroy()
*
* Purpose:
+ *
* Destroy and free resources _directly_ associated with an HTTP Buffer.
*
* Takes a pointer to pointer to the buffer structure.
@@ -563,6 +578,7 @@ done:
* If buffer or buffer pointer is NULL, there is no effect.
*
* Headers list at `first_header` is not touched.
+ *
* - Programmer should re-use or destroy `first_header` pointer
* (hrb_node_t *) as suits their purposes.
* - Recommend fetching prior to destroy()
@@ -572,6 +588,7 @@ done:
* - Failure to account for this will result in a memory leak.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - successfully released buffer resources
* - if `buf` is NULL or `*buf` is NULL, no effect
@@ -580,6 +597,7 @@ done:
*
* Programmer: Jacob Smith
* 2017-07-21
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -596,9 +614,8 @@ H5FD_s3comms_hrb_destroy(hrb_t **_buf)
if (_buf != NULL && *_buf != NULL) {
buf = *_buf;
- if (buf->magic != S3COMMS_HRB_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pointer's magic does not match.\n");
- }
+ if (buf->magic != S3COMMS_HRB_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pointer's magic does not match.");
H5MM_xfree(buf->verb);
H5MM_xfree(buf->version);
@@ -613,9 +630,11 @@ done:
} /* end H5FD_s3comms_hrb_destroy() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_hrb_init_request()
*
* Purpose:
+ *
* Create a new HTTP Request Buffer
*
* All non-null arguments should be null-terminated strings.
@@ -623,17 +642,20 @@ done:
* If `verb` is NULL, defaults to "GET".
* If `http_version` is NULL, defaults to "HTTP/1.1".
*
- * `resource` cannot be NULL; should be string beginning with slash character ('/').
+ * `resource` cannot be NULL; should be string beginning with slash
+ * character ('/').
*
* All strings are copied into the structure, making them safe from
* modification in source strings.
*
* Return:
+ *
* - SUCCESS: pointer to new `hrb_t`
* - FAILURE: `NULL`
*
* Programmer: Jacob Smith
* 2017-07-21
+ *
*----------------------------------------------------------------------------
*/
hrb_t *
@@ -655,12 +677,11 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch
#endif
if (_resource == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "resource string cannot be null.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "resource string cannot be null.");
/* populate valid NULLs with defaults */
if (_verb == NULL)
_verb = "GET";
-
if (_http_version == NULL)
_http_version = "HTTP/1.1";
@@ -668,28 +689,24 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch
request = (hrb_t *)H5MM_malloc(sizeof(hrb_t));
if (request == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for request structure");
-
request->magic = S3COMMS_HRB_MAGIC;
request->body = NULL;
request->body_len = 0;
request->first_header = NULL;
- /* malloc and copy strings for the structure
- */
+ /* malloc and copy strings for the structure */
reslen = HDstrlen(_resource);
if (_resource[0] == '/') {
res = (char *)H5MM_malloc(sizeof(char) * (reslen + 1));
if (res == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
-
HDmemcpy(res, _resource, (reslen + 1));
}
else {
res = (char *)H5MM_malloc(sizeof(char) * (reslen + 2));
if (res == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
-
*res = '/';
HDmemcpy((&res[1]), _resource, (reslen + 1));
HDassert((reslen + 1) == HDstrlen(res));
@@ -699,14 +716,12 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch
verb = (char *)H5MM_malloc(sizeof(char) * verblen);
if (verb == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for verb string");
-
HDstrncpy(verb, _verb, verblen);
vrsnlen = HDstrlen(_http_version) + 1;
vrsn = (char *)H5MM_malloc(sizeof(char) * vrsnlen);
if (vrsn == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for http-version string");
-
HDstrncpy(vrsn, _http_version, vrsnlen);
/* place new copies into structure */
@@ -737,19 +752,24 @@ done:
****************************************************************************/
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_s3r_close()
*
* Purpose:
+ *
* Close communications through given S3 Request Handle (`s3r_t`)
* and clean up associated resources.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - FAILURE: `FAIL`
* - fails if handle is null or has invalid magic number
*
+ *
* Programmer: Jacob Smith
* 2017-08-31
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -764,10 +784,9 @@ H5FD_s3comms_s3r_close(s3r_t *handle)
#endif
if (handle == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
if (handle->magic != S3COMMS_S3R_MAGIC)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
curl_easy_cleanup(handle->curlhandle);
@@ -788,18 +807,23 @@ done:
} /* H5FD_s3comms_s3r_close */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_s3r_get_filesize()
*
* Purpose:
+ *
* Retrieve the filesize of an open request handle.
*
* Wrapper "getter" to hide implementation details.
*
+ *
* Return:
+ *
* - SUCCESS: size of file, in bytes, if handle is valid.
* - FAILURE: 0, if handle is NULL or undefined.
*
* Programmer: Jacob Smith 2017-01-14
+ *
*----------------------------------------------------------------------------
*/
size_t
@@ -816,9 +840,11 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle)
} /* H5FD_s3comms_s3r_get_filesize */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_s3r_getsize()
*
* Purpose:
+ *
* Get the number of bytes of handle's target resource.
*
* Sets handle and curlhandle with to enact an HTTP HEAD request on file,
@@ -836,11 +862,13 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle)
* not to be trusted.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - FAILURE: `FAIL`
*
* Programmer: Jacob Smith
* 2017-08-23
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -850,9 +878,9 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
CURL * curlh = NULL;
char * end = NULL;
char * headerresponse = NULL;
+ struct s3r_datastruct sds = {S3COMMS_CALLBACK_DATASTRUCT_MAGIC, NULL, 0};
char * start = NULL;
herr_t ret_value = SUCCEED;
- struct s3r_datastruct sds = {S3COMMS_CALLBACK_DATASTRUCT_MAGIC, NULL, 0};
FUNC_ENTER_NOAPI_NOINIT
@@ -861,41 +889,32 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
#endif
if (handle == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
if (handle->magic != S3COMMS_S3R_MAGIC)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
if (handle->curlhandle == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.\n")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.")
/********************
* PREPARE FOR HEAD *
********************/
curlh = handle->curlhandle;
-
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, 1L))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_NOBODY). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY).");
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, &sds))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_HEADERDATA). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA).");
HDassert(handle->httpverb == NULL);
handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16);
if (handle->httpverb == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb");
-
HDmemcpy(handle->httpverb, "HEAD", 5);
headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER);
if (headerresponse == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for curl header response");
-
sds.data = headerresponse;
/*******************
@@ -907,44 +926,40 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
* only http metadata will be sent by server and recorded by s3comms
*/
if (FAIL == H5FD_s3comms_s3r_read(handle, 0, 0, NULL))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize.");
- if (sds.size > CURL_MAX_HTTP_HEADER) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun\n");
- }
- else if (sds.size == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata\n");
+ if (sds.size > CURL_MAX_HTTP_HEADER)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun")
+ else if (sds.size == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata")
#if S3COMMS_DEBUG
- }
- else {
+ else
HDfprintf(stderr, "GETSIZE: OK\n");
#endif
- }
/******************
* PARSE RESPONSE *
******************/
- start = strstr(headerresponse, "\r\nContent-Length: ");
+ start = HDstrstr(headerresponse, "\r\nContent-Length: ");
if (start == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find \"Content-Length\" in response.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find \"Content-Length\" in response.");
- /* move "start" to beginning of value in line; find end of line
- */
+ /* move "start" to beginning of value in line; find end of line */
start = start + HDstrlen("\r\nContent-Length: ");
- end = strstr(start, "\r\n");
+ end = HDstrstr(start, "\r\n");
if (end == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find end of content length line");
- /* place null terminator at end of numbers */
+ /* place null terminator at end of numbers
+ */
*end = '\0';
- content_length = strtoumax((const char *)start, NULL, 0);
-
+ content_length = HDstrtoumax((const char *)start, NULL, 0);
if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX)
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t");
- if (content_length == 0 || errno == ERANGE) /* errno set by strtoumax*/
+ if (content_length == 0 || errno == ERANGE) /* errno set by HDstrtoumax*/
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"could not convert found \"Content-Length\" response (\"%s\")",
start); /* range is null-terminated, remember */
@@ -955,16 +970,11 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
* UNDO HEAD SETTINGS *
**********************/
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, NULL)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_NOBODY). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY).");
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, NULL))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_HEADERDATA). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA).");
done:
H5MM_xfree(headerresponse);
@@ -974,10 +984,13 @@ done:
} /* H5FD_s3comms_s3r_getsize */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_s3r_open()
*
* Purpose:
+ *
* Logically 'open' a file hosted on S3.
+ *
* - create new Request Handle
* - copy supplied url
* - copy authentication info if supplied
@@ -994,6 +1007,7 @@ done:
* Uses `H5FD_s3comms_parse_url()` to validate and parse url input.
*
* Return:
+ *
* - SUCCESS: Pointer to new request handle.
* - FAILURE: NULL
* - occurs if:
@@ -1005,6 +1019,7 @@ done:
*
* Programmer: Jacob Smith
* 2017-09-01
+ *
*----------------------------------------------------------------------------
*/
s3r_t *
@@ -1023,10 +1038,10 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
#endif
if (url == NULL || url[0] == '\0')
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "url cannot be null.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "url cannot be null.");
- /* probably a malformed url, but could be internal error */
if (FAIL == H5FD_s3comms_parse_url(url, &purl))
+ /* probably a malformed url, but could be internal error */
HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, "unable to create parsed url structure");
HDassert(purl != NULL); /* if above passes, this must be true */
@@ -1034,7 +1049,7 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
handle = (s3r_t *)H5MM_malloc(sizeof(s3r_t));
if (handle == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle.");
handle->magic = S3COMMS_S3R_MAGIC;
handle->purl = purl;
@@ -1049,36 +1064,32 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
*************************************/
if ((region != NULL && *region != '\0') || (id != NULL && *id != '\0') || (signing_key != NULL)) {
+
/* if one exists, all three must exist */
if (region == NULL || region[0] == '\0')
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "region cannot be null.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "region cannot be null.");
if (id == NULL || id[0] == '\0')
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "secret id cannot be null.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "secret id cannot be null.");
if (signing_key == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "signing key cannot be null.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "signing key cannot be null.");
/* copy strings */
tmplen = HDstrlen(region) + 1;
handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen);
if (handle->region == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy.");
HDmemcpy(handle->region, region, tmplen);
tmplen = HDstrlen(id) + 1;
handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen);
if (handle->secret_id == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy.");
HDmemcpy(handle->secret_id, id, tmplen);
tmplen = SHA256_DIGEST_LENGTH;
handle->signing_key = (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen);
if (handle->signing_key == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy.");
HDmemcpy(handle->signing_key, signing_key, tmplen);
} /* if authentication information provided */
@@ -1087,34 +1098,23 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
************************/
curlh = curl_easy_init();
-
if (curlh == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem creating curl easy handle!\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem creating curl easy handle!");
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPGET, 1L))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_HTTPGET). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTPGET).");
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_HTTP_VERSION). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTP_VERSION).");
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_FAILONERROR, 1L))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_FAILONERROR). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_FAILONERROR).");
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEFUNCTION, curlwritecallback))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_WRITEFUNCTION). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_WRITEFUNCTION).");
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_URL, url))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_URL). "
- "(placeholder flags)");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_URL).");
#if S3COMMS_CURL_VERBOSITY > 1
/* CURL will print (to stdout) information for each operation
@@ -1131,7 +1131,7 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
*******************/
if (FAIL == H5FD_s3comms_s3r_getsize(handle))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem in H5FD_s3comms_s3r_getsize.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem in H5FD_s3comms_s3r_getsize.");
/*********************
* FINAL PREPARATION *
@@ -1146,17 +1146,14 @@ done:
if (ret_value == NULL) {
if (curlh != NULL)
curl_easy_cleanup(curlh);
-
if (FAIL == H5FD_s3comms_free_purl(purl))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to free parsed url structure")
-
if (handle != NULL) {
H5MM_xfree(handle->region);
H5MM_xfree(handle->secret_id);
H5MM_xfree(handle->signing_key);
if (handle->httpverb != NULL)
H5MM_xfree(handle->httpverb);
-
H5MM_xfree(handle);
}
}
@@ -1165,9 +1162,11 @@ done:
} /* H5FD_s3comms_s3r_open */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_s3r_read()
*
* Purpose:
+ *
* Read file pointed to by request handle, writing specified
* `offset` .. `offset + len` bytes to buffer `dest`.
*
@@ -1194,11 +1193,13 @@ done:
* from server.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - FAILURE: `FAIL`
*
* Programmer: Jacob Smith
* 2017-08-22
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -1213,7 +1214,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
char * rangebytesstr = NULL;
hrb_t * request = NULL;
int ret = 0; /* working variable to check */
- /* return value of HDsnprintf */
+ /* return value of HDsnprintf */
struct s3r_datastruct *sds = NULL;
herr_t ret_value = SUCCEED;
@@ -1228,17 +1229,13 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
**************************************/
if (handle == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
if (handle->magic != S3COMMS_S3R_MAGIC)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
if (handle->curlhandle == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.")
if (handle->purl == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.")
HDassert(handle->purl->magic == S3COMMS_PARSED_URL_MAGIC);
if (offset > handle->filesize || (len + offset) > handle->filesize)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to read past EoF")
@@ -1252,15 +1249,14 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
if (dest != NULL) {
sds = (struct s3r_datastruct *)H5MM_malloc(sizeof(struct s3r_datastruct));
if (sds == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc destination datastructure.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc destination datastructure.");
sds->magic = S3COMMS_CALLBACK_DATASTRUCT_MAGIC;
sds->data = (char *)dest;
sds->size = 0;
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEDATA, sds))
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL,
- "error while setting CURL option (CURLOPT_WRITEDATA). "
- "(placeholder flags)");
+ "error while setting CURL option (CURLOPT_WRITEDATA).");
}
/*********************
@@ -1270,8 +1266,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
if (len > 0) {
rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE + 1));
if (rangebytesstr == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.");
ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE),
"bytes=" H5_PRINTF_HADDR_FMT "-" H5_PRINTF_HADDR_FMT, offset, offset + len - 1);
if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
@@ -1280,8 +1275,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
else if (offset > 0) {
rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE + 1));
if (rangebytesstr == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.");
ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), "bytes=" H5_PRINTF_HADDR_FMT "-",
offset);
if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
@@ -1293,12 +1287,12 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
*******************/
if (handle->signing_key == NULL) {
- /* Do not authenticate. */
+ /* Do not authenticate. */
if (rangebytesstr != NULL) {
/* Pass in range directly */
char *bytesrange_ptr = NULL; /* pointer past "bytes=" portion */
- bytesrange_ptr = strchr(rangebytesstr, '=');
+ bytesrange_ptr = HDstrchr(rangebytesstr, '=');
HDassert(bytesrange_ptr != NULL);
bytesrange_ptr++; /* move to first char past '=' */
HDassert(*bytesrange_ptr != '\0');
@@ -1309,7 +1303,8 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
}
}
else {
- /* authenticate request */
+ /* authenticate request
+ */
char authorization[512 + 1];
/* 512 := approximate max length...
* 67 <len("AWS4-HMAC-SHA256 Credential=///s3/aws4_request,"
@@ -1337,93 +1332,70 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
signed_headers[0] = 0;
/**** VERIFY INFORMATION EXISTS ****/
- if (handle->region == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null region.\n");
if (handle->secret_id == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null secret_id.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null secret_id.");
if (handle->signing_key == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null signing_key.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null signing_key.");
if (handle->httpverb == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null httpverb.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null httpverb.");
if (handle->purl->host == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null host.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null host.");
if (handle->purl->path == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null resource.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null resource.");
/**** CREATE HTTP REQUEST STRUCTURE (hrb_t) ****/
request = H5FD_s3comms_hrb_init_request((const char *)handle->httpverb,
(const char *)handle->purl->path, "HTTP/1.1");
if (request == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request.");
HDassert(request->magic == S3COMMS_HRB_MAGIC);
now = gmnow();
if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not format ISO8601 time.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not format ISO8601 time.");
if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-date", (const char *)iso8601now))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-date header")
-
if (headers == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-content-sha256", (const char *)EMPTY_SHA256))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-content-sha256 header")
-
if (headers == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
if (rangebytesstr != NULL) {
- if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Range", (const char *)rangebytesstr))
+ if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Range", rangebytesstr))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set range header")
-
if (headers == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
}
- if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", (const char *)handle->purl->host))
+ if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", handle->purl->host))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set host header")
-
if (headers == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
request->first_header = headers;
/**** COMPUTE AUTHORIZATION ****/
- if (FAIL == H5FD_s3comms_aws_canonical_request(buffer1, 512, signed_headers, 48, request))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "(placeholder flags)\n");
+ /* buffer1 -> canonical request */
+ if (FAIL == H5FD_s3comms_aws_canonical_request(buffer1, 512, signed_headers, 48, request))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad canonical request");
/* buffer2->string-to-sign */
if (FAIL == H5FD_s3comms_tostringtosign(buffer2, buffer1, iso8601now, handle->region))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "(placeholder flags)\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad string-to-sign");
/* buffer1 -> signature */
if (FAIL == H5FD_s3comms_HMAC_SHA256(handle->signing_key, SHA256_DIGEST_LENGTH, buffer2,
HDstrlen(buffer2), buffer1))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "(placeholder flags)\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad signature");
iso8601now[8] = 0; /* trim to yyyyMMDD */
ret = S3COMMS_FORMAT_CREDENTIAL(buffer2, handle->secret_id, iso8601now, handle->region, "s3");
@@ -1435,18 +1407,13 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
if (ret <= 0 || ret >= 512)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 authorization string");
- /* append authorization header to http request buffer
- */
+ /* append authorization header to http request buffer */
if (H5FD_s3comms_hrb_node_set(&headers, "Authorization", (const char *)authorization) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set Authorization header")
-
if (headers == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
- /* update hrb's "first header" pointer
- */
+ /* update hrb's "first header" pointer */
request->first_header = headers;
/**** SET CURLHANDLE HTTP HEADERS FROM GENERATED DATA ****/
@@ -1456,25 +1423,19 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC);
curlheaders = curl_slist_append(curlheaders, (const char *)node->cat);
if (curlheaders == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not append header to curl slist. "
- "(placeholder flags)\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not append header to curl slist.");
node = node->next;
}
/* sanity-check */
- /* above loop was probably never run */
if (curlheaders == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "curlheaders was never populated.\n");
+ /* above loop was probably never run */
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "curlheaders was never populated.");
- /* finally, set http headers in curl handle
- */
+ /* finally, set http headers in curl handle */
if (curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, curlheaders) != CURLE_OK)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option "
- "(CURLOPT_HTTPHEADER). (placeholder flags)");
-
+ "error while setting CURL option (CURLOPT_HTTPHEADER).");
} /* end if should authenticate (info provided) */
/*******************
@@ -1498,10 +1459,9 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
if (p_status != CURLE_OK) {
if (CURLE_OK != curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem getting response code")
-
HDfprintf(stderr, "CURL ERROR CODE: %d\nHTTP CODE: %d\n", p_status, httpcode);
HDfprintf(stderr, "%s\n", curl_easy_strerror(p_status));
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "problem while performing request.\n");
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "problem while performing request.");
}
if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem unsetting error buffer")
@@ -1510,16 +1470,15 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
p_status = curl_easy_perform(curlh);
if (p_status != CURLE_OK)
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request\n")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request")
#endif
#if S3COMMS_DEBUG
if (dest != NULL) {
HDfprintf(stderr, "len: %d\n", (int)len);
HDfprintf(stderr, "CHECKING FOR BUFFER OVERFLOW\n");
- if (sds == NULL) {
+ if (sds == NULL)
HDfprintf(stderr, "sds is NULL!\n");
- }
else {
HDfprintf(stderr, "sds: 0x%lx\n", (long long)sds);
HDfprintf(stderr, "sds->size: %d\n", (int)sds->size);
@@ -1527,13 +1486,13 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
HDfprintf(stderr, "buffer overwrite\n");
}
}
- else {
+ else
HDfprintf(stderr, "performed on entire file\n");
- }
#endif
done:
- /* clean any malloc'd resources */
+ /* clean any malloc'd resources
+ */
if (curlheaders != NULL) {
curl_slist_free_all(curlheaders);
curlheaders = NULL;
@@ -1550,7 +1509,6 @@ done:
while (headers != NULL)
if (FAIL == H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header node")
-
HDassert(NULL == headers);
if (FAIL == H5FD_s3comms_hrb_destroy(&request))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header request structure")
@@ -1575,17 +1533,21 @@ done:
****************************************************************************/
/*----------------------------------------------------------------------------
+ *
* Function: gmnow()
*
* Purpose:
+ *
* Get the output of `time.h`'s `gmtime()` call while minimizing setup
* clutter where important.
*
* Return:
+ *
* Pointer to resulting `struct tm`,as created by gmtime(time_t * T).
*
* Programmer: Jacob Smith
* 2017-07-12
+ *
*----------------------------------------------------------------------------
*/
struct tm *
@@ -1596,8 +1558,8 @@ gmnow(void)
struct tm *ret_value = NULL;
/* Doctor assert, checks against error in time() */
- if ((time_t)(-1) != time(now_ptr))
- ret_value = gmtime(now_ptr);
+ if ((time_t)(-1) != HDtime(now_ptr))
+ ret_value = HDgmtime(now_ptr);
HDassert(ret_value != NULL);
@@ -1605,9 +1567,11 @@ gmnow(void)
} /* end gmnow() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_aws_canonical_request()
*
* Purpose:
+ *
* Compose AWS "Canonical Request" (and signed headers string)
* as defined in the REST API documentation.
*
@@ -1616,6 +1580,7 @@ gmnow(void)
* Destination string arguments must be provided with adequate space.
*
* Canonical Request format:
+ *
* <HTTP VERB>"\n"
* <resource path>"\n"
* <query string>"\n"
@@ -1628,6 +1593,7 @@ gmnow(void)
* <hex-string of sha256sum of body> ("e3b0c4429...", e.g.)
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - writes canonical request to respective `...dest` strings
* - FAILURE: `FAIL`
@@ -1636,6 +1602,7 @@ gmnow(void)
*
* Programmer: Jacob Smith
* 2017-10-04
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -1651,7 +1618,6 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c
size_t cr_len = 0; /* working length of canonical request str */
size_t sh_len = 0; /* working length of signed headers str */
char tmpstr[256 + 1];
-
tmpstr[256] = 0; /* terminating NULL */
/* "query params" refers to the optional element in the URL, e.g.
@@ -1671,80 +1637,75 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c
#endif
if (http_request == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null.\n");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null.");
HDassert(http_request->magic == S3COMMS_HRB_MAGIC);
if (canonical_request_dest == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null.");
if (signed_headers_dest == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "signed headers destination cannot be null.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "signed headers destination cannot be null.");
- /* HTTP verb, resource path, and query string lines
- */
+ /* HTTP verb, resource path, and query string lines */
cr_len = (HDstrlen(http_request->verb) + HDstrlen(http_request->resource) + HDstrlen(query_params) +
(size_t)3); /* three newline chars */
if (cr_len >= cr_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request");
-
- ret = HDsnprintf(/* TODO: compiler warning */
- canonical_request_dest, (cr_size - 1), "%s\n%s\n%s\n", http_request->verb,
+ /* TODO: compiler warning */
+ ret = HDsnprintf(canonical_request_dest, (cr_size - 1), "%s\n%s\n%s\n", http_request->verb,
http_request->resource, query_params);
if (ret < 0 || (size_t)ret >= cr_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to compose canonical request first line");
- /* write in canonical headers, building signed headers concurrently
- */
+ /* write in canonical headers, building signed headers concurrently */
node = http_request->first_header; /* assumed sorted */
while (node != NULL) {
+
HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC);
ret = HDsnprintf(tmpstr, 256, "%s:%s\n", node->lowername, node->value);
if (ret < 0 || ret >= 256)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to concatenate HTTP header %s:%s",
node->lowername, node->value);
-
cr_len += HDstrlen(tmpstr);
if (cr_len + 1 > cr_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request");
-
- strcat(canonical_request_dest, tmpstr);
+ HDstrcat(canonical_request_dest, tmpstr);
ret = HDsnprintf(tmpstr, 256, "%s;", node->lowername);
if (ret < 0 || ret >= 256)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to append semicolon to lowername %s",
node->lowername);
-
sh_len += HDstrlen(tmpstr);
if (sh_len + 1 > sh_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in signed headers");
-
- strcat(signed_headers_dest, tmpstr);
+ HDstrcat(signed_headers_dest, tmpstr);
node = node->next;
} /* end while node is not NULL */
- /* remove tailing ';' from signed headers sequence */
+ /* remove trailing ';' from signed headers sequence */
signed_headers_dest[HDstrlen(signed_headers_dest) - 1] = '\0';
/* append signed headers and payload hash
* NOTE: at present, no HTTP body is handled, per the nature of
* requests/range-gets
*/
- strcat(canonical_request_dest, "\n");
- strcat(canonical_request_dest, signed_headers_dest);
- strcat(canonical_request_dest, "\n");
- strcat(canonical_request_dest, EMPTY_SHA256);
+ HDstrcat(canonical_request_dest, "\n");
+ HDstrcat(canonical_request_dest, signed_headers_dest);
+ HDstrcat(canonical_request_dest, "\n");
+ HDstrcat(canonical_request_dest, EMPTY_SHA256);
done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_aws_canonical_request() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_bytes_to_hex()
*
* Purpose:
+ *
* Produce human-readable hex string [0-9A-F] from sequence of bytes.
*
* For each byte (char), writes two-character hexadecimal representation.
@@ -1758,6 +1719,7 @@ done:
* `msg_len` message length of 0 has no effect.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - hex string written to `dest` (not null-terminated)
* - FAILURE: `FAIL`
@@ -1765,7 +1727,8 @@ done:
* - `msg == NULL`
*
* Programmer: Jacob Smith
- * 2017-07-12 *
+ * 2017-07-12
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -1781,17 +1744,15 @@ H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len,
#endif
if (dest == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hex destination cannot be null.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hex destination cannot be null.")
if (msg == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bytes sequence cannot be null.\n")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bytes sequence cannot be null.")
for (i = 0; i < msg_len; i++) {
int chars_written = HDsnprintf(&(dest[i * 2]), 3, /* 'X', 'X', '\n' */
(lowercase == TRUE) ? "%02x" : "%02X", msg[i]);
- if (chars_written != 2) {
+ if (chars_written != 2)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem while writing hex chars for %c", msg[i]);
- }
}
done:
@@ -1799,18 +1760,22 @@ done:
} /* end H5FD_s3comms_bytes_to_hex() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_free_purl()
*
* Purpose:
+ *
* Release resources from a parsed_url_t pointer.
*
* If pointer is null, nothing happens.
*
* Return:
+ *
* `SUCCEED` (never fails)
*
* Programmer: Jacob Smith
* 2017-11-01
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -1826,19 +1791,14 @@ H5FD_s3comms_free_purl(parsed_url_t *purl)
HDassert(purl->magic == S3COMMS_PARSED_URL_MAGIC);
if (purl->scheme != NULL)
H5MM_xfree(purl->scheme);
-
if (purl->host != NULL)
H5MM_xfree(purl->host);
-
if (purl->port != NULL)
H5MM_xfree(purl->port);
-
if (purl->path != NULL)
H5MM_xfree(purl->path);
-
if (purl->query != NULL)
H5MM_xfree(purl->query);
-
purl->magic += 1ul;
H5MM_xfree(purl);
}
@@ -1847,9 +1807,11 @@ H5FD_s3comms_free_purl(parsed_url_t *purl)
} /* end H5FD_s3comms_free_purl() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_HMAC_SHA256()
*
* Purpose:
+ *
* Generate Hash-based Message Authentication Checksum using the SHA-256
* hashing algorithm.
*
@@ -1862,6 +1824,7 @@ H5FD_s3comms_free_purl(parsed_url_t *purl)
* `dest` will _not_ be null-terminated by this function.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - hex string written to `dest` (not null-terminated)
* - FAILURE: `FAIL`
@@ -1870,6 +1833,7 @@ H5FD_s3comms_free_purl(parsed_url_t *purl)
*
* Programmer: Jacob Smith
* 2017-07-??
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -1891,7 +1855,7 @@ H5FD_s3comms_HMAC_SHA256(const unsigned char *key, size_t key_len, const char *m
HMAC(EVP_sha256(), key, (int)key_len, (const unsigned char *)msg, msg_len, md, &md_len);
- if (H5FD_s3comms_bytes_to_hex(dest, (const unsigned char *)md, (size_t)md_len, TRUE) == FAIL)
+ if (H5FD_s3comms_bytes_to_hex(dest, (const unsigned char *)md, (size_t)md_len, true) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert to hex string.");
done:
@@ -1899,9 +1863,11 @@ done:
} /* H5FD_s3comms_HMAC_SHA256 */
/*-----------------------------------------------------------------------------
+ *
* Function: H5FD__s3comms_load_aws_creds_from_file()
*
* Purpose:
+ *
* Extract AWS configuration information from a target file.
*
* Given a file and a profile name, e.g. "ros3_vfd_test", attempt to locate
@@ -1931,6 +1897,7 @@ done:
* when reading from multiple files.
*
* Return:
+ *
* + SUCCESS: `SUCCEED`
* + no error. settings may or may not have been loaded.
* + FAILURE: `FAIL`
@@ -1941,6 +1908,7 @@ done:
*
* Programmer: Jacob Smith
* 2018-02-27
+ *
*-----------------------------------------------------------------------------
*/
static herr_t
@@ -1974,34 +1942,29 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha
/* format target line for start of profile */
if (32 < HDsnprintf(profile_line, 32, "[%s]", profile_name))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format profile label");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format profile label")
/* look for start of profile */
do {
/* clear buffer */
- for (buffer_i = 0; buffer_i < 128; buffer_i++) {
+ for (buffer_i = 0; buffer_i < 128; buffer_i++)
buffer[buffer_i] = 0;
- }
line_buffer = fgets(line_buffer, 128, file);
- if (line_buffer == NULL) { /* reached end of file */
+ if (line_buffer == NULL) /* reached end of file */
goto done;
- }
- } while (strncmp(line_buffer, profile_line, HDstrlen(profile_line)));
+ } while (HDstrncmp(line_buffer, profile_line, HDstrlen(profile_line)));
/* extract credentials from lines */
do {
/* clear buffer */
- for (buffer_i = 0; buffer_i < 128; buffer_i++) {
+ for (buffer_i = 0; buffer_i < 128; buffer_i++)
buffer[buffer_i] = 0;
- }
/* collect a line from file */
line_buffer = fgets(line_buffer, 128, file);
- if (line_buffer == NULL) {
- goto done;
- /* end of file */
- }
+ if (line_buffer == NULL)
+ goto done; /* end of file */
/* loop over names to see if line looks like assignment */
for (setting_i = 0; setting_i < setting_count; setting_i++) {
@@ -2012,7 +1975,7 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha
setting_name = setting_names[setting_i];
setting_name_len = HDstrlen(setting_name);
if (HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format line prefix");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format line prefix")
/* found a matching name? */
if (!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) {
@@ -2028,20 +1991,16 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha
} while (*line_buffer != 0 && *line_buffer != '=');
if (*line_buffer == 0 || *(line_buffer + 1) == 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incomplete assignment in file");
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incomplete assignment in file")
line_buffer++; /* was pointing at '='; advance */
/* copy line buffer into out pointer */
- if (HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer,
- HDstrlen(line_buffer)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to copy line into pointer");
+ HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer, HDstrlen(line_buffer));
/* "trim" tailing whitespace by replacing with null terminator*/
buffer_i = 0;
- while (!isspace(setting_pointers[setting_i][buffer_i])) {
+ while (!HDisspace(setting_pointers[setting_i][buffer_i]))
buffer_i++;
- }
setting_pointers[setting_i][buffer_i] = '\0';
break; /* have read setting; don't compare with others */
@@ -2054,9 +2013,11 @@ done:
} /* end H5FD__s3comms_load_aws_creds_from_file() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_load_aws_profile()
*
* Purpose :
+ *
* Read aws profile elements from standard location on system and store
* settings in memory.
*
@@ -2070,6 +2031,7 @@ done:
* Settings are stored in the supplied buffers as null-terminated strings.
*
* Return:
+ *
* + SUCCESS: `SUCCEED` (0)
* + no error occurred and all settings were populated
* + FAILURE: `FAIL` (-1)
@@ -2079,6 +2041,7 @@ done:
*
* Programmer: Jacob Smith
* 2018-02-27
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2104,38 +2067,32 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char *
#endif
if (ret < 0 || (size_t)ret >= 117)
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format home-aws path")
-
ret = HDsnprintf(filepath, 128, "%s%s", awspath, "credentials");
if (ret < 0 || (size_t)ret >= 128)
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format credentials path")
- credfile = fopen(filepath, "r");
+ credfile = HDfopen(filepath, "r");
if (credfile != NULL) {
if (H5FD__s3comms_load_aws_creds_from_file(credfile, profile_name, key_id_out, secret_access_key_out,
- aws_region_out) == FAIL) {
+ aws_region_out) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws credentials")
- }
- if (fclose(credfile) == EOF)
+ if (HDfclose(credfile) == EOF)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close credentials file")
-
credfile = NULL;
} /* end if credential file opened */
ret = HDsnprintf(filepath, 128, "%s%s", awspath, "config");
if (ret < 0 || (size_t)ret >= 128)
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format config path")
-
- credfile = fopen(filepath, "r");
+ credfile = HDfopen(filepath, "r");
if (credfile != NULL) {
if (H5FD__s3comms_load_aws_creds_from_file(
credfile, profile_name, (*key_id_out == 0) ? key_id_out : NULL,
(*secret_access_key_out == 0) ? secret_access_key_out : NULL,
- (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL) {
+ (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws config")
- }
- if (fclose(credfile) == EOF)
+ if (HDfclose(credfile) == EOF)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close config file")
-
credfile = NULL;
} /* end if credential file opened */
@@ -2144,18 +2101,19 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char *
ret_value = FAIL;
done:
- if (credfile != NULL) {
- if (fclose(credfile) == EOF) {
+ if (credfile != NULL)
+ if (HDfclose(credfile) == EOF)
HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, "problem error-closing aws configuration file")
- }
- }
+
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_load_aws_profile() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_nlowercase()
*
* Purpose:
+ *
* From string starting at `s`, write `len` characters to `dest`,
* converting all to lowercase.
*
@@ -2165,6 +2123,7 @@ done:
* Provided as convenience.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - upon completion, `dest` is populated
* - FAILURE: `FAIL`
@@ -2172,6 +2131,7 @@ done:
*
* Programmer: Jacob Smith
* 2017-09-18
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2186,13 +2146,13 @@ H5FD_s3comms_nlowercase(char *dest, const char *s, size_t len)
#endif
if (dest == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.\n");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.");
if (len > 0) {
HDmemcpy(dest, s, len);
do {
len--;
- dest[len] = (char)tolower((int)dest[len]);
+ dest[len] = (char)HDtolower((int)dest[len]);
} while (len > 0);
}
@@ -2201,9 +2161,11 @@ done:
} /* end H5FD_s3comms_nlowercase() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_parse_url()
*
* Purpose:
+ *
* Parse URL-like string and stuff URL components into
* `parsed_url` structure, if possible.
*
@@ -2217,6 +2179,7 @@ done:
* Empty or absent elements are NULL in new purl structure.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - `purl` pointer is populated
* - FAILURE: `FAIL`
@@ -2225,6 +2188,7 @@ done:
*
* Programmer: Jacob Smith
* 2017-10-30
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2238,7 +2202,7 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
unsigned int i = 0;
herr_t ret_value = FAIL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI_NOINIT;
#if S3COMMS_DEBUG
HDprintf("called H5FD_s3comms_parse_url.\n");
@@ -2252,7 +2216,6 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
purl = (parsed_url_t *)H5MM_malloc(sizeof(parsed_url_t));
if (purl == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for parsed_url_t");
-
purl->magic = S3COMMS_PARSED_URL_MAGIC;
purl->scheme = NULL;
purl->host = NULL;
@@ -2267,26 +2230,24 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
tmpstr = HDstrchr(curstr, ':');
if (tmpstr == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction: probably not URL");
-
len = tmpstr - curstr;
HDassert((0 <= len) && (len < urllen));
/* check for restrictions */
for (i = 0; i < len; i++) {
/* scheme = [a-zA-Z+-.]+ (terminated by ":") */
- if (!isalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && '.' != curstr[i])
+ if (!HDisalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && '.' != curstr[i])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction");
}
+
/* copy lowercased scheme to structure */
purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
if (purl->scheme == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for SCHEME");
-
- (void)HDstrncpy(purl->scheme, curstr, (size_t)len);
+ HDstrncpy(purl->scheme, curstr, (size_t)len);
purl->scheme[len] = '\0';
- for (i = 0; i < len; i++) {
- purl->scheme[i] = (char)tolower(purl->scheme[i]);
- }
+ for (i = 0; i < len; i++)
+ purl->scheme[i] = (char)HDtolower(purl->scheme[i]);
/* Skip "://" */
tmpstr += 3;
@@ -2299,9 +2260,9 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
if (*curstr == '[') {
/* IPv6 */
while (']' != *tmpstr) {
- if (tmpstr == 0) /* end of string reached! */
+ /* end of string reached! */
+ if (tmpstr == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reached end of URL: incomplete IPv6 HOST");
-
tmpstr++;
}
tmpstr++;
@@ -2310,24 +2271,20 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
while (0 != *tmpstr) {
if (':' == *tmpstr || '/' == *tmpstr || '?' == *tmpstr)
break;
-
tmpstr++;
}
} /* end else (IPv4) */
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty");
- }
- else if (len > urllen) {
+ if (len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty")
+ else if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of HOST substring");
- }
/* copy host */
purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
if (purl->host == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for HOST");
-
- (void)HDstrncpy(purl->host, curstr, (size_t)len);
+ HDstrncpy(purl->host, curstr, (size_t)len);
purl->host[len] = 0;
/*************
@@ -2337,29 +2294,22 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
if (':' == *tmpstr) {
tmpstr += 1; /* advance past ':' */
curstr = tmpstr;
- while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) {
+ while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr))
tmpstr++;
- }
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty");
- }
- else if (len > urllen) {
+ if (len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty")
+ else if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring");
- }
-
- for (i = 0; i < len; i++) {
- if (!isdigit(curstr[i]))
+ for (i = 0; i < len; i++)
+ if (!HDisdigit(curstr[i]))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT is not a decimal string");
- }
- /* copy port
- */
+ /* copy port */
purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->port == NULL) /* cannot malloc */
+ if (purl->port == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PORT");
-
- (void)HDstrncpy(purl->port, curstr, (size_t)len);
+ HDstrncpy(purl->port, curstr, (size_t)len);
purl->port[len] = 0;
} /* end if PORT element */
@@ -2372,21 +2322,17 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
tmpstr += 1;
curstr = tmpstr;
- /* seek end of PATH
- */
- while ((0 != *tmpstr) && ('?' != *tmpstr)) {
+ /* seek end of PATH */
+ while ((0 != *tmpstr) && ('?' != *tmpstr))
tmpstr++;
- }
len = tmpstr - curstr;
if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PATH substring");
-
if (len > 0) {
purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
if (purl->path == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH");
- /* cannot malloc path pointer */
- (void)HDstrncpy(purl->path, curstr, (size_t)len);
+ HDstrncpy(purl->path, curstr, (size_t)len);
purl->path[len] = 0;
}
} /* end if PATH element */
@@ -2398,21 +2344,17 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
if ('?' == *tmpstr) {
tmpstr += 1;
curstr = tmpstr;
- while (0 != *tmpstr) {
+ while (0 != *tmpstr)
tmpstr++;
- }
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty");
- }
- else if (len > urllen) {
+ if (len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty")
+ else if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of QUERY substring");
- }
purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
if (purl->query == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for QUERY");
- /* cannot malloc path pointer */
- (void)HDstrncpy(purl->query, curstr, (size_t)len);
+ HDstrncpy(purl->query, curstr, (size_t)len);
purl->query[len] = 0;
} /* end if QUERY exists */
@@ -2427,9 +2369,11 @@ done:
} /* end H5FD_s3comms_parse_url() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_percent_encode_char()
*
* Purpose:
+ *
* "Percent-encode" utf-8 character `c`, e.g.,
* '$' -> "%24"
* '¢' -> "%C2%A2"
@@ -2452,6 +2396,7 @@ done:
* `repr_len`.
*
* Return : SUCCEED/FAIL
+ *
* - SUCCESS: `SUCCEED`
* - percent-encoded representation written to `repr`
* - 'repr' is null-terminated
@@ -2459,6 +2404,7 @@ done:
* - `c` or `repr` was NULL
*
* Programmer: Jacob Smith
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2479,7 +2425,7 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
#endif
if (repr == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.\n")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.")
#if S3COMMS_DEBUG
H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, FALSE);
@@ -2498,10 +2444,10 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
chars_written = HDsnprintf(repr, 4, "%%%02X", c);
if (chars_written < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
-
} /* end if single-byte unicode char */
else {
- /* multi-byte, multi-percent representation */
+ /* multi-byte, multi-percent representation
+ */
unsigned int acc = 0; /* byte accumulator */
unsigned int k = 0; /* uint character representation */
unsigned int stack_size = 0;
@@ -2513,7 +2459,8 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
k = (unsigned int)c;
*repr_len = 0;
do {
- /* push number onto stack in six-bit slices */
+ /* push number onto stack in six-bit slices
+ */
acc = k;
acc >>= 6; /* cull least */
acc <<= 6; /* six bits */
@@ -2548,7 +2495,6 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
chars_written = HDsnprintf(repr, 4, "%%%02X", (unsigned char)(acc + stack[stack_size]));
if (chars_written < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
-
*repr_len += 3;
/************************
@@ -2561,7 +2507,6 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
HDsnprintf(&repr[i * 3 + 3], 4, "%%%02X", (unsigned char)(0x80 + stack[stack_size - 1 - i]));
if (chars_written < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
-
*repr_len += 3;
} /* end for each continuation byte */
} /* end else (multi-byte) */
@@ -2573,9 +2518,11 @@ done:
} /* H5FD_s3comms_percent_encode_char */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_signing_key()
*
* Purpose:
+ *
* Create AWS4 "Signing Key" from secret key, AWS region, and timestamp.
*
* Sequentially runs HMAC_SHA256 on strings in specified order,
@@ -2597,6 +2544,7 @@ done:
* Programmer must ensure that `md` is appropriately allocated.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - raw byte data of signing key written to `md`
* - FAILURE: `FAIL`
@@ -2604,6 +2552,7 @@ done:
*
* Programmer: Jacob Smith
* 2017-07-13
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2624,21 +2573,18 @@ H5FD_s3comms_signing_key(unsigned char *md, const char *secret, const char *regi
#endif
if (md == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Destination `md` cannot be NULL.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Destination `md` cannot be NULL.")
if (secret == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`secret` cannot be NULL.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`secret` cannot be NULL.")
if (region == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`region` cannot be NULL.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`region` cannot be NULL.")
if (iso8601now == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`iso8601now` cannot be NULL.\n")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`iso8601now` cannot be NULL.")
AWS4_secret_len = 4 + HDstrlen(secret) + 1;
AWS4_secret = (char *)H5MM_malloc(sizeof(char *) * AWS4_secret_len);
if (AWS4_secret == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Could not allocate space.\n")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Could not allocate space.")
/* prepend "AWS4" to start of the secret key */
ret = HDsnprintf(AWS4_secret, AWS4_secret_len, "%s%s", "AWS4", secret);
@@ -2665,9 +2611,11 @@ done:
} /* end H5FD_s3comms_signing_key() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_tostringtosign()
*
* Purpose:
+ *
* Get AWS "String to Sign" from Canonical Request, timestamp,
* and AWS "region".
*
@@ -2686,6 +2634,7 @@ done:
* It is left to programmer to ensure `dest` has adequate space.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - "string to sign" written to `dest` and null-terminated
* - FAILURE: `FAIL`
@@ -2694,6 +2643,7 @@ done:
*
* Programmer: Jacob Smith
* 2017-07-??
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2715,20 +2665,16 @@ H5FD_s3comms_tostringtosign(char *dest, const char *req, const char *now, const
#endif
if (dest == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer cannot be null.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer cannot be null.")
if (req == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request cannot be null.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request cannot be null.")
if (now == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Timestring cannot be NULL.\n")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Timestring cannot be NULL.")
if (region == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Region cannot be NULL.\n")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Region cannot be NULL.")
- for (i = 0; i < 128; i++) {
+ for (i = 0; i < 128; i++)
tmp[i] = '\0';
- }
for (i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) {
checksum[i] = '\0';
hexsum[i] = '\0';
@@ -2752,13 +2698,12 @@ H5FD_s3comms_tostringtosign(char *dest, const char *req, const char *now, const
SHA256((const unsigned char *)req, HDstrlen(req), checksum);
- if (H5FD_s3comms_bytes_to_hex(hexsum, (const unsigned char *)checksum, SHA256_DIGEST_LENGTH, TRUE) ==
+ if (H5FD_s3comms_bytes_to_hex(hexsum, (const unsigned char *)checksum, SHA256_DIGEST_LENGTH, true) ==
FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not create hex string");
- for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) {
+ for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++)
dest[d++] = hexsum[i];
- }
dest[d] = '\0';
@@ -2767,6 +2712,7 @@ done:
} /* end H5ros3_tostringtosign() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_trim()
*
* Purpose:
@@ -2784,12 +2730,14 @@ done:
* is set to 0.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - FAILURE: `FAIL`
* - `dest == NULL`
*
* Programmer: Jacob Smith
* 2017-09-18
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2805,7 +2753,6 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written)
if (dest == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.")
-
if (s == NULL)
s_len = 0;
@@ -2813,7 +2760,7 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written)
/* Find first non-whitespace character from start;
* reduce total length per character.
*/
- while ((s_len > 0) && isspace((unsigned char)s[0]) && s_len > 0) {
+ while ((s_len > 0) && HDisspace((unsigned char)s[0]) && s_len > 0) {
s++;
s_len--;
}
@@ -2825,11 +2772,10 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written)
if (s_len > 0) {
do {
s_len--;
- } while (isspace((unsigned char)s[s_len]));
+ } while (HDisspace((unsigned char)s[s_len]));
s_len++;
- /* write output into dest
- */
+ /* write output into dest */
HDmemcpy(dest, s, s_len);
}
}
@@ -2841,9 +2787,11 @@ done:
} /* end H5FD_s3comms_trim() */
/*----------------------------------------------------------------------------
+ *
* Function: H5FD_s3comms_uriencode()
*
* Purpose:
+ *
* URIencode (percent-encode) every byte except "[a-zA-Z0-9]-._~".
*
* For each character in source string `_s` from `s[0]` to `s[s_len-1]`,
@@ -2865,6 +2813,7 @@ done:
* `s_len == 0` will have no effect.
*
* Return:
+ *
* - SUCCESS: `SUCCEED`
* - FAILURE: `FAIL`
* - source strings `s` or destination `dest` are NULL
@@ -2872,6 +2821,7 @@ done:
*
* Programmer: Jacob Smith
* 2017-07-??
+ *
*----------------------------------------------------------------------------
*/
herr_t
@@ -2893,7 +2843,6 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s
if (s == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source string cannot be NULL");
-
if (dest == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be NULL");
@@ -2903,10 +2852,9 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s
*/
for (s_off = 0; s_off < s_len; s_off++) {
c = s[s_off];
- if (isalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' ||
- (c == '/' && encode_slash == FALSE)) {
+ if (HDisalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' ||
+ (c == '/' && encode_slash == FALSE))
dest[dest_off++] = c;
- }
else {
hex_off = 0;
if (H5FD_s3comms_percent_encode_char(hex_buffer, (const unsigned char)c, &hex_len) == FAIL) {
@@ -2918,9 +2866,8 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s
hex_buffer, (int)s_off, s);
}
- for (hex_off = 0; hex_off < hex_len; hex_off++) {
+ for (hex_off = 0; hex_off < hex_len; hex_off++)
dest[dest_off++] = hex_buffer[hex_off];
- }
} /* end else (not a regular character) */
} /* end for each character */
diff --git a/src/H5FDs3comms.h b/src/H5FDs3comms.h
index 6bd3232..5d939f8 100644
--- a/src/H5FDs3comms.h
+++ b/src/H5FDs3comms.h
@@ -52,9 +52,6 @@
*
*****************************************************************************/
-#ifndef H5FDs3comms_H
-#define H5FDs3comms_H
-
#include "H5private.h" /* Generic Functions */
#ifdef H5_HAVE_ROS3_VFD
@@ -563,5 +560,3 @@ H5_DLL herr_t H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hb
#endif
#endif /* H5_HAVE_ROS3_VFD */
-
-#endif /* ifndef H5FDs3comms_H */
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index aedabe7..d537587 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Thursday, July 29, 1999
*
* Purpose: The POSIX unbuffered file driver using only the HDF5 public
@@ -782,7 +782,6 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
* results
*/
while (size > 0) {
-
h5_posix_io_t bytes_in = 0; /* # of bytes to write */
h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */
diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h
index 8a9b10a..db658da 100644
--- a/src/H5FDsec2.h
+++ b/src/H5FDsec2.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the sec2 driver.
diff --git a/src/H5FDspace.c b/src/H5FDspace.c
index f0be674..900f34e 100644
--- a/src/H5FDspace.c
+++ b/src/H5FDspace.c
@@ -15,7 +15,7 @@
*
* Created: H5FDspace.c
* Jan 3 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Space allocation routines for the file.
*
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 73218f0..6290214 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, October 22, 1997
*
* Purpose: The C STDIO virtual file driver which only uses calls from stdio.h.
diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h
index 0a4e560..6239a6e 100644
--- a/src/H5FDstdio.h
+++ b/src/H5FDstdio.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the sec2 driver.
diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h
index 249ee5c..7e759b7 100644
--- a/src/H5FDwindows.h
+++ b/src/H5FDwindows.h
@@ -12,8 +12,8 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Scott Wegner <swegner@hdfgroup.org>
- * Based on code by Robb Matzke
+ * Programmer: Scott Wegner
+ * Based on code by Robb Matzke
* Thursday, May 24 2007
*
* Purpose: The public header file for the windows driver.
diff --git a/src/H5FL.c b/src/H5FL.c
index 049e91d..8c110ed 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
* Purpose: Manage priority queues of free-lists (of blocks of bytes).
@@ -180,8 +180,6 @@ H5FL_init_interface(void)
* Programmer: Quincey Koziol
* Tuesday, August 1, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
@@ -218,8 +216,6 @@ done:
* Programmer: Quincey Koziol
* Friday, March 24, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -268,8 +264,6 @@ done:
* Programmer: Quincey Koziol
* Friday, March 24, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -354,8 +348,6 @@ done:
* Programmer: Quincey Koziol
* Friday, March 24, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -430,8 +422,6 @@ done:
* Programmer: Quincey Koziol
* Monday, December 23, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -467,8 +457,6 @@ done:
* Programmer: Quincey Koziol
* Tuesday, July 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -636,8 +624,6 @@ H5FL_reg_term(void)
* Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5FL_blk_node_t *
@@ -696,8 +682,6 @@ H5FL_blk_find_list(H5FL_blk_node_t **head, size_t size)
* Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5FL_blk_node_t *
@@ -746,8 +730,6 @@ done:
* Programmer: Quincey Koziol
* Saturday, March 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -788,8 +770,6 @@ done:
* Programmer: Quincey Koziol
* Monday, December 16, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -827,8 +807,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -862,7 +840,6 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS)
/* Decrement the amount of global "block" free list memory in use */
H5FL_blk_gc_head.mem_freed -= size;
-
} /* end if */
/* No free list available, or there are no nodes on the list, allocate a new node to give to the user */
else {
@@ -918,8 +895,6 @@ done:
* Programmer: Quincey Koziol
* Monday, December 23, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -958,8 +933,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1063,8 +1036,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1137,8 +1108,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1200,8 +1169,6 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head)
* Programmer: Quincey Koziol
* Saturday, March 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1303,8 +1270,6 @@ H5FL_blk_term(void)
* Programmer: Quincey Koziol
* Saturday, March 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1354,8 +1319,6 @@ done:
* Programmer: Quincey Koziol
* Friday, March 24, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1434,8 +1397,6 @@ done:
* Programmer: Quincey Koziol
* Saturday, March 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1508,8 +1469,6 @@ done:
* Programmer: Quincey Koziol
* Monday, December 23, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1545,8 +1504,6 @@ done:
* Programmer: Quincey Koziol
* Saturday, March 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1607,8 +1564,6 @@ done:
* Programmer: Quincey Koziol
* Tuesday, July 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1668,8 +1623,6 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head)
* Programmer: Quincey Koziol
* Saturday, March 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1772,8 +1725,6 @@ H5FL_arr_term(void)
* Programmer: Quincey Koziol
* Saturday, April 3, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1807,8 +1758,6 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj)
* Programmer: Quincey Koziol
* Saturday, April 3, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1840,8 +1789,6 @@ done:
* Programmer: Quincey Koziol
* Saturday, April 3, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1873,8 +1820,6 @@ done:
* Programmer: Quincey Koziol
* Saturday, April 3, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -2187,8 +2132,6 @@ done:
* Programmer: Neil Fortner
* Friday, December 19, 2008
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2237,8 +2180,6 @@ H5FL_fac_gc_list(H5FL_fac_head_t *head)
* Programmer: Neil Fortner
* Friday, December 19, 2008
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2344,8 +2285,6 @@ done:
* Programmer: Neil Fortner
* Friday, December 19, 2008
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2390,8 +2329,6 @@ H5FL_fac_term_all(void)
* Programmer: Quincey Koziol
* Friday, March 24, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h
index b609d7b..2655c29 100644
--- a/src/H5FLprivate.h
+++ b/src/H5FLprivate.h
@@ -15,12 +15,10 @@
*
* Created: H5FLprivate.h
* Mar 23 2000
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Private non-prototype header.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5FLprivate_H
@@ -189,10 +187,10 @@ typedef struct H5FL_blk_head_t {
/* Declare a static free list to manage objects of type 't' */
#define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t)
-/* Allocate an block of type 't' */
+/* Allocate a block of type 't' */
#define H5FL_BLK_MALLOC(t, size) (uint8_t *)H5FL_blk_malloc(&(H5FL_BLK_NAME(t)), size H5FL_TRACK_INFO)
-/* Allocate an block of type 't' and clear it to zeros */
+/* Allocate a block of type 't' and clear it to zeros */
#define H5FL_BLK_CALLOC(t, size) (uint8_t *)H5FL_blk_calloc(&(H5FL_BLK_NAME(t)), size H5FL_TRACK_INFO)
/* Free a block of type 't' */
diff --git a/src/H5FS.c b/src/H5FS.c
index f41796f..42e9234 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -12,12 +12,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, May 2, 2006
*
- * Purpose: Free space tracking functions.
+ * Purpose: Free space tracking functions.
*
- * Note: (Used to be in the H5HFflist.c file, prior to the date above)
+ * Note: (Used to be in the H5HFflist.c file, prior to the date above)
*
*/
@@ -75,29 +75,24 @@ H5FL_DEFINE(H5FS_t);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5FS_create
- *
- * Purpose: Allocate & initialize file free space info
+ * Function: H5FS_create
*
- * Return: Success: Pointer to free space structure
+ * Purpose: Allocate & initialize file free space info
*
- * Failure: NULL
+ * Return: Success: Pointer to free space structure
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 7, 2006
*
- * Modifications:
- * Vailin Choi, July 29th, 2008
- * Add two more parameters for handling alignment: alignment & threshhold
- *
*-------------------------------------------------------------------------
*/
H5FS_t *
H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_create, size_t nclasses,
const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold)
{
- H5FS_t *fspace = NULL; /* New free space structure */
- H5FS_t *ret_value; /* Return value */
+ H5FS_t *fspace = NULL; /* New free space structure */
+ H5FS_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
#ifdef H5FS_DEBUG
@@ -162,31 +157,25 @@ done:
} /* H5FS_create() */
/*-------------------------------------------------------------------------
- * Function: H5FS_open
- *
- * Purpose: Open an existing file free space info structure on disk
+ * Function: H5FS_open
*
- * Return: Success: Pointer to free space structure
+ * Purpose: Open an existing file free space info structure on disk
*
- * Failure: NULL
+ * Return: Success: Pointer to free space structure
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 2, 2006
*
- * Modfications:
- *
- * Vailin Choi, July 29th, 2008
- * Add two more parameters for handling alignment: alignment & threshhold
- *
*-------------------------------------------------------------------------
*/
H5FS_t *
H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, size_t nclasses, const H5FS_section_class_t *classes[],
void *cls_init_udata, hsize_t alignment, hsize_t threshold)
{
- H5FS_t * fspace = NULL; /* New free space structure */
- H5FS_hdr_cache_ud_t cache_udata; /* User-data for metadata cache callback */
- H5FS_t * ret_value; /* Return value */
+ H5FS_t * fspace = NULL; /* New free space structure */
+ H5FS_hdr_cache_ud_t cache_udata; /* User-data for metadata cache callback */
+ H5FS_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
#ifdef H5FS_DEBUG
@@ -238,15 +227,13 @@ done:
} /* H5FS_open() */
/*-------------------------------------------------------------------------
- * Function: H5FS_delete
+ * Function: H5FS_delete
*
- * Purpose: Delete a free space manager on disk
+ * Purpose: Delete a free space manager on disk
*
- * Return: Success: non-negative
+ * Return: SUCCEED/FAIL
*
- * Failure: negative
- *
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 30, 2006
*
*-------------------------------------------------------------------------
@@ -334,16 +321,14 @@ done:
} /* H5FS_delete() */
/*-------------------------------------------------------------------------
- * Function: H5FS_close
+ * Function: H5FS_close
*
- * Purpose: Destroy & deallocate free list structure, serializing sections
+ * Purpose: Destroy & deallocate free list structure, serializing sections
* in the bins
*
- * Return: Success: non-negative
- *
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 7, 2006
*
*-------------------------------------------------------------------------
@@ -512,14 +497,14 @@ done:
} /* H5FS_close() */
/*-------------------------------------------------------------------------
- * Function: H5FS_new
+ * Function: H5FS__new
*
- * Purpose: Create new free space manager structure
+ * Purpose: Create new free space manager structure
*
- * Return: Success: non-NULL, pointer to new free space manager struct
- * Failure: NULL
+ * Return: Success: non-NULL, pointer to new free space manager struct
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, July 31, 2006
*
*-------------------------------------------------------------------------
@@ -596,8 +581,7 @@ done:
*
* Purpose: Collect meta storage info used by the free space manager
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED (Can't fail)
*
* Programmer: Vailin Choi
* June 19, 2007
@@ -612,7 +596,6 @@ H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size)
/*
* Check arguments.
*/
- HDassert(f);
HDassert(fspace);
HDassert(meta_size);
@@ -710,15 +693,14 @@ done:
} /* end H5FS_decr() */
/*-------------------------------------------------------------------------
- * Function: H5FS_dirty
+ * Function: H5FS_dirty
*
- * Purpose: Mark free space header as dirty
+ * Purpose: Mark free space header as dirty
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Feb 14 2008
+ * Programmer: Quincey Koziol
+ * Feb 14 2008
*
*-------------------------------------------------------------------------
*/
@@ -728,9 +710,6 @@ H5FS_dirty(H5FS_t *fspace)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
-#ifdef QAK
- HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC);
-#endif /* QAK */
/* Sanity check */
HDassert(fspace);
@@ -746,15 +725,14 @@ done:
} /* end H5FS_dirty() */
/*-------------------------------------------------------------------------
- * Function: H5FS_hdr_dest
+ * Function: H5FS_hdr_dest
*
- * Purpose: Destroys a free space header in memory.
+ * Purpose: Destroys a free space header in memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * May 2 2006
+ * Programmer: Quincey Koziol
+ * May 2 2006
*
*-------------------------------------------------------------------------
*/
@@ -791,14 +769,13 @@ done:
} /* end H5FS_hdr_dest() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sinfo_free_sect_cb
+ * Function: H5FS_sinfo_free_sect_cb
*
- * Purpose: Free a size-tracking node for a bin
+ * Purpose: Free a size-tracking node for a bin
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED (Can't fail)
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, March 11, 2006
*
*-------------------------------------------------------------------------
@@ -821,15 +798,13 @@ H5FS_sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data)
} /* H5FS_sinfo_free_sect_cb() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sinfo_free_node_cb
- *
- * Purpose: Free a size-tracking node for a bin
+ * Function: H5FS_sinfo_free_node_cb
*
- * Return: Success: non-negative
+ * Purpose: Free a size-tracking node for a bin
*
- * Failure: negative
+ * Return: SUCCEED (Can't fail)
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, March 11, 2006
*
*-------------------------------------------------------------------------
@@ -854,15 +829,14 @@ H5FS_sinfo_free_node_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data)
} /* H5FS_sinfo_free_node_cb() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sinfo_dest
+ * Function: H5FS_sinfo_dest
*
- * Purpose: Destroys a free space section info in memory.
+ * Purpose: Destroys a free space section info in memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * July 31 2006
+ * Programmer: Quincey Koziol
+ * July 31 2006
*
*-------------------------------------------------------------------------
*/
@@ -915,15 +889,14 @@ done:
#ifdef H5FS_DEBUG_ASSERT
/*-------------------------------------------------------------------------
- * Function: H5FS_assert
+ * Function: H5FS_assert
*
- * Purpose: Verify that the free space manager is mostly sane
+ * Purpose: Verify that the free space manager is mostly sane
*
- * Return: Non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Jul 17 2006
+ * Programmer: Quincey Koziol
+ * Jul 17 2006
*
*-------------------------------------------------------------------------
*/
@@ -931,9 +904,6 @@ herr_t
H5FS_assert(const H5FS_t *fspace)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
-#ifndef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_assert", fspace->tot_sect_count);
-#endif /* QAK */
/* Checks for section info, if it's available */
if (fspace->sinfo) {
@@ -949,9 +919,6 @@ H5FS_assert(const H5FS_t *fspace)
HDassert(fspace->tot_sect_count >= fspace->serial_sect_count);
HDassert(fspace->tot_sect_count >= fspace->ghost_sect_count);
HDassert(fspace->tot_sect_count == (fspace->serial_sect_count + fspace->ghost_sect_count));
-#ifdef QAK
- HDassert(fspace->serial_sect_count > 0 || fspace->ghost_sect_count == 0);
-#endif /* QAK */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FS_assert() */
diff --git a/src/H5FScache.c b/src/H5FScache.c
index dcb19e3..0cedb56 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5FScache.c
- * May 2 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Created: H5FScache.c
+ * May 2 2006
+ * Quincey Koziol
*
- * Purpose: Implement file free space metadata cache methods.
+ * Purpose: Implement file free space metadata cache methods.
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c
index f7e02e4..e50dfb1 100644
--- a/src/H5FSdbg.c
+++ b/src/H5FSdbg.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5FSdbg.c
- * May 9 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Created: H5FSdbg.c
+ * May 9 2006
+ * Quincey Koziol
*
- * Purpose: Dump debugging information about a free space manager
+ * Purpose: Dump debugging information about a free space manager
*
*-------------------------------------------------------------------------
*/
@@ -33,11 +33,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FSpkg.h" /* File free space */
-#include "H5HFprivate.h" /* Fractal heaps */
-#include "H5MFprivate.h" /* File memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FSpkg.h" /* File free space */
+#include "H5HFprivate.h" /* Fractal heaps */
+#include "H5MFprivate.h" /* File memory management */
/****************/
/* Local Macros */
@@ -68,19 +68,14 @@
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5FS_debug
+ * Function: H5FS_debug
*
- * Purpose: Prints debugging info about a free space manager.
+ * Purpose: Prints debugging info about a free space manager.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * May 9 2006
- *
- * Modifications:
- * Vailin Choi, July 29th, 2008
- * Add H5FS_CLIENT_FILE_ID for File Memory Management
+ * Programmer: Quincey Koziol
+ * May 9 2006
*
*-------------------------------------------------------------------------
*/
@@ -153,15 +148,14 @@ done:
} /* end H5FS_debug() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_debug
+ * Function: H5FS_sect_debug
*
- * Purpose: Prints debugging info about a free space section.
+ * Purpose: Prints debugging info about a free space section.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * May 30 2006
+ * Programmer: Quincey Koziol
+ * May 30 2006
*
*-------------------------------------------------------------------------
*/
@@ -191,15 +185,14 @@ done:
} /* end H5FS_sect_debug() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sects_debug
+ * Function: H5FS_sects_debug
*
- * Purpose: Prints debugging info about the free space sections.
+ * Purpose: Prints debugging info about the free space sections.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * May 9 2006
+ * Programmer: Quincey Koziol
+ * May 9 2006
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h
index 096a7ce..25e80cb 100644
--- a/src/H5FSpkg.h
+++ b/src/H5FSpkg.h
@@ -12,12 +12,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * Tuesday, May 2, 2006
+ * Programmer: Quincey Koziol
+ * Tuesday, May 2, 2006
*
- * Purpose: This file contains declarations which are visible only within
- * the H5FS package. Source files outside the H5FS package should
- * include H5FSprivate.h instead.
+ * Purpose: This file contains declarations which are visible only within
+ * the H5FS package. Source files outside the H5FS package should
+ * include H5FSprivate.h instead.
*/
#ifndef H5FS_PACKAGE
#error "Do not include this file outside the H5FS package!"
@@ -39,8 +39,8 @@
#include "H5FSprivate.h" /* File free space */
/* Other private headers needed by this file */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5SLprivate.h" /* Skip lists */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5SLprivate.h" /* Skip lists */
/**************************/
/* Package Private Macros */
@@ -62,19 +62,19 @@
H5FS_METADATA_PREFIX_SIZE \
\
/* Free space header specific fields */ \
- + 1 /* Client ID */ \
- + H5F_SIZEOF_SIZE(f) /* Total free space tracked */ \
- + H5F_SIZEOF_SIZE(f) /* Total # of sections tracked */ \
- + H5F_SIZEOF_SIZE(f) /* # of serializable sections tracked */ \
- + H5F_SIZEOF_SIZE(f) /* # of ghost sections tracked */ \
- + 2 /* Number of section classes */ \
- + 2 /* Shrink percent */ \
- + 2 /* Expand percent */ \
- + 2 /* Size of address space for sections (log2 of value) */ \
- + H5F_SIZEOF_SIZE(f) /* Max. size of section to track */ \
- + H5F_SIZEOF_ADDR(f) /* Address of serialized free space sections */ \
- + H5F_SIZEOF_SIZE(f) /* Size of serialized free space sections used */ \
- + H5F_SIZEOF_SIZE(f) /* Allocated size of serialized free space sections */ \
+ + 1 /* Client ID */ \
+ + (unsigned)H5F_SIZEOF_SIZE(f) /* Total free space tracked */ \
+ + (unsigned)H5F_SIZEOF_SIZE(f) /* Total # of sections tracked */ \
+ + (unsigned)H5F_SIZEOF_SIZE(f) /* # of serializable sections tracked */ \
+ + (unsigned)H5F_SIZEOF_SIZE(f) /* # of ghost sections tracked */ \
+ + 2 /* Number of section classes */ \
+ + 2 /* Shrink percent */ \
+ + 2 /* Expand percent */ \
+ + 2 /* Size of address space for sections (log2 of value) */ \
+ + (unsigned)H5F_SIZEOF_SIZE(f) /* Max. size of section to track */ \
+ + (unsigned)H5F_SIZEOF_ADDR(f) /* Address of serialized free space sections */ \
+ + (unsigned)H5F_SIZEOF_SIZE(f) /* Size of serialized free space sections used */ \
+ + (unsigned)H5F_SIZEOF_SIZE(f) /* Allocated size of serialized free space sections */ \
)
/* Size of the free space serialized sections on disk */
@@ -83,7 +83,7 @@
H5FS_METADATA_PREFIX_SIZE \
\
/* Free space serialized sections specific fields */ \
- + H5F_SIZEOF_ADDR(f) /* Address of free space header for these sections */ \
+ + (unsigned)H5F_SIZEOF_ADDR(f) /* Address of free space header for these sections */ \
)
/****************************/
diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h
index e7e058f..8977667 100644
--- a/src/H5FSprivate.h
+++ b/src/H5FSprivate.h
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5FSprivate.h
- * May 2 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Created: H5FSprivate.h
+ * May 2 2006
+ * Quincey Koziol
*
- * Purpose: Private header for library accessible file free space routines.
+ * Purpose: Private header for library accessible file free space routines.
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5FSpublic.h b/src/H5FSpublic.h
index e2b744a..33349b5 100644
--- a/src/H5FSpublic.h
+++ b/src/H5FSpublic.h
@@ -15,7 +15,7 @@
*
* Created: H5FSpublic.h
* May 2 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Public declarations for the file free space package.
*
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 59be78c..43213f0 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Monday, July 31, 2006
*
- * Purpose: Free space tracking functions.
+ * Purpose: Free space tracking functions.
*
*/
@@ -96,14 +96,14 @@ H5FL_DEFINE(H5FS_sinfo_t);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5FS_sinfo_new
+ * Function: H5FS_sinfo_new
*
- * Purpose: Create new section info structure
+ * Purpose: Create new section info structure
*
- * Return: Success: non-NULL, pointer to new section info struct
- * Failure: NULL
+ * Return: Success: non-NULL, pointer to new section info struct
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, July 31, 2006
*
*-------------------------------------------------------------------------
@@ -172,19 +172,18 @@ done:
} /* H5FS_sinfo_new() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sinfo_lock
+ * Function: H5FS_sinfo_lock
*
- * Purpose: Make certain the section info for the free space manager is
+ * Purpose: Make certain the section info for the free space manager is
* in memory.
*
* Either uses existing section info owned by the free space
* header, loads section info from disk, or creates new section
* info
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 7, 2008
*
*-------------------------------------------------------------------------
@@ -290,15 +289,14 @@ done:
} /* H5FS_sinfo_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sinfo_unlock
+ * Function: H5FS_sinfo_unlock
*
- * Purpose: Release the section info, either giving ownership back to
+ * Purpose: Release the section info, either giving ownership back to
* the cache or letting the free space header keep it.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, February 7, 2008
*
*-------------------------------------------------------------------------
@@ -368,6 +366,7 @@ H5FS_sinfo_unlock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hbool_t modified)
/* Check if the section info size in the file has changed */
if (fspace->sect_size != fspace->alloc_sect_size)
cache_flags |= H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG;
+
} /* end if */
/* Sanity check */
@@ -461,14 +460,13 @@ done:
} /* H5FS_sinfo_unlock() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_serialize_size
+ * Function: H5FS_sect_serialize_size
*
- * Purpose: Determine serialized size of all sections in free space manager
+ * Purpose: Determine serialized size of all sections in free space manager
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 8, 2006
*
*-------------------------------------------------------------------------
@@ -480,16 +478,6 @@ H5FS_sect_serialize_size(H5FS_t *fspace)
/* Check arguments. */
HDassert(fspace);
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS_sect_serialize_size",
- fspace->sect_size);
- HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS_sect_serialize_size",
- fspace->serial_sect_count);
- HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS_sect_serialize_size",
- fspace->alloc_sect_size);
- HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size",
- fspace->sinfo->serial_size_count);
-#endif /* QAK */
/* Compute the size of the buffer required to serialize all the sections */
if (fspace->serial_sect_count > 0) {
@@ -499,12 +487,6 @@ H5FS_sect_serialize_size(H5FS_t *fspace)
sect_buf_size = fspace->sinfo->sect_prefix_size;
/* Count for each differently sized serializable section */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size",
- fspace->sinfo->serial_size_count);
- HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS_sect_serialize_size",
- fspace->serial_sect_count);
-#endif /* QAK */
sect_buf_size +=
fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count);
@@ -531,15 +513,14 @@ H5FS_sect_serialize_size(H5FS_t *fspace)
} /* H5FS_sect_serialize_size() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_increase
+ * Function: H5FS_sect_increase
*
- * Purpose: Increase the size of the serialized free space section info
+ * Purpose: Increase the size of the serialized free space section info
* on disk
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 8, 2006
*
*-------------------------------------------------------------------------
@@ -572,10 +553,6 @@ H5FS_sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned fla
fspace->serial_sect_count++;
/* Increment amount of space required to serialize all sections */
-#ifdef QAK
- HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
- HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
-#endif /* QAK */
fspace->sinfo->serial_size += cls->serial_size;
/* Update the free space sections' serialized size */
@@ -591,16 +568,14 @@ done:
} /* H5FS_sect_increase() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_decrease
+ * Function: H5FS_sect_decrease
*
- * Purpose: Decrease the size of the serialized free space section info
+ * Purpose: Decrease the size of the serialized free space section info
* on disk
*
- * Return: Success: non-negative
- *
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 8, 2006
*
*-------------------------------------------------------------------------
@@ -633,10 +608,6 @@ H5FS_sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls)
fspace->serial_sect_count--;
/* Decrement amount of space required to serialize all sections */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
- HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
-#endif /* QAK */
fspace->sinfo->serial_size -= cls->serial_size;
/* Update the free space sections' serialized size */
@@ -649,14 +620,13 @@ done:
} /* H5FS_sect_decrease() */
/*-------------------------------------------------------------------------
- * Function: H5FS_size_node_decr
+ * Function: H5FS_size_node_decr
*
- * Purpose: Decrement the number of sections of a particular size
+ * Purpose: Decrement the number of sections of a particular size
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
*-------------------------------------------------------------------------
@@ -679,9 +649,6 @@ H5FS_size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node,
* the bin's skiplist is also a skiplist...)
*/
sinfo->bins[bin].tot_sect_count--;
-#ifdef QAK
- HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count);
-#endif /* QAK */
/* Check for 'ghost' or 'serializable' section */
if (cls->flags & H5FS_CLS_GHOST_OBJ) {
@@ -737,15 +704,14 @@ done:
} /* H5FS_size_node_decr() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_unlink_size
+ * Function: H5FS_sect_unlink_size
*
- * Purpose: Remove a section node from size tracking data structures for
+ * Purpose: Remove a section node from size tracking data structures for
* a free space manager
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
*-------------------------------------------------------------------------
@@ -790,17 +756,15 @@ done:
} /* H5FS_sect_unlink_size() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_unlink_rest
+ * Function: H5FS_sect_unlink_rest
*
- * Purpose: Finish unlinking a section from the rest of the free space
+ * Purpose: Finish unlinking a section from the rest of the free space
* manager's data structures, after the section has been removed
* from the size tracking data structures
*
- * Return: Success: non-negative
- *
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
*-------------------------------------------------------------------------
@@ -822,10 +786,6 @@ H5FS_sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sect
if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
H5FS_section_info_t *tmp_sect_node; /* Temporary section node */
-#ifdef QAK
- HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, &sect->addr);
if (tmp_sect_node == NULL || tmp_sect_node != sect)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list")
@@ -835,10 +795,7 @@ H5FS_sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sect
if (H5FS_sect_decrease(fspace, cls) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk")
- /* Decrement amount of free space managed */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
+ /* Decrement amount of free space managed */
fspace->tot_space -= sect->size;
done:
@@ -846,14 +803,13 @@ done:
} /* H5FS_sect_unlink_rest() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_remove_real
+ * Function: H5FS_sect_remove_real
*
- * Purpose: Remove a section from the free space manager
+ * Purpose: Remove a section from the free space manager
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
*-------------------------------------------------------------------------
@@ -888,14 +844,13 @@ done:
} /* H5FS_sect_remove_real() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_remove
+ * Function: H5FS_sect_remove
*
- * Purpose: Remove a section from the free space manager
+ * Purpose: Remove a section from the free space manager
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
*-------------------------------------------------------------------------
@@ -931,14 +886,13 @@ done:
} /* H5FS_sect_remove() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_link_size
+ * Function: H5FS_sect_link_size
*
- * Purpose: Add a section of free space to the free list bins
+ * Purpose: Add a section of free space to the free list bins
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 20, 2006
*
*-------------------------------------------------------------------------
@@ -952,9 +906,6 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_s
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
-#ifdef QAK
- HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr);
-#endif /* QAK */
/* Check arguments. */
HDassert(sinfo);
@@ -969,10 +920,9 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_s
if (NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes")
} /* end if */
- else {
+ else
/* Check for node list of the correct size already */
fspace_node = (H5FS_node_t *)H5SL_search(sinfo->bins[bin].bin_list, &sect->size);
- } /* end else */
/* Check if we need to create a new skip list for nodes of this size */
if (fspace_node == NULL) {
@@ -1000,9 +950,6 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_s
/* (Different from the # of items in the bin's skiplist, since each node on
* the bin's skiplist is also a skiplist...)
*/
-#ifdef QAK
- HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count);
-#endif /* QAK */
sinfo->bins[bin].tot_sect_count++;
if (cls->flags & H5FS_CLS_GHOST_OBJ) {
sinfo->bins[bin].ghost_sect_count++;
@@ -1038,16 +985,14 @@ done:
} /* H5FS_sect_link_size() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_link_rest
+ * Function: H5FS_sect_link_rest
*
- * Purpose: Link a section into the rest of the non-size tracking
+ * Purpose: Link a section into the rest of the non-size tracking
* free space manager data structures
*
- * Return: Success: non-negative
+ * Return: SUCCEED/FAIL
*
- * Failure: negative
- *
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
*-------------------------------------------------------------------------
@@ -1067,10 +1012,6 @@ H5FS_sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sectio
/* Add section to the address-ordered list of sections, if allowed */
if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
-#ifdef QAK
- HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
if (fspace->sinfo->merge_list == NULL)
if (NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL,
@@ -1092,15 +1033,13 @@ done:
} /* H5FS_sect_link_rest() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_link
- *
- * Purpose: Link a section into the internal data structures
+ * Function: H5FS_sect_link
*
- * Return: Success: non-negative
+ * Purpose: Link a section into the internal data structures
*
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
*-------------------------------------------------------------------------
@@ -1122,46 +1061,29 @@ H5FS_sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags)
cls = &fspace->sect_cls[sect->type];
/* Add section to size tracked data structures */
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 1.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
if (H5FS_sect_link_size(fspace->sinfo, cls, sect) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures")
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 2.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
/* Update rest of free space manager data structures for section addition */
if (H5FS_sect_link_rest(fspace, cls, sect, flags) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL,
"can't add section to non-size tracking data structures")
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS_sect_link() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_merge
+ * Function: H5FS_sect_merge
*
- * Purpose: Attempt to merge a returned free space section with existing
+ * Purpose: Attempt to merge a returned free space section with existing
* free space.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, May 17, 2006
*
- * Modifications: Vailin Choi; Sept 25th 2008
- * Changes to the "shrinking" part--
- * 1. Get last section node in merge-list instead of "less-than"
- * node for further iteration
- * 2. Remove "can-be-shrunk" section from free-space instead of
- * "less-than" section
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1284,10 +1206,6 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
} while (modified);
} /* end if */
HDassert(*sect);
-#ifdef QAK
- HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size,
- (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
-#endif /* QAK */
/* Loop until no more shrinking */
do {
@@ -1300,10 +1218,6 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
if ((status = (*sect_cls->can_shrink)(*sect, op_data)) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container")
if (status > 0) {
-#ifdef QAK
- HDfprintf(stderr, "%s: Can shrink!\n", FUNC);
-#endif /* QAK */
-
/* Remove SECT from free-space manager */
/* (only possible to happen on second+ pass through loop) */
if (remove_sect) {
@@ -1347,33 +1261,18 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
if (remove_sect && (*sect != NULL))
*sect = NULL;
-#ifdef QAK
- HDfprintf(stderr, "%s: Done shrinking\n", FUNC);
- if (*sect)
- HDfprintf(stderr, "%s: (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size,
- (*sect)->type,
- ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
- else
- HDfprintf(stderr, "%s: *sect = %p\n", FUNC, *sect);
-#endif /* QAK */
-
done:
-#ifdef QAK
- HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
-#endif /* QAK */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS_sect_merge() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_add
- *
- * Purpose: Add a section of free space to the free list
+ * Function: H5FS_sect_add
*
- * Return: Success: non-negative
+ * Purpose: Add a section of free space to the free list
*
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 7, 2006
*
*-------------------------------------------------------------------------
@@ -1407,10 +1306,9 @@ H5FS_sect_add(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t *sect
/* Call "add" section class callback, if there is one */
cls = &fspace->sect_cls[sect->type];
- if (cls->add) {
+ if (cls->add)
if ((*cls->add)(sect, &flags, op_data) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "'add' section class callback failed")
- } /* end if */
/* Check for merging returned space with existing section node */
if (flags & H5FS_ADD_RETURNED_SPACE) {
@@ -1455,14 +1353,13 @@ done:
} /* H5FS_sect_add() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_try_extend
+ * Function: H5FS_sect_try_extend
*
- * Purpose: Try to extend a block using space from a section on the free list
+ * Purpose: Try to extend a block using space from a section on the free list
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, January 8, 2008
*
*-------------------------------------------------------------------------
@@ -1587,23 +1484,16 @@ done:
} /* H5FS_sect_try_extend() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_find_node
+ * Function: H5FS_sect_find_node
*
- * Purpose: Locate a section of free space (in existing free space list
+ * Purpose: Locate a section of free space (in existing free space list
* bins) that is large enough to fulfill request.
*
- * Return: Success: non-negative
- *
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 20, 2006
*
- * Modifications:
- * Vailin Choi, July 29th, 2008
- * Modified to handle alignment by going through each bin to find
- * a section that is big enough to fulfill "request+fragment for alignment"
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -1629,10 +1519,6 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node)
/* Determine correct bin which holds items of at least the section's size */
bin = H5VM_log2_gen(request);
HDassert(bin < fspace->sinfo->nbins);
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins);
- HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin);
-#endif /* QAK */
alignment = fspace->alignment;
if (!((alignment > 1) && (request >= fspace->threshold)))
alignment = 0; /* no alignment */
@@ -1728,10 +1614,10 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node)
/* sanity check */
HDassert(split_sect->addr < (*node)->addr);
HDassert(request <= (*node)->size);
- }
+ } /* end if */
/* Indicate that we found a node for the request */
HGOTO_DONE(TRUE)
- }
+ } /* end if */
/* Get the next section node in the list */
curr_sect_node = H5SL_next(curr_sect_node);
@@ -1742,7 +1628,7 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node)
} /* end while of curr_size_node */
} /* else of alignment */
} /* if bin_list */
- /* Advance to next larger bin */
+ /* Advance to next larger bin */
bin++;
} while (bin < fspace->sinfo->nbins);
@@ -1751,22 +1637,16 @@ done:
} /* H5FS_sect_find_node() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_find
+ * Function: H5FS_sect_find
*
- * Purpose: Locate a section of free space (in existing free space list) that
+ * Purpose: Locate a section of free space (in existing free space list) that
* is large enough to fulfill request.
*
- * Return: Success: non-negative
- *
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 7, 2006
*
- * Modifications:
- * Vailin Choi, July 29th 2008
- * Move H5FS_sect_unlink_rest() to H5FS_sect_find_node()
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -1778,10 +1658,6 @@ H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, H5FS_se
FUNC_ENTER_NOAPI(FAIL)
-#ifdef QAK
- HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request);
-#endif /* QAK */
-
/* Check arguments. */
HDassert(fspace);
HDassert(fspace->nclasses);
@@ -1789,11 +1665,6 @@ H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, H5FS_se
HDassert(node);
/* Check for any sections on free space list */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count);
- HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count);
- HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_sect_count);
-#endif /* QAK */
if (fspace->tot_sect_count > 0) {
/* Get a pointer to the section info */
if (H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0)
@@ -1808,12 +1679,8 @@ H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, H5FS_se
if (ret_value > 0) {
/* Note that we've modified the section info */
sinfo_modified = TRUE;
-#ifdef QAK
- HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = %u\n", FUNC,
- (*node)->size, (*node)->addr, (*node)->type);
-#endif /* QAK */
- }
- } /* end if */
+ } /* end if */
+ } /* end if */
done:
/* Release the section info */
@@ -1827,16 +1694,14 @@ done:
} /* H5FS_sect_find() */
/*-------------------------------------------------------------------------
- * Function: H5FS_iterate_sect_cb
+ * Function: H5FS_iterate_sect_cb
*
- * Purpose: Skip list iterator callback to iterate over free space sections
+ * Purpose: Skip list iterator callback to iterate over free space sections
* of a particular size
*
- * Return: Success: non-negative
+ * Return: SUCCEED/FAIL
*
- * Failure: negative
- *
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, May 13, 2006
*
*-------------------------------------------------------------------------
@@ -1864,16 +1729,14 @@ done:
} /* H5FS_iterate_sect_cb() */
/*-------------------------------------------------------------------------
- * Function: H5FS_iterate_node_cb
+ * Function: H5FS_iterate_node_cb
*
- * Purpose: Skip list iterator callback to iterate over free space sections
+ * Purpose: Skip list iterator callback to iterate over free space sections
* in a bin
*
- * Return: Success: non-negative
- *
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, May 13, 2006
*
*-------------------------------------------------------------------------
@@ -1902,15 +1765,13 @@ done:
} /* H5FS_iterate_node_cb() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_iterate
+ * Function: H5FS_sect_iterate
*
- * Purpose: Iterate over all the sections managed
+ * Purpose: Iterate over all the sections managed
*
- * Return: Success: non-negative
+ * Return: SUCCEED/FAIL
*
- * Failure: negative
- *
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, May 13, 2006
*
*-------------------------------------------------------------------------
@@ -1928,10 +1789,6 @@ H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, v
HDassert(fspace);
HDassert(op);
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count);
-#endif /* QAK */
-
/* Set up user data for iterator */
udata.fspace = fspace;
udata.op = op;
@@ -1947,9 +1804,6 @@ H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, v
sinfo_valid = TRUE;
/* Iterate over all the bins */
-#ifdef QAK
- HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC);
-#endif /* QAK */
for (bin = 0; bin < fspace->sinfo->nbins; bin++) {
/* Check if there are any sections in this bin */
if (fspace->sinfo->bins[bin].bin_list) {
@@ -1969,14 +1823,13 @@ done:
} /* H5FS_sect_iterate() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_stats
+ * Function: H5FS_sect_stats
*
- * Purpose: Retrieve info about the sections managed
+ * Purpose: Retrieve info about the sections managed
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 30, 2006
*
*-------------------------------------------------------------------------
@@ -1999,16 +1852,14 @@ H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects)
} /* H5FS_sect_stats() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_change_class
+ * Function: H5FS_sect_change_class
*
- * Purpose: Make appropriate adjustments to internal data structures when
+ * Purpose: Make appropriate adjustments to internal data structures when
* a section changes class
*
- * Return: Success: non-negative
- *
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -2039,10 +1890,6 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf
old_class = sect->type;
old_cls = &fspace->sect_cls[sect->type];
new_cls = &fspace->sect_cls[new_class];
-#ifdef QAK
- HDfprintf(stderr, "%s: old_cls->flags = %x\n", FUNC, old_cls->flags);
- HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags);
-#endif /* QAK */
/* Check if the section's class change will affect the # of serializable or ghost sections */
if ((old_cls->flags & H5FS_CLS_GHOST_OBJ) != (new_cls->flags & H5FS_CLS_GHOST_OBJ)) {
@@ -2055,9 +1902,6 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf
to_ghost = FALSE;
else
to_ghost = TRUE;
-#ifdef QAK
- HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost);
-#endif /* QAK */
/* Sanity check */
HDassert(fspace->sinfo->bins);
@@ -2121,16 +1965,9 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf
to_mergable = TRUE;
else
to_mergable = FALSE;
-#ifdef QAK
- HDfprintf(stderr, "%s: to_mergable = %u\n", FUNC, to_mergable);
-#endif /* QAK */
/* Add or remove section from merge list, as appropriate */
if (to_mergable) {
-#ifdef QAK
- HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
if (fspace->sinfo->merge_list == NULL)
if (NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL,
@@ -2142,10 +1979,6 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf
else {
H5FS_section_info_t *tmp_sect_node; /* Temporary section node */
-#ifdef QAK
- HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, &sect->addr);
if (tmp_sect_node == NULL || tmp_sect_node != sect)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list")
@@ -2174,15 +2007,14 @@ done:
#ifdef H5FS_DEBUG_ASSERT
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_assert
+ * Function: H5FS_sect_assert
*
- * Purpose: Verify that the sections managed are mostly sane
+ * Purpose: Verify that the sections managed are mostly sane
*
- * Return: Non-negative on success, negative on failure
+ * Return: void
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Jul 17 2006
+ * Programmer: Quincey Koziol
+ * Jul 17 2006
*
*-------------------------------------------------------------------------
*/
@@ -2192,9 +2024,6 @@ H5FS_sect_assert(const H5FS_t *fspace)
hsize_t separate_obj; /* The number of separate objects managed */
FUNC_ENTER_NOAPI_NOINIT_NOERR
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspace->tot_sect_count);
-#endif /* QAK */
/* Initialize state */
separate_obj = 0;
@@ -2251,10 +2080,6 @@ H5FS_sect_assert(const H5FS_t *fspace)
/* Get section node & it's class */
sect = H5SL_item(curr_sect_node);
cls = &fspace->sect_cls[sect->type];
-#ifdef QAK
- HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n",
- "H5FS_assert", sect->size, sect->addr, sect->type);
-#endif /* QAK */
/* Sanity check section */
HDassert(H5F_addr_defined(sect->addr));
@@ -2325,15 +2150,14 @@ H5FS_sect_assert(const H5FS_t *fspace)
#endif /* H5FS_DEBUG_ASSERT */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_try_shrink_eoa
+ * Function: H5FS_sect_try_shrink_eoa
*
- * Purpose: To shrink the last section on the merge list if the section
- * is at EOF.
+ * Purpose: To shrink the last section on the merge list if the section
+ * is at EOF.
*
- * Return: Success: non-negative (TRUE/FALSE)
- * Failure: negative
+ * Return: TRUE/FALSE/FAIL
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
*
*-------------------------------------------------------------------------
*/
@@ -2395,14 +2219,14 @@ done:
} /* H5FS_sect_try_shrink_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FS_sect_query_last_sect
+ * Function: H5FS_sect_query_last_sect
*
- * Purpose: Retrieve info about the last section on the merge list
+ * Purpose: Retrieve info about the last section on the merge list
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5FSstat.c b/src/H5FSstat.c
index 9bf735f..fa7e7e0 100644
--- a/src/H5FSstat.c
+++ b/src/H5FSstat.c
@@ -25,9 +25,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FSpkg.h" /* Free-space manager */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FSpkg.h" /* Free-space manager */
/****************/
/* Local Macros */
@@ -62,12 +62,10 @@
*
* Purpose: Retrieve metadata statistics for the free-space manager
*
- * Return: Success: non-negative
- *
- * Failure: does not fail
+ * Return: SUCCEED (Can't fail)
*
* Programmer: Vailin Choi
- * August 25th, 2008
+ * August 25th, 2008
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5FStest.c b/src/H5FStest.c
index a165e18..de2d447 100644
--- a/src/H5FStest.c
+++ b/src/H5FStest.c
@@ -26,9 +26,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FSpkg.h" /* Free-space manager */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FSpkg.h" /* Free-space manager */
/****************/
/* Local Macros */
@@ -63,12 +63,10 @@
*
* Purpose: Retrieve the parameters used to create the free-space manager
*
- * Return: Success: non-negative
+ * Return: SUCCEED/FAIL
*
- * Failure: negative
- *
- * Programmer: similar to H5HF_get_cparam_test()
- * Vailin Choi; August 25th, 2008
+ * Programmer: Vailin Choi
+ * August 25th, 2008
*
*-------------------------------------------------------------------------
*/
@@ -95,11 +93,10 @@ H5FS_get_cparam_test(const H5FS_t *frsp, H5FS_create_t *cparam)
*
* Purpose: Compare the parameters used to create the fractal heap
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: A value like strcmp()
*
- * Programmer: similar to H5HF_cmp_cparam_test()
- * Vailin Choi; August 25th, 2008
+ * Programmer: Vailin Choi
+ * August 25th, 2008
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Fefc.c b/src/H5Fefc.c
index b000317..ebbc911 100644
--- a/src/H5Fefc.c
+++ b/src/H5Fefc.c
@@ -15,7 +15,7 @@
*
* Created: H5Defc.c
* December 13, 2010
- * Neil Fortner <nfortne2@hdfgroup.org>
+ * Neil Fortner
*
* Purpose: External file caching routines - implements a
* cache of external files to minimize the number of
diff --git a/src/H5Ffake.c b/src/H5Ffake.c
index 7077c57..1d7633e 100644
--- a/src/H5Ffake.c
+++ b/src/H5Ffake.c
@@ -56,7 +56,6 @@ H5F_init_fake_interface(void)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 2, 2006
*
*-------------------------------------------------------------------------
@@ -100,7 +99,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 2, 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fio.c b/src/H5Fio.c
index 8e5c0e9..ffa83c3 100644
--- a/src/H5Fio.c
+++ b/src/H5Fio.c
@@ -15,7 +15,7 @@
*
* Created: H5Fio.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File I/O routines.
*
@@ -75,7 +75,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
@@ -88,6 +87,7 @@ H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, hid_t
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(buf);
@@ -120,7 +120,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
@@ -132,10 +131,8 @@ H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, hid_
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
-#ifdef QAK
- HDfprintf(stderr, "%s: write to addr = %a, size = %Zu\n", FUNC, addr, size);
-#endif /* QAK */
+ /* Sanity checks */
HDassert(f);
HDassert(f->shared);
HDassert(H5F_INTENT(f) & H5F_ACC_RDWR);
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index 28ae3f6..f3c75a9 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -76,7 +76,8 @@ H5F_close_mounts(H5F_t *f)
/* Unmount all child files. Loop backwards to avoid having to adjust u when
* a file is unmounted. Note that we rely on unsigned u "wrapping around"
- * to terminate the loop. */
+ * to terminate the loop.
+ */
for (u = f->shared->mtab.nmounts - 1; u < f->shared->mtab.nmounts; u--) {
/* Only unmount children mounted to this top level file structure */
if (f->shared->mtab.child[u].file->parent == f) {
@@ -97,7 +98,7 @@ H5F_close_mounts(H5F_t *f)
f->shared->mtab.nmounts--;
f->nmounts--;
}
- } /* end if */
+ }
HDassert(f->nmounts == 0);
@@ -183,7 +184,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED p
for (ancestor = parent; ancestor; ancestor = ancestor->parent) {
if (ancestor->shared == child->shared)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount would introduce a cycle")
- } /* end for */
+ }
/* Make certain that the parent & child files have the same "file close degree" */
if (parent->shared->fc_degree != child->shared->fc_degree)
@@ -207,7 +208,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED p
rt = md;
else if (cmp > 0)
lt = md + 1;
- } /* end while */
+ }
if (cmp > 0)
md++;
if (!cmp)
@@ -223,7 +224,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED p
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for mount table")
parent->shared->mtab.child = x;
parent->shared->mtab.nalloc = n;
- } /* end if */
+ }
/* Insert into table */
HDmemmove(parent->shared->mtab.child + md + 1, parent->shared->mtab.child + md,
@@ -255,12 +256,12 @@ done:
if (mount_point) {
if (H5G_close(mount_point) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close mounted group")
- } /* end if */
+ }
else {
if (H5G_loc_free(&mp_loc) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free mount location")
- } /* end else */
- } /* end if */
+ }
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_mount() */
@@ -333,21 +334,21 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id)
/* Found the correct index */
child_idx = (int)u;
break;
- } /* end if */
- } /* end for */
+ }
+ }
}
else {
unsigned lt, rt, md = 0; /*binary search indices */
int cmp; /*binary search comparison value*/
- /*
- * We've been given the mount point in the parent. We use a binary
+ /* We've been given the mount point in the parent. We use a binary
* search in the parent to locate the mounted file, if any.
*/
parent = child; /*we guessed wrong*/
lt = 0;
rt = parent->shared->mtab.nmounts;
cmp = -1;
+
while (lt < rt && cmp) {
md = (lt + rt) / 2;
mnt_oloc = H5G_oloc(parent->shared->mtab.child[md].group);
@@ -356,7 +357,8 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id)
rt = md;
else
lt = md + 1;
- } /* end while */
+ }
+
if (cmp)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "not a mount point")
@@ -446,15 +448,12 @@ H5F_is_mount(const H5F_t *file)
} /* end H5F_is_mount() */
/*-------------------------------------------------------------------------
- * Function: H5Fmount
+ * Function: H5Fmount
*
- * Purpose: Mount file CHILD_ID onto the group specified by LOC_ID and
- * NAME using mount properties PLIST_ID.
+ * Purpose: Mount file CHILD_ID onto the group specified by LOC_ID and
+ * NAME using mount properties PLIST_ID.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Tuesday, October 6, 1998
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -489,21 +488,18 @@ done:
} /* end H5Fmount() */
/*-------------------------------------------------------------------------
- * Function: H5Funmount
+ * Function: H5Funmount
*
- * Purpose: Given a mount point, dissassociate the mount point's file
- * from the file mounted there. Do not close either file.
+ * Purpose: Given a mount point, dissassociate the mount point's file
+ * from the file mounted there. Do not close either file.
*
- * The mount point can either be the group in the parent or the
- * root group of the mounted file (both groups have the same
- * name). If the mount point was opened before the mount then
- * it's the group in the parent, but if it was opened after the
- * mount then it's the root group of the child.
+ * The mount point can either be the group in the parent or the
+ * root group of the mounted file (both groups have the same
+ * name). If the mount point was opened before the mount then
+ * it's the group in the parent, but if it was opened after the
+ * mount then it's the root group of the child.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Tuesday, October 6, 1998
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -531,12 +527,12 @@ done:
} /* end H5Funmount() */
/*-------------------------------------------------------------------------
- * Function: H5F_mount_count_ids_recurse
+ * Function: H5F_mount_count_ids_recurse
*
- * Purpose: Helper routine for counting number of open IDs in mount
+ * Purpose: Helper routine for counting number of open IDs in mount
* hierarchy.
*
- * Return: <none>
+ * Return: void
*
* Programmer: Quincey Koziol
* Tuesday, July 19, 2005
@@ -575,17 +571,17 @@ H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_obj
H5F_mount_count_ids_recurse(f->shared->mtab.child[u].file, nopen_files, nopen_objs);
}
- } /* end for */
+ }
FUNC_LEAVE_NOAPI_VOID
} /* end H5F_mount_count_ids_recurse() */
/*-------------------------------------------------------------------------
- * Function: H5F_mount_count_ids
+ * Function: H5F_mount_count_ids
*
- * Purpose: Count the number of open file & object IDs in a mount hierarchy
+ * Purpose: Count the number of open file & object IDs in a mount hierarchy
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Tues, July 19, 2005
@@ -654,11 +650,11 @@ done:
} /* end H5F_flush_mounts_recurse() */
/*-------------------------------------------------------------------------
- * Function: H5F_flush_mounts
+ * Function: H5F_flush_mounts
*
- * Purpose: Flush a mount hierarchy
+ * Purpose: Flush a mount hierarchy
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Fri, August 21, 2009
@@ -735,7 +731,7 @@ H5F_traverse_mount(H5O_loc_t *oloc /*in,out*/)
rt = md;
else
lt = md + 1;
- } /* end while */
+ }
/* Copy root info over to ENT */
if (0 == cmp) {
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index 9c7c33e..9a8258a 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -15,7 +15,7 @@
*
* Created: H5Fmpi.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: MPI-related routines.
*
@@ -68,52 +68,48 @@
#ifdef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
- * Function: H5F_mpi_get_rank
+ * Function: H5F_mpi_get_rank
*
- * Purpose: Retrieves the rank of an MPI process.
+ * Purpose: Retrieves the rank of an MPI process.
*
- * Return: Success: The rank (non-negative)
+ * Return: Success: The rank (non-negative)
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, January 30, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
H5F_mpi_get_rank(const H5F_t *f)
{
- int ret_value;
+ int ret_value = -1;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI((-1))
HDassert(f && f->shared);
/* Dispatch to driver */
if ((ret_value = H5FD_mpi_get_rank(f->shared->lf)) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "driver get_rank request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_mpi_get_rank() */
/*-------------------------------------------------------------------------
- * Function: H5F_mpi_get_comm
+ * Function: H5F_mpi_get_comm
*
- * Purpose: Retrieves the file's communicator
+ * Purpose: Retrieves the file's communicator
*
- * Return: Success: The communicator (non-negative)
+ * Return: Success: The communicator (non-negative)
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, January 30, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
MPI_Comm
@@ -145,8 +141,6 @@ done:
* Programmer: John Mainzer
* Friday, May 6, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -167,16 +161,11 @@ done:
} /* end H5F_mpi_get_size() */
/*-------------------------------------------------------------------------
- * Function: H5Fset_mpi_atomicity
+ * Function: H5Fset_mpi_atomicity
*
- * Purpose: Sets the atomicity mode
+ * Purpose: Private call to set the atomicity mode
*
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Mohamad Chaarawi
- * Feb 14, 2012
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -197,25 +186,24 @@ H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag)
if (!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, does not support MPI atomicity mode")
- /* set atomicity value */
+ /* Set atomicity value */
if (H5FD_set_mpio_atomicity(file->shared->lf, flag) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set atomicity flag")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Fset_mpi_atomicity() */
/*-------------------------------------------------------------------------
- * Function: H5Fget_mpi_atomicity
- *
- * Purpose: Returns the atomicity mode
+ * Function: H5Fget_mpi_atomicity
*
- * Return: Success: Non-negative
+ * Purpose: Returns the atomicity mode
*
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Mohamad Chaarawi
- * Feb 14, 2012
+ * Programmer: Mohamad Chaarawi
+ * Feb 14, 2012
*
*-------------------------------------------------------------------------
*/
@@ -236,7 +224,7 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag)
if (!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, does not support MPI atomicity mode")
- /* get atomicity value */
+ /* Get atomicity value */
if (H5FD_get_mpio_atomicity(file->shared->lf, flag) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get atomicity flag")
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 1a6a502..222e4b3 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, September 28, 2000
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index 011ee28..01cb946 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -88,9 +88,9 @@ typedef enum H5F_scope_t {
* H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL
* H5F_CLOSE_WEAK - file closes only after all opened objects are closed
* H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file
- close fails
+ close fails
* H5F_CLOSE_STRONG - if there are opened objects, close them first, then
- close file
+ close file
*/
typedef enum H5F_close_degree_t {
H5F_CLOSE_DEFAULT = 0,
diff --git a/src/H5Fquery.c b/src/H5Fquery.c
index 64e95b7..9a1f7d2 100644
--- a/src/H5Fquery.c
+++ b/src/H5Fquery.c
@@ -31,10 +31,10 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fpkg.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
/****************/
/* Local Macros */
@@ -65,17 +65,13 @@
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5F_get_intent
+ * Function: H5F_get_intent
*
- * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
- *
- * Return: 'intent' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * September 29, 2000
+ * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: 'intent' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
unsigned
@@ -90,16 +86,12 @@ H5F_get_intent(const H5F_t *f)
} /* end H5F_get_intent() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_open_name
- *
- * Purpose: Retrieve the name used to open a file.
+ * Function: H5F_get_open_name
*
- * Return: Success: The name of the file.
- * Failure: ? (should not happen)
- *
- * Programmer: Neil Fortner
- * December 15 2008
+ * Purpose: Retrieve the name used to open a file.
*
+ * Return: Success: The name of the file.
+ * Failure: ? (should not happen)
*-------------------------------------------------------------------------
*/
char *
@@ -115,16 +107,12 @@ H5F_get_open_name(const H5F_t *f)
} /* end H5F_get_open_name() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_actual_name
- *
- * Purpose: Retrieve the actual name of a file, after resolving symlinks, etc.
+ * Function: H5F_get_actual_name
*
- * Return: Success: The name of the file.
- * Failure: ? (should not happen)
- *
- * Programmer: Quincey Koziol
- * November 25 2009
+ * Purpose: Retrieve the actual name of a file, after resolving symlinks, etc.
*
+ * Return: Success: The name of the file.
+ * Failure: ? (should not happen)
*-------------------------------------------------------------------------
*/
char *
@@ -140,17 +128,13 @@ H5F_get_actual_name(const H5F_t *f)
} /* end H5F_get_actual_name() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_extpath
- *
- * Purpose: Retrieve the file's 'extpath' flags
- * This is used by H5L_extern_traverse() and
- * H5D_build_extfile_prefix() to retrieve the main file's location
- * when searching the target file.
+ * Function: H5F_get_extpath
*
- * Return: 'extpath' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Vailin Choi, April 2, 2008
+ * Purpose: Retrieve the file's 'extpath' flags
+ * This is used by H5L_extern_traverse() and H5D_build_file_prefix()
+ * to retrieve the main file's location when searching the target file.
*
+ * Return: 'extpath' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
char *
@@ -166,14 +150,11 @@ H5F_get_extpath(const H5F_t *f)
} /* end H5F_get_extpath() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_shared
- *
- * Purpose: Retrieve the file's 'shared' pointer
+ * Function: H5F_get_shared
*
- * Return: 'shared' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'shared' pointer
*
+ * Return: 'shared' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
H5F_file_t *
@@ -188,14 +169,11 @@ H5F_get_shared(const H5F_t *f)
} /* end H5F_get_shared() */
/*-------------------------------------------------------------------------
- * Function: H5F_same_shared
- *
- * Purpose: Determine if two files have the same shared file pointer
- *
- * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
+ * Function: H5F_same_shared
*
- * Programmer: Quincey Koziol, July 19, 2011
+ * Purpose: Determine if two files have the same shared file pointer
*
+ * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
hbool_t
@@ -213,14 +191,11 @@ H5F_same_shared(const H5F_t *f1, const H5F_t *f2)
} /* end H5F_same_shared() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_nopen_objs
- *
- * Purpose: Retrieve the file's 'nopen_objs' value
- *
- * Return: 'nopen_objs' on success/abort on failure (shouldn't fail)
+ * Function: H5F_get_nopen_objs
*
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'nopen_objs' value
*
+ * Return: 'nopen_objs' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
unsigned
@@ -235,14 +210,11 @@ H5F_get_nopen_objs(const H5F_t *f)
} /* end H5F_get_nopen_objs() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_file_id
+ * Function: H5F_get_file_id
*
- * Purpose: Retrieve the file's 'file_id' value
- *
- * Return: 'file_id' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'file_id' value
*
+ * Return: 'file_id' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
hid_t
@@ -257,14 +229,11 @@ H5F_get_file_id(const H5F_t *f)
} /* end H5F_get_file_id() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_parent
- *
- * Purpose: Retrieve the file's 'parent' pointer
- *
- * Return: 'parent' on success/abort on failure (shouldn't fail)
+ * Function: H5F_get_parent
*
- * Programmer: Quincey Koziol, July 19, 2011
+ * Purpose: Retrieve the file's 'parent' pointer
*
+ * Return: 'parent' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
H5F_t *
@@ -279,14 +248,11 @@ H5F_get_parent(const H5F_t *f)
} /* end H5F_get_parent() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_nmounts
+ * Function: H5F_get_nmounts
*
- * Purpose: Retrieve the file's 'nmounts' value
- *
- * Return: 'nmounts' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'nmounts' value
*
+ * Return: 'nmounts' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
unsigned
@@ -301,17 +267,12 @@ H5F_get_nmounts(const H5F_t *f)
} /* end H5F_get_nmounts() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_fcpl
- *
- * Purpose: Retrieve the value of a file's FCPL.
+ * Function: H5F_get_fcpl
*
- * Return: Success: The FCPL for the file.
- * Failure: ? (should not happen)
- *
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * May 25 2005
+ * Purpose: Retrieve the value of a file's FCPL.
*
+ * Return: Success: The FCPL for the file.
+ * Failure: ? (should not happen)
*-------------------------------------------------------------------------
*/
hid_t
@@ -327,17 +288,13 @@ H5F_get_fcpl(const H5F_t *f)
} /* end H5F_get_fcpl() */
/*-------------------------------------------------------------------------
- * Function: H5F_sizeof_addr
- *
- * Purpose: Quick and dirty routine to retrieve the size of the file's size_t
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
+ * Function: H5F_sizeof_addr
*
- * Return: 'sizeof_addr' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * September 29, 2000
+ * Purpose: Quick and dirty routine to retrieve the size of the file's size_t
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: 'sizeof_addr' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
uint8_t
@@ -353,17 +310,13 @@ H5F_sizeof_addr(const H5F_t *f)
} /* end H5F_sizeof_addr() */
/*-------------------------------------------------------------------------
- * Function: H5F_sizeof_size
- *
- * Purpose: Quick and dirty routine to retrieve the size of the file's off_t
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
+ * Function: H5F_sizeof_size
*
- * Return: 'sizeof_size' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * September 29, 2000
+ * Purpose: Quick and dirty routine to retrieve the size of the file's off_t
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: 'sizeof_size' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
uint8_t
@@ -379,14 +332,11 @@ H5F_sizeof_size(const H5F_t *f)
} /* H5F_sizeof_size() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_sohm_addr
- *
- * Purpose: Retrieve the file's 'sohm_addr' value
+ * Function: H5F_get_sohm_addr
*
- * Return: 'sohm_addr' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'sohm_addr' value
*
+ * Return: 'sohm_addr' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
haddr_t
@@ -402,14 +352,11 @@ H5F_get_sohm_addr(const H5F_t *f)
} /* end H5F_get_sohm_addr() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_sohm_vers
- *
- * Purpose: Retrieve the file's 'sohm_vers' value
- *
- * Return: 'sohm_vers' on success/abort on failure (shouldn't fail)
+ * Function: H5F_get_sohm_vers
*
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'sohm_vers' value
*
+ * Return: 'sohm_vers' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
unsigned
@@ -425,14 +372,11 @@ H5F_get_sohm_vers(const H5F_t *f)
} /* end H5F_get_sohm_vers() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_sohm_nindexes
- *
- * Purpose: Retrieve the file's 'sohm_nindexes' value
- *
- * Return: 'sohm_nindexes' on success/abort on failure (shouldn't fail)
+ * Function: H5F_get_sohm_nindexes
*
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'sohm_nindexes' value
*
+ * Return: 'sohm_nindexes' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
unsigned
@@ -448,19 +392,15 @@ H5F_get_sohm_nindexes(const H5F_t *f)
} /* end H5F_get_sohm_nindexes() */
/*-------------------------------------------------------------------------
- * Function: H5F_sym_leaf_k
+ * Function: H5F_sym_leaf_k
*
- * Purpose: Replaced a macro to retrieve the symbol table leaf size,
- * now that the generic properties are being used to store
- * the values.
- *
- * Return: Success: Non-negative, and the symbol table leaf size is returned.
- * Failure: Negative (should not happen)
- *
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
- * Oct 14 2001
+ * Purpose: Replaced a macro to retrieve the symbol table leaf size,
+ * now that the generic properties are being used to store
+ * the values.
*
+ * Return: Success: Non-negative, and the symbol table leaf size is
+ * returned.
+ * Failure: Negative (should not happen)
*-------------------------------------------------------------------------
*/
unsigned
@@ -477,19 +417,15 @@ H5F_sym_leaf_k(const H5F_t *f)
} /* end H5F_sym_leaf_k() */
/*-------------------------------------------------------------------------
- * Function: H5F_Kvalue
- *
- * Purpose: Replaced a macro to retrieve a B-tree key value for a certain
- * type, now that the generic properties are being used to store
- * the B-tree values.
- *
- * Return: Success: Non-negative, and the B-tree key value is returned.
- * Failure: Negative (should not happen)
+ * Function: H5F_Kvalue
*
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
- * Oct 14 2001
+ * Purpose: Replaced a macro to retrieve a B-tree key value for a certain
+ * type, now that the generic properties are being used to store
+ * the B-tree values.
*
+ * Return: Success: Non-negative, and the B-tree key value is
+ * returned.
+ * Failure: Negative (should not happen)
*-------------------------------------------------------------------------
*/
unsigned
@@ -507,14 +443,11 @@ H5F_Kvalue(const H5F_t *f, const H5B_class_t *type)
} /* end H5F_Kvalue() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_nrefs
+ * Function: H5F_get_nrefs
*
- * Purpose: Retrieve the file's 'nrefs' value
- *
- * Return: 'nrefs' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol, July 20, 2011
+ * Purpose: Retrieve the file's 'nrefs' value
*
+ * Return: 'nrefs' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
unsigned
@@ -530,20 +463,15 @@ H5F_get_nrefs(const H5F_t *f)
} /* end H5F_get_nrefs() */
/*-------------------------------------------------------------------------
- * Function: H5F_rdcc_nslots
+ * Function: H5F_rdcc_nslots
*
- * Purpose: Replaced a macro to retrieve the raw data cache number of slots,
- * now that the generic properties are being used to store
- * the values.
+ * Purpose: Replaced a macro to retrieve the raw data cache number of slots,
+ * now that the generic properties are being used to store
+ * the values.
*
- * Return: Success: Non-negative, and the raw data cache number of
+ * Return: Success: Non-negative, and the raw data cache number of
* of slots is returned.
- * Failure: Negative (should not happen)
- *
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jun 1 2004
- *
+ * Failure: Negative (should not happen)
*-------------------------------------------------------------------------
*/
size_t
@@ -559,20 +487,15 @@ H5F_rdcc_nslots(const H5F_t *f)
} /* end H5F_rdcc_nelmts() */
/*-------------------------------------------------------------------------
- * Function: H5F_rdcc_nbytes
+ * Function: H5F_rdcc_nbytes
*
- * Purpose: Replaced a macro to retrieve the raw data cache number of bytes,
- * now that the generic properties are being used to store
- * the values.
+ * Purpose: Replaced a macro to retrieve the raw data cache number of bytes,
+ * now that the generic properties are being used to store
+ * the values.
*
- * Return: Success: Non-negative, and the raw data cache number of
+ * Return: Success: Non-negative, and the raw data cache number of
* of bytes is returned.
- * Failure: Negative (should not happen)
- *
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jun 1 2004
- *
+ * Failure: Negative (should not happen)
*-------------------------------------------------------------------------
*/
size_t
@@ -588,19 +511,15 @@ H5F_rdcc_nbytes(const H5F_t *f)
} /* end H5F_rdcc_nbytes() */
/*-------------------------------------------------------------------------
- * Function: H5F_rdcc_w0
- *
- * Purpose: Replaced a macro to retrieve the raw data cache 'w0' value
- * now that the generic properties are being used to store
- * the values.
+ * Function: H5F_rdcc_w0
*
- * Return: Success: Non-negative, and the raw data cache 'w0' value is returned.
- * Failure: Negative (should not happen)
- *
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jun 2 2004
+ * Purpose: Replaced a macro to retrieve the raw data cache 'w0' value
+ * now that the generic properties are being used to store
+ * the values.
*
+ * Return: Success: Non-negative, and the raw data cache 'w0' value
+ * is returned.
+ * Failure: Negative (should not happen)
*-------------------------------------------------------------------------
*/
double
@@ -616,17 +535,13 @@ H5F_rdcc_w0(const H5F_t *f)
} /* end H5F_rdcc_w0() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_base_addr
- *
- * Purpose: Quick and dirty routine to retrieve the file's 'base_addr' value
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
+ * Function: H5F_get_base_addr
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu <slu@ncsa.uiuc.edu>
- * December 20, 2002
+ * Purpose: Quick and dirty routine to retrieve the file's 'base_addr' value
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
haddr_t
@@ -643,19 +558,15 @@ H5F_get_base_addr(const H5F_t *f)
} /* end H5F_get_base_addr() */
/*-------------------------------------------------------------------------
- * Function: H5F_grp_btree_shared
- *
- * Purpose: Replaced a macro to retrieve the shared B-tree node info
- * now that the generic properties are being used to store
- * the values.
- *
- * Return: Success: Non-void, and the shared B-tree node info is returned.
- * Failure: void (should not happen)
+ * Function: H5F_grp_btree_shared
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jul 5 2004
+ * Purpose: Replaced a macro to retrieve the shared B-tree node info
+ * now that the generic properties are being used to store
+ * the values.
*
+ * Return: Success: Non-void, and the shared B-tree node info
+ * is returned.
+ * Failure: void (should not happen)
*-------------------------------------------------------------------------
*/
H5RC_t *
@@ -671,19 +582,15 @@ H5F_grp_btree_shared(const H5F_t *f)
} /* end H5F_grp_btree_shared() */
/*-------------------------------------------------------------------------
- * Function: H5F_sieve_buf_size
- *
- * Purpose: Replaced a macro to retrieve the dataset sieve buffer size
- * now that the generic properties are being used to store
- * the values.
- *
- * Return: Success: Non-void, and the dataset sieve buffer size is returned.
- * Failure: void (should not happen)
+ * Function: H5F_sieve_buf_size
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jul 8 2005
+ * Purpose: Replaced a macro to retrieve the dataset sieve buffer size
+ * now that the generic properties are being used to store
+ * the values.
*
+ * Return: Success: Non-void, and the dataset sieve buffer size
+ * is returned.
+ * Failure: void (should not happen)
*-------------------------------------------------------------------------
*/
size_t
@@ -699,18 +606,17 @@ H5F_sieve_buf_size(const H5F_t *f)
} /* end H5F_sieve_buf_size() */
/*-------------------------------------------------------------------------
- * Function: H5F_gc_ref
+ * Function: H5F_gc_ref
*
- * Purpose: Replaced a macro to retrieve the "garbage collect
- * references flag" now that the generic properties are being used
- * to store the values.
+ * Purpose: Replaced a macro to retrieve the "garbage collect
+ * references flag" now that the generic properties are being used
+ * to store the values.
*
- * Return: Success: The "garbage collect references flag" is returned.
- * Failure: (should not happen)
+ * Return: Success: The "garbage collect references flag" is returned.
+ * Failure: (should not happen)
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jul 8 2005
+ * Programmer: Quincey Koziol
+ * Jul 8 2005
*
*-------------------------------------------------------------------------
*/
@@ -734,11 +640,6 @@ H5F_gc_ref(const H5F_t *f)
*
* Return: Success: Non-negative, the 'use the latest format' flag
* Failure: (can't happen)
- *
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Oct 2 2006
- *
*-------------------------------------------------------------------------
*/
hbool_t
@@ -754,17 +655,12 @@ H5F_use_latest_format(const H5F_t *f)
} /* end H5F_use_latest_format() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_fc_degree
- *
- * Purpose: Retrieve the 'file close degree' for the file.
- *
- * Return: Success: Non-negative, the 'file close degree'
- * Failure: (can't happen)
+ * Function: H5F_get_fc_degree
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Mar 5 2007
+ * Purpose: Retrieve the 'file close degree' for the file.
*
+ * Return: Success: Non-negative, the 'file close degree'
+ * Failure: (can't happen)
*-------------------------------------------------------------------------
*/
H5F_close_degree_t
@@ -780,17 +676,12 @@ H5F_get_fc_degree(const H5F_t *f)
} /* end H5F_get_fc_degree() */
/*-------------------------------------------------------------------------
- * Function: H5F_store_msg_crt_idx
- *
- * Purpose: Retrieve the 'store message creation index' flag for the file.
+ * Function: H5F_store_msg_crt_idx
*
- * Return: Success: Non-negative, the 'store message creation index' flag
- * Failure: (can't happen)
- *
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Mar 6 2007
+ * Purpose: Retrieve the 'store message creation index' flag for the file.
*
+ * Return: Success: Non-negative, the 'store message creation index' flag
+ * Failure: (can't happen)
*-------------------------------------------------------------------------
*/
hbool_t
@@ -806,17 +697,12 @@ H5F_store_msg_crt_idx(const H5F_t *f)
} /* end H5F_store_msg_crt_idx() */
/*-------------------------------------------------------------------------
- * Function: H5F_has_feature
- *
- * Purpose: Check if a file has a particular feature enabled
+ * Function: H5F_has_feature
*
- * Return: Success: Non-negative - TRUE or FALSE
- * Failure: Negative (should not happen)
- *
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * May 31 2004
+ * Purpose: Check if a file has a particular feature enabled
*
+ * Return: Success: Non-negative - TRUE or FALSE
+ * Failure: Negative (should not happen)
*-------------------------------------------------------------------------
*/
hbool_t
@@ -832,17 +718,13 @@ H5F_has_feature(const H5F_t *f, unsigned feature)
} /* end H5F_has_feature() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_driver_id
- *
- * Purpose: Quick and dirty routine to retrieve the file's 'driver_id' value
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
+ * Function: H5F_get_driver_id
*
- * Return: 'driver_id' on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * October 10, 2000
+ * Purpose: Quick and dirty routine to retrieve the file's 'driver_id' value
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: 'driver_id' on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
hid_t
@@ -859,17 +741,13 @@ H5F_get_driver_id(const H5F_t *f)
} /* end H5F_get_driver_id() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_fileno
- *
- * Purpose: Quick and dirty routine to retrieve the file's 'fileno' value
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
+ * Function: H5F_get_fileno
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * March 27, 2002
+ * Purpose: Quick and dirty routine to retrieve the file's 'fileno' value
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -893,21 +771,17 @@ done:
} /* end H5F_get_fileno() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_eoa
- *
- * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5F_get_eoa
*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * June 1, 2004
+ * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value
*
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
haddr_t
H5F_get_eoa(const H5F_t *f, H5FD_mem_t type)
{
- haddr_t ret_value;
+ haddr_t ret_value = HADDR_UNDEF; /* Return value */
FUNC_ENTER_NOAPI(HADDR_UNDEF)
@@ -923,17 +797,13 @@ done:
} /* end H5F_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_vfd_handle
- *
- * Purpose: Returns a pointer to the file handle of the low-level file
- * driver. This is the private function for H5Fget_vfd_handle.
- *
- * Return: Success: Non-negative.
- * Failure: negative.
+ * Function: H5F_get_vfd_handle
*
- * Programmer: Raymond Lu
- * Sep. 16, 2002
+ * Purpose: Returns a pointer to the file handle of the low-level file
+ * driver. This is the private function for H5Fget_vfd_handle.
*
+ * Return: Success: Non-negative.
+ * Failure: negative.
*-------------------------------------------------------------------------
*/
herr_t
@@ -956,18 +826,14 @@ done:
} /* end H5F_get_vfd_handle() */
/*-------------------------------------------------------------------------
- * Function: H5F_is_tmp_addr
+ * Function: H5F_is_tmp_addr
*
- * Purpose: Quick and dirty routine to determine if an address is in
- * the 'temporary' file space.
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
- *
- * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
- *
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * June 11, 2009
+ * Purpose: Quick and dirty routine to determine if an address is in
+ * the 'temporary' file space.
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
hbool_t
@@ -983,18 +849,14 @@ H5F_is_tmp_addr(const H5F_t *f, haddr_t addr)
} /* end H5F_is_tmp_addr() */
/*-------------------------------------------------------------------------
- * Function: H5F_use_tmp_space
- *
- * Purpose: Quick and dirty routine to determine if using temporary
- * file space is allowed for this file.
- * (Mainly added to stop non-file routines from poking about in the
- * H5F_t data structure)
- *
- * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
+ * Function: H5F_use_tmp_space
*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * July 1, 2009
+ * Purpose: Quick and dirty routine to determine if using temporary
+ * file space is allowed for this file.
+ * (Mainly added to stop non-file routines from poking about in the
+ * H5F_t data structure)
*
+ * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
*-------------------------------------------------------------------------
*/
hbool_t
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c
index 6eec44a..738f301 100644
--- a/src/H5Fsfile.c
+++ b/src/H5Fsfile.c
@@ -39,11 +39,11 @@ H5FL_DEFINE_STATIC(H5F_sfile_node_t);
H5F_sfile_node_t *H5F_sfile_head_g = NULL;
/*-------------------------------------------------------------------------
- * Function: H5F_sfile_assert_num
+ * Function: H5F_sfile_assert_num
*
- * Purpose: Sanity checking that shared file list is empty
+ * Purpose: Sanity checking that shared file list is empty
*
- * Return: none (void)
+ * Return: void
*
* Programmer: Quincey Koziol
* Monday, July 25, 2005
@@ -82,17 +82,15 @@ H5F_sfile_assert_num(unsigned n)
} /* H5F_sfile_assert_num() */
/*-------------------------------------------------------------------------
- * Function: H5F_sfile_add
+ * Function: H5F_sfile_add
*
- * Purpose: Add a "shared" file struct to the list of open files
+ * Purpose: Add a "shared" file struct to the list of open files
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Monday, July 18, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -122,18 +120,16 @@ done:
} /* end H5F_sfile_add() */
/*-------------------------------------------------------------------------
- * Function: H5F_sfile_search
+ * Function: H5F_sfile_search
*
- * Purpose: Search for a "shared" file with low-level file info that
+ * Purpose: Search for a "shared" file with low-level file info that
* matches
*
- * Return: Non-NULL on success / NULL on failure
+ * Return: Non-NULL on success / NULL on failure
*
* Programmer: Quincey Koziol
* Monday, July 18, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5F_file_t *
@@ -163,17 +159,15 @@ done:
} /* end H5F_sfile_search() */
/*-------------------------------------------------------------------------
- * Function: H5F_sfile_remove
+ * Function: H5F_sfile_remove
*
- * Purpose: Remove a "shared" file struct from the list of open files
+ * Purpose: Remove a "shared" file struct from the list of open files
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Monday, July 18, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index cb331d0..3f1a3b7 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -233,7 +233,6 @@ done:
* Failure: FAIL
*
* Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
* Sept 12, 2003
*
*-------------------------------------------------------------------------
@@ -308,7 +307,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 15, 2003
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index 73f4925..7a78a8f 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -11,6 +11,17 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/*-------------------------------------------------------------------------
+ *
+ * Created: H5Fsuper_cache.c
+ * Aug 15 2009
+ * Quincey Koziol
+ *
+ * Purpose: Implement file superblock & driver info metadata cache methods.
+ *
+ *-------------------------------------------------------------------------
+ */
+
/****************/
/* Module Setup */
/****************/
diff --git a/src/H5Ftest.c b/src/H5Ftest.c
index 957d089..a582bfa 100644
--- a/src/H5Ftest.c
+++ b/src/H5Ftest.c
@@ -15,7 +15,7 @@
*
* Created: H5Ftest.c
* Jan 3 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File testing routines.
*
@@ -72,15 +72,14 @@
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5F_get_sohm_mesg_count_test
+ * Function: H5F_get_sohm_mesg_count_test
*
* Purpose: Retrieve the number of shared messages of a given type in a file
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Jan 3, 2007
+ * Programmer: Quincey Koziol
+ * Jan 3, 2007
*
*-------------------------------------------------------------------------
*/
@@ -105,15 +104,14 @@ done:
} /* end H5F_get_sohm_mesg_count_test() */
/*-------------------------------------------------------------------------
- * Function: H5F_check_cached_stab_test
+ * Function: H5F_check_cached_stab_test
*
* Purpose: Check that a file's superblock contains a cached symbol
* table entry, that the entry matches that in the root
* group's object header, and check that the addresses are
* valid.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Neil Fortner
* Mar 31, 2009
@@ -141,12 +139,11 @@ done:
} /* end H5F_check_cached_stab_test() */
/*-------------------------------------------------------------------------
- * Function: H5F_get_maxaddr_test
+ * Function: H5F_get_maxaddr_test
*
* Purpose: Retrieve the maximum address for a file
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Jun 10, 2009
diff --git a/src/H5G.c b/src/H5G.c
index 599caf7..7a77170 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -14,14 +14,12 @@
/*-------------------------------------------------------------------------
*
* Created: H5G.c
- * Jul 18 1997
- * Robb Matzke <matzke@llnl.gov>
*
* Purpose: Symbol table functions. The functions that begin with
- * `H5G_stab_' don't understand the naming system; they operate
+ * 'H5G_stab_' don't understand the naming system; they operate
* on a single symbol table at a time.
*
- * The functions that begin with `H5G_node_' operate on the leaf
+ * The functions that begin with 'H5G_node_' operate on the leaf
* nodes of a symbol table B-tree. They should be defined in
* the H5Gnode.c file.
*
@@ -42,11 +40,11 @@
* +--------------+----------- +--------------------------------+
* | Location ID | Name | Meaning |
* +--------------+------------+--------------------------------+
- * | File ID | "/foo/bar" | Find `foo' within `bar' within |
+ * | File ID | "/foo/bar" | Find 'foo' within 'bar' within |
* | | | the root group of the specified|
* | | | file. |
* +--------------+------------+--------------------------------+
- * | File ID | "foo/bar" | Find `foo' within `bar' within |
+ * | File ID | "foo/bar" | Find 'foo' within 'bar' within |
* | | | the root group of the specified|
* | | | file. |
* +--------------+------------+--------------------------------+
@@ -56,11 +54,11 @@
* | File ID | "." | The root group of the specified|
* | | | the specified file. |
* +--------------+------------+--------------------------------+
- * | Group ID | "/foo/bar" | Find `foo' within `bar' within |
+ * | Group ID | "/foo/bar" | Find 'foo' within 'bar' within |
* | | | the root group of the file |
* | | | containing the specified group.|
* +--------------+------------+--------------------------------+
- * | Group ID | "foo/bar" | File `foo' within `bar' within |
+ * | Group ID | "foo/bar" | File 'foo' within 'bar' within |
* | | | the specified group. |
* +--------------+------------+--------------------------------+
* | Group ID | "/" | The root group of the file |
@@ -194,7 +192,6 @@ done:
*
* Return: Success: Positive if anything is done that might
* affect other interfaces; zero otherwise.
- *
* Failure: Negative.
*
* Programmer: Robb Matzke
@@ -231,9 +228,9 @@ H5G_term_interface(void)
} /* end H5G_term_interface() */
/*-------------------------------------------------------------------------
- * Function: H5Gcreate2
+ * Function: H5Gcreate2
*
- * Purpose: Creates a new group relative to LOC_ID, giving it the
+ * Purpose: Creates a new group relative to LOC_ID, giving it the
* specified creation property list GCPL_ID and access
* property list GAPL_ID. The link to the new group is
* created with the LCPL_ID.
@@ -245,14 +242,11 @@ H5G_term_interface(void)
* hid_t gcpl_id; IN: Property list for group creation
* hid_t gapl_id; IN: Property list for group access
*
- * Return: Success: The object ID of a new, empty group open for
- * writing. Call H5Gclose() when finished with
- * the group.
- *
- * Failure: FAIL
+ * Return: Success: The object ID of a new, empty group open for
+ * writing. Call H5Gclose() when finished with
+ * the group.
*
- * Programmer: Quincey Koziol
- * April 5, 2007
+ * Failure: FAIL
*
*-------------------------------------------------------------------------
*/
@@ -305,9 +299,9 @@ done:
} /* end H5Gcreate2() */
/*-------------------------------------------------------------------------
- * Function: H5Gcreate_anon
+ * Function: H5Gcreate_anon
*
- * Purpose: Creates a new group relative to LOC_ID, giving it the
+ * Purpose: Creates a new group relative to LOC_ID, giving it the
* specified creation property list GCPL_ID and access
* property list GAPL_ID.
*
@@ -323,19 +317,16 @@ done:
* hid_t gcpl_id; IN: Property list for group creation
* hid_t gapl_id; IN: Property list for group access
*
- * Example: To create missing groups "A" and "B01" along the given path "/A/B01/grp"
+ * Example: To create missing groups "A" and "B01" along the given path "/A/B01/grp"
* hid_t create_id = H5Pcreate(H5P_GROUP_CREATE);
* int status = H5Pset_create_intermediate_group(create_id, TRUE);
* hid_t gid = H5Gcreate_anon(file_id, "/A/B01/grp", create_id, H5P_DEFAULT);
*
- * Return: Success: The object ID of a new, empty group open for
- * writing. Call H5Gclose() when finished with
- * the group.
+ * Return: Success: The object ID of a new, empty group open for
+ * writing. Call H5Gclose() when finished with
+ * the group.
*
- * Failure: FAIL
- *
- * Programmer: Peter Cao
- * May 08, 2005
+ * Failure: FAIL
*
*-------------------------------------------------------------------------
*/
@@ -402,17 +393,15 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Gopen2
*
- * Purpose: Opens an existing group for modification. When finished,
- * call H5Gclose() to close it and release resources.
+ * Purpose: Opens an existing group for modification. When finished,
+ * call H5Gclose() to close it and release resources.
*
* This function allows the user the pass in a Group Access
* Property List, which H5Gopen1() does not.
*
- * Return: Success: Object ID of the group.
- * Failure: FAIL
+ * Return: Success: Object ID of the group
*
- * Programmer: James Laird
- * Thursday, July 27, 2006
+ * Failure: FAIL
*
*-------------------------------------------------------------------------
*/
@@ -456,18 +445,15 @@ done:
} /* end H5Gopen2() */
/*-------------------------------------------------------------------------
- * Function: H5Gget_create_plist
- *
- * Purpose: Returns a copy of the group creation property list.
+ * Function: H5Gget_create_plist
*
- * Return: Success: ID for a copy of the group creation
- * property list. The property list ID should be
- * released by calling H5Pclose().
+ * Purpose: Returns a copy of the group creation property list.
*
- * Failure: FAIL
+ * Return: Success: ID for a copy of the group creation
+ * property list. The property list ID should be
+ * released by calling H5Pclose().
*
- * Programmer: Quincey Koziol
- * Tuesday, October 25, 2005
+ * Failure: FAIL
*
*-------------------------------------------------------------------------
*/
@@ -492,18 +478,15 @@ done:
} /* end H5Gget_create_plist() */
/*-------------------------------------------------------------------------
- * Function: H5G_get_create_plist
- *
- * Purpose: Private function for H5Gget_create_plist
+ * Function: H5G_get_create_plist
*
- * Return: Success: ID for a copy of the group creation
- * property list. The property list ID should be
- * released by calling H5Pclose().
+ * Purpose: Private function for H5Gget_create_plist
*
- * Failure: FAIL
+ * Return: Success: ID for a copy of the group creation
+ * property list. The property list ID should be
+ * released by calling H5Pclose().
*
- * Programmer: Quincey Koziol
- * Tuesday, October 25, 2005
+ * Failure: FAIL
*
*-------------------------------------------------------------------------
*/
@@ -586,15 +569,11 @@ done:
} /* end H5G_get_create_plist() */
/*-------------------------------------------------------------------------
- * Function: H5Gget_info
- *
- * Purpose: Retrieve information about a group.
+ * Function: H5Gget_info
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Purpose: Retrieve information about a group.
*
- * Programmer: Quincey Koziol
- * November 27 2006
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -628,15 +607,12 @@ done:
} /* end H5Gget_info() */
/*-------------------------------------------------------------------------
- * Function: H5Gget_info_by_name
- *
- * Purpose: Retrieve information about a group.
+ * Function: H5Gget_info_by_name
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Purpose: Retrieve information about a group, where the group is
+ * identified by name instead of ID.
*
- * Programmer: Quincey Koziol
- * November 27 2006
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -687,16 +663,12 @@ done:
} /* end H5Gget_info_by_name() */
/*-------------------------------------------------------------------------
- * Function: H5Gget_info_by_idx
+ * Function: H5Gget_info_by_idx
*
- * Purpose: Retrieve information about a group, according to the order
+ * Purpose: Retrieve information about a group, according to the order
* of an index.
*
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * November 27 2006
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -754,15 +726,12 @@ done:
} /* end H5Gget_info_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5Gclose
- *
- * Purpose: Closes the specified group. The group ID will no longer be
- * valid for accessing the group.
+ * Function: H5Gclose
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Closes the specified group. The group ID will no longer be
+ * valid for accessing the group.
*
- * Programmer: Robb Matzke
- * Wednesday, December 31, 1997
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -778,8 +747,7 @@ H5Gclose(hid_t group_id)
if (NULL == H5I_object_verify(group_id, H5I_GROUP))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
- /*
- * Decrement the counter on the group atom. It will be freed if the count
+ /* Decrement the counter on the group atom. It will be freed if the count
* reaches zero.
*/
if (H5I_dec_app_ref(group_id) < 0)
diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c
index 333bca0..b8650f6 100644
--- a/src/H5Gbtree2.c
+++ b/src/H5Gbtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5Gbtree2.c
* Sep 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for indexing fields on links
*
@@ -142,7 +142,6 @@ const H5B2_class_t H5G_BT2_CORDER[1] = {{
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -403,18 +402,6 @@ H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, in
HDassert(bt2_udata);
HDassert(bt2_rec);
-#ifdef QAK
- {
- unsigned u;
-
- HDfprintf(stderr, "%s: bt2_udata->corder = %Hd\n", "H5G_dense_btree2_corder_compare",
- (hsize_t)bt2_udata->corder);
- HDfprintf(stderr, "%s: bt2_rec = {%Hu, ", "H5G_dense_btree2_corder_compare",
- (hsize_t)bt2_rec->corder);
- for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
- HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
- }
-#endif /* QAK */
/* Check creation order value */
if (bt2_udata->corder < bt2_rec->corder)
*result = -1;
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index d03f6c9..90c3ac3 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -15,7 +15,7 @@
*
* Created: H5Gcache.c
* Feb 5 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement group metadata cache methods.
*
diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c
index 8dc0663..39009ba 100644
--- a/src/H5Gcompact.c
+++ b/src/H5Gcompact.c
@@ -15,7 +15,7 @@
*
* Created: H5Gcompact.c
* Sep 5 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for handling compact storage.
*
@@ -64,15 +64,14 @@ static herr_t H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, cons
H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable);
/*-------------------------------------------------------------------------
- * Function: H5G_compact_build_table_cb
+ * Function: H5G_compact_build_table_cb
*
- * Purpose: Callback routine for searching 'link' messages for a particular
+ * Purpose: Callback routine for searching 'link' messages for a particular
* name.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
@@ -173,7 +172,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -257,7 +255,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
@@ -423,15 +420,14 @@ done:
} /* end H5G__compact_iterate() */
/*-------------------------------------------------------------------------
- * Function: H5G_compact_lookup_cb
+ * Function: H5G_compact_lookup_cb
*
- * Purpose: Callback routine for searching 'link' messages for a particular
+ * Purpose: Callback routine for searching 'link' messages for a particular
* name & gettting object location for it
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -476,7 +472,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -521,7 +516,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index 41b3185..b145aac 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -15,7 +15,7 @@
*
* Created: H5Gdense.c
* Sep 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for operating on "dense" link storage for a
* group in a file.
@@ -250,7 +250,6 @@ typedef struct {
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2006
*
*-------------------------------------------------------------------------
@@ -294,17 +293,11 @@ H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, const H5O_pline_t
/* Retrieve the heap's address in the file */
if (H5HF_get_heap_addr(fheap, &(linfo->fheap_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get fractal heap address")
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr);
-#endif /* QAK */
/* Retrieve the heap's ID length in the file */
if (H5HF_get_id_len(fheap, &fheap_id_len) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length")
HDassert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN);
-#ifdef QAK
- HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
-#endif /* QAK */
/* Create the name index v2 B-tree */
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
@@ -320,9 +313,6 @@ H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, const H5O_pline_t
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_name, &(linfo->name_bt2_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index")
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr);
-#endif /* QAK */
/* Check if we should create a creation order index v2 B-tree */
if (linfo->index_corder) {
@@ -340,10 +330,7 @@ H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, const H5O_pline_t
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_corder, &(linfo->corder_bt2_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index")
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_addr);
-#endif /* QAK */
- } /* end if */
+ } /* end if */
done:
/* Close the open objects */
@@ -365,7 +352,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -391,18 +377,10 @@ H5G__dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, const H5O_l
HDassert(f);
HDassert(linfo);
HDassert(lnk);
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr);
- HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr);
-#endif /* QAK */
/* Find out the size of buffer needed for serialized link */
if ((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size")
-#ifdef QAK
- HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDstrlen(lnk->name),
- link_size);
-#endif /* QAK */
/* Wrap the local buffer for serialized link */
if (NULL == (wb = H5WB_wrap(link_buf, sizeof(link_buf))))
@@ -477,7 +455,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -513,7 +490,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -576,7 +552,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -615,7 +590,6 @@ done:
* Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -654,7 +628,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -764,7 +737,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 25 2006
*
*-------------------------------------------------------------------------
@@ -863,7 +835,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -899,7 +870,6 @@ done:
* Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -955,7 +925,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -1072,7 +1041,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
@@ -1116,7 +1084,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
@@ -1159,7 +1126,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
@@ -1276,7 +1242,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1342,7 +1307,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1386,7 +1350,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1452,7 +1415,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 15 2006
*
*-------------------------------------------------------------------------
@@ -1484,7 +1446,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 15 2006
*
*-------------------------------------------------------------------------
@@ -1595,7 +1556,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -1704,7 +1664,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1799,7 +1758,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index e770bc1..2677c99 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Gdeprec.c
* June 21 2006
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * James Laird
*
* Purpose: Deprecated functions from the H5G interface. These
* functions are here for compatibility purposes and may be
@@ -311,10 +311,9 @@ H5Gopen1(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group")
done:
- if (ret_value < 0) {
+ if (ret_value < 0)
if (grp && H5G_close(grp) < 0)
HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group")
- } /* end if */
FUNC_LEAVE_API(ret_value)
} /* end H5Gopen1() */
@@ -709,29 +708,26 @@ done:
} /* end H5Gget_comment() */
/*-------------------------------------------------------------------------
- * Function: H5Giterate
- *
- * Purpose: Iterates over the entries of a group. The LOC_ID and NAME
- * identify the group over which to iterate and IDX indicates
- * where to start iterating (zero means at the beginning). The
- * OPERATOR is called for each member and the iteration
- * continues until the operator returns non-zero or all members
- * are processed. The operator is passed a group ID for the
- * group being iterated, a member name, and OP_DATA for each
- * member.
- *
- * Note: Deprecated in favor of H5Literate
- *
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
- *
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
- *
- * Programmer: Robb Matzke
- * Monday, March 23, 1998
+ * Function: H5Giterate
+ *
+ * Purpose: Iterates over the entries of a group. The LOC_ID and NAME
+ * identify the group over which to iterate and IDX indicates
+ * where to start iterating (zero means at the beginning). The
+ * OPERATOR is called for each member and the iteration
+ * continues until the operator returns non-zero or all members
+ * are processed. The operator is passed a group ID for the
+ * group being iterated, a member name, and OP_DATA for each
+ * member.
+ *
+ * NOTE: Deprecated in favor of H5Literate
+ *
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
+ *
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 641e9ef..66489ca 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, September 19, 1997
*/
@@ -75,7 +75,6 @@ H5FL_BLK_EXTERN(str_buf);
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -116,7 +115,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -181,7 +179,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -220,7 +217,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -291,7 +287,6 @@ done:
* Failure: Negative
*
* Programmer: Pedro Vicente
- * pvn@ncsa.uiuc.edu
* ???day, August ??, 2002
*
* Notes: 'depth' parameter determines how much of the group entry
@@ -369,7 +364,6 @@ H5G__ent_reset(H5G_entry_t *ent)
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -512,7 +506,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 29 1997
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gint.c b/src/H5Gint.c
index b863e67..20d12e6 100644
--- a/src/H5Gint.c
+++ b/src/H5Gint.c
@@ -15,7 +15,7 @@
*
* Created: H5Gint.c
* April 5 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: General use, "internal" routines for groups.
*
@@ -34,13 +34,13 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FOprivate.h" /* File objects */
-#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Lprivate.h" /* Links */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FOprivate.h" /* File objects */
+#include "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Lprivate.h" /* Links */
+#include "H5MMprivate.h" /* Memory management */
/****************/
/* Local Macros */
@@ -201,7 +201,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -287,7 +286,7 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, hid_t dxpl
H5O_loc_t grp_oloc; /* Opened object object location */
hbool_t loc_found = FALSE; /* Location at 'name' found */
H5O_type_t obj_type; /* Type of object at location */
- H5G_t * ret_value; /* Return value */
+ H5G_t * ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -319,10 +318,9 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, hid_t dxpl
ret_value = grp;
done:
- if (!ret_value) {
+ if (!ret_value)
if (loc_found && H5G_loc_free(&grp_loc) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, NULL, "can't free location")
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G__open_name() */
@@ -345,9 +343,9 @@ done:
H5G_t *
H5G_open(const H5G_loc_t *loc, hid_t dxpl_id)
{
- H5G_t * grp = NULL; /* Group opened */
- H5G_shared_t *shared_fo; /* Shared group object */
- H5G_t * ret_value; /* Return value */
+ H5G_t * grp = NULL; /* Group opened */
+ H5G_shared_t *shared_fo; /* Shared group object */
+ H5G_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -769,8 +767,7 @@ done:
*
* Purpose: Private function for iterating over links in a group
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Oct 3, 2005
@@ -781,11 +778,11 @@ herr_t
H5G_iterate(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip,
hsize_t *last_lnk, const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id)
{
- H5G_loc_t loc; /* Location of parent for group */
- hid_t gid = -1; /* ID of group to iterate over */
- H5G_t * grp = NULL; /* Pointer to group data structure to iterate over */
- H5G_iter_appcall_ud_t udata; /* User data for callback */
- herr_t ret_value; /* Return value */
+ H5G_loc_t loc; /* Location of parent for group */
+ hid_t gid = H5I_INVALID_HID; /* ID of group to iterate over */
+ H5G_t * grp = NULL; /* Pointer to group data structure to iterate over */
+ H5G_iter_appcall_ud_t udata; /* User data for callback */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -794,8 +791,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_o
HDassert(last_lnk);
HDassert(lnk_op && lnk_op->op_func.op_new);
- /*
- * Open the group on which to operate. We also create a group ID which
+ /* Open the group on which to operate. We also create a group ID which
* we can pass to the application-defined operator.
*/
if (H5G_loc(loc_id, &loc) < 0)
@@ -820,7 +816,7 @@ done:
if (gid > 0) {
if (H5I_dec_app_ref(gid) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group")
- } /* end if */
+ }
else if (grp && H5G_close(grp) < 0)
HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group")
@@ -1013,9 +1009,9 @@ done:
} /* end H5G_visit_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_visit
+ * Function: H5G_visit
*
- * Purpose: Recursively visit all the links in a group and all
+ * Purpose: Recursively visit all the links in a group and all
* the groups that are linked to from that group. Links within
* each group are visited according to the order within the
* specified index (unless the specified index does not exist for
@@ -1027,18 +1023,13 @@ done:
* callback with more than one link that points to a particular
* _object_.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
- *
- *
- *
- * Programmer: Quincey Koziol
- * November 4 2007
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
*-------------------------------------------------------------------------
*/
@@ -1046,15 +1037,15 @@ herr_t
H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op,
void *op_data, hid_t lapl_id, hid_t dxpl_id)
{
- H5G_iter_visit_ud_t udata; /* User data for callback */
- H5O_linfo_t linfo; /* Link info message */
- htri_t linfo_exists; /* Whether the link info message exists */
- hid_t gid = (-1); /* Group ID */
- H5G_t * grp = NULL; /* Group opened */
- H5G_loc_t loc; /* Location of group passed in */
- H5G_loc_t start_loc; /* Location of starting group */
- unsigned rc; /* Reference count of object */
- herr_t ret_value; /* Return value */
+ H5G_iter_visit_ud_t udata; /* User data for callback */
+ H5O_linfo_t linfo; /* Link info message */
+ htri_t linfo_exists; /* Whether the link info message exists */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ H5G_t * grp = NULL; /* Group opened */
+ H5G_loc_t loc; /* Location of group passed in */
+ H5G_loc_t start_loc; /* Location of starting group */
+ unsigned rc; /* Reference count of object */
+ herr_t ret_value = FAIL; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
diff --git a/src/H5Glink.c b/src/H5Glink.c
index 5892516..d7cd56c 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -15,7 +15,7 @@
*
* Created: H5Glink.c
* Nov 13 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Functions for handling links in groups.
*
@@ -86,7 +86,6 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
* (i.e. same as strcmp())
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
@@ -112,7 +111,6 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2)
* (i.e. opposite strcmp())
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 25 2006
*
*-------------------------------------------------------------------------
@@ -137,7 +135,6 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2)
* as equal, their order in the sorted array is undefined.
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
@@ -145,7 +142,7 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2)
static int
H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -171,7 +168,6 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
* as equal, their order in the sorted array is undefined.
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
@@ -179,7 +175,7 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
static int
H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -201,7 +197,6 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 16 2006
*
*-------------------------------------------------------------------------
@@ -385,15 +380,14 @@ done:
} /* end H5G__link_to_loc() */
/*-------------------------------------------------------------------------
- * Function: H5G__link_sort_table
+ * Function: H5G__link_sort_table
*
* Purpose: Sort table containing a list of links for a group
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * Nov 20, 2006
+ * Programmer: Quincey Koziol
+ * Nov 20, 2006
*
*-------------------------------------------------------------------------
*/
@@ -526,7 +520,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 13 2006
*
*-------------------------------------------------------------------------
@@ -547,7 +540,7 @@ H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r,
obj_path_r = H5G_build_fullpath_refstr_str(grp_full_path_r, lnk->name);
if (H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL, dxpl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to replace name")
- } /* end if */
+ }
done:
if (obj_path_r)
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index 066590c..105191a 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -15,7 +15,7 @@
*
* Created: H5Gloc.c
* Sep 13 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for working with group "locations"
*
@@ -129,15 +129,11 @@ static herr_t H5G_loc_get_comment_cb(H5G_loc_t *grp_loc, const char *name, const
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5G_loc
+ * Function: H5G_loc
*
- * Purpose: Given an object ID return a location for the object.
+ * Purpose: Given an object ID return a location for the object.
*
- * Return: Success: Group pointer.
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Tuesday, September 13, 2005
+ * Returns: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -642,13 +638,13 @@ done:
} /* end H5G_loc_exists() */
/*-------------------------------------------------------------------------
- * Function: H5G_loc_info_cb
+ * Function: H5G__loc_info_cb
*
- * Purpose: Callback for retrieving object info for an object in a group
+ * Purpose: Callback for retrieving object info for an object in a group
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 23, 2006
*
*-------------------------------------------------------------------------
@@ -680,9 +676,9 @@ done:
} /* end H5G_loc_info_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_loc_info
+ * Function: H5G_loc_info
*
- * Purpose: Retrieve the information for an object from a group location
+ * Purpose: Retrieve the information for an object from a group location
* and path to that object
*
* Return: Non-negative on success/Negative on failure
diff --git a/src/H5Gname.c b/src/H5Gname.c
index 5f8c2d8..b22bddf 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -15,7 +15,7 @@
*
* Created: H5Gname.c
* Sep 12 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for handling group hierarchy paths.
*
@@ -114,7 +114,6 @@ H5FL_BLK_EXTERN(str_buf);
* Failure: Ptr to the null terminator of NAME.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -151,10 +150,10 @@ H5G__component(const char *name, size_t *size_p)
char *
H5G_normalize(const char *name)
{
- char * norm; /* Pointer to the normalized string */
- size_t s, d; /* Positions within the strings */
- unsigned last_slash; /* Flag to indicate last character was a slash */
- char * ret_value; /* Return value */
+ char * norm; /* Pointer to the normalized string */
+ size_t s, d; /* Positions within the strings */
+ unsigned last_slash; /* Flag to indicate last character was a slash */
+ char * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -205,7 +204,7 @@ done:
* Return: TRUE for valid prefix, FALSE for not a valid prefix, FAIL
* on error
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
*
* Date: September 24, 2002
*
@@ -269,7 +268,7 @@ done:
*
* Return: Pointer to reference counted string on success, NULL on error
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
*
* Date: August 19, 2005
*
@@ -278,12 +277,12 @@ done:
static H5RS_str_t *
H5G_build_fullpath(const char *prefix, const char *name)
{
- char * full_path; /* Full user path built */
- size_t orig_path_len; /* Original length of the path */
- size_t path_len; /* Length of the path */
- size_t name_len; /* Length of the name */
- unsigned need_sep; /* Flag to indicate if separator is needed */
- H5RS_str_t *ret_value; /* Return value */
+ char * full_path; /* Full user path built */
+ size_t orig_path_len; /* Original length of the path */
+ size_t path_len; /* Length of the path */
+ size_t name_len; /* Length of the name */
+ unsigned need_sep; /* Flag to indicate if separator is needed */
+ H5RS_str_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -330,7 +329,7 @@ done:
* Return: Success: Non-NULL, combined path
* Failure: NULL
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
* Tuesday, October 11, 2005
*
*-------------------------------------------------------------------------
@@ -338,8 +337,8 @@ done:
H5RS_str_t *
H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name)
{
- const char *prefix; /* Pointer to raw string for path */
- H5RS_str_t *ret_value;
+ const char *prefix; /* Pointer to raw string for path */
+ H5RS_str_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -366,7 +365,7 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name)
*
* Return: Pointer to reference counted string on success, NULL on error
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
*
* Date: August 19, 2005
*
@@ -433,7 +432,7 @@ H5G__name_init(H5G_name_t *name, const char *path)
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* Thursday, August 22, 2002
*
*-------------------------------------------------------------------------
@@ -536,18 +535,14 @@ H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth)
* Programmer: Quincey Koziol
* Tuesday, December 13, 2005
*
- * Modifications: Leon Arber
- * Oct. 18, 2006
- * Added functionality to get the name for a reference.
- *
*-------------------------------------------------------------------------
*/
ssize_t
H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, hbool_t *cached, hid_t lapl_id,
hid_t dxpl_id)
{
- ssize_t len = 0; /* Length of object's name */
- ssize_t ret_value; /* Return value */
+ ssize_t len = 0; /* Length of object's name */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -633,7 +628,7 @@ H5G_name_reset(H5G_name_t *name)
*
* Return: Success
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
*
* Date: August 22, 2002
*
@@ -768,7 +763,7 @@ done:
*
* Return: Success: 0, Failure: -1
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
*
* Date: June 5, 2002
*
@@ -1047,7 +1042,7 @@ done:
*
* Return: Success: 0, Failure: -1
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
*
* Date: June 11, 2002
*
@@ -1135,7 +1130,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS
else {
/* We pass NULL as link pointer when we need to search all IDs */
search_group = search_dataset = search_datatype = TRUE;
- } /* end else */
+ }
/* Check if we need to operate on the objects affected */
if (search_group || search_dataset || search_datatype) {
@@ -1179,11 +1174,11 @@ done:
* Purpose: Callback for retrieving object's name by address
*
* Return: Positive if path is for object desired
- * 0 if not correct object
- * negative on failure.
+ * 0 if not correct object
+ * negative on failure.
*
* Programmer: Quincey Koziol
- * November 4 2007
+ * November 4 2007
*
*-------------------------------------------------------------------------
*/
@@ -1246,10 +1241,11 @@ done:
*
* Purpose: Tries to figure out the path to an object from it's address
*
- * Return: returns size of path name, and copies it into buffer
- * pointed to by name if that buffer is big enough.
- * 0 if it cannot find the path
- * negative on failure.
+ * Return: Success: Returns size of path name, and copies it into buffer
+ * pointed to by name if that buffer is big enough.
+ * 0 if it cannot find the path
+ *
+ * Failure: -1
*
* Programmer: Quincey Koziol
* November 4 2007
@@ -1259,11 +1255,11 @@ done:
ssize_t
H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t *loc, char *name, size_t size)
{
- H5G_gnba_iter_t udata; /* User data for iteration */
- H5G_loc_t root_loc; /* Root group's location */
- hbool_t found_obj = FALSE; /* If we found the object */
- herr_t status; /* Status from iteration */
- ssize_t ret_value; /* Return value */
+ H5G_gnba_iter_t udata; /* User data for iteration */
+ H5G_loc_t root_loc; /* Root group's location */
+ hbool_t found_obj = FALSE; /* If we found the object */
+ herr_t status; /* Status from iteration */
+ ssize_t ret_value = -1; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 92e1dfd..b9fba36 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -15,7 +15,7 @@
*
* Created: H5Gnode.c
* Jun 26 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Functions for handling symbol table nodes. A
* symbol table node is a small collection of symbol
@@ -134,8 +134,6 @@ H5FL_SEQ_DEFINE(H5G_entry_t);
* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5RC_t *
@@ -157,7 +155,6 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 8 1997
*
*-------------------------------------------------------------------------
@@ -186,7 +183,6 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 8 1997
*
*-------------------------------------------------------------------------
@@ -253,7 +249,6 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 15 2003
*
*-------------------------------------------------------------------------
@@ -292,7 +287,6 @@ H5G__node_free(H5G_node_t *sym)
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -363,11 +357,8 @@ done:
* Failure: FAIL (same as LT_KEY<RT_KEY)
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -419,11 +410,8 @@ done:
* Failure: FAIL (same as UDATA < LT_KEY)
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -480,7 +468,6 @@ done:
* Failure: Negative if not found.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -568,7 +555,6 @@ done:
* Failure: H5B_INS_ERROR, NEW_NODE_P might not be initialized.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 24 1997
*
*-------------------------------------------------------------------------
@@ -929,7 +915,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 24 1997
*
*-------------------------------------------------------------------------
@@ -1336,7 +1321,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 19 2006
*
*-------------------------------------------------------------------------
@@ -1443,7 +1427,6 @@ H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATT
* Return: 0(zero) on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 4 1997
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index 62832b5..b092361 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -15,7 +15,7 @@
*
* Created: H5Gobj.c
* Sep 5 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for abstract handling of objects in groups.
*
@@ -105,7 +105,6 @@ static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *li
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 29 2005
*
*-------------------------------------------------------------------------
@@ -159,7 +158,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 29 2005
*
*-------------------------------------------------------------------------
@@ -289,7 +287,6 @@ done:
* Failure: FAIL if error occurred
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 11 2007
*
*-------------------------------------------------------------------------
@@ -352,7 +349,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
@@ -387,7 +383,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 16 2006
*
*-------------------------------------------------------------------------
@@ -426,7 +421,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -695,7 +689,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 27 2006
*
*-------------------------------------------------------------------------
@@ -1092,7 +1085,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 26 2005
*
*-------------------------------------------------------------------------
@@ -1145,7 +1137,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index 1547292..6002ff5 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -1,4 +1,4 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Thursday, September 18, 1997
*
* Purpose: This file contains declarations which are visible
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index 6e37296..5b04e9d 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -35,13 +35,6 @@
#include "H5RSprivate.h" /* Reference-counted strings */
/*
- * Define this to enable debugging.
- */
-#ifdef NDEBUG
-#undef H5G_DEBUG
-#endif
-
-/*
* The disk size for a symbol table entry...
*/
#define H5G_SIZEOF_SCRATCH 16
diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h
index a9d44cc..92323b4 100644
--- a/src/H5Gpublic.h
+++ b/src/H5Gpublic.h
@@ -15,7 +15,7 @@
*
* Created: H5Gpublic.h
* Jul 11 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Public declarations for the H5G package
*
@@ -37,10 +37,6 @@
/* Public Macros */
/*****************/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*******************/
/* Public Typedefs */
/*******************/
@@ -69,6 +65,10 @@ typedef struct H5G_info_t {
/*********************/
/* Public Prototypes */
/*********************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
H5_DLL hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id);
H5_DLL hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id);
H5_DLL hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id);
diff --git a/src/H5Groot.c b/src/H5Groot.c
index 05c9141..61d526b 100644
--- a/src/H5Groot.c
+++ b/src/H5Groot.c
@@ -15,7 +15,7 @@
*
* Created: H5Groot.c
* Apr 8 2009
- * Neil Fortner <nfortne2@hdfgroup.org>
+ * Neil Fortner
*
* Purpose: Functions for operating on the root group.
*
@@ -126,7 +126,6 @@ H5G_rootof(H5F_t *f)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -357,7 +356,6 @@ H5G_root_free(H5G_t *grp)
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 5 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index e8e7526..8d72d86 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Friday, September 19, 1997
*
*/
@@ -118,7 +118,6 @@ typedef struct H5G_bt_it_lbi_t {
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 7 2005
*
*-------------------------------------------------------------------------
@@ -184,7 +183,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 1 1997
*
*-------------------------------------------------------------------------
@@ -241,7 +239,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@uiuc.edu
* Nov 7 2005
*
*-------------------------------------------------------------------------
@@ -295,7 +292,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 1 1997
*
*-------------------------------------------------------------------------
@@ -446,8 +442,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, March 20, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -509,10 +503,10 @@ herr_t
H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, hsize_t skip,
hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data)
{
- H5HL_t * heap = NULL; /* Local heap for group */
- H5O_stab_t stab; /* Info about symbol table */
- H5G_link_table_t ltable = {0, NULL}; /* Link table */
- herr_t ret_value; /* Return value */
+ H5HL_t * heap = NULL; /* Local heap for group */
+ H5O_stab_t stab; /* Info about symbol table */
+ H5G_link_table_t ltable = {0, NULL}; /* Link table */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -731,7 +725,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t
H5O_stab_t stab; /* Info about local heap & B-tree */
H5G_bt_it_gnbi_t udata; /* Iteration information */
hbool_t udata_valid = FALSE; /* Whether iteration information is valid */
- ssize_t ret_value; /* Return value */
+ ssize_t ret_value = -1; /* Return value */
/* Portably clear udata struct (before FUNC_ENTER) */
HDmemset(&udata, 0, sizeof(udata));
@@ -839,7 +833,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -847,11 +840,11 @@ done:
htri_t
H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id)
{
- H5HL_t * heap = NULL; /* Pointer to local heap */
- H5G_bt_lkp_t bt_udata; /* Data to pass through B-tree */
- H5G_stab_fnd_ud_t udata; /* 'User data' to give to callback */
- H5O_stab_t stab; /* Symbol table message */
- htri_t ret_value; /* Return value */
+ H5HL_t * heap = NULL; /* Pointer to local heap */
+ H5G_bt_lkp_t bt_udata; /* Data to pass through B-tree */
+ H5G_stab_fnd_ud_t udata; /* 'User data' to give to callback */
+ H5O_stab_t stab; /* Symbol table message */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -939,7 +932,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -1022,7 +1014,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Mar 17, 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gtest.c b/src/H5Gtest.c
index 9422f26..b815a4a 100644
--- a/src/H5Gtest.c
+++ b/src/H5Gtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Monday, October 17, 2005
*
* Purpose: Group testing functions.
@@ -71,7 +71,7 @@
htri_t H5G__is_empty_test(gid)
hid_t gid; IN: group to check
RETURNS
- Non-negative TRUE/FALSE on success, negative on failure
+ TRUE/FALSE on success, FAIL on failure
DESCRIPTION
Checks to see if the group has no link messages and no symbol table message
and no "dense" link storage
@@ -184,7 +184,7 @@ done:
hid_t gid; IN: group to check
unsigned *nmsgs; OUT: # of link messages in header
RETURNS
- Non-negative TRUE/FALSE on success, negative on failure
+ TRUE/FALSE on success, FAIL on failure
DESCRIPTION
Checks to see if the group has link messages and how many.
GLOBAL VARIABLES
@@ -242,7 +242,7 @@ done:
htri_t H5G__has_stab_test(gid)
hid_t gid; IN: group to check
RETURNS
- Non-negative TRUE/FALSE on success, negative on failure
+ TRUE/FALSE on success, FAIL on failure
DESCRIPTION
Checks to see if the group has a symbol table message.
GLOBAL VARIABLES
@@ -290,7 +290,7 @@ done:
htri_t H5G__is_new_dense_test(gid)
hid_t gid; IN: group to check
RETURNS
- Non-negative TRUE/FALSE on success, negative on failure
+ TRUE/FALSE on success, FAIL on failure
DESCRIPTION
Checks to see if the group is in the "new" format for groups (link messages/
fractal heap+v2 B-tree) and if it is in "dense" storage form (ie. it has
@@ -359,7 +359,7 @@ done:
hsize_t *name_count; OUT: Number of links in name index
hsize_t *corder_count; OUT: Number of links in creation order index
RETURNS
- Non-negative on success, negative on failure
+ SUCCEED/FAIL
DESCRIPTION
Currently, just retrieves the number of links in each index and returns
them.
@@ -437,7 +437,7 @@ done:
hid_t gid; IN: group to check
size_t *lheap_size; OUT: Size of local heap
RETURNS
- Non-negative on success, negative on failure
+ SUCCEED/FAIL
DESCRIPTION
Checks the size of the local heap for a group
GLOBAL VARIABLES
@@ -484,7 +484,7 @@ done:
size_t *user_path_len; OUT: Size of user path
unsigned *obj_hidden; OUT: Whether object is hidden
RETURNS
- Non-negative on success, negative on failure
+ SUCCEED/FAIL
DESCRIPTION
Retrieves the user path for an ID. A zero for the length is returned in
the case of no user path.
@@ -578,8 +578,7 @@ done:
* the provided group's object header, and check that the
* addresses are valid.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Neil Fortner
* Mar 31, 2009
@@ -633,7 +632,7 @@ done:
* group with a symbol table, and that that information is
* correct.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: H5_ITER_STOP/H5_ITER_CONT/H5_ITER_ERROR
*
* Programmer: Neil Fortner
* Apr 8, 2011
@@ -696,7 +695,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUS
(sn->entry[i].cache.stab.heap_addr != stab.heap_addr))
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR,
"cached symbol table information is incorrect")
- } /* end if */
+ }
else if (sn->entry[i].type == H5G_CACHED_STAB)
HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR, "nonexistent STAB message is cached")
@@ -732,7 +731,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* April 6 2011
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c
index 043569d..c5329e3 100644
--- a/src/H5Gtraverse.c
+++ b/src/H5Gtraverse.c
@@ -15,7 +15,7 @@
*
* Created: H5Gtraverse.c
* Sep 13 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for traversing group hierarchy
*
@@ -372,7 +372,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2006
*
*-------------------------------------------------------------------------
@@ -457,7 +456,6 @@ done:
* resolved.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -807,7 +805,6 @@ done:
* traversed.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 13 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5HF.c b/src/H5HF.c
index 0826a51..8c71641 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -15,7 +15,7 @@
*
* Created: H5HF.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implements a "fractal heap" for storing variable-
* length objects in a file.
@@ -81,7 +81,6 @@ H5FL_DEFINE_STATIC(H5HF_t);
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -105,7 +104,6 @@ H5HF_op_read(const void *obj, size_t obj_len, void *op_data)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
@@ -130,7 +128,6 @@ H5HF_op_write(const void *obj, size_t obj_len, void *op_data)
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -197,7 +194,6 @@ done:
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 18 2006
*
*-------------------------------------------------------------------------
@@ -262,7 +258,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -292,7 +287,6 @@ H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 18 2006
*
*-------------------------------------------------------------------------
@@ -323,7 +317,6 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p)
* filled in), negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -388,7 +381,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 9 2006
*
*-------------------------------------------------------------------------
@@ -455,7 +447,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 18 2006
*
*-------------------------------------------------------------------------
@@ -531,7 +522,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
@@ -601,7 +591,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -665,7 +654,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 15 2006
*
*-------------------------------------------------------------------------
@@ -729,7 +717,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -822,7 +809,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 4 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c
index 261acab..2e0e9af 100644
--- a/src/H5HFbtree2.c
+++ b/src/H5HFbtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5HFbtree2.c
* Aug 7 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for "huge" object tracker
*
@@ -781,10 +781,6 @@ H5HF_huge_bt2_dir_compare(const void *_rec1, const void *_rec2, int *result)
FUNC_ENTER_NOAPI_NOINIT_NOERR
-#ifdef QAK
- HDfprintf(stderr, "%s: rec1 = {%a, %Hu}\n", "H5HF_huge_bt2_dir_compare", rec1->addr, rec1->len);
- HDfprintf(stderr, "%s: rec2 = {%a, %Hu}\n", "H5HF_huge_bt2_dir_compare", rec2->addr, rec2->len);
-#endif /* QAK */
if (rec1->addr < rec2->addr)
*result = -1;
else if (rec1->addr > rec2->addr)
@@ -906,13 +902,6 @@ H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
-#ifdef QAK
- HDfprintf(stderr, "%s: nrecord = {%a, %Hu, %x, %Hu}\n", "H5HF_huge_bt2_filt_dir_found",
- ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->addr,
- ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->len,
- ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->filter_mask,
- ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->obj_size);
-#endif /* QAK */
*(H5HF_huge_bt2_filt_dir_rec_t *)op_data = *(const H5HF_huge_bt2_filt_dir_rec_t *)nrecord;
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index a648e84..deb19be 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -15,7 +15,7 @@
*
* Created: H5HFcache.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implement fractal heap metadata cache methods.
*
@@ -146,7 +146,6 @@ H5FL_BLK_DEFINE(direct_block);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -195,7 +194,6 @@ H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -243,7 +241,6 @@ H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -433,7 +430,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -567,7 +563,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -613,7 +608,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -651,7 +645,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -682,7 +675,6 @@ H5HF_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_hdr_t *hdr, size_t
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -887,7 +879,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -1075,7 +1066,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -1126,7 +1116,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -1164,7 +1153,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -1194,7 +1182,6 @@ H5HF_cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5HF_indirect_t *ibl
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -1373,7 +1360,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -1660,7 +1646,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -1712,7 +1697,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -1750,7 +1734,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index ad041f1..b0a7d7f 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -15,7 +15,7 @@
*
* Created: H5HFdbg.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Dump debugging information about a fractal heap
*
@@ -97,7 +97,6 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int i
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 28 2006
*
*-------------------------------------------------------------------------
@@ -155,7 +154,6 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 23 2012
*
*-------------------------------------------------------------------------
@@ -249,7 +247,6 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -293,7 +290,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 13 2006
*
*-------------------------------------------------------------------------
@@ -376,7 +372,6 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 28 2006
*
*-------------------------------------------------------------------------
@@ -499,7 +494,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 23 2012
*
*-------------------------------------------------------------------------
@@ -613,7 +607,6 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 7 2006
*
*-------------------------------------------------------------------------
@@ -671,7 +664,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 13 2006
*
*-------------------------------------------------------------------------
@@ -703,10 +695,6 @@ H5HF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata)
"Section address:", sect->sect_info.addr);
HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth,
"Section size:", sect->sect_info.size);
-#ifdef QAK
- HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth,
- "Section state:", (sect->sect_info.state == H5FS_SECT_LIVE ? "live" : "serialized"));
-#endif /* QAK */
/* Dump section-specific debugging information */
if (H5FS_sect_debug(udata->fspace, _sect, udata->stream, udata->indent + 3, MAX(0, udata->fwidth - 3)) <
@@ -725,7 +713,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 9 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index 46be310..2e83868 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -15,7 +15,7 @@
*
* Created: H5HFdblock.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Direct block routines for fractal heaps.
*
@@ -77,7 +77,6 @@ H5FL_DEFINE(H5HF_direct_t);
* Return: Pointer to new direct block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -209,7 +208,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 17 2006
*
*-------------------------------------------------------------------------
@@ -321,7 +319,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 13 2006
*
*-------------------------------------------------------------------------
@@ -422,7 +419,6 @@ done:
* Return: Pointer to direct block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -497,7 +493,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 8 2006
*
*-------------------------------------------------------------------------
@@ -603,7 +598,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -670,7 +664,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c
index 8d01eab..bb6f3f3 100644
--- a/src/H5HFdtable.c
+++ b/src/H5HFdtable.c
@@ -15,7 +15,7 @@
*
* Created: H5HFdtable.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: "Doubling table" routines for fractal heaps.
*
@@ -73,7 +73,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -137,7 +136,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -153,9 +151,6 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi
HDassert(dtable);
HDassert(row);
HDassert(col);
-#ifdef QAK
- HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off);
-#endif /* QAK */
/* Check for offset in first row */
if (off < dtable->num_id_first_row) {
@@ -166,9 +161,6 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi
unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */
hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */
-#ifdef QAK
- HDfprintf(stderr, "%s: high_bit = %u, off_mask = %Hu\n", "H5HF_dtable_lookup", high_bit, off_mask);
-#endif /* QAK */
*row = (high_bit - dtable->first_row_bits) + 1;
H5_CHECKED_ASSIGN(*col, unsigned, ((off - off_mask) / dtable->row_block_size[*row]), hsize_t);
} /* end else */
@@ -184,7 +176,6 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
@@ -222,7 +213,6 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable)
* Return: Non-negative on success (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 25 2006
*
*-------------------------------------------------------------------------
@@ -230,7 +220,7 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable)
unsigned
H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size)
{
- unsigned row; /* Row where block will fit */
+ unsigned row = 0; /* Row where block will fit */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -257,7 +247,6 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size)
* Return: Non-negative on success (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -265,7 +254,7 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size)
unsigned
H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size)
{
- unsigned rows; /* # of rows required for indirect block */
+ unsigned rows = 0; /* # of rows required for indirect block */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -287,7 +276,6 @@ H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size)
* Return: Non-zero span size on success/zero on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 25 2006
*
*-------------------------------------------------------------------------
@@ -296,11 +284,11 @@ hsize_t
H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col,
unsigned num_entries)
{
- unsigned start_entry; /* Entry for first block covered */
- unsigned end_row; /* Row for last block covered */
- unsigned end_col; /* Column for last block covered */
- unsigned end_entry; /* Entry for last block covered */
- hsize_t acc_span_size; /* Accumulated span size */
+ unsigned start_entry; /* Entry for first block covered */
+ unsigned end_row; /* Row for last block covered */
+ unsigned end_col; /* Column for last block covered */
+ unsigned end_entry; /* Entry for last block covered */
+ hsize_t acc_span_size = 0; /* Accumulated span size */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -317,12 +305,6 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned
end_entry = (start_entry + num_entries) - 1;
end_row = end_entry / dtable->cparam.width;
end_col = end_entry % dtable->cparam.width;
-#ifdef QAK
- HDfprintf(stderr, "%s: start_row = %u, start_col = %u, start_entry = %u\n",
- "H5HF_sect_indirect_span_size", start_row, start_col, start_entry);
- HDfprintf(stderr, "%s: end_row = %u, end_col = %u, end_entry = %u\n", "H5HF_sect_indirect_span_size",
- end_row, end_col, end_entry);
-#endif /* QAK */
/* Initialize accumulated span size */
acc_span_size = 0;
@@ -331,7 +313,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned
/* Check for multi-row span */
if (start_row != end_row) {
- /* Accomodate partial starting row */
+ /* Accommodate partial starting row */
if (start_col > 0) {
acc_span_size = dtable->row_block_size[start_row] * (dtable->cparam.width - start_col);
start_row++;
@@ -343,7 +325,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned
start_row++;
} /* end while */
- /* Accomodate partial ending row */
+ /* Accommodate partial ending row */
acc_span_size += dtable->row_block_size[start_row] * (end_col + 1);
} /* end if */
else {
@@ -351,8 +333,5 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned
acc_span_size = dtable->row_block_size[start_row] * ((end_col - start_col) + 1);
} /* end else */
-#ifdef QAK
- HDfprintf(stderr, "%s: acc_span_size = %Hu\n", "H5HF_dtable_span_size", acc_span_size);
-#endif /* QAK */
FUNC_LEAVE_NOAPI(acc_span_size)
} /* end H5HF_sect_indirect_span_size() */
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index 0ddd072..09d10b3 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -15,7 +15,7 @@
*
* Created: H5HFhdr.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Heap header routines for fractal heaps.
*
@@ -45,13 +45,13 @@
/* Limit on the size of the max. direct block size */
/* (This is limited to 32-bits currently, because I think it's unlikely to
* need to be larger, the 32-bit limit for H5VM_log2_of2(n), and
- * some offsets/sizes are encoded with a maxiumum of 32-bits - QAK)
+ * some offsets/sizes are encoded with a maximum of 32-bits - QAK)
*/
#define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024)
/* Limit on the width of the doubling table */
/* (This is limited to 16-bits currently, because I think it's unlikely to
- * need to be larger, and its encoded with a maxiumum of 16-bits - QAK)
+ * need to be larger, and its encoded with a maximum of 16-bits - QAK)
*/
#define H5HF_WIDTH_LIMIT (64 * 1024)
#endif /* NDEBUG */
@@ -91,7 +91,6 @@ H5FL_DEFINE_STATIC(H5HF_hdr_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
@@ -99,8 +98,8 @@ H5FL_DEFINE_STATIC(H5HF_hdr_t);
H5HF_hdr_t *
H5HF_hdr_alloc(H5F_t *f)
{
- H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */
- H5HF_hdr_t *ret_value; /* Return value */
+ H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */
+ H5HF_hdr_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -134,7 +133,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
@@ -186,7 +184,6 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2006
*
*-------------------------------------------------------------------------
@@ -224,7 +221,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2006
*
*-------------------------------------------------------------------------
@@ -279,7 +275,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
@@ -316,7 +311,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
@@ -324,9 +318,9 @@ done:
haddr_t
H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
{
- H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */
- size_t dblock_overhead; /* Direct block's overhead */
- haddr_t ret_value; /* Return value */
+ H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */
+ size_t dblock_overhead; /* Direct block's overhead */
+ haddr_t ret_value = HADDR_UNDEF; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -515,7 +509,6 @@ done:
* Return: Pointer to indirect block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 5 2010
*
*-------------------------------------------------------------------------
@@ -523,9 +516,9 @@ done:
H5HF_hdr_t *
H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw)
{
- H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
- H5HF_hdr_t * hdr; /* Fractal heap header */
- H5HF_hdr_t * ret_value; /* Return value */
+ H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
+ H5HF_hdr_t * hdr; /* Fractal heap header */
+ H5HF_hdr_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -562,7 +555,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
@@ -597,7 +589,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
@@ -635,7 +626,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 1 2006
*
*-------------------------------------------------------------------------
@@ -662,7 +652,6 @@ H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 1 2006
*
*-------------------------------------------------------------------------
@@ -690,7 +679,6 @@ H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
@@ -727,7 +715,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 9 2006
*
*-------------------------------------------------------------------------
@@ -764,7 +751,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 10 2006
*
*-------------------------------------------------------------------------
@@ -803,7 +789,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 23 2006
*
*-------------------------------------------------------------------------
@@ -833,7 +818,6 @@ H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 30 2006
*
*-------------------------------------------------------------------------
@@ -870,7 +854,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -906,7 +889,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 3 2006
*
*-------------------------------------------------------------------------
@@ -958,7 +940,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 14 2006
*
*-------------------------------------------------------------------------
@@ -1153,7 +1134,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 23 2006
*
*-------------------------------------------------------------------------
@@ -1192,7 +1172,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -1344,7 +1323,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 17 2006
*
*-------------------------------------------------------------------------
@@ -1391,7 +1369,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 27 2009
*
*-------------------------------------------------------------------------
@@ -1432,7 +1409,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 5 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c
index 83634e8..5457612 100644
--- a/src/H5HFhuge.c
+++ b/src/H5HFhuge.c
@@ -15,7 +15,7 @@
*
* Created: H5HFhuge.c
* Aug 7 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for "huge" objects in fractal heap
*
@@ -86,7 +86,6 @@ static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -166,7 +165,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -187,10 +185,6 @@ H5HF_huge_init(H5HF_hdr_t *hdr)
* the file in the heap ID (which will speed up accessing it) and we don't
* have any I/O pipeline filters.
*/
-#ifdef QAK
- HDfprintf(stderr, "%s: hdr->id_len = %u\n", "H5HF_huge_init", (unsigned)hdr->id_len);
- HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr->filter_len);
-#endif /* QAK */
if (hdr->filter_len > 0) {
if ((hdr->id_len - 1) >= (unsigned)(hdr->sizeof_addr + hdr->sizeof_size + 4 + hdr->sizeof_size)) {
/* Indicate that v2 B-tree doesn't have to be used to locate object */
@@ -240,7 +234,6 @@ H5HF_huge_init(H5HF_hdr_t *hdr)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 15 2006
*
*-------------------------------------------------------------------------
@@ -287,7 +280,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -349,11 +341,6 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, voi
if (H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &write_size,
&write_buf) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed")
-#ifdef QAK
- HDfprintf(stderr, "%s: nbytes = %Zu, write_size = %Zu, write_buf = %p\n", FUNC, nbytes, write_size,
- write_buf);
- HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj);
-#endif /* QAK */
/* Update size of object on disk */
write_size = nbytes;
@@ -387,10 +374,6 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, voi
obj_rec.len = write_size;
obj_rec.filter_mask = filter_mask;
obj_rec.obj_size = obj_size;
-#ifdef QAK
- HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len,
- obj_rec.filter_mask, obj_rec.obj_size);
-#endif /* QAK */
/* Insert record for object in v2 B-tree */
if (H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0)
@@ -410,9 +393,6 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, voi
/* Initialize record for tracking object in v2 B-tree */
obj_rec.addr = obj_addr;
obj_rec.len = write_size;
-#ifdef QAK
- HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len);
-#endif /* QAK */
/* Insert record for object in v2 B-tree */
if (H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0)
@@ -442,11 +422,6 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, voi
filt_indir_rec.filter_mask = filter_mask;
filt_indir_rec.obj_size = obj_size;
filt_indir_rec.id = new_id;
-#ifdef QAK
- HDfprintf(stderr, "%s: filt_indir_rec = {%a, %Hu, %x, %Hu, %Hu}\n", FUNC, filt_indir_rec.addr,
- filt_indir_rec.len, filt_indir_rec.filter_mask, filt_indir_rec.obj_size,
- filt_indir_rec.id);
-#endif /* QAK */
/* Set pointer to record to insert */
ins_rec = &filt_indir_rec;
@@ -456,10 +431,6 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, voi
indir_rec.addr = obj_addr;
indir_rec.len = write_size;
indir_rec.id = new_id;
-#ifdef QAK
- HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indir_rec.len,
- indir_rec.id);
-#endif /* QAK */
/* Set pointer to record to insert */
ins_rec = &indir_rec;
@@ -494,7 +465,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -586,7 +556,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -735,7 +704,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 21 2007
*
*-------------------------------------------------------------------------
@@ -813,7 +781,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -848,7 +815,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -883,7 +849,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -992,7 +957,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -1055,7 +1019,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index 261c190..e613cab 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -15,7 +15,7 @@
*
* Created: H5HFiblock.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Indirect block routines for fractal heaps.
*
@@ -90,7 +90,6 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 17 2006
*
*-------------------------------------------------------------------------
@@ -156,7 +155,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 17 2006
*
*-------------------------------------------------------------------------
@@ -222,7 +220,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
@@ -258,7 +255,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
@@ -336,7 +332,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
@@ -367,7 +362,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -508,7 +502,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -703,7 +696,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jun 12 2006
*
*-------------------------------------------------------------------------
@@ -849,7 +841,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -931,7 +922,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -996,7 +986,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -1138,7 +1127,6 @@ done:
* Return: Pointer to indirect block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -1264,7 +1252,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 17 2006
*
*-------------------------------------------------------------------------
@@ -1316,7 +1303,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 30 2006
*
*-------------------------------------------------------------------------
@@ -1380,7 +1366,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -1499,7 +1484,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -1533,7 +1517,6 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -1713,7 +1696,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFiter.c b/src/H5HFiter.c
index 50d93c2..cbdb919 100644
--- a/src/H5HFiter.c
+++ b/src/H5HFiter.c
@@ -15,7 +15,7 @@
*
* Created: H5HFiter.c
* Apr 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Block iteration routines for fractal heaps.
*
@@ -77,7 +77,6 @@ H5FL_DEFINE(H5HF_block_loc_t);
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -107,7 +106,6 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -265,7 +263,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -297,7 +294,6 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -357,7 +353,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -417,7 +412,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -452,7 +446,6 @@ H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -499,7 +492,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -554,7 +546,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -592,7 +583,6 @@ H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsig
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 25 2006
*
*-------------------------------------------------------------------------
@@ -631,7 +621,6 @@ H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 25 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFman.c b/src/H5HFman.c
index e0293fb..b9b819b 100644
--- a/src/H5HFman.c
+++ b/src/H5HFman.c
@@ -15,7 +15,7 @@
*
* Created: H5HFman.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: "Managed" object routines for fractal heaps.
*
@@ -89,7 +89,6 @@ static herr_t H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 13 2006
*
*-------------------------------------------------------------------------
@@ -218,7 +217,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 17 2006
*
*-------------------------------------------------------------------------
@@ -368,7 +366,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 17 2006
*
*-------------------------------------------------------------------------
@@ -403,7 +400,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
@@ -439,7 +435,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -474,7 +469,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 15 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h
index aa80c52..ee06294 100644
--- a/src/H5HFpkg.h
+++ b/src/H5HFpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, February 24, 2006
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h
index 4b0edf8..afcc828 100644
--- a/src/H5HFprivate.h
+++ b/src/H5HFprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5HFprivate.h
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Private header for library accessible fractal heap routines.
*
diff --git a/src/H5HFpublic.h b/src/H5HFpublic.h
index aa7903d..73388c0 100644
--- a/src/H5HFpublic.h
+++ b/src/H5HFpublic.h
@@ -15,7 +15,7 @@
*
* Created: H5HFpublic.h
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Public declarations for the fractal heap package.
*
diff --git a/src/H5HFsection.c b/src/H5HFsection.c
index 2d4234f..bd37bff 100644
--- a/src/H5HFsection.c
+++ b/src/H5HFsection.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Monday, May 1, 2006
*
- * Purpose: Free space section routines for fractal heaps.
+ * Purpose: Free space section routines for fractal heaps
*
*/
@@ -372,8 +372,8 @@ done:
static H5HF_free_section_t *
H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state)
{
- H5HF_free_section_t *new_sect; /* New section */
- H5HF_free_section_t *ret_value; /* Return value */
+ H5HF_free_section_t *new_sect; /* New section */
+ H5HF_free_section_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -444,7 +444,6 @@ done:
* Return: Pointer to new section on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 30 2006
*
*-------------------------------------------------------------------------
@@ -452,8 +451,8 @@ done:
H5HF_free_section_t *
H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry)
{
- H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */
- H5HF_free_section_t *ret_value; /* Return value */
+ H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */
+ H5HF_free_section_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -496,7 +495,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* October 24 2006
*
*-------------------------------------------------------------------------
@@ -551,15 +549,14 @@ done:
} /* end H5HF_sect_single_locate_parent() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_single_revive
+ * Function: H5HF_sect_single_revive
*
- * Purpose: Update the memory information for a 'single' free section
+ * Purpose: Update the memory information for a 'single' free section
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * May 8 2006
+ * Programmer: Quincey Koziol
+ * May 8 2006
*
*-------------------------------------------------------------------------
*/
@@ -598,15 +595,14 @@ done:
} /* end H5HF_sect_single_revive() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_single_dblock_info
+ * Function: H5HF_sect_single_dblock_info
*
- * Purpose: Retrieve the direct block information for a single section
+ * Purpose: Retrieve the direct block information for a single section
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * October 24 2006
+ * Programmer: Quincey Koziol
+ * October 24 2006
*
*-------------------------------------------------------------------------
*/
@@ -653,7 +649,6 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -1097,11 +1092,10 @@ H5HF_sect_single_free(H5FS_section_info_t *_sect)
HDassert(sect);
/* Check for live reference to an indirect block */
- if (sect->sect_info.state == H5FS_SECT_LIVE) {
+ if (sect->sect_info.state == H5FS_SECT_LIVE)
/* Get parent indirect block, if there was one */
if (sect->u.single.parent)
parent = sect->u.single.parent;
- } /* end if */
/* Release the section */
if (H5HF_sect_node_free(sect, parent) < 0)
@@ -1216,8 +1210,8 @@ static H5HF_free_section_t *
H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col,
unsigned nentries, H5HF_free_section_t *under_sect)
{
- H5HF_free_section_t *sect = NULL; /* 'Row' section created */
- H5HF_free_section_t *ret_value; /* Return value */
+ H5HF_free_section_t *sect = NULL; /* 'Row' section created */
+ H5HF_free_section_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1255,7 +1249,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -1302,7 +1295,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -1341,7 +1333,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -1415,7 +1406,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -1456,7 +1446,6 @@ done:
* Return: Pointer to indirect block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 9 2006
*
*-------------------------------------------------------------------------
@@ -1620,8 +1609,8 @@ static H5FS_section_info_t *
H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, const uint8_t *buf,
haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags)
{
- H5HF_hdr_t * hdr; /* Fractal heap header */
- H5FS_section_info_t *ret_value; /* Return value */
+ H5HF_hdr_t * hdr; /* Fractal heap header */
+ H5FS_section_info_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -2025,7 +2014,6 @@ H5HF_sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent,
* Return: Offset of indirect block in "heap space" (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -2056,7 +2044,6 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect)
* Return: Pointer to the top indirect section (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -2159,7 +2146,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -2228,7 +2214,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -2291,7 +2276,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -2548,7 +2532,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 3 2006
*
*-------------------------------------------------------------------------
@@ -2625,7 +2608,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -2676,7 +2658,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 3 2006
*
*-------------------------------------------------------------------------
@@ -2743,7 +2724,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -2802,7 +2782,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -3074,7 +3053,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -3312,7 +3290,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/<can't fail>
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 17 2006
*
*-------------------------------------------------------------------------
@@ -3346,7 +3323,6 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -3397,7 +3373,6 @@ done:
* Return: Pointer to indirect block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 9 2006
*
*-------------------------------------------------------------------------
@@ -3850,7 +3825,6 @@ done:
* Purpose: Deserialize a buffer into a "live" indirect section
*
* Return: Success: non-negative
- *
* Failure: negative
*
* Programmer: Quincey Koziol
@@ -3953,11 +3927,10 @@ H5HF_sect_indirect_free(H5HF_free_section_t *sect)
sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents);
/* Check for live reference to an indirect block */
- if (sect->sect_info.state == H5FS_SECT_LIVE) {
+ if (sect->sect_info.state == H5FS_SECT_LIVE)
/* Get indirect block, if there was one */
if (sect->u.indirect.u.iblock)
iblock = sect->u.indirect.u.iblock;
- } /* end if */
/* Release the sections */
if (H5HF_sect_node_free(sect, iblock) < 0)
diff --git a/src/H5HFspace.c b/src/H5HFspace.c
index 7e9f89e..2744103 100644
--- a/src/H5HFspace.c
+++ b/src/H5HFspace.c
@@ -15,7 +15,7 @@
*
* Created: H5HFspace.c
* May 2 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Space allocation routines for fractal heaps.
*
@@ -80,14 +80,8 @@
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
- * Modifications:
- * Vailin Choi, July 29th, 2008
- * Pass values of alignment and threshold to FS_create() and FS_open()
- * for handling alignment.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -147,7 +141,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 15 2006
*
*-------------------------------------------------------------------------
@@ -189,11 +182,9 @@ done:
* Purpose: Attempt to find space in a fractal heap
*
* Return: Success: non-negative
- *
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -242,7 +233,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 24 2012
*
*-------------------------------------------------------------------------
@@ -287,7 +277,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 23 2012
*
*-------------------------------------------------------------------------
@@ -326,7 +315,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 24 2012
*
*-------------------------------------------------------------------------
@@ -379,7 +367,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 24 2012
*
*-------------------------------------------------------------------------
@@ -418,7 +405,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14 2007
*
*-------------------------------------------------------------------------
@@ -462,7 +448,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 24 2006
*
*-------------------------------------------------------------------------
@@ -499,7 +484,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -523,9 +507,6 @@ H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id)
/* Retrieve the number of sections for this heap */
if (H5FS_sect_stats(hdr->fspace, NULL, &nsects) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOUNT, FAIL, "can't query free space section count")
-#ifdef QAK
- HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects);
-#endif /* QAK */
/* Close the free space for the heap */
if (H5FS_close(hdr->f, dxpl_id, hdr->fspace) < 0)
@@ -553,7 +534,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -588,7 +568,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -599,9 +578,6 @@ H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
-#ifdef QAK
- HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
/*
* Check arguments.
diff --git a/src/H5HFstat.c b/src/H5HFstat.c
index 328b1d7..e428df9 100644
--- a/src/H5HFstat.c
+++ b/src/H5HFstat.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Monday, March 6, 2006
*
* Purpose: Fractal heap metadata statistics functions.
diff --git a/src/H5HFtest.c b/src/H5HFtest.c
index 6a4e292..faea9b8 100644
--- a/src/H5HFtest.c
+++ b/src/H5HFtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Thursday, February 3, 2006
*
* Purpose: Fractal heap testing functions.
@@ -177,24 +177,19 @@ H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2)
/* Don't worry about comparing the filter names right now... */
/* (they are expanded during the encode/decode process, but aren't copied
- * during the H5Z_append operation, generating false positive failures)
+ * during the H5Z_append operation, generating false positive failures -QAK)
*/
-#ifdef QAK
+#if 0
/* Check filter name */
- HDfprintf(stderr, "%s: Check 1.0\n", "H5HF_cmp_cparam_test");
- HDfprintf(stderr, "%s: cparam1->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u,
- (cparam1->pline.filter[u].name ? cparam1->pline.filter[u].name : "<nil>"));
- HDfprintf(stderr, "%s: cparam2->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u,
- (cparam2->pline.filter[u].name ? cparam2->pline.filter[u].name : "<nil>"));
- if (!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name)
+ if(!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name)
HGOTO_DONE(-1)
- else if (cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name)
+ else if(cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name)
HGOTO_DONE(1)
- else if (cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) {
- if ((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name)))
+ else if(cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) {
+ if((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name)))
HGOTO_DONE(ret_value)
} /* end if */
-#endif /* QAK */
+#endif
/* Check # of filter parameters */
if (cparam1->pline.filter[u].cd_nelmts < cparam2->pline.filter[u].cd_nelmts)
@@ -234,7 +229,7 @@ done:
unsigned
H5HF_get_max_root_rows(const H5HF_t *fh)
{
- unsigned ret_value; /* Return value */
+ unsigned ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -264,7 +259,7 @@ H5HF_get_max_root_rows(const H5HF_t *fh)
unsigned
H5HF_get_dtable_width_test(const H5HF_t *fh)
{
- unsigned ret_value; /* Return value */
+ unsigned ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -294,7 +289,7 @@ H5HF_get_dtable_width_test(const H5HF_t *fh)
unsigned
H5HF_get_dtable_max_drows_test(const H5HF_t *fh)
{
- unsigned ret_value; /* Return value */
+ unsigned ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -328,7 +323,7 @@ H5HF_get_dtable_max_drows_test(const H5HF_t *fh)
unsigned
H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos)
{
- unsigned ret_value; /* Return value */
+ unsigned ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -359,7 +354,7 @@ H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos)
hsize_t
H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row)
{
- hsize_t ret_value; /* Return value */
+ hsize_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -390,7 +385,7 @@ H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row)
hsize_t
H5HF_get_dblock_free_test(const H5HF_t *fh, unsigned row)
{
- hsize_t ret_value; /* Return value */
+ hsize_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c
index 3c18933..d32f733 100644
--- a/src/H5HFtiny.c
+++ b/src/H5HFtiny.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5HFtiny.c
- * Aug 14 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5HFtiny.c
+ * Aug 14 2006
+ * Quincey Koziol
*
- * Purpose: Routines for "tiny" objects in fractal heap
+ * Purpose: Routines for "tiny" objects in fractal heap
*
*-------------------------------------------------------------------------
*/
@@ -72,15 +72,14 @@ static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operato
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_init
+ * Function: H5HF_tiny_init
*
- * Purpose: Initialize information for tracking 'tiny' objects
+ * Purpose: Initialize information for tracking 'tiny' objects
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Aug 14 2006
+ * Programmer: Quincey Koziol
+ * Aug 14 2006
*
*-------------------------------------------------------------------------
*/
@@ -118,15 +117,14 @@ H5HF_tiny_init(H5HF_hdr_t *hdr)
} /* end H5HF_tiny_init() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_insert
+ * Function: H5HF_tiny_insert
*
- * Purpose: Pack a 'tiny' object in a heap ID
+ * Purpose: Pack a 'tiny' object in a heap ID
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Aug 14 2006
+ * Programmer: Quincey Koziol
+ * Aug 14 2006
*
*-------------------------------------------------------------------------
*/
@@ -138,9 +136,6 @@ H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
-#ifdef QAK
- HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size);
-#endif /* QAK */
/*
* Check arguments.
@@ -180,15 +175,14 @@ done:
} /* end H5HF_tiny_insert() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_get_obj_len
+ * Function: H5HF_tiny_get_obj_len
*
- * Purpose: Get the size of a 'tiny' object in a fractal heap
+ * Purpose: Get the size of a 'tiny' object in a fractal heap
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED (Can't fail)
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Aug 14 2006
+ * Programmer: Quincey Koziol
+ * Aug 14 2006
*
*-------------------------------------------------------------------------
*/
@@ -222,15 +216,14 @@ H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
} /* end H5HF_tiny_get_obj_len() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_op_real
+ * Function: H5HF_tiny_op_real
*
- * Purpose: Internal routine to perform operation on 'tiny' object
+ * Purpose: Internal routine to perform operation on 'tiny' object
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 11 2006
+ * Programmer: Quincey Koziol
+ * Sep 11 2006
*
*-------------------------------------------------------------------------
*/
@@ -281,15 +274,14 @@ done:
} /* end H5HF_tiny_op_real() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_read
+ * Function: H5HF_tiny_read
*
- * Purpose: Read a 'tiny' object from the heap
+ * Purpose: Read a 'tiny' object from the heap
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Aug 8 2006
+ * Programmer: Quincey Koziol
+ * Aug 8 2006
*
*-------------------------------------------------------------------------
*/
@@ -316,15 +308,14 @@ done:
} /* end H5HF_tiny_read() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_op
+ * Function: H5HF_tiny_op
*
- * Purpose: Operate directly on a 'tiny' object
+ * Purpose: Operate directly on a 'tiny' object
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Sept 11 2006
+ * Programmer: Quincey Koziol
+ * Sept 11 2006
*
*-------------------------------------------------------------------------
*/
@@ -351,15 +342,14 @@ done:
} /* end H5HF_tiny_op() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_remove
+ * Function: H5HF_tiny_remove
*
- * Purpose: Remove a 'tiny' object from the heap statistics
+ * Purpose: Remove a 'tiny' object from the heap statistics
*
- * Return: SUCCEED/FAIL
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Aug 14 2006
+ * Programmer: Quincey Koziol
+ * Aug 14 2006
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5HG.c b/src/H5HG.c
index b9559c7..389e8b8 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, March 27, 1998
*
* Purpose: Operations on the global heap. The global heap is the set of
@@ -709,13 +709,6 @@ done:
* Programmer: Robb Matzke
* Monday, March 30, 1998
*
- * Modifications:
- *
- * John Mainzer - 6/8/05
- * Modified function to use the dirtied parameter of
- * H5AC_unprotect() instead of modifying the is_dirty
- * field of the cache info.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -795,11 +788,11 @@ done:
} /* end H5HG_remove() */
/*-------------------------------------------------------------------------
- * Function: H5HG_free
+ * Function: H5HG_free
*
- * Purpose: Destroys a global heap collection in memory
+ * Purpose: Destroys a global heap collection in memory
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Wednesday, January 15, 2003
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index 3d25bc0..7e352e6 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -15,7 +15,7 @@
*
* Created: H5HGcache.c
* Feb 5 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement global heap metadata cache methods.
*
diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c
index 885f9cf..867aa5e 100644
--- a/src/H5HGdbg.c
+++ b/src/H5HGdbg.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
* Purpose: Global Heap object debugging functions.
@@ -68,7 +68,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Mar 27, 1998
*
*-------------------------------------------------------------------------
diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h
index 8c7239e..757ee64 100644
--- a/src/H5HGpkg.h
+++ b/src/H5HGpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
* Purpose: This file contains declarations which are visible
diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h
index 1c80efa..6e2b0f9 100644
--- a/src/H5HGprivate.h
+++ b/src/H5HGprivate.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, March 27, 1998
*/
#ifndef _H5HGprivate_H
diff --git a/src/H5HGpublic.h b/src/H5HGpublic.h
index fcec593..acb48a2 100644
--- a/src/H5HGpublic.h
+++ b/src/H5HGpublic.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, March 27, 1998
*/
#ifndef _H5HGpublic_H
diff --git a/src/H5HGquery.c b/src/H5HGquery.c
index 9e4862d..e1d1ad1 100644
--- a/src/H5HGquery.c
+++ b/src/H5HGquery.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Wednesday, July 20, 2011
*
* Purpose: Query routines for global heaps.
diff --git a/src/H5HL.c b/src/H5HL.c
index cdb1416..eedee92 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -13,12 +13,12 @@
/*-------------------------------------------------------------------------
*
- * Created: H5HL.c
- * Jul 16 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5HL.c
+ * Jul 16 1997
+ * Robb Matzke
*
- * Purpose: Heap functions for the local heaps used by symbol
- * tables to store names (among other things).
+ * Purpose: Heap functions for the local heaps used by symbol
+ * tables to store names (among other things).
*
*-------------------------------------------------------------------------
*/
@@ -32,11 +32,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5HLpkg.h" /* Local Heaps */
-#include "H5MFprivate.h" /* File memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5HLpkg.h" /* Local Heaps */
+#include "H5MFprivate.h" /* File memory management */
/****************/
/* Local Macros */
@@ -78,23 +78,21 @@ H5FL_BLK_DEFINE(lheap_chunk);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5HL_create
+ * Function: H5HL_create
*
- * Purpose: Creates a new heap data structure on disk and caches it
- * in memory. SIZE_HINT is a hint for the initial size of the
- * data area of the heap. If size hint is invalid then a
- * reasonable (but probably not optimal) size will be chosen.
- * If the heap ever has to grow, then REALLOC_HINT is the
- * minimum amount by which the heap will grow.
+ * Purpose: Creates a new heap data structure on disk and caches it
+ * in memory. SIZE_HINT is a hint for the initial size of the
+ * data area of the heap. If size hint is invalid then a
+ * reasonable (but probably not optimal) size will be chosen.
+ * If the heap ever has to grow, then REALLOC_HINT is the
+ * minimum amount by which the heap will grow.
*
- * Return: Success: Non-negative. The file address of new heap is
- * returned through the ADDR argument.
+ * Return: Success: SUCCEED. The file address of new heap is
+ * returned through the ADDR argument.
+ * Failure: FAIL. addr_p will be HADDR_UNDEF.
*
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 16 1997
+ * Programmer: Robb Matzke
+ * Jul 16 1997
*
*-------------------------------------------------------------------------
*/
@@ -188,7 +186,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 12 2008
*
*-------------------------------------------------------------------------
@@ -296,11 +293,9 @@ done:
* Purpose: Go through the heap's freelist and determine if we can
* eliminate the free blocks at the tail of the buffer.
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
* Sept. 16, 2003
*
*-------------------------------------------------------------------------
@@ -420,7 +415,6 @@ done:
* Failure: NULL
*
* Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
* Sept. 17, 2003
*
*-------------------------------------------------------------------------
@@ -506,13 +500,12 @@ done:
* Function: H5HL_offset_into
*
* Purpose: Called directly after the call to H5HL_protect so that
- * a pointer to the object in the heap can be got.
+ * a pointer to the object in the heap can be obtained.
*
* Return: Success: Valid pointer.
- * Failure: NULL
+ * Failure: Can't fail
*
* Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
* Sept. 17, 2003
*
*-------------------------------------------------------------------------
@@ -539,11 +532,9 @@ done:
*
* Purpose: Unprotect the data retrieved by the H5HL_protect call.
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: SUCCEED/FAIL
*
* Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
* Sept. 17, 2003
*
*-------------------------------------------------------------------------
@@ -585,16 +576,15 @@ done:
} /* end H5HL_unprotect() */
/*-------------------------------------------------------------------------
- * Function: H5HL_remove_free
+ * Function: H5HL_remove_free
*
- * Purpose: Removes free list element FL from the specified heap and
- * frees it.
+ * Purpose: Removes free list element FL from the specified heap and
+ * frees it.
*
- * Return: NULL
+ * Return: NULL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 17 1997
+ * Programmer: Robb Matzke
+ * Jul 17 1997
*
*-------------------------------------------------------------------------
*/
@@ -615,16 +605,14 @@ H5HL_remove_free(H5HL_t *heap, H5HL_free_t *fl)
} /* end H5HL_remove_free() */
/*-------------------------------------------------------------------------
- * Function: H5HL_dirty
+ * Function: H5HL_dirty
*
- * Purpose: Mark heap as dirty
+ * Purpose: Mark heap as dirty
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Oct 12 2008
+ * Programmer: Quincey Koziol
+ * Oct 12 2008
*
*-------------------------------------------------------------------------
*/
@@ -657,16 +645,15 @@ done:
} /* end H5HL_dirty() */
/*-------------------------------------------------------------------------
- * Function: H5HL_insert
+ * Function: H5HL_insert
*
- * Purpose: Inserts a new item into the heap.
+ * Purpose: Inserts a new item into the heap.
*
- * Return: Success: Offset of new item within heap.
- * Failure: UFAIL
+ * Return: Success: Offset of new item within heap.
+ * Failure: UFAIL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 17 1997
+ * Programmer: Robb Matzke
+ * Jul 17 1997
*
*-------------------------------------------------------------------------
*/
@@ -865,26 +852,25 @@ done:
} /* H5HL_insert() */
/*-------------------------------------------------------------------------
- * Function: H5HL_remove
+ * Function: H5HL_remove
*
- * Purpose: Removes an object or part of an object from the heap at
- * address ADDR of file F. The object (or part) to remove
- * begins at byte OFFSET from the beginning of the heap and
- * continues for SIZE bytes.
+ * Purpose: Removes an object or part of an object from the heap at
+ * address ADDR of file F. The object (or part) to remove
+ * begins at byte OFFSET from the beginning of the heap and
+ * continues for SIZE bytes.
*
- * Once part of an object is removed, one must not attempt
- * to access that part. Removing the beginning of an object
- * results in the object OFFSET increasing by the amount
- * truncated. Removing the end of an object results in
- * object truncation. Removing the middle of an object results
- * in two separate objects, one at the original offset and
- * one at the first offset past the removed portion.
+ * Once part of an object is removed, one must not attempt
+ * to access that part. Removing the beginning of an object
+ * results in the object OFFSET increasing by the amount
+ * truncated. Removing the end of an object results in
+ * object truncation. Removing the middle of an object results
+ * in two separate objects, one at the original offset and
+ * one at the first offset past the removed portion.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 16 1997
+ * Programmer: Robb Matzke
+ * Jul 16 1997
*
*-------------------------------------------------------------------------
*/
@@ -1017,15 +1003,14 @@ done:
} /* end H5HL_remove() */
/*-------------------------------------------------------------------------
- * Function: H5HL_delete
+ * Function: H5HL_delete
*
- * Purpose: Deletes a local heap from disk, freeing disk space used.
+ * Purpose: Deletes a local heap from disk, freeing disk space used.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Mar 22 2003
+ * Programmer: Quincey Koziol
+ * Mar 22 2003
*
*-------------------------------------------------------------------------
*/
@@ -1095,15 +1080,14 @@ done:
} /* end H5HL_delete() */
/*-------------------------------------------------------------------------
- * Function: H5HL_get_size
+ * Function: H5HL_get_size
*
- * Purpose: Retrieves the current size of a heap
+ * Purpose: Retrieves the current size of a heap
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Nov 7 2005
+ * Programmer: Quincey Koziol
+ * Nov 7 2005
*
*-------------------------------------------------------------------------
*/
@@ -1152,7 +1136,7 @@ done:
* Purpose: Compute the size in bytes of the specified instance of
* H5HL_t via H5HL_size()
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Vailin Choi
* June 19 2007
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index b903a6e..4fe9faa 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5HLcache.c
- * Feb 5 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5HLcache.c
+ * Feb 5 2008
+ * Quincey Koziol
*
- * Purpose: Implement local heap metadata cache methods.
+ * Purpose: Implement local heap metadata cache methods.
*
*-------------------------------------------------------------------------
*/
@@ -43,10 +43,11 @@
#define H5HL_VERSION 0 /* Local heap collection version */
-/* Set the local heap size to speculatively read in */
-/* (needs to be more than the local heap prefix size to work at all and
+/* Set the local heap size to speculatively read in
+ * (needs to be more than the local heap prefix size to work at all and
* should be larger than the default local heap size to save the
- * extra I/O operations) */
+ * extra I/O operations)
+ */
#define H5HL_SPEC_READ_SIZE 512
/******************/
@@ -114,7 +115,6 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 12 2008
*
*-------------------------------------------------------------------------
@@ -177,16 +177,14 @@ done:
} /* end H5HL_fl_deserialize() */
/*-------------------------------------------------------------------------
- * Function: H5HL_fl_serialize
+ * Function: H5HL_fl_serialize
*
- * Purpose: Serialize the free list for a heap data block
+ * Purpose: Serialize the free list for a heap data block
*
- * Return: Success: SUCCESS
- * Failure: FAIL
+ * Return: Nothing (void)
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Oct 12 2008
+ * Programmer: Quincey Koziol
+ * Oct 12 2008
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index 9df2cb5..f8d9d92 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -11,10 +11,10 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
- * Purpose: Local Heap object debugging functions.
+ * Purpose: Local Heap object debugging functions.
*/
#define H5HL_PACKAGE /* Suppress error about including H5HLpkg */
@@ -25,24 +25,14 @@
#include "H5MMprivate.h" /* Memory management */
/*-------------------------------------------------------------------------
- * Function: H5HL_debug
+ * Function: H5HL_debug
*
- * Purpose: Prints debugging information about a heap.
+ * Purpose: Prints debugging information about a heap.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 1 1997
- *
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
- *
- * John Mainzer, 6/17/05
- * Modified the function to use the new dirtied parameter of
- * of H5AC_unprotect() instead of modifying the is_dirty
- * field of the cache info.
+ * Programmer: Robb Matzke
+ * Aug 1 1997
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5HLint.c b/src/H5HLint.c
index 6f1983e..a74aaf2 100644
--- a/src/H5HLint.c
+++ b/src/H5HLint.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5HLint.c
- * Oct 12 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5HLint.c
+ * Oct 12 2008
+ * Quincey Koziol
*
- * Purpose: Local heap internal routines.
+ * Purpose: Local heap internal routines.
*
*-------------------------------------------------------------------------
*/
@@ -73,16 +73,15 @@ H5FL_DEFINE_STATIC(H5HL_dblk_t);
H5FL_DEFINE_STATIC(H5HL_prfx_t);
/*-------------------------------------------------------------------------
- * Function: H5HL_new
+ * Function: H5HL_new
*
- * Purpose: Create a new local heap object
+ * Purpose: Create a new local heap object
*
- * Return: Success: non-NULL pointer to new local heap
- * Failure: NULL
+ * Return: Success: non-NULL pointer to new local heap
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Jan 5 2010
+ * Programmer: Quincey Koziol
+ * Jan 5 2010
*
*-------------------------------------------------------------------------
*/
@@ -118,14 +117,12 @@ done:
/*-------------------------------------------------------------------------
* Function: H5HL_inc_rc
*
- * Purpose: Increment ref. count on heap
+ * Purpose: Increment ref. count on heap
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED (Can't fail)
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Oct 12 2008
+ * Programmer: Quincey Koziol
+ * Oct 12 2008
*
*-------------------------------------------------------------------------
*/
@@ -146,14 +143,12 @@ H5HL_inc_rc(H5HL_t *heap)
/*-------------------------------------------------------------------------
* Function: H5HL_dec_rc
*
- * Purpose: Decrement ref. count on heap
+ * Purpose: Decrement ref. count on heap
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Oct 12 2008
+ * Programmer: Quincey Koziol
+ * Oct 12 2008
*
*-------------------------------------------------------------------------
*/
@@ -176,15 +171,14 @@ H5HL_dec_rc(H5HL_t *heap)
} /* end H5HL_dec_rc() */
/*-------------------------------------------------------------------------
- * Function: H5HL_dest
+ * Function: H5HL_dest
*
- * Purpose: Destroys a heap in memory.
+ * Purpose: Destroys a heap in memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jan 15 2003
+ * Programmer: Quincey Koziol
+ * Jan 15 2003
*
*-------------------------------------------------------------------------
*/
@@ -225,7 +219,6 @@ H5HL_dest(H5HL_t *heap)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 12 2008
*
*-------------------------------------------------------------------------
@@ -269,7 +262,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 12 2008
*
*-------------------------------------------------------------------------
@@ -313,7 +305,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 12 2008
*
*-------------------------------------------------------------------------
@@ -357,7 +348,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 12 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h
index 412a4df..d19c984 100644
--- a/src/H5HLpkg.h
+++ b/src/H5HLpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
* Purpose: This file contains declarations which are visible
@@ -53,12 +53,12 @@ H5FL_BLK_EXTERN(lheap_chunk);
/**************************/
#define H5HL_SIZEOF_HDR(F) \
- H5HL_ALIGN(H5_SIZEOF_MAGIC + /*heap signature */ \
- 1 + /*version */ \
- 3 + /*reserved */ \
- H5F_SIZEOF_SIZE(F) + /*data size */ \
- H5F_SIZEOF_SIZE(F) + /*free list head */ \
- H5F_SIZEOF_ADDR(F)) /*data address */
+ H5HL_ALIGN(H5_SIZEOF_MAGIC + /* heap signature */ \
+ 1 + /* version */ \
+ 3 + /* reserved */ \
+ H5F_SIZEOF_SIZE(F) + /* data size */ \
+ H5F_SIZEOF_SIZE(F) + /* free list head */ \
+ H5F_SIZEOF_ADDR(F)) /* data address */
/* Value indicating end of free list on disk */
#define H5HL_FREE_NULL 1
@@ -68,10 +68,10 @@ H5FL_BLK_EXTERN(lheap_chunk);
/****************************/
typedef struct H5HL_free_t {
- size_t offset; /*offset of free block */
- size_t size; /*size of free block */
- struct H5HL_free_t *prev; /*previous entry in free list */
- struct H5HL_free_t *next; /*next entry in free list */
+ size_t offset; /* offset of free block */
+ size_t size; /* size of free block */
+ struct H5HL_free_t *prev; /* previous entry in free list */
+ struct H5HL_free_t *next; /* next entry in free list */
} H5HL_free_t;
/* Forward declarations */
@@ -80,49 +80,46 @@ typedef struct H5HL_prfx_t H5HL_prfx_t;
struct H5HL_t {
/* General heap-management fields */
- size_t rc; /* Ref. count for prefix & data block using this struct */
- size_t prots; /* # of times the heap has been protected */
- size_t sizeof_size; /* Size of file sizes */
- size_t sizeof_addr; /* Size of file addresses */
- hbool_t single_cache_obj; /* Indicate if the heap is a single object in the cache */
- H5HL_free_t *freelist; /*the free list */
+ size_t rc; /* Ref. count for prefix & data block using this struct */
+ size_t prots; /* # of times the heap has been protected */
+ size_t sizeof_size; /* Size of file sizes */
+ size_t sizeof_addr; /* Size of file addresses */
+ hbool_t single_cache_obj; /* Indicate if the heap is a single object in the cache */
+ H5HL_free_t *freelist; /* the free list */
/* Prefix-specific fields */
- H5HL_prfx_t *prfx; /* The prefix object for the heap */
- haddr_t prfx_addr; /* address of heap prefix */
- size_t prfx_size; /* size of heap prefix */
- hsize_t free_block; /* Address of first free block */
+ H5HL_prfx_t *prfx; /* The prefix object for the heap */
+ haddr_t prfx_addr; /* address of heap prefix */
+ size_t prfx_size; /* size of heap prefix */
+ hsize_t free_block; /* Address of first free block */
/* Data block-specific fields */
- H5HL_dblk_t *dblk; /* The data block object for the heap */
- haddr_t dblk_addr; /* address of data block */
- size_t dblk_size; /* size of heap data block on disk and in mem */
- uint8_t * dblk_image; /* The data block image */
+ H5HL_dblk_t *dblk; /* The data block object for the heap */
+ haddr_t dblk_addr; /* address of data block */
+ size_t dblk_size; /* size of heap data block on disk and in mem */
+ uint8_t * dblk_image; /* The data block image */
};
/* Struct for heap data block */
struct H5HL_dblk_t {
- H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
- /* first field in structure */
- H5HL_t *heap; /* Pointer to heap for data block */
+ H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
+ /* first field in structure */
+ H5HL_t *heap; /* Pointer to heap for data block */
};
/* Struct for heap prefix */
struct H5HL_prfx_t {
- H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
- /* first field in structure */
- H5HL_t *heap; /* Pointer to heap for prefix */
+ H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
+ /* first field in structure */
+ H5HL_t *heap; /* Pointer to heap for prefix */
};
/* Callback information for loading local heap prefix from disk */
typedef struct H5HL_cache_prfx_ud_t {
- /* Downwards */
size_t sizeof_size; /* Size of file sizes */
size_t sizeof_addr; /* Size of file addresses */
haddr_t prfx_addr; /* Address of prefix */
size_t sizeof_prfx; /* Size of heap prefix */
-
- /* Upwards */
} H5HL_cache_prfx_ud_t;
/* Callback information for loading local heap data block from disk */
diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h
index 0ec047b..b57e153 100644
--- a/src/H5HLprivate.h
+++ b/src/H5HLprivate.h
@@ -13,13 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5HLprivate.h
- * Jul 16 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5HLprivate.h
+ * Jul 16 1997
+ * Robb Matzke
*
- * Purpose:
- *
- * Modifications:
+ * Purpose: Private declarations for the H5HL (local heap) package.
*
*-------------------------------------------------------------------------
*/
@@ -30,23 +28,23 @@
#include "H5HLpublic.h"
/* Private headers needed by this file. */
-#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Fprivate.h" /* File access */
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Fprivate.h" /* File access */
/*
* Feature: Define H5HL_DEBUG on the compiler command line if you want to
- * diagnostic messages from this layer.
+ * enable diagnostic messages from this layer.
*/
#ifdef NDEBUG
#undef H5HL_DEBUG
#endif
-#define H5HL_ALIGN(X) ((((unsigned)X) + 7) & (unsigned)(~0x07)) /*align on 8-byte boundary */
+#define H5HL_ALIGN(X) ((((unsigned)X) + 7) & (unsigned)(~0x07)) /* align on 8-byte boundary */
#define H5HL_SIZEOF_FREE(F) \
- H5HL_ALIGN(H5F_SIZEOF_SIZE(F) + /*ptr to next free block */ \
- H5F_SIZEOF_SIZE(F)) /*size of this free block */
+ H5HL_ALIGN(H5F_SIZEOF_SIZE(F) + /* ptr to next free block */ \
+ H5F_SIZEOF_SIZE(F)) /* size of this free block */
/****************************/
/* Library Private Typedefs */
@@ -56,7 +54,7 @@
typedef struct H5HL_t H5HL_t;
/*
- * Library prototypes...
+ * Library prototypes
*/
H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr /*out*/);
H5_DLL H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw);
diff --git a/src/H5HLpublic.h b/src/H5HLpublic.h
index 451e6c7..26bae68 100644
--- a/src/H5HLpublic.h
+++ b/src/H5HLpublic.h
@@ -15,7 +15,7 @@
*
* Created: H5HLpublic.h
* Jul 16 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Public declarations for the H5HL (local heap) package.
*
diff --git a/src/H5I.c b/src/H5I.c
index 8e382ba..8e7be3d 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -12,25 +12,17 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * FILE: H5I.c - Internal storage routines for handling "IDs"
+ * FILE: H5I.c - Internal storage routines for handling "IDs"
*
- * REMARKS: ID's which allow objects (void *'s currently) to be bundled
- * into "types" for more general storage.
+ * REMARKS: IDs which allow objects (void * currently) to be bundled
+ * into "types" for more general storage.
*
- * DESIGN: The types are stored in an array of pointers to store each
- * type in an element. Each "type" node contains a link to a
- * hash table to manage the IDs in each type. Allowed types are
- * values within the range 1 to H5I_MAX_NUM_TYPES and are given out
- * at run-time. Types used by the library are stored in global
- * variables defined in H5Ipublic.h.
- *
- * AUTHOR: Quincey Koziol
- *
- * MODIFICATIONS:
- * 1/3/96 - Starting writing specs & coding prototype
- * 1/7/96 - Finished coding prototype
- * 6/10/97 - Moved into HDF5 library
- * 5/18/04 - Expanded to allow registration of new types at run-time
+ * DESIGN: The types are stored in an array of pointers to store each
+ * type in an element. Each "type" node contains a link to a
+ * hash table to manage the IDs in each type. Allowed types are
+ * values within the range 1 to H5I_MAX_NUM_TYPES and are given out
+ * at run-time. Types used by the library are stored in global
+ * variables defined in H5Ipublic.h.
*/
#define H5I_PACKAGE /*suppress error about including H5Ipkg */
@@ -71,10 +63,10 @@
/* Atom information structure used */
typedef struct H5I_id_info_t {
- hid_t id; /* ID for this info */
- unsigned count; /* ref. count for this atom */
- unsigned app_count; /* ref. count of application visible atoms */
- const void *obj_ptr; /* pointer associated with the atom */
+ hid_t id; /* ID for this info */
+ unsigned count; /* ref. count for this atom */
+ unsigned app_count; /* ref. count of application visible atoms */
+ const void *obj_ptr; /* pointer associated with the atom */
} H5I_id_info_t;
/* ID type structure used */
@@ -223,39 +215,35 @@ H5I_term_interface(void)
} /* end H5I_term_interface() */
/*-------------------------------------------------------------------------
- * Function: H5Iregister_type
+ * Function: H5Iregister_type
*
- * Purpose: Public interface to H5I_register_type. Creates a new type
- * of ID's to give out. A specific number (RESERVED) of type
- * entries may be reserved to enable "constant" values to be handed
- * out which are valid IDs in the type, but which do not map to any
- * data structures and are not allocated dynamically later. HASH_SIZE is
- * the minimum hash table size to use for the type. FREE_FUNC is
- * called with an object pointer when the object is removed from
- * the type.
+ * Purpose: Public interface to H5I_register_type. Creates a new type
+ * of ID's to give out. A specific number (RESERVED) of type
+ * entries may be reserved to enable "constant" values to be handed
+ * out which are valid IDs in the type, but which do not map to any
+ * data structures and are not allocated dynamically later. HASH_SIZE is
+ * the minimum hash table size to use for the type. FREE_FUNC is
+ * called with an object pointer when the object is removed from
+ * the type.
*
- * Return: Success: Type ID of the new type
- * Failure: H5I_BADID
- *
- * Programmers: Nathaniel Furrer
- * James Laird
- * Friday, April 30, 2004
+ * Return: Success: Type ID of the new type
+ * Failure: H5I_BADID
*
*-------------------------------------------------------------------------
*/
H5I_type_t
H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func)
{
- H5I_class_t *cls = NULL; /* New ID class */
- H5I_type_t new_type; /* New ID type value */
- H5I_type_t ret_value; /* Return value */
+ H5I_class_t *cls = NULL; /* New ID class */
+ H5I_type_t new_type; /* New ID type value */
+ H5I_type_t ret_value = H5I_BADID; /* Return value */
FUNC_ENTER_API(H5I_BADID)
H5TRACE3("It", "zIux", hash_size, reserved, free_func);
/* Generate a new H5I_type_t value */
- /* Increment the number of types*/
+ /* Increment the number of types */
if (H5I_next_type < H5I_MAX_NUM_TYPES) {
new_type = H5I_next_type;
H5_INC_ENUM(H5I_type_t, H5I_next_type);
@@ -298,27 +286,21 @@ H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func)
done:
/* Clean up on error */
- if (ret_value < 0) {
+ if (ret_value < 0)
if (cls)
cls = H5FL_FREE(H5I_class_t, cls);
- } /* end if */
FUNC_LEAVE_API(ret_value)
} /* end H5Iregister_type() */
/*-------------------------------------------------------------------------
- * Function: H5I_register_type
+ * Function: H5I_register_type
*
- * Purpose: Creates a new type of ID's to give out.
- * The class is initialized or its reference count is incremented
+ * Purpose: Creates a new type of ID's to give out.
+ * The class is initialized or its reference count is incremented
* (if it is already initialized).
*
- * Return: Success: Type ID of the new type
- * Failure: H5I_BADID
- *
- * Programmers: Nathaniel Furrer
- * James Laird
- * Friday, April 30, 2004
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -377,17 +359,12 @@ done:
} /* end H5I_register_type() */
/*-------------------------------------------------------------------------
- * Function: H5Itype_exists
+ * Function: H5Itype_exists
*
* Purpose: Query function to inform the user if a given type is
* currently registered with the library.
*
- * Return: Success: 1 if the type is registered, 0 if it is not
- * Failure: Negative
- *
- * Programmer: James Laird
- * Nathaniel Furrer
- * Tuesday, June 29, 2004
+ * Return: TRUE/FALSE/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -413,18 +390,17 @@ done:
} /* end H5Itype_exists() */
/*-------------------------------------------------------------------------
- * Function: H5Inmembers
+ * Function: H5Inmembers
*
- * Purpose: Returns the number of members in a type. Public interface to
- * H5I_nmembers. The public interface throws an error if the
+ * Purpose: Returns the number of members in a type. Public interface to
+ * H5I_nmembers. The public interface throws an error if the
* supplied type does not exist. This is different than the
* private interface, which will just return 0.
*
- * Return: Success: Zero
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
* Friday, April 23, 2004
*
*-------------------------------------------------------------------------
@@ -463,16 +439,16 @@ done:
} /* end H5Inmembers() */
/*-------------------------------------------------------------------------
- * Function: H5I_nmembers
+ * Function: H5I_nmembers
*
- * Purpose: Returns the number of members in a type.
+ * Purpose: Returns the number of members in a type.
*
- * Return: Success: Number of members; zero if the type is empty
- * or has been deleted.
+ * Return: Success: Number of members; zero if the type is empty
+ * or has been deleted.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, March 24, 1999
*
*-------------------------------------------------------------------------
@@ -498,17 +474,16 @@ done:
} /* end H5I_nmembers() */
/*-------------------------------------------------------------------------
- * Function: H5Iclear_type
+ * Function: H5Iclear_type
*
- * Purpose: Removes all objects from the type, calling the free
- * function for each object regardless of the reference count.
- * Public interface to H5I_clear_type.
+ * Purpose: Removes all objects from the type, calling the free
+ * function for each object regardless of the reference count.
+ * Public interface to H5I_clear_type.
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
* Friday, April 23, 2004
*
*-------------------------------------------------------------------------
@@ -516,7 +491,7 @@ done:
herr_t
H5Iclear_type(H5I_type_t type, hbool_t force)
{
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "Itb", type, force);
@@ -559,15 +534,14 @@ H5I__free_cb(void *_item, void H5_ATTR_UNUSED *_key, void H5_ATTR_UNUSED *_udata
} /* end H5I__free_cb() */
/*-------------------------------------------------------------------------
- * Function: H5I_clear_type
+ * Function: H5I_clear_type
*
- * Purpose: Removes all objects from the type, calling the free
- * function for each object regardless of the reference count.
+ * Purpose: Removes all objects from the type, calling the free
+ * function for each object regardless of the reference count.
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, March 24, 1999
*
*-------------------------------------------------------------------------
@@ -609,11 +583,10 @@ done:
/*-------------------------------------------------------------------------
* Function: H5I__clear_type_cb
*
- * Purpose: Attempts to free the specified ID , calling the free
+ * Purpose: Attempts to free the specified ID, calling the free
* function for the object.
*
- * Return: Success: Non-negative
- * Failure: negative
+ * Return: TRUE/FALSE/FAIL
*
* Programmer: Neil Fortner
* Friday, July 10, 2015
@@ -629,12 +602,12 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata)
FUNC_ENTER_STATIC_NOERR
+ /* Sanity checks */
HDassert(id);
HDassert(udata);
HDassert(udata->type_ptr);
- /*
- * Do nothing to the object if the reference count is larger than
+ /* Do nothing to the object if the reference count is larger than
* one and forcing is off.
*/
if (udata->force || (id->count - (!udata->app_ref * id->app_count)) <= 1) {
@@ -674,25 +647,25 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata)
} /* end H5I__clear_type_cb() */
/*-------------------------------------------------------------------------
- * Function: H5Idestroy_type
+ * Function: H5Idestroy_type
*
- * Purpose: Destroys a type along with all atoms in that type
- * regardless of their reference counts. Destroying IDs
- * involves calling the free-func for each ID's object and
- * then adding the ID struct to the ID free list. Public
- * interface to H5I__destroy_type.
+ * Purpose: Destroys a type along with all atoms in that type
+ * regardless of their reference counts. Destroying IDs
+ * involves calling the free-func for each ID's object and
+ * then adding the ID struct to the ID free list. Public
+ * interface to H5I__destroy_type.
*
- * Return: Zero on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Nathaniel Furrer
- * James Laird
+ * Programmer: Nathaniel Furrer
+ * James Laird
*
*-------------------------------------------------------------------------
*/
herr_t
H5Idestroy_type(H5I_type_t type)
{
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "It", type);
@@ -707,17 +680,17 @@ done:
} /* end H5Idestroy_type() */
/*-------------------------------------------------------------------------
- * Function: H5I__destroy_type
+ * Function: H5I__destroy_type
*
- * Purpose: Destroys a type along with all atoms in that type
- * regardless of their reference counts. Destroying IDs
- * involves calling the free-func for each ID's object and
- * then adding the ID struct to the ID free list.
+ * Purpose: Destroys a type along with all atoms in that type
+ * regardless of their reference counts. Destroying IDs
+ * involves calling the free-func for each ID's object and
+ * then adding the ID struct to the ID free list.
*
- * Return: Zero on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Nathaniel Furrer
- * James Laird
+ * Programmer: Nathaniel Furrer
+ * James Laird
*
*-------------------------------------------------------------------------
*/
@@ -760,22 +733,19 @@ done:
} /* end H5I__destroy_type() */
/*-------------------------------------------------------------------------
- * Function: H5Iregister
- *
- * Purpose: Public interface to H5I_register.
+ * Function: H5Iregister
*
- * Return: Success: New object id.
- * Failure: Negative
+ * Purpose: Public interface to H5I_register.
*
- * Programmer: Nathaniel Furrer
- * James Laird
+ * Return: Success: New object ID
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
hid_t
H5Iregister(H5I_type_t type, const void *object)
{
- hid_t ret_value; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE2("i", "It*x", type, object);
@@ -830,20 +800,18 @@ H5I__wrapped_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
} /* end H5I__wrapped_cb() */
/*-------------------------------------------------------------------------
- * Function: H5I_register
+ * Function: H5I_register
*
- * Purpose: Registers an OBJECT in a TYPE and returns an ID for it.
- * This routine does _not_ check for unique-ness of the objects,
- * if you register an object twice, you will get two different
- * IDs for it. This routine does make certain that each ID in a
- * type is unique. IDs are created by getting a unique number
- * for the type the ID is in and incorporating the type into
- * the ID which is returned to the user.
- *
- * Return: Success: New object id.
- * Failure: Negative
+ * Purpose: Registers an OBJECT in a TYPE and returns an ID for it.
+ * This routine does _not_ check for unique-ness of the objects,
+ * if you register an object twice, you will get two different
+ * IDs for it. This routine does make certain that each ID in a
+ * type is unique. IDs are created by getting a unique number
+ * for the type the ID is in and incorporating the type into
+ * the ID which is returned to the user.
*
- * Programmer: Unknown
+ * Return: Success: New object ID
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -938,24 +906,24 @@ done:
} /* end H5I_register() */
/*-------------------------------------------------------------------------
- * Function: H5I_subst
+ * Function: H5I_subst
*
- * Purpose: Substitute a new object pointer for the specified ID.
+ * Purpose: Substitute a new object pointer for the specified ID.
*
- * Return: Success: Non-null previous object pointer associated
- * with the specified ID.
- * Failure: NULL
+ * Return: Success: Non-NULL previous object pointer associated
+ * with the specified ID.
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * Saturday, February 27, 2010
+ * Programmer: Quincey Koziol
+ * Saturday, February 27, 2010
*
*-------------------------------------------------------------------------
*/
void *
H5I_subst(hid_t id, const void *new_object)
{
- H5I_id_info_t *id_ptr; /* Ptr to the atom */
- void * ret_value; /* Return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the atom */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -972,26 +940,25 @@ H5I_subst(hid_t id, const void *new_object)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end if */
+} /* end H5I_subst() */
/*-------------------------------------------------------------------------
- * Function: H5I_object
+ * Function: H5I_object
*
- * Purpose: Find an object pointer for the specified ID.
+ * Purpose: Find an object pointer for the specified ID.
*
- * Return: Success: Non-null object pointer associated with the
- * specified ID.
- * Failure: NULL
+ * Return: Success: Non-NULL object pointer associated with the
+ * specified ID
*
- * Programmer: Unknown
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
void *
H5I_object(hid_t id)
{
- H5I_id_info_t *id_ptr; /*ptr to the new atom */
- void * ret_value = NULL; /*return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the new atom */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1004,36 +971,32 @@ H5I_object(hid_t id)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end if */
+} /* end H5I_object() */
/*-------------------------------------------------------------------------
- * Function: H5Iobject_verify
+ * Function: H5Iobject_verify
*
- * Purpose: Find an object pointer for the specified ID, verifying that
- * its in a particular type. Public interface to
- * H5I_object_verify.
+ * Purpose: Find an object pointer for the specified ID, verifying that
+ * its in a particular type. Public interface to
+ * H5I_object_verify.
*
- * Return: Success: Non-null object pointer associated with the
- * specified ID.
- * Failure: NULL
- *
- * Programmer: Nathaniel Furrer
- * James Laird
- * Friday, April 23, 2004
+ * Return: Success: Non-NULL object pointer associated with the
+ * specified ID.
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
void *
H5Iobject_verify(hid_t id, H5I_type_t id_type)
{
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_API(NULL)
H5TRACE2("*x", "iIt", id, id_type);
+ /* Validate parameters */
if (H5I_IS_LIB_TYPE(id_type))
HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type")
-
if (id_type < 1 || id_type >= H5I_next_type)
HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "identifier has invalid type")
@@ -1044,25 +1007,25 @@ done:
} /* end H5Iobject_verify() */
/*-------------------------------------------------------------------------
- * Function: H5I_object_verify
+ * Function: H5I_object_verify
*
- * Purpose: Find an object pointer for the specified ID, verifying that
- * its in a particular type.
+ * Purpose: Find an object pointer for the specified ID, verifying that
+ * its in a particular type.
*
- * Return: Success: Non-null object pointer associated with the
- * specified ID.
- * Failure: NULL
+ * Return: Success: Non-NULL object pointer associated with the
+ * specified ID.
+ * Failure: NULL
*
- * Programmer: Quincey Koziol
- * Wednesday, July 31, 2002
+ * Programmer: Quincey Koziol
+ * Wednesday, July 31, 2002
*
*-------------------------------------------------------------------------
*/
void *
H5I_object_verify(hid_t id, H5I_type_t id_type)
{
- H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */
- void * ret_value = NULL; /*return value */
+ H5I_id_info_t *id_ptr = NULL; /* Pointer to the new atom */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1080,25 +1043,27 @@ done:
} /* H5I_object_verify() */
/*-------------------------------------------------------------------------
- * Function: H5I_get_type
+ * Function: H5I_get_type
*
- * Purpose: Given an object ID return the type to which it
- * belongs. The ID need not be the ID of an object which
- * currently exists because the type number is encoded
- * in the object ID.
+ * Purpose: Given an object ID return the type to which it
+ * belongs. The ID need not be the ID of an object which
+ * currently exists because the type number is encoded
+ * in the object ID.
*
- * Return: Success: A valid type number
- * Failure: H5I_BADID, a negative value.
+ * Return: Success: A positive integer (corresponding to an H5I_type_t
+ * enum value for library ID types, but not for user
+ * ID types).
+ * Failure: H5I_BADID
*
- * Programmer: Robb Matzke
- * Friday, February 19, 1999
+ * Programmer: Robb Matzke
+ * Friday, February 19, 1999
*
*-------------------------------------------------------------------------
*/
H5I_type_t
H5I_get_type(hid_t id)
{
- H5I_type_t ret_value = H5I_BADID;
+ H5I_type_t ret_value = H5I_BADID; /* Return value */
FUNC_ENTER_NOAPI(H5I_BADID)
@@ -1112,17 +1077,17 @@ done:
} /* end H5I_get_type() */
/*-------------------------------------------------------------------------
- * Function: H5Iget_type
+ * Function: H5Iget_type
*
- * Purpose: The public version of H5I_get_type(), obtains a type number
- * when given an ID. The ID need not be the ID of an
- * object which currently exists because the type number is
- * encoded as part of the ID.
+ * Purpose: The public version of H5I_get_type(), obtains a type number
+ * when given an ID. The ID need not be the ID of an
+ * object which currently exists because the type number is
+ * encoded as part of the ID.
*
- * Return: Success: Type number
- * Failure: H5I_BADID, a negative value
- *
- * Programmer: Unknown
+ * Return: Success: A positive integer (corresponding to an H5I_type_t
+ * enum value for library ID types, but not for user
+ * ID types).
+ * Failure: H5I_BADID
*
*-------------------------------------------------------------------------
*/
@@ -1144,26 +1109,26 @@ done:
} /* end H5Iget_type() */
/*-------------------------------------------------------------------------
- * Function: H5Iremove_verify
+ * Function: H5Iremove_verify
*
- * Purpose: Removes the specified ID from its type, first checking that the
- * type of the ID and the type type are the same. Public interface to
- * H5I__remove_verify.
+ * Purpose: Removes the specified ID from its type, first checking that the
+ * type of the ID and the type type are the same. Public interface to
+ * H5I__remove_verify.
*
- * Return: Success: A pointer to the object that was removed, the
- * same pointer which would have been found by
- * calling H5I_object().
- * Failure: NULL
+ * Return: Success: A pointer to the object that was removed, the
+ * same pointer which would have been found by
+ * calling H5I_object().
+ * Failure: NULL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
*
*-------------------------------------------------------------------------
*/
void *
H5Iremove_verify(hid_t id, H5I_type_t id_type)
{
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_API(NULL)
H5TRACE2("*x", "iIt", id, id_type);
@@ -1179,25 +1144,25 @@ done:
} /* end H5Iremove_verify() */
/*-------------------------------------------------------------------------
- * Function: H5I__remove_verify
+ * Function: H5I__remove_verify
*
- * Purpose: Removes the specified ID from its type, first checking that
- * the ID's type is the same as the ID type supplied as an argument
+ * Purpose: Removes the specified ID from its type, first checking that
+ * the ID's type is the same as the ID type supplied as an argument
*
- * Return: Success: A pointer to the object that was removed, the
- * same pointer which would have been found by
- * calling H5I_object().
- * Failure: NULL
+ * Return: Success: A pointer to the object that was removed, the
+ * same pointer which would have been found by
+ * calling H5I_object().
+ * Failure: NULL
*
- * Programmer: James Laird
- * Nat Furrer
+ * Programmer: James Laird
+ * Nat Furrer
*
*-------------------------------------------------------------------------
*/
void *
H5I__remove_verify(hid_t id, H5I_type_t id_type)
{
- void *ret_value = NULL; /*return value */
+ void *ret_value = NULL; /*return value */
FUNC_ENTER_STATIC_NOERR
@@ -1211,14 +1176,14 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type)
} /* end H5I__remove_verify() */
/*-------------------------------------------------------------------------
- * Function: H5I__remove_common
+ * Function: H5I__remove_common
*
- * Purpose: Common code to remove a specified ID from its type.
+ * Purpose: Common code to remove a specified ID from its type.
*
- * Return: Success: A pointer to the object that was removed, the
- * same pointer which would have been found by
- * calling H5I_object().
- * Failure: NULL
+ * Return: Success: A pointer to the object that was removed, the
+ * same pointer which would have been found by
+ * calling H5I_object().
+ * Failure: NULL
*
* Programmer: Quincey Koziol
* October 3, 2013
@@ -1228,8 +1193,8 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type)
static void *
H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id)
{
- H5I_id_info_t *curr_id; /*ptr to the current atom */
- void * ret_value; /*return value */
+ H5I_id_info_t *curr_id; /* Pointer to the current atom */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -1285,25 +1250,23 @@ done:
} /* end H5I__remove_common() */
/*-------------------------------------------------------------------------
- * Function: H5I_remove
+ * Function: H5I_remove
*
- * Purpose: Removes the specified ID from its type.
+ * Purpose: Removes the specified ID from its type.
*
- * Return: Success: A pointer to the object that was removed, the
- * same pointer which would have been found by
- * calling H5I_object().
- * Failure: NULL
- *
- * Programmer: Unknown
+ * Return: Success: A pointer to the object that was removed, the
+ * same pointer which would have been found by
+ * calling H5I_object().
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
void *
H5I_remove(hid_t id)
{
- H5I_id_type_t *type_ptr; /*ptr to the atomic type */
- H5I_type_t type; /*atom's atomic type */
- void * ret_value; /*return value */
+ H5I_id_type_t *type_ptr; /* Pointer to the atomic type */
+ H5I_type_t type; /* Atom's atomic type */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1324,14 +1287,14 @@ done:
} /* end H5I_remove() */
/*-------------------------------------------------------------------------
- * Function: H5Idec_ref
+ * Function: H5Idec_ref
*
- * Purpose: Decrements the number of references outstanding for an ID.
+ * Purpose: Decrements the number of references outstanding for an ID.
* If the reference count for an ID reaches zero, the object
* will be closed.
*
- * Return: Success: New reference count
- * Failure: Negative
+ * Return: Success: New reference count
+ * Failure: -1
*
* Programmer: Quincey Koziol
* Dec 7, 2003
@@ -1341,57 +1304,54 @@ done:
int
H5Idec_ref(hid_t id)
{
- int ret_value; /* Return value */
+ int ret_value = 0; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE1("Is", "i", id);
/* Check arguments */
if (id < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID")
/* Do actual decrement operation */
if ((ret_value = H5I_dec_app_ref(id)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Idec_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_dec_ref
+ * Function: H5I_dec_ref
*
- * Purpose: Decrements the number of references outstanding for an ID.
- * This will fail if the type is not a reference counted type.
- * The ID type's 'free' function will be called for the ID
- * if the reference count for the ID reaches 0 and a free
- * function has been defined at type creation time.
+ * Purpose: Decrements the number of references outstanding for an ID.
+ * This will fail if the type is not a reference counted type.
+ * The ID type's 'free' function will be called for the ID
+ * if the reference count for the ID reaches 0 and a free
+ * function has been defined at type creation time.
*
- * Return: Success: New reference count.
+ * Return: Success: New reference count
*
- * Failure: Negative
- *
- * Programmer: Unknown
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
int
H5I_dec_ref(hid_t id)
{
- H5I_id_info_t *id_ptr; /*ptr to the new ID */
- int ret_value; /* Return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the new ID */
+ int ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI((-1))
/* Sanity check */
HDassert(id >= 0);
/* General lookup of the ID */
if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
- /*
- * If this is the last reference to the object then invoke the type's
+ /* If this is the last reference to the object then invoke the type's
* free method on the object. If the free method is undefined or
* successful then remove the object from the type; otherwise leave
* the object in the type without decrementing the reference
@@ -1406,7 +1366,7 @@ H5I_dec_ref(hid_t id)
* file. We have to close the dataset anyway. (SLU - 2010/9/7)
*/
if (1 == id_ptr->count) {
- H5I_id_type_t *type_ptr; /*ptr to the type */
+ H5I_id_type_t *type_ptr; /*ptr to the type */
/* Get the ID's type */
type_ptr = H5I_id_type_list_g[H5I_TYPE(id)];
@@ -1415,11 +1375,11 @@ H5I_dec_ref(hid_t id)
if (!type_ptr->cls->free_func || (type_ptr->cls->free_func)((void *)id_ptr->obj_ptr) >= 0) {
/* Remove the node from the type */
if (NULL == H5I__remove_common(type_ptr, id))
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, FAIL, "can't remove ID node")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, (-1), "can't remove ID node")
ret_value = 0;
} /* end if */
else
- ret_value = FAIL;
+ ret_value = -1;
} /* end if */
else {
--(id_ptr->count);
@@ -1431,13 +1391,13 @@ done:
} /* end H5I_dec_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_dec_app_ref
+ * Function: H5I_dec_app_ref
*
- * Purpose: H5I_dec_ref wrapper for case of modifying the application ref.
- * count for an ID as well as normal reference count.
+ * Purpose: H5I_dec_ref wrapper for case of modifying the application ref.
+ * count for an ID as well as normal reference count.
*
- * Return: Success: New app. reference count.
- * Failure: Negative
+ * Return: Success: New app. reference count
+ * Failure: -1
*
* Programmer: Quincey Koziol
* Sept 16, 2010
@@ -1447,23 +1407,23 @@ done:
int
H5I_dec_app_ref(hid_t id)
{
- H5I_id_info_t *id_ptr; /*ptr to the new ID */
- int ret_value; /* Return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the new ID */
+ int ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI((-1))
/* Sanity check */
HDassert(id >= 0);
/* Call regular decrement reference count routine */
if ((ret_value = H5I_dec_ref(id)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count")
/* Check if the ID still exists */
if (ret_value > 0) {
/* General lookup of the ID */
if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
/* Adjust app_ref */
--(id_ptr->app_count);
@@ -1478,25 +1438,22 @@ done:
} /* end H5I_dec_app_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_dec_app_ref_always_close
+ * Function: H5I_dec_app_ref_always_close
*
- * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID,
- * even when the free routine fails
+ * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID,
+ * even when the free routine fails
*
- * Return: Success: New app. reference count.
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Sept 16, 2010
+ * Return: Success: New app. reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
int
H5I_dec_app_ref_always_close(hid_t id)
{
- int ret_value; /* Return value */
+ int ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI((-1))
/* Sanity check */
HDassert(id >= 0);
@@ -1514,23 +1471,20 @@ H5I_dec_app_ref_always_close(hid_t id)
*/
H5I_remove(id);
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count")
- } /* end if */
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count")
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_dec_app_ref_always_close() */
/*-------------------------------------------------------------------------
- * Function: H5Iinc_ref
- *
- * Purpose: Increments the number of references outstanding for an ID.
+ * Function: H5Iinc_ref
*
- * Return: Success: New reference count
- * Failure: Negative
+ * Purpose: Increments the number of references outstanding for an ID.
*
- * Programmer: Quincey Koziol
- * Dec 7, 2003
+ * Return: Success: New reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -1539,48 +1493,45 @@ H5Iinc_ref(hid_t id)
{
int ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE1("Is", "i", id);
/* Check arguments */
if (id < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID")
/* Do actual increment operation */
if ((ret_value = H5I_inc_ref(id, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, (-1), "can't increment ID ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iinc_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_inc_ref
+ * Function: H5I_inc_ref
*
- * Purpose: Increment the reference count for an object.
+ * Purpose: Increment the reference count for an object.
*
- * Return: Success: The new reference count.
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Thursday, July 29, 1999
+ * Return: Success: The new reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
int
H5I_inc_ref(hid_t id, hbool_t app_ref)
{
- H5I_id_info_t *id_ptr; /*ptr to the ID */
- int ret_value; /* Return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the ID */
+ int ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI((-1))
/* Sanity check */
HDassert(id >= 0);
/* General lookup of the ID */
if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
/* Adjust reference counts */
++(id_ptr->count);
@@ -1595,15 +1546,12 @@ done:
} /* end H5I_inc_ref() */
/*-------------------------------------------------------------------------
- * Function: H5Iget_ref
+ * Function: H5Iget_ref
*
- * Purpose: Retrieves the number of references outstanding for an ID.
+ * Purpose: Retrieves the number of references outstanding for an ID.
*
- * Return: Success: Reference count
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Dec 7, 2003
+ * Return: Success: Reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -1612,48 +1560,45 @@ H5Iget_ref(hid_t id)
{
int ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE1("Is", "i", id);
/* Check arguments */
if (id < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID")
/* Do actual retrieve operation */
if ((ret_value = H5I_get_ref(id, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't get ID ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_get_ref
- *
- * Purpose: Retrieve the reference count for an object.
+ * Function: H5I_get_ref
*
- * Return: Success: The reference count.
- * Failure: Negative
+ * Purpose: Retrieve the reference count for an object.
*
- * Programmer: Quincey Koziol
- * Saturday, Decemeber 6, 2003
+ * Return: Success: The reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
int
H5I_get_ref(hid_t id, hbool_t app_ref)
{
- H5I_id_info_t *id_ptr; /*ptr to the ID */
- int ret_value; /* Return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the ID */
+ int ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI((-1))
/* Sanity check */
HDassert(id >= 0);
/* General lookup of the ID */
if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
/* Set return value */
ret_value = (int)(app_ref ? id_ptr->app_count : id_ptr->count);
@@ -1663,16 +1608,12 @@ done:
} /* end H5I_get_ref() */
/*-------------------------------------------------------------------------
- * Function: H5Iinc_type_ref
- *
- * Purpose: Increments the number of references outstanding for an ID type.
+ * Function: H5Iinc_type_ref
*
- * Return: Success: New reference count
- * Failure: Negative
+ * Purpose: Increments the number of references outstanding for an ID type.
*
- * Programmer: Nat Furrer
- * James Laird
- * April 30, 2004
+ * Return: Success: New reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -1681,43 +1622,38 @@ H5Iinc_type_ref(H5I_type_t type)
{
int ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE1("Is", "It", type);
/* Check arguments */
if (type <= 0 || type >= H5I_next_type)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID type")
-
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type")
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type")
/* Do actual increment operation */
if ((ret_value = H5I__inc_type_ref(type)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID type ref count")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, (-1), "can't increment ID type ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iinc_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I__inc_type_ref
+ * Function: H5I__inc_type_ref
*
- * Purpose: Increment the reference count for an ID type.
+ * Purpose: Increment the reference count for an ID type.
*
- * Return: Success: The new reference count.
- * Failure: Negative
- *
- * Programmer: James Laird
- * Nat Furrer
- * Friday, April 30, 2004
+ * Return: Success: The new reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
static int
H5I__inc_type_ref(H5I_type_t type)
{
- H5I_id_type_t *type_ptr; /* ptr to the type */
- int ret_value; /* Return value */
+ H5I_id_type_t *type_ptr; /* Pointer to the type */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_STATIC
@@ -1726,8 +1662,8 @@ H5I__inc_type_ref(H5I_type_t type)
/* Check arguments */
type_ptr = H5I_id_type_list_g[type];
- if (!type_ptr)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type")
+ if (NULL == type_ptr)
+ HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type")
/* Set return value */
ret_value = (int)(++(type_ptr->init_count));
@@ -1737,37 +1673,39 @@ done:
} /* end H5I__inc_type_ref() */
/*-------------------------------------------------------------------------
- * Function: H5Idec_type_ref
- *
- * Purpose: Decrements the reference count on an entire type of IDs.
- * If the type reference count becomes zero then the type is
- * destroyed along with all atoms in that type regardless of
- * their reference counts. Destroying IDs involves calling
- * the free-func for each ID's object and then adding the ID
- * struct to the ID free list. Public interface to
- * H5I_dec_type_ref.
- * Returns the number of references to the type on success; a
- * return value of 0 means that the type will have to be
- * re-initialized before it can be used again (and should probably
- * be set to H5I_UNINIT).
- *
- * Return: Number of references to type on success/Negative on failure
- *
- * Programmer: Nathaniel Furrer
- * James Laird
+ * Function: H5Idec_type_ref
+ *
+ * Purpose: Decrements the reference count on an entire type of IDs.
+ * If the type reference count becomes zero then the type is
+ * destroyed along with all atoms in that type regardless of
+ * their reference counts. Destroying IDs involves calling
+ * the free-func for each ID's object and then adding the ID
+ * struct to the ID free list. Public interface to
+ * H5I_dec_type_ref.
+ * Returns the number of references to the type on success; a
+ * return value of 0 means that the type will have to be
+ * re-initialized before it can be used again (and should probably
+ * be set to H5I_UNINIT).
+ *
+ * NOTE: Using an error type to also represent a count is semantially
+ * incorrect. We should consider fixing this in a future major
+ * release (DER).
+ *
+ * Return: Success: Number of references to type
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
herr_t
H5Idec_type_ref(H5I_type_t type)
{
- herr_t ret_value; /* Return value */
+ herr_t ret_value = 0; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE1("e", "It", type);
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type")
ret_value = H5I_dec_type_ref(type);
@@ -1776,30 +1714,29 @@ done:
} /* end H5Idec_type_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_dec_type_ref
- *
- * Purpose: Decrements the reference count on an entire type of IDs.
- * If the type reference count becomes zero then the type is
- * destroyed along with all atoms in that type regardless of
- * their reference counts. Destroying IDs involves calling
- * the free-func for each ID's object and then adding the ID
- * struct to the ID free list.
- * Returns the number of references to the type on success; a
- * return value of 0 means that the type will have to be
- * re-initialized before it can be used again (and should probably
- * be set to H5I_UNINIT).
- *
- * Return: Number of references to type on success/Negative on failure
- *
- * Programmer: Unknown
+ * Function: H5I_dec_type_ref
+ *
+ * Purpose: Decrements the reference count on an entire type of IDs.
+ * If the type reference count becomes zero then the type is
+ * destroyed along with all atoms in that type regardless of
+ * their reference counts. Destroying IDs involves calling
+ * the free-func for each ID's object and then adding the ID
+ * struct to the ID free list.
+ * Returns the number of references to the type on success; a
+ * return value of 0 means that the type will have to be
+ * re-initialized before it can be used again (and should probably
+ * be set to H5I_UNINIT).
+ *
+ * Return: Success: Number of references to type
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
herr_t
H5I_dec_type_ref(H5I_type_t type)
{
- H5I_id_type_t *type_ptr; /* Pointer to the ID type */
- herr_t ret_value; /* Return value */
+ H5I_id_type_t *type_ptr; /* Pointer to the ID type */
+ herr_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1810,8 +1747,7 @@ H5I_dec_type_ref(H5I_type_t type)
if (type_ptr == NULL || type_ptr->init_count <= 0)
HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type")
- /*
- * Decrement the number of users of the atomic type. If this is the
+ /* Decrement the number of users of the atomic type. If this is the
* last user of the type then release all atoms from the type and
* free all memory it used. The free function is invoked for each atom
* being freed.
@@ -1819,27 +1755,23 @@ H5I_dec_type_ref(H5I_type_t type)
if (1 == type_ptr->init_count) {
H5I__destroy_type(type);
ret_value = 0;
- } /* end if */
+ }
else {
--(type_ptr->init_count);
ret_value = (herr_t)type_ptr->init_count;
- } /* end else */
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_dec_type_ref() */
/*-------------------------------------------------------------------------
- * Function: H5Iget_type_ref
+ * Function: H5Iget_type_ref
*
- * Purpose: Retrieves the number of references outstanding for a type.
+ * Purpose: Retrieves the number of references outstanding for a type.
*
- * Return: Success: Reference count
- * Failure: Negative
- *
- * Programmer: Nat Furrer
- * James Laird
- * April 30, 2004
+ * Return: Success: Reference count
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -1848,44 +1780,39 @@ H5Iget_type_ref(H5I_type_t type)
{
int ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE1("Is", "It", type);
/* Check arguments */
if (type <= 0 || type >= H5I_next_type)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID type")
-
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type")
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type")
/* Do actual retrieve operation */
if ((ret_value = H5I__get_type_ref(type)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID type ref count")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't get ID type ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I__get_type_ref
- *
- * Purpose: Retrieve the reference count for an ID type.
+ * Function: H5I__get_type_ref
*
- * Return: Success: The reference count.
+ * Purpose: Retrieve the reference count for an ID type.
*
- * Failure: Negative
+ * Return: Success: The reference count
*
- * Programmer: Nat Furrer
- * James Laird
- * April 30, 2004
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
static int
H5I__get_type_ref(H5I_type_t type)
{
- H5I_id_type_t *type_ptr; /*ptr to the type */
- int ret_value; /* Return value */
+ H5I_id_type_t *type_ptr; /* Pointer to the type */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_STATIC
@@ -1905,17 +1832,12 @@ done:
} /* end H5I__get_type_ref() */
/*-------------------------------------------------------------------------
- * Function: H5Iis_valid
+ * Function: H5Iis_valid
*
- * Purpose: Check if the given id is valid. An id is valid if it is in
+ * Purpose: Check if the given id is valid. An id is valid if it is in
* use and has an application reference count of at least 1.
*
- * Return: Success: TRUE if the id is valid, FALSE otherwise.
- *
- * Failure: Negative (never fails currently)
- *
- * Programmer: Neil Fortner
- * Friday, October 31, 2008 (boo)
+ * Return: TRUE/FALSE/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -1931,9 +1853,7 @@ H5Iis_valid(hid_t id)
/* Find the ID */
if (NULL == (id_ptr = H5I__find_id(id)))
ret_value = FALSE;
-
- /* Check if the found id is an internal id */
- else if (!id_ptr->app_count)
+ else if (!id_ptr->app_count) /* Check if the found id is an internal id */
ret_value = FALSE;
done:
@@ -1941,19 +1861,14 @@ done:
} /* end H5Iis_valid() */
/*-------------------------------------------------------------------------
- * Function: H5I__search_cb
+ * Function: H5I__search_cb
*
- * Purpose: Callback routine for H5Isearch, when it calls H5I_iterate.
- * Calls "user" callback search function, and then sets return
- * value, based on the result of that callback.
+ * Purpose: Callback routine for H5Isearch, when it calls H5I_iterate.
+ * Calls "user" callback search function, and then sets return
+ * value, based on the result of that callback.
*
- * Return: Success: The first object in the type for which FUNC
- * returns non-zero. NULL if FUNC returned zero
- * for every object in the type.
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Friday, March 30, 2012
+ * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1)
+ * Failure: H5_ITER_ERROR (-1)
*
*-------------------------------------------------------------------------
*/
@@ -1973,26 +1888,22 @@ H5I__search_cb(void *obj, hid_t id, void *_udata)
} /* end H5I__search_cb() */
/*-------------------------------------------------------------------------
- * Function: H5Isearch
- *
- * Purpose: Apply function FUNC to each member of type TYPE and return a
- * pointer to the first object for which FUNC returns non-zero.
- * The FUNC should take a pointer to the object and the KEY as
- * arguments and return non-zero to terminate the search (zero
- * to continue). Public interface to H5I_search.
+ * Function: H5Isearch
*
- * Limitation: Currently there is no way to start searching from where a
- * previous search left off.
+ * Purpose: Apply function FUNC to each member of type TYPE and return a
+ * pointer to the first object for which FUNC returns non-zero.
+ * The FUNC should take a pointer to the object and the KEY as
+ * arguments and return non-zero to terminate the search (zero
+ * to continue). Public interface to H5I_search.
*
- * Return: Success: The first object in the type for which FUNC
- * returns non-zero. NULL if FUNC returned zero
- * for every object in the type.
+ * Limitation: Currently there is no way to start searching from where a
+ * previous search left off.
*
- * Failure: NULL
+ * Return: Success: The first object in the type for which FUNC
+ * returns non-zero. NULL if FUNC returned zero
+ * for every object in the type.
*
- * Programmer: James Laird
- * Nathaniel Furrer
- * Friday, April 23, 2004
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
@@ -2027,17 +1938,14 @@ done:
} /* end H5Isearch() */
/*-------------------------------------------------------------------------
- * Function: H5I__iterate_cb
+ * Function: H5I__iterate_cb
*
- * Purpose: Callback routine for H5I_iterate, invokes "user" callback
+ * Purpose: Callback routine for H5I_iterate, invokes "user" callback
* function, and then sets return value, based on the result of
* that callback.
*
- * Return: Success: Non-negative on success
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Thursday, October 3, 2013
+ * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1)
+ * Failure: H5_ITER_ERROR (-1)
*
*-------------------------------------------------------------------------
*/
@@ -2050,55 +1958,56 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
FUNC_ENTER_STATIC_NOERR
- /* Don't make callback if app_ref is set and the appl. ref count is 0 */
+ /* Only invoke the callback function if this ID is visible externally and
+ * its reference count is positive.
+ */
if ((!udata->app_ref) || (item->app_count > 0)) {
herr_t cb_ret_val;
- /* (Casting away const OK) */
- cb_ret_val = (*udata->user_func)((void *)item->obj_ptr, item->id, udata->user_udata);
+ /* Invoke callback function */
+ cb_ret_val = (*udata->user_func)((void *)item->obj_ptr, item->id,
+ udata->user_udata); /* (Casting away const OK) */
+
+ /* Set the return value based on the callback's return value */
if (cb_ret_val > 0)
ret_value = H5_ITER_STOP; /* terminate iteration early */
else if (cb_ret_val < 0)
ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I__iterate_cb() */
/*-------------------------------------------------------------------------
- * Function: H5I_iterate
+ * Function: H5I_iterate
*
- * Purpose: Apply function FUNC to each member of type TYPE (with
- * non-zero application reference count if app_ref is TRUE).
- * Stop if FUNC returns a non zero value (i.e. anything
- * other than H5_ITER_CONT).
+ * Purpose: Apply function FUNC to each member of type TYPE (with
+ * non-zero application reference count if app_ref is TRUE).
+ * Stop if FUNC returns a non zero value (i.e. anything
+ * other than H5_ITER_CONT).
*
- * If FUNC returns a positive value (i.e. H5_ITER_STOP),
- * return SUCCEED.
+ * If FUNC returns a positive value (i.e. H5_ITER_STOP),
+ * return SUCCEED.
*
- * If FUNC returns a negative value (i.e. H5_ITER_ERROR),
- * return FAIL.
+ * If FUNC returns a negative value (i.e. H5_ITER_ERROR),
+ * return FAIL.
*
- * The FUNC should take a pointer to the object and the
- * udata as arguments and return non-zero to terminate
- * siteration, and zero to continue.
+ * The FUNC should take a pointer to the object and the
+ * udata as arguments and return non-zero to terminate
+ * siteration, and zero to continue.
*
- * Limitation: Currently there is no way to start the iteration from
- * where a previous iteration left off.
+ * Limitation: Currently there is no way to start the iteration from
+ * where a previous iteration left off.
*
- * Return: Success: SUCCEED
- * Failure: FAIL
- *
- * Programmer: John Mainzer
- * Monday, December 6, 2011
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref)
{
- H5I_id_type_t *type_ptr; /*ptr to the type */
- herr_t ret_value = SUCCEED; /*return value */
+ H5I_id_type_t *type_ptr; /* Pointer to the type */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2120,32 +2029,30 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re
/* Iterate over IDs */
if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed")
- } /* end if */
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_iterate() */
/*-------------------------------------------------------------------------
- * Function: H5I__find_id
- *
- * Purpose: Given an object ID find the info struct that describes the
- * object.
+ * Function: H5I__find_id
*
- * Return: Success: Ptr to the object's info struct.
+ * Purpose: Given an object ID find the info struct that describes the
+ * object.
*
- * Failure: NULL
+ * Return: Success: A pointer to the object's info struct.
*
- * Programmer: Unknown
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
static H5I_id_info_t *
H5I__find_id(hid_t id)
{
- H5I_type_t type; /*ID's type */
- H5I_id_type_t *type_ptr; /*ptr to the type */
- H5I_id_info_t *ret_value; /*return value */
+ H5I_type_t type; /*ID's type */
+ H5I_id_type_t *type_ptr; /*ptr to the type */
+ H5I_id_info_t *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC_NOERR
@@ -2153,7 +2060,6 @@ H5I__find_id(hid_t id)
type = H5I_TYPE(id);
if (type <= H5I_BADID || type >= H5I_next_type)
HGOTO_DONE(NULL)
-
type_ptr = H5I_id_type_list_g[type];
if (!type_ptr || type_ptr->init_count <= 0)
HGOTO_DONE(NULL)
@@ -2166,24 +2072,20 @@ done:
} /* end H5I__find_id() */
/*-------------------------------------------------------------------------
- * Function: H5Iget_name
- *
- * Purpose: Gets a name of an object from its ID.
- *
- * Return: Success: The length of name.
+ * Function: H5Iget_name
*
- * Failure: -1
+ * Purpose: Gets a name of an object from its ID.
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Return: Success: The length of the name
*
- * Date: July 26, 2002
+ * Failure: -1
*
* Comments: Public function
- * If `name' is non-NULL then write up to `size' bytes into that
+ * If 'name' is non-NULL then write up to 'size' bytes into that
* buffer and always return the length of the entry name.
- * Otherwise `size' is ignored and the function does not store the name,
+ * Otherwise 'size' is ignored and the function does not store the name,
* just returning the number of characters required to store the name.
- * If an error occurs then the buffer pointed to by `name' (NULL or non-NULL)
+ * If an error occurs then the buffer pointed to by 'name' (NULL or non-NULL)
* is unchanged and the function returns a negative value.
* If a zero is returned for the name's length, then there is no name
* associated with the ID.
@@ -2196,33 +2098,30 @@ H5Iget_name(hid_t id, char *name /*out*/, size_t size)
H5G_loc_t loc; /* Object location */
ssize_t ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE3("Zs", "ixz", id, name, size);
/* Get object location */
if (H5G_loc(id, &loc) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object location")
/* Call internal group routine to retrieve object's name */
if ((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_name() */
/*-------------------------------------------------------------------------
- * Function: H5Iget_file_id
- *
- * Purpose: The public version of H5I_get_file_id(), obtains the file
- * ID given an object ID. User has to close this ID.
+ * Function: H5Iget_file_id
*
- * Return: Success: file ID
+ * Purpose: Obtains the file ID given an object ID. The user has to
+ * close this ID.
*
- * Failure: a negative value
+ * Return: Success: The file ID associated with the object
*
- * Programmer: Raymond Lu
- * Oct 27, 2003
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
@@ -2242,16 +2141,13 @@ done:
} /* end H5Iget_file_id() */
/*-------------------------------------------------------------------------
- * Function: H5I_get_file_id
+ * Function: H5I_get_file_id
*
- * Purpose: The private version of H5Iget_file_id(), obtains the file
+ * Purpose: The private version of H5Iget_file_id(), obtains the file
* ID given an object ID.
*
- * Return: Success: file ID
- * Failure: a negative value
- *
- * Programmer: Raymond Lu
- * Oct 27, 2003
+ * Return: Success: The file ID associated with the object
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h
index b05028c..ed7f4b7 100644
--- a/src/H5Ipkg.h
+++ b/src/H5Ipkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, May 15, 2003
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index 5abe3da..448749a 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -28,26 +28,26 @@
* fail otherwise).
*
* When adding types here, add a section to the 'misc19' test in test/tmisc.c
- * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in.
+ * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it.
*
*/
typedef enum H5I_type_t {
- H5I_UNINIT = (-2), /*uninitialized type */
- H5I_BADID = (-1), /*invalid Type */
- H5I_FILE = 1, /*type ID for File objects */
- H5I_GROUP, /*type ID for Group objects */
- H5I_DATATYPE, /*type ID for Datatype objects */
- H5I_DATASPACE, /*type ID for Dataspace objects */
- H5I_DATASET, /*type ID for Dataset objects */
- H5I_ATTR, /*type ID for Attribute objects */
- H5I_REFERENCE, /*type ID for Reference objects */
- H5I_VFL, /*type ID for virtual file layer */
- H5I_GENPROP_CLS, /*type ID for generic property list classes */
- H5I_GENPROP_LST, /*type ID for generic property lists */
- H5I_ERROR_CLASS, /*type ID for error classes */
- H5I_ERROR_MSG, /*type ID for error messages */
- H5I_ERROR_STACK, /*type ID for error stacks */
- H5I_NTYPES /*number of library types, MUST BE LAST! */
+ H5I_UNINIT = (-2), /* uninitialized type */
+ H5I_BADID = (-1), /* invalid Type */
+ H5I_FILE = 1, /* type ID for File objects */
+ H5I_GROUP, /* type ID for Group objects */
+ H5I_DATATYPE, /* type ID for Datatype objects */
+ H5I_DATASPACE, /* type ID for Dataspace objects */
+ H5I_DATASET, /* type ID for Dataset objects */
+ H5I_ATTR, /* type ID for Attribute objects */
+ H5I_REFERENCE, /* type ID for Reference objects */
+ H5I_VFL, /* type ID for virtual file layer */
+ H5I_GENPROP_CLS, /* type ID for generic property list classes */
+ H5I_GENPROP_LST, /* type ID for generic property lists */
+ H5I_ERROR_CLASS, /* type ID for error classes */
+ H5I_ERROR_MSG, /* type ID for error messages */
+ H5I_ERROR_STACK, /* type ID for error stacks */
+ H5I_NTYPES /* number of library types, MUST BE LAST! */
} H5I_type_t;
/* Type of atoms to return to users */
diff --git a/src/H5Itest.c b/src/H5Itest.c
index 0dbbaba..74d649e 100644
--- a/src/H5Itest.c
+++ b/src/H5Itest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgoup.org>
+/* Programmer: Quincey Koziol
* Tuesday, July 27, 2010
*
* Purpose: ID testing functions.
@@ -54,14 +54,14 @@
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5I_get_name_test
+ * Function: H5I_get_name_test
*
- * Purpose: Testing version of H5Iget_name()
+ * Purpose: Testing version of H5Iget_name()
*
- * Return: Success: The length of name.
- * Failure: -1
+ * Return: Success: The length of name.
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 27, 2010
*
*-------------------------------------------------------------------------
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 23fe03c..aae3684 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -21,7 +21,7 @@
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gpkg.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
+#include "H5Iprivate.h" /* IDs */
#include "H5Lpkg.h" /* Links */
#include "H5MMprivate.h" /* Memory management */
#include "H5Opublic.h" /* File objects */
@@ -148,7 +148,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5L_extern_traverse
*
- * Purpose: Default traversal function for external links. This can
+ * Purpose: Default traversal function for external links. This can
* be overridden using H5Lregister().
*
* Given a filename and path packed into the link udata,
@@ -159,7 +159,7 @@ done:
*
* Return: ID of the opened object on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
* Modifications:
* Vailin Choi, April 2, 2008
diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h
index 47967a7..b006f3c 100644
--- a/src/H5Lpkg.h
+++ b/src/H5Lpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: James Laird <matzke@llnl.gov>
+ * Programmer: James Laird
* Friday, December 1, 2005
*
* Purpose: This file contains declarations which are visible
diff --git a/src/H5MF.c b/src/H5MF.c
index 6137bf0..f3fe763 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -15,7 +15,7 @@
*
* Created: H5MF.c
* Jul 11 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: File memory management functions.
*
@@ -209,7 +209,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 8 2008
*
*-------------------------------------------------------------------------
@@ -255,7 +254,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 8 2008
*
*-------------------------------------------------------------------------
@@ -307,7 +305,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 8 2008
*
*-------------------------------------------------------------------------
@@ -392,7 +389,6 @@ done:
* Failure: HADDR_UNDEF
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 11 1997
*
*-------------------------------------------------------------------------
@@ -572,7 +568,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 17 1997
*
*-------------------------------------------------------------------------
@@ -787,7 +782,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5MF_get_freespace
*
- * Purpose: Retrieve the amount of free space in a file.
+ * Purpose: Retrieve the amount of free space in the file
*
* Return: Success: Amount of free space in file
* Failure: Negative
@@ -795,11 +790,6 @@ done:
* Programmer: Quincey Koziol
* Monday, October 6, 2003
*
- * Modifications:
- * Vailin Choi; July 2012
- * As the default free-list mapping is changed to H5FD_FLMAP_DICHOTOMY,
- * checks are added to account for the last section of each free-space manager
- * and the remaining space in the two aggregators are at EOF.
*-------------------------------------------------------------------------
*/
herr_t
@@ -928,7 +918,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 14 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c
index b3a9d88..48031ee 100644
--- a/src/H5MFaggr.c
+++ b/src/H5MFaggr.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Tuesday, January 8, 2008
*
* Purpose: Routines for aggregating free space allocations
diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c
index 7ce6cf7..2c3e27e 100644
--- a/src/H5MFdbg.c
+++ b/src/H5MFdbg.c
@@ -15,7 +15,7 @@
*
* Created: H5MFdbg.c
* Jan 31 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File memory management debugging functions.
*
@@ -84,7 +84,6 @@ typedef struct {
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* January 31 2008
*
*-------------------------------------------------------------------------
@@ -133,7 +132,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 31 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h
index c2f109a..97715ac 100644
--- a/src/H5MFprivate.h
+++ b/src/H5MFprivate.h
@@ -15,12 +15,10 @@
*
* Created: H5MFprivate.h
* Jul 11 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Private header file for file memory management.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5MFprivate_H
diff --git a/src/H5MFsection.c b/src/H5MFsection.c
index 7a8ab24..8427ca3 100644
--- a/src/H5MFsection.c
+++ b/src/H5MFsection.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Tuesday, January 8, 2008
*
* Purpose: Free space section callbacks for file.
@@ -109,7 +109,6 @@ H5FL_DEFINE(H5MF_free_section_t);
* Return: Pointer to new section on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* January 8 2008
*
*-------------------------------------------------------------------------
@@ -117,8 +116,8 @@ H5FL_DEFINE(H5MF_free_section_t);
H5MF_free_section_t *
H5MF_sect_simple_new(haddr_t sect_off, hsize_t sect_size)
{
- H5MF_free_section_t *sect = NULL; /* 'Simple' free space section to add */
- H5MF_free_section_t *ret_value; /* Return value */
+ H5MF_free_section_t *sect; /* 'Simple' free space section to add */
+ H5MF_free_section_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -163,8 +162,8 @@ H5MF_sect_simple_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, hid
const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, hsize_t sect_size,
unsigned H5_ATTR_UNUSED *des_flags)
{
- H5MF_free_section_t *sect; /* New section */
- H5FS_section_info_t *ret_value; /* Return value */
+ H5MF_free_section_t *sect; /* New section */
+ H5FS_section_info_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -202,9 +201,9 @@ static htri_t
H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_info_t *_sect2,
void H5_ATTR_UNUSED *_udata)
{
- const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */
- const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */
- htri_t ret_value; /* Return value */
+ const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */
+ const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -280,9 +279,9 @@ H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
{
const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */
H5MF_sect_ud_t * udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
- haddr_t eoa; /* End of address space in the file */
- haddr_t end; /* End of section to extend */
- htri_t ret_value; /* Return value */
+ haddr_t eoa; /* End of address space in the file */
+ haddr_t end; /* End of section to extend */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5MM.c b/src/H5MM.c
index 081542b..bab8e55 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -15,7 +15,7 @@
*
* Created: H5MM.c
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Memory management functions
*
@@ -55,7 +55,7 @@
void *
H5MM_malloc(size_t size)
{
- void *ret_value;
+ void *ret_value = NULL;
HDassert(size);
@@ -94,7 +94,7 @@ H5MM_malloc(size_t size)
void *
H5MM_calloc(size_t size)
{
- void *ret_value;
+ void *ret_value = NULL;
HDassert(size);
diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h
index fe93522..90a79c7 100644
--- a/src/H5MMprivate.h
+++ b/src/H5MMprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5MMprivate.h
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Private header for memory management.
*
diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h
index f66fafb..62d2d98 100644
--- a/src/H5MMpublic.h
+++ b/src/H5MMpublic.h
@@ -13,15 +13,13 @@
/*-------------------------------------------------------------------------
*
- * Created: H5MMproto.h
+ * Created: H5MMpublic.h
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Public declarations for the H5MM (memory management)
* package.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5MMpublic_H
diff --git a/src/H5MP.c b/src/H5MP.c
index 7acda6c..d65a322 100644
--- a/src/H5MP.c
+++ b/src/H5MP.c
@@ -15,7 +15,7 @@
*
* Created: H5MP.c
* May 2 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implements memory pools. (Similar to Apache's APR
* memory pools)
@@ -73,7 +73,6 @@ H5FL_DEFINE(H5MP_pool_t);
* Return: Pointer to the memory pool "header" on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2005
*
*-------------------------------------------------------------------------
@@ -81,8 +80,8 @@ H5FL_DEFINE(H5MP_pool_t);
H5MP_pool_t *
H5MP_create(size_t page_size, unsigned flags)
{
- H5MP_pool_t *mp = NULL; /* New memory pool header */
- H5MP_pool_t *ret_value; /* Return value */
+ H5MP_pool_t *mp = NULL; /* New memory pool header */
+ H5MP_pool_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -122,7 +121,6 @@ done:
* Return: Pointer to the page allocated on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 4 2005
*
*-------------------------------------------------------------------------
@@ -130,9 +128,9 @@ done:
static H5MP_page_t *
H5MP_new_page(H5MP_pool_t *mp, size_t page_size)
{
- H5MP_page_t * new_page; /* New page created */
- H5MP_page_blk_t *first_blk; /* Pointer to first block in page */
- H5MP_page_t * ret_value; /* Return value */
+ H5MP_page_t * new_page; /* New page created */
+ H5MP_page_blk_t *first_blk; /* Pointer to first block in page */
+ H5MP_page_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -153,9 +151,6 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size)
new_page->free_size = mp->max_size;
new_page->fac_alloc = TRUE;
} /* end else */
-#ifdef QAK
- HDfprintf(stderr, "%s: Allocating new page = %p\n", FUNC, new_page);
-#endif /* QAK */
/* Initialize page information */
first_blk = H5MP_PAGE_FIRST_BLOCK(new_page);
@@ -191,7 +186,6 @@ done:
* Return: Pointer to the space allocated on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2005
*
*-------------------------------------------------------------------------
@@ -202,7 +196,7 @@ H5MP_malloc(H5MP_pool_t *mp, size_t request)
H5MP_page_t * alloc_page = NULL; /* Page to allocate space from */
H5MP_page_blk_t *alloc_free; /* Pointer to free space in page */
size_t needed; /* Size requested, plus block header and alignment */
- void * ret_value; /* Return value */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -212,10 +206,6 @@ H5MP_malloc(H5MP_pool_t *mp, size_t request)
/* Compute actual size needed */
needed = H5MP_BLOCK_ALIGN(request) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t));
-#ifdef QAK
- HDfprintf(stderr, "%s: sizeof(H5MP_page_blk_t) = %Zu\n", FUNC, sizeof(H5MP_page_blk_t));
- HDfprintf(stderr, "%s: request = %Zu, needed = %Zu\n", FUNC, request, needed);
-#endif /* QAK */
/* See if the request can be handled by existing free space */
if (needed <= mp->free_size) {
@@ -312,9 +302,6 @@ found:
/* Set new space pointer for the return value */
ret_value = ((unsigned char *)alloc_free) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t));
-#ifdef QAK
- HDfprintf(stderr, "%s: Allocating space from page, ret_value = %p\n", FUNC, ret_value);
-#endif /* QAK */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -328,7 +315,6 @@ done:
* Return: NULL on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 3 2005
*
* Note: Should we release pages that have no used blocks?
@@ -357,9 +343,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc)
/* Add it's space to the amount of free space in the page & pool */
spc_page = spc_blk->page;
-#ifdef QAK
- HDfprintf(stderr, "%s: Freeing from page = %p\n", "H5MP_free", spc_page);
-#endif /* QAK */
spc_page->free_size += spc_blk->size;
mp->free_size += spc_blk->size;
@@ -416,7 +399,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc)
* Return: Non-negative on success/negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 3 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5MPpkg.h b/src/H5MPpkg.h
index 23bcecf..46a6789 100644
--- a/src/H5MPpkg.h
+++ b/src/H5MPpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Monday, May 2, 2005
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5MPprivate.h b/src/H5MPprivate.h
index 22e36cc..de3f45c 100644
--- a/src/H5MPprivate.h
+++ b/src/H5MPprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5MPprivate.h
* May 2 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Private header for memory pool routines.
*
diff --git a/src/H5MPtest.c b/src/H5MPtest.c
index 8ba54f9..eeaa3a4 100644
--- a/src/H5MPtest.c
+++ b/src/H5MPtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
* Purpose: Memory pool testing functions.
@@ -41,8 +41,6 @@
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -72,8 +70,6 @@ H5MP_get_pool_free_size(const H5MP_pool_t *mp, size_t *free_size)
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -106,8 +102,6 @@ H5MP_get_pool_first_page(const H5MP_pool_t *mp, H5MP_page_t **page)
* Programmer: Quincey Koziol
* Wednesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -141,10 +135,6 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
/* Check that the free space from the blocks on the free list
* corresponds to space in page */
-#ifdef QAK
- HDfprintf(stderr, "%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_free_size_correct",
- page_free, page->free_size);
-#endif /* QAK */
if (page_free != page->free_size)
HGOTO_DONE(FALSE)
@@ -157,10 +147,6 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
/* Check that the free space from the pages
* corresponds to free space in pool */
-#ifdef QAK
- HDfprintf(stderr, "%s: pool_free = %Zu, mp->free_size = %Zu\n", "H5MP_pool_is_free_size_correct",
- pool_free, mp->free_size);
-#endif /* QAK */
if (pool_free != mp->free_size)
HGOTO_DONE(FALSE)
@@ -180,8 +166,6 @@ done:
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -211,8 +195,6 @@ H5MP_get_page_free_size(const H5MP_page_t *page, size_t *free_size)
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5O.c b/src/H5O.c
index a2a78bb..1efc878 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5O.c
- * Aug 5 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5O.c
*
- * Purpose: Object header routines.
+ * Purpose: Public object header routines
*
*-------------------------------------------------------------------------
*/
@@ -192,9 +190,9 @@ H5O_init_interface(void)
} /* end H5O_init_interface() */
/*-------------------------------------------------------------------------
- * Function: H5Oopen
+ * Function: H5Oopen
*
- * Purpose: Opens an object within an HDF5 file.
+ * Purpose: Opens an object within an HDF5 file.
*
* This function opens an object in the same way that H5Gopen2,
* H5Topen2, and H5Dopen2 do. However, H5Oopen doesn't require
@@ -205,11 +203,11 @@ H5O_init_interface(void)
* The opened object should be closed again with H5Oclose
* or H5Gclose, H5Tclose, or H5Dclose.
*
- * Return: Success: An open object identifier
- * Failure: Negative
+ * Return: Success: An open object identifier
+ * Failure: H5I_INVALID_HID
*
- * Programmer: James Laird
- * July 14 2006
+ * Programmer: James Laird
+ * July 14 2006
*
*-------------------------------------------------------------------------
*/
@@ -237,9 +235,9 @@ done:
} /* end H5Oopen() */
/*-------------------------------------------------------------------------
- * Function: H5Oopen_by_idx
+ * Function: H5Oopen_by_idx
*
- * Purpose: Opens an object within an HDF5 file, according to the offset
+ * Purpose: Opens an object within an HDF5 file, according to the offset
* within an index.
*
* This function opens an object in the same way that H5Gopen,
@@ -251,11 +249,11 @@ done:
* The opened object should be closed again with H5Oclose
* or H5Gclose, H5Tclose, or H5Dclose.
*
- * Return: Success: An open object identifier
- * Failure: Negative
+ * Return: Success: An open object identifier
+ * Failure: H5I_INVALID_HID
*
- * Programmer: Quincey Koziol
- * November 20 2006
+ * Programmer: Quincey Koziol
+ * November 20 2006
*
*-------------------------------------------------------------------------
*/
@@ -312,9 +310,9 @@ done:
} /* end H5Oopen_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5Oopen_by_addr
+ * Function: H5Oopen_by_addr
*
- * Purpose: Warning! This function is EXTREMELY DANGEROUS!
+ * Purpose: Warning! This function is EXTREMELY DANGEROUS!
* Improper use can lead to FILE CORRUPTION, INACCESSIBLE DATA,
* and other VERY BAD THINGS!
*
@@ -338,11 +336,11 @@ done:
* HDF5 file, and HDF5's file drivers will transparently
* map this to an address on disk for the filesystem.
*
- * Return: Success: An open object identifier
- * Failure: Negative
+ * Return: Success: An open object identifier
+ * Failure: H5I_INVALID_HID
*
- * Programmer: James Laird
- * July 14 2006
+ * Programmer: James Laird
+ * July 14 2006
*
*-------------------------------------------------------------------------
*/
@@ -378,27 +376,26 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object")
done:
-
FUNC_LEAVE_API(ret_value)
} /* end H5Oopen_by_addr() */
/*-------------------------------------------------------------------------
- * Function: H5Olink
+ * Function: H5Olink
*
- * Purpose: Creates a hard link from NEW_NAME to the object specified
- * by OBJ_ID using properties defined in the Link Creation
+ * Purpose: Creates a hard link from NEW_NAME to the object specified
+ * by OBJ_ID using properties defined in the Link Creation
* Property List LCPL.
*
- * This function should be used to link objects that have just
+ * This function should be used to link objects that have just
* been created.
*
- * NEW_NAME is interpreted relative to
- * NEW_LOC_ID, which is either a file ID or a
- * group ID.
+ * NEW_NAME is interpreted relative to
+ * NEW_LOC_ID, which is either a file ID or a
+ * group ID.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Tuesday, December 13, 2005
*
*-------------------------------------------------------------------------
@@ -406,8 +403,8 @@ done:
herr_t
H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5G_loc_t new_loc;
- H5G_loc_t obj_loc;
+ H5G_loc_t new_loc; /* Location of group to link from */
+ H5G_loc_t obj_loc; /* Location of object to link to */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -440,9 +437,9 @@ done:
} /* end H5Olink() */
/*-------------------------------------------------------------------------
- * Function: H5Oincr_refcount
+ * Function: H5Oincr_refcount
*
- * Purpose: Warning! This function is EXTREMELY DANGEROUS!
+ * Purpose: Warning! This function is EXTREMELY DANGEROUS!
* Improper use can lead to FILE CORRUPTION, INACCESSIBLE DATA,
* and other VERY BAD THINGS!
*
@@ -451,19 +448,19 @@ done:
* that references an object by address is created. When the
* link is deleted, H5Odecr_refcount should be used.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: James Laird
- * July 14 2006
+ * Programmer: James Laird
+ * July 14 2006
*
*-------------------------------------------------------------------------
*/
herr_t
H5Oincr_refcount(hid_t object_id)
{
- H5O_loc_t *oloc;
- herr_t ret_value = SUCCEED;
+ H5O_loc_t *oloc; /* Object location */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", object_id);
@@ -480,9 +477,9 @@ done:
} /* end H5O_incr_refcount() */
/*-------------------------------------------------------------------------
- * Function: H5Odecr_refcount
+ * Function: H5Odecr_refcount
*
- * Purpose: Warning! This function is EXTREMELY DANGEROUS!
+ * Purpose: Warning! This function is EXTREMELY DANGEROUS!
* Improper use can lead to FILE CORRUPTION, INACCESSIBLE DATA,
* and other VERY BAD THINGS!
*
@@ -491,19 +488,19 @@ done:
* that reference an object by address are deleted, and only
* after H5Oincr_refcount has already been used.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: James Laird
- * July 14 2006
+ * Programmer: James Laird
+ * July 14 2006
*
*-------------------------------------------------------------------------
*/
herr_t
H5Odecr_refcount(hid_t object_id)
{
- H5O_loc_t *oloc;
- herr_t ret_value = SUCCEED;
+ H5O_loc_t *oloc; /* Object location */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", object_id);
@@ -520,15 +517,15 @@ done:
} /* end H5Odecr_refcount() */
/*-------------------------------------------------------------------------
- * Function: H5Oexists_by_name
+ * Function: H5Oexists_by_name
*
- * Purpose: Determine if a linked-to object exists
+ * Purpose: Determine if a linked-to object exists
*
- * Return: Success: TRUE/FALSE
- * Failure: Negative
+ * Return: Success: TRUE/FALSE
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
- * February 2 2010
+ * Programmer: Quincey Koziol
+ * February 2 2010
*
*-------------------------------------------------------------------------
*/
@@ -560,15 +557,15 @@ done:
} /* end H5Oexists_by_name() */
/*-------------------------------------------------------------------------
- * Function: H5Oget_info
+ * Function: H5Oget_info
*
- * Purpose: Retrieve information about an object.
+ * Purpose: Retrieve information about an object.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
- * November 21 2006
+ * Programmer: Quincey Koziol
+ * November 21 2006
*
*-------------------------------------------------------------------------
*/
@@ -596,12 +593,12 @@ done:
} /* end H5Oget_info() */
/*-------------------------------------------------------------------------
- * Function: H5Oget_info_by_name
+ * Function: H5Oget_info_by_name
*
- * Purpose: Retrieve information about an object.
+ * Purpose: Retrieve information about an object
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* November 21 2006
@@ -638,16 +635,16 @@ done:
} /* end H5Oget_info_by_name() */
/*-------------------------------------------------------------------------
- * Function: H5Oget_info_by_idx
+ * Function: H5Oget_info_by_idx
*
- * Purpose: Retrieve information about an object, according to the order
+ * Purpose: Retrieve information about an object, according to the order
* of an index.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
- * November 26 2006
+ * Programmer: Quincey Koziol
+ * November 26 2006
*
*-------------------------------------------------------------------------
*/
@@ -705,19 +702,19 @@ done:
} /* end H5Oget_info_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5Oset_comment
+ * Function: H5Oset_comment
*
* Purpose: Gives the specified object a comment. The COMMENT string
- * should be a null terminated string. An object can have only
- * one comment at a time. Passing NULL for the COMMENT argument
- * will remove the comment property from the object.
+ * should be a null terminated string. An object can have only
+ * one comment at a time. Passing NULL for the COMMENT argument
+ * will remove the comment property from the object.
*
- * Note: Deprecated in favor of using attributes on objects
+ * Note: Deprecated in favor of using attributes on objects
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * August 30 2007
+ * Programmer: Quincey Koziol
+ * August 30 2007
*
*-------------------------------------------------------------------------
*/
@@ -743,19 +740,19 @@ done:
} /* end H5Oset_comment() */
/*-------------------------------------------------------------------------
- * Function: H5Oset_comment_by_name
+ * Function: H5Oset_comment_by_name
*
* Purpose: Gives the specified object a comment. The COMMENT string
- * should be a null terminated string. An object can have only
- * one comment at a time. Passing NULL for the COMMENT argument
- * will remove the comment property from the object.
+ * should be a null terminated string. An object can have only
+ * one comment at a time. Passing NULL for the COMMENT argument
+ * will remove the comment property from the object.
*
- * Note: Deprecated in favor of using attributes on objects
+ * Note: Deprecated in favor of using attributes on objects
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * August 30 2007
+ * Programmer: Quincey Koziol
+ * August 30 2007
*
*-------------------------------------------------------------------------
*/
@@ -787,91 +784,91 @@ done:
} /* end H5Oset_comment_by_name() */
/*-------------------------------------------------------------------------
- * Function: H5Oget_comment
+ * Function: H5Oget_comment
*
- * Purpose: Retrieve comment for an object.
+ * Purpose: Retrieve comment for an object.
*
- * Return: Success: Number of bytes in the comment excluding the
- * null terminator. Zero if the object has no
- * comment.
+ * Return: Success: Number of bytes in the comment excluding the
+ * null terminator. Zero if the object has no
+ * comment.
*
- * Failure: Negative
+ * Failure: -1
*
- * Programmer: Quincey Koziol
- * August 30 2007
+ * Programmer: Quincey Koziol
+ * August 30 2007
*
*-------------------------------------------------------------------------
*/
ssize_t
H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize)
{
- H5G_loc_t loc; /* Location of group */
- ssize_t ret_value; /* Return value */
+ H5G_loc_t loc; /* Location of group */
+ ssize_t ret_value = -1; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE3("Zs", "i*sz", obj_id, comment, bufsize);
/* Check args */
if (H5G_loc(obj_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a location")
/* Retrieve the object's comment */
if ((ret_value = H5G_loc_get_comment(&loc, ".", comment /*out*/, bufsize, H5P_LINK_ACCESS_DEFAULT,
H5AC_ind_dxpl_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, (-1), "object not found")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Oget_comment() */
/*-------------------------------------------------------------------------
- * Function: H5Oget_comment_by_name
+ * Function: H5Oget_comment_by_name
*
- * Purpose: Retrieve comment for an object.
+ * Purpose: Retrieve comment for an object.
*
- * Return: Success: Number of bytes in the comment excluding the
- * null terminator. Zero if the object has no
- * comment.
+ * Return: Success: Number of bytes in the comment excluding the
+ * null terminator. Zero if the object has no
+ * comment.
*
- * Failure: Negative
+ * Failure: -1
*
- * Programmer: Quincey Koziol
- * August 30 2007
+ * Programmer: Quincey Koziol
+ * August 30 2007
*
*-------------------------------------------------------------------------
*/
ssize_t
H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, hid_t lapl_id)
{
- H5G_loc_t loc; /* Location of group */
- ssize_t ret_value; /* Return value */
+ H5G_loc_t loc; /* Location of group */
+ ssize_t ret_value = -1; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE5("Zs", "i*s*szi", loc_id, name, comment, bufsize, lapl_id);
/* Check args */
if (H5G_loc(loc_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a location")
if (!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "no name")
if (H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else if (TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not link access property list ID")
/* Retrieve the object's comment */
if ((ret_value = H5G_loc_get_comment(&loc, name, comment /*out*/, bufsize, lapl_id, H5AC_ind_dxpl_id)) <
0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, (-1), "object not found")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Oget_comment_by_name() */
/*-------------------------------------------------------------------------
- * Function: H5Ovisit
+ * Function: H5Ovisit
*
- * Purpose: Recursively visit an object and all the objects reachable
+ * Purpose: Recursively visit an object and all the objects reachable
* from it. If the starting object is a group, all the objects
* linked to from that group will be visited. Links within
* each group are visited according to the order within the
@@ -887,16 +884,16 @@ done:
* iteration index and iteration order given) will be used to in
* the callback about the object.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
- * Programmer: Quincey Koziol
- * November 25 2007
+ * Programmer: Quincey Koziol
+ * November 25 2007
*
*-------------------------------------------------------------------------
*/
@@ -926,9 +923,9 @@ done:
} /* end H5Ovisit() */
/*-------------------------------------------------------------------------
- * Function: H5Ovisit_by_name
+ * Function: H5Ovisit_by_name
*
- * Purpose: Recursively visit an object and all the objects reachable
+ * Purpose: Recursively visit an object and all the objects reachable
* from it. If the starting object is a group, all the objects
* linked to from that group will be visited. Links within
* each group are visited according to the order within the
@@ -944,16 +941,16 @@ done:
* iteration index and iteration order given) will be used to in
* the callback about the object.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
- * Programmer: Quincey Koziol
- * November 24 2007
+ * Programmer: Quincey Koziol
+ * November 24 2007
*
*-------------------------------------------------------------------------
*/
@@ -990,20 +987,20 @@ done:
} /* end H5Ovisit_by_name() */
/*-------------------------------------------------------------------------
- * Function: H5Oclose
+ * Function: H5Oclose
*
- * Purpose: Close an open file object.
+ * Purpose: Close an open file object.
*
* This is the companion to H5Oopen. It is used to close any
* open object in an HDF5 file (but not IDs are that not file
* objects, such as property lists and dataspaces). It has
* the same effect as calling H5Gclose, H5Dclose, or H5Tclose.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: James Laird
- * July 14 2006
+ * Programmer: James Laird
+ * July 14 2006
*
*-------------------------------------------------------------------------
*/
@@ -1064,7 +1061,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
*-------------------------------------------------------------------------
@@ -1435,7 +1431,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
*-------------------------------------------------------------------------
@@ -1551,7 +1546,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
*-------------------------------------------------------------------------
@@ -1599,7 +1593,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Dec 31 2002
*
*-------------------------------------------------------------------------
@@ -1823,7 +1816,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -1869,7 +1861,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -1904,7 +1895,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Dec 31 2002
*
*-------------------------------------------------------------------------
@@ -2078,7 +2068,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * <koziol@ncsa.uiuc.edu>
* Tuesday, January 21, 2003
*
*-------------------------------------------------------------------------
@@ -2149,7 +2138,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 19 2003
*
*-------------------------------------------------------------------------
@@ -2203,7 +2191,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 19 2003
*
*-------------------------------------------------------------------------
@@ -2719,15 +2706,12 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr)
} /* end H5O_get_hdr_info_real() */
/*-------------------------------------------------------------------------
- * Function: H5O_get_info
+ * Function: H5O_get_info
*
- * Purpose: Retrieve the information for an object
+ * Purpose: Retrieve information about an object.
*
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * November 21 2006
+ * Return: Success: Non-negative
+ * Failure: Negative
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index f11a11a..785bb22 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Oainfo.c
* Mar 6 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Attribute Information messages.
*
@@ -93,7 +93,6 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
@@ -167,7 +166,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
@@ -222,7 +220,6 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
@@ -262,7 +259,6 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
@@ -292,7 +288,7 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void
/*-------------------------------------------------------------------------
* Function: H5O_ainfo_free
*
- * Purpose: Free's the message
+ * Purpose: Frees the message
*
* Return: Non-negative on success/Negative on failure
*
@@ -480,7 +476,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 93d051b..9e30c91 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -15,7 +15,7 @@
*
* Created: H5Oalloc.c
* Nov 17 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object header allocation routines.
*
@@ -91,7 +91,6 @@ H5FL_EXTERN(H5O_cont_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -217,7 +216,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -315,7 +313,6 @@ H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *ga
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 22 2006
*
*-------------------------------------------------------------------------
@@ -425,7 +422,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 21 2005
*
*-------------------------------------------------------------------------
@@ -500,7 +496,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, siz
uint8_t * old_image; /* Old address of chunk's image in memory */
size_t old_size; /* Old size of chunk */
htri_t was_extended; /* If chunk can be extended */
- size_t extend_msg; /* Index of null message to extend */
+ size_t extend_msg = 0; /* Index of null message to extend */
hbool_t extended_msg = FALSE; /* Whether an existing message was extended */
uint8_t new_size_flags = 0; /* New chunk #0 size flags */
hbool_t adjust_size_flags = FALSE; /* Whether to adjust the chunk #0 size flags */
@@ -719,7 +715,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 7 1997
*
*-------------------------------------------------------------------------
@@ -1103,7 +1098,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -1187,7 +1181,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 22 2006
*
*-------------------------------------------------------------------------
@@ -1436,7 +1429,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 17 2005
*
*-------------------------------------------------------------------------
@@ -1754,7 +1746,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 10 2005
*
*-------------------------------------------------------------------------
@@ -1895,7 +1886,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 17 2005
*
*-------------------------------------------------------------------------
@@ -2084,14 +2074,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 4 2005
*
- * Modifications:
- * Feb. 2009: Vailin Choi
- * Add 2 more parameters to H5O_move_msgs_forward() for moving
- * messages forward into "continuation" message
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2149,7 +2133,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Oct 20 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 1a0d632..c01277d 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -244,7 +244,7 @@ done:
if (NULL == ret_value)
if (attr) {
if (attr->shared) {
- /* Free any dynamicly allocated items */
+ /* Free any dynamically allocated items */
if (H5A_free(attr) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't release attribute info")
@@ -384,7 +384,7 @@ done:
static void *
H5O_attr_copy(const void *_src, void *_dst)
{
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index 0521a87..14daa3d 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Oattribute.c
- * Dec 11 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Oattribute.c
*
- * Purpose: Object header attribute routines.
+ * Purpose: Object header attribute routines.
*
*-------------------------------------------------------------------------
*/
@@ -38,8 +36,8 @@
#include "H5MMprivate.h" /* Memory management */
#include "H5Opkg.h" /* Object headers */
#include "H5SMprivate.h" /* Shared Object Header Messages */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Fprivate.h" /* File */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Fprivate.h" /* File */
/****************/
/* Local Macros */
@@ -152,13 +150,8 @@ static htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, cons
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
- * Modifications:
- * Vailin Choi; Sept 2011
- * Indicate that the object header is modified and might possibly need
- * to condense messages in the object header
*-------------------------------------------------------------------------
*/
static herr_t
@@ -403,13 +396,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
- * Modifications:
- * Vailin Choi; September 2011
- * Change oh_modified from boolean to unsigned
- * (See H5Oprivate.h for possible flags)
*-------------------------------------------------------------------------
*/
static herr_t
@@ -455,11 +443,6 @@ done:
* Programmer: Quincey Koziol
* Monday, December 11, 2006
*
- * Modification:Raymond Lu
- * 23 June 2008
- * If the attribute is in dense storage and has already been
- * opened, make a copy of already opened object to share some
- * object information.
*-------------------------------------------------------------------------
*/
H5A_t *
@@ -558,7 +541,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
@@ -594,11 +576,6 @@ done:
* Programmer: Quincey Koziol
* Monday, December 18, 2006
*
- * Modification:Raymond Lu
- * 23 June 2008
- * After opening the attribute, check whether it's in dense
- * storage and has already been opened. If it has, close the
- * opened object and make a copy of already opened object.
*-------------------------------------------------------------------------
*/
H5A_t *
@@ -755,7 +732,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 2 2007
*
*-------------------------------------------------------------------------
@@ -830,18 +806,12 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
* Modification:Raymond Lu
* 4 June 2008
* Took out the data copying part because the attribute data
* is shared between attribute handle and object header.
- *
- * Modifications:
- * Vailin Choi; Sept 2011
- * Indicate that the object header is modified but does not need to
- * condense messages in the object header
*-------------------------------------------------------------------------
*/
static herr_t
@@ -999,13 +969,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 5 2006
*
- * Modifications:
- * Vailin Choi; September 2011
- * Change "oh_modified" from boolean to unsigned
- * (See H5Oprivate.h for possible flags)
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1049,13 +1014,8 @@ H5O_attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out*/,
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 5 2006
*
- * Modifications:
- * Vailin Choi; Sept 2011
- * Indicate that the object header is modified and might possibly need
- * to condense messages in the object header
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1129,7 +1089,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_
mesg->native = NULL;
/* Delete old attribute */
- /* (doesn't decrement the link count on shared components becuase
+ /* (doesn't decrement the link count on shared components because
* the "native" pointer has been reset)
*/
if (H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, FALSE) < 0)
@@ -1516,13 +1476,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
- * Modifications:
- * Vailin Choi; Sept 2011
- * Indicate that the object header is modified and might possibly need
- * to condense messages in the object header
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1795,13 +1750,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
- * Modifications:
- * Vailin Choi; September 2011
- * Change "oh_modified" from boolean to unsigned
- * (See H5Oprivate.h for possible flags)
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Obogus.c b/src/H5Obogus.c
index 994e8e8..01adabf 100644
--- a/src/H5Obogus.c
+++ b/src/H5Obogus.c
@@ -15,7 +15,7 @@
*
* Created: H5Obogus.c
* Jan 21 2003
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: "bogus" message. This message is guaranteed to never
* be found in a valid HDF5 file and is only used to
@@ -102,7 +102,6 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
*-------------------------------------------------------------------------
@@ -150,7 +149,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
*-------------------------------------------------------------------------
@@ -185,7 +183,6 @@ H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
*-------------------------------------------------------------------------
@@ -207,11 +204,8 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c
index 27423ae..cd8ea76 100644
--- a/src/H5Obtreek.c
+++ b/src/H5Obtreek.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, March 1, 2007
*
* Purpose: A message holding non-default v1 B-tree 'K' value
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 8a8ce9f..8a77761 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -15,7 +15,7 @@
*
* Created: H5Ocache.c
* Sep 28 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Object header metadata cache virtual functions.
*
@@ -137,7 +137,6 @@ H5FL_SEQ_DEFINE(H5O_cont_t);
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
*-------------------------------------------------------------------------
@@ -352,7 +351,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
*-------------------------------------------------------------------------
@@ -499,7 +497,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 15 2003
*
*-------------------------------------------------------------------------
@@ -545,7 +542,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 20 2003
*
* Changes: In the parallel case, there is the possibility that the
@@ -660,7 +656,6 @@ H5O_size(const H5F_t H5_ATTR_UNUSED *f, const H5O_t *oh, size_t *size_ptr)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 12 2008
*
*-------------------------------------------------------------------------
@@ -758,7 +753,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 12 2008
*
*-------------------------------------------------------------------------
@@ -808,7 +802,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
@@ -856,7 +849,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
* Changes: In the parallel case, there is the possibility that the
@@ -933,7 +925,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
@@ -963,7 +954,6 @@ H5O_cache_chk_size(const H5F_t H5_ATTR_UNUSED *f, const H5O_chunk_proxy_t *chk_p
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
@@ -1010,7 +1000,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
@@ -1362,7 +1351,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
@@ -1429,7 +1417,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 13, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c
index 10320e7..f47bec2 100644
--- a/src/H5Ochunk.c
+++ b/src/H5Ochunk.c
@@ -15,7 +15,7 @@
*
* Created: H5Ochunk.c
* Jul 13 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object header chunk routines.
*
@@ -67,15 +67,13 @@ H5FL_DEFINE(H5O_chunk_proxy_t);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5O_chunk_add
+ * Function: H5O_chunk_add
*
- * Purpose: Add new chunk for object header to metadata cache
+ * Purpose: Add new chunk for object header to metadata cache
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -120,15 +118,13 @@ done:
} /* end H5O_chunk_add() */
/*-------------------------------------------------------------------------
- * Function: H5O_chunk_protect
+ * Function: H5O_chunk_protect
*
- * Purpose: Protect an object header chunk for modifications
+ * Purpose: Protect an object header chunk for modifications
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 17 2008
*
*-------------------------------------------------------------------------
@@ -137,7 +133,7 @@ H5O_chunk_proxy_t *
H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
{
H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for protected chunk */
- H5O_chunk_proxy_t *ret_value; /* Return value */
+ H5O_chunk_proxy_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -194,15 +190,13 @@ done:
} /* end H5O_chunk_protect() */
/*-------------------------------------------------------------------------
- * Function: H5O_chunk_unprotect
+ * Function: H5O_chunk_unprotect
*
- * Purpose: Unprotect an object header chunk after modifications
+ * Purpose: Unprotect an object header chunk after modifications
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 17 2008
*
*-------------------------------------------------------------------------
@@ -246,15 +240,13 @@ done:
} /* end H5O_chunk_unprotect() */
/*-------------------------------------------------------------------------
- * Function: H5O_chunk_resize
+ * Function: H5O_chunk_resize
*
- * Purpose: Resize an object header chunk
+ * Purpose: Resize an object header chunk
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 6 2010
*
*-------------------------------------------------------------------------
@@ -287,15 +279,13 @@ done:
} /* end H5O_chunk_resize() */
/*-------------------------------------------------------------------------
- * Function: H5O_chunk_update_idx
+ * Function: H5O_chunk_update_idx
*
- * Purpose: Update the chunk index for a chunk proxy
+ * Purpose: Update the chunk index for a chunk proxy
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -339,15 +329,13 @@ done:
} /* end H5O_chunk_update_idx() */
/*-------------------------------------------------------------------------
- * Function: H5O_chunk_delete
+ * Function: H5O_chunk_delete
*
- * Purpose: Notify metadata cache that a chunk has been deleted
+ * Purpose: Notify metadata cache that a chunk has been deleted
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Ocont.c b/src/H5Ocont.c
index 787cd40..50e7ee0 100644
--- a/src/H5Ocont.c
+++ b/src/H5Ocont.c
@@ -15,7 +15,7 @@
*
* Created: H5Ocont.c
* Aug 6 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: The object header continuation message. This
* message is only generated and read from within
@@ -80,7 +80,6 @@ H5FL_DEFINE(H5O_cont_t);
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -123,7 +122,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 7 1997
*
*-------------------------------------------------------------------------
@@ -161,7 +159,6 @@ H5O_cont_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -183,7 +180,7 @@ H5O_cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void
/*-------------------------------------------------------------------------
* Function: H5O_cont_free
*
- * Purpose: Free's the message
+ * Purpose: Frees the message
*
* Return: Non-negative on success/Negative on failure
*
@@ -245,11 +242,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 0c27f30..2cc3f24 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -15,7 +15,7 @@
*
* Created: H5Ocopy.c
* Nov 6 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object copying routines.
*
@@ -296,13 +296,6 @@ done:
* Programmer: Peter Cao
* May 30, 2005
*
- * Modifications:
- * Vailin Choi; Feb 2012
- * Bug fix for HDFFV-7853
- * When the object is opened, call the object's flush class action
- * to ensure that cached data is flushed so that H5Ocopy will get
- * the correct data.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1507,10 +1500,6 @@ done:
* Programmer: Neil Fortner
* Nov 3 2011
*
- * Modifications:
- * Vailin Choi; August 2012
- * Use H5O_obj_class to get object type instead of
- * H5O_get_info(...TRUE....) saving time in traversing metadata.
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Odbg.c b/src/H5Odbg.c
index 87f0dd4..92d0175 100644
--- a/src/H5Odbg.c
+++ b/src/H5Odbg.c
@@ -15,7 +15,7 @@
*
* Created: H5Odbg.c
* Nov 17 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object header debugging routines.
*
@@ -76,7 +76,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -232,11 +231,8 @@ H5O_assert(const H5O_t *oh)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 13 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -275,13 +271,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
- * Modifications:
- * Feb. 2009: Vailin Choi
- * Fixed bug in the accumulation of chunk_total
- * Used the appropriate flag when printing creation order tracked/indexed
*-------------------------------------------------------------------------
*/
herr_t
@@ -496,7 +487,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c
index 7a84df5..ae24682 100644
--- a/src/H5Odrvinfo.c
+++ b/src/H5Odrvinfo.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, March 1, 2007
*
* Purpose: A message holding driver info settings
@@ -80,8 +80,8 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- H5O_drvinfo_t *mesg; /* Native message */
- void * ret_value; /* Return value */
+ H5O_drvinfo_t *mesg; /* Native message */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -175,9 +175,9 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share
static void *
H5O_drvinfo_copy(const void *_mesg, void *_dest)
{
- const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
- H5O_drvinfo_t * dest = (H5O_drvinfo_t *)_dest;
- void * ret_value;
+ const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
+ H5O_drvinfo_t * dest = (H5O_drvinfo_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -223,8 +223,8 @@ done:
static size_t
H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
- const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
- size_t ret_value;
+ const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -249,7 +249,6 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 1 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index bc257b9..953ce7c 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -14,16 +14,16 @@
#define H5O_PACKAGE /*suppress error about including H5Opkg */
#define H5T_PACKAGE /*prevent warning from including H5Tpkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* Files */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Gprivate.h" /* Groups */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Tpkg.h" /* Datatypes */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* Files */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Gprivate.h" /* Groups */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Tpkg.h" /* Datatypes */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* PRIVATE PROTOTYPES */
static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg);
@@ -2102,7 +2102,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int ind
case H5T_SGN_ERROR:
case H5T_NSGN:
default:
- sprintf(buf, "H5T_SGN_%d", (int)(dt->shared->u.atomic.u.i.sign));
+ HDsprintf(buf, "H5T_SGN_%d", (int)(dt->shared->u.atomic.u.i.sign));
s = buf;
break;
} /* end switch */
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 04c8599..d038329 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Tuesday, November 25, 1997
*/
@@ -452,7 +452,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds
H5O_efl_t *efl_dst = NULL;
H5HL_t * heap = NULL; /* Pointer to local heap for EFL file names */
size_t idx, size, name_offset, heap_size;
- void * ret_value; /* Return value */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 776d6dc..1095d1b 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -11,24 +11,24 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, September 30, 1998
*
- * Purpose: The fill message indicates a bit pattern to use for
- * uninitialized data points of a dataset.
+ * Purpose: The fill message indicates a bit pattern to use for
+ * uninitialized data points of a dataset.
*/
#define H5O_PACKAGE /*suppress error about including H5Opkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Sprivate.h" /* Dataspaces */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Sprivate.h" /* Dataspaces */
static void * H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags,
unsigned *ioflags, size_t p_size, const uint8_t *p);
@@ -167,14 +167,14 @@ H5FL_DEFINE(H5O_fill_t);
H5FL_BLK_EXTERN(type_conv);
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_decode
+ * Function: H5O_fill_new_decode
*
- * Purpose: Decode a new fill value message. The new fill value
- * message is fill value plus space allocation time and
- * fill value writing time and whether fill value is defined.
+ * Purpose: Decode a new fill value message. The new fill value
+ * message is fill value plus space allocation time and
+ * fill value writing time and whether fill value is defined.
*
- * Return: Success: Ptr to new message in native struct.
- * Failure: NULL
+ * Return: Success: Ptr to new message in native struct.
+ * Failure: NULL
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -186,8 +186,8 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- H5O_fill_t *fill = NULL;
- void * ret_value;
+ H5O_fill_t *fill = NULL;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -344,13 +344,13 @@ done:
} /* end H5O_fill_old_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_encode
+ * Function: H5O_fill_new_encode
*
- * Purpose: Encode a new fill value message. The new fill value
- * message is fill value plus space allocation time and
- * fill value writing time and whether fill value is defined.
+ * Purpose: Encode a new fill value message. The new fill value
+ * message is fill value plus space allocation time and
+ * fill value writing time and whether fill value is defined.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -472,15 +472,15 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
} /* end H5O_fill_old_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_copy
+ * Function: H5O_fill_copy
*
- * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
- * necessary. The new fill value message is fill value plus
- * space allocation time and fill value writing time and
- * whether fill value is defined.
+ * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
+ * necessary. The new fill value message is fill value plus
+ * space allocation time and fill value writing time and
+ * whether fill value is defined.
*
- * Return: Success: Ptr to _DEST
- * Failure: NULL
+ * Return: Success: Ptr to _DEST
+ * Failure: NULL
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -590,16 +590,16 @@ done:
} /* end H5O_fill_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_size
+ * Function: H5O_fill_new_size
*
- * Purpose: Returns the size of the raw message in bytes not counting the
- * message type or size fields, but only the data fields. This
- * function doesn't take into account alignment. The new fill
- * value message is fill value plus space allocation time and
- * fill value writing time and whether fill value is defined.
+ * Purpose: Returns the size of the raw message in bytes not counting the
+ * message type or size fields, but only the data fields. This
+ * function doesn't take into account alignment. The new fill
+ * value message is fill value plus space allocation time and
+ * fill value writing time and whether fill value is defined.
*
- * Return: Success: Message data size in bytes w/o alignment.
- * Failure: 0
+ * Return: Success: Message data size in bytes w/o alignment.
+ * Failure: 0
*
* Programmer: Raymond Lu
* Feb 26, 2002
@@ -624,15 +624,15 @@ H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
1 + /* Fill value write time */
1; /* Fill value defined */
if (fill->fill_defined)
- ret_value += 4 + /* Fill value size */
- (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */
+ ret_value += 4 + /* Fill value size */
+ (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */
} /* end if */
else {
ret_value = 1 + /* Version number */
1; /* Status flags */
if (fill->size > 0)
- ret_value += 4 + /* Fill value size */
- (size_t)fill->size; /* Size of fill value */
+ ret_value += 4 + /* Fill value size */
+ (size_t)fill->size; /* Size of fill value */
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
@@ -666,13 +666,13 @@ H5O_fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
} /* end H5O_fill_old_size() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_reset_dyn
+ * Function: H5O_fill_reset_dyn
*
- * Purpose: Resets dynamic fill value fields
+ * Purpose: Resets dynamic fill value fields
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, January 22, 2007
*
*-------------------------------------------------------------------------
@@ -731,13 +731,13 @@ done:
} /* end H5O_fill_reset_dyn() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_reset
+ * Function: H5O_fill_reset
*
- * Purpose: Resets a message to an initial state.
+ * Purpose: Resets a message to an initial state.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
*-------------------------------------------------------------------------
@@ -763,13 +763,13 @@ H5O_fill_reset(void *_fill)
} /* end H5O_fill_reset() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_free
+ * Function: H5O_fill_free
*
- * Purpose: Frees the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, December 5, 2002
*
*-------------------------------------------------------------------------
@@ -787,13 +787,13 @@ H5O_fill_free(void *fill)
} /* end H5O_fill_free() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_debug
+ * Function: H5O_fill_debug
*
- * Purpose: Prints debugging info for the message.
+ * Purpose: Prints debugging info for the message.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
*-------------------------------------------------------------------------
@@ -887,16 +887,16 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void
} /* end H5O_fill_debug() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_convert
+ * Function: H5O_fill_convert
*
- * Purpose: Convert a fill value from whatever data type it currently has
- * to the specified dataset type. The `type' field of the fill
- * value struct will be set to NULL to indicate that it has the
- * same type as the dataset.
+ * Purpose: Convert a fill value from whatever data type it currently has
+ * to the specified dataset type. The `type' field of the fill
+ * value struct will be set to NULL to indicate that it has the
+ * same type as the dataset.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, October 1, 1998
*
*-------------------------------------------------------------------------
@@ -904,9 +904,9 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void
herr_t
H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_t dxpl_id)
{
- H5T_path_t *tpath; /* Type conversion info */
- void * buf = NULL, *bkg = NULL; /* Conversion buffers */
- hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */
+ H5T_path_t *tpath; /* Type conversion info */
+ void * buf = NULL, *bkg = NULL; /* Conversion buffers */
+ hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -993,7 +993,7 @@ done:
*
* Purpose: Set the encoding for a fill value to the latest version.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Tuesday, July 24, 2007
diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c
index 1dca8b5..e670a85 100644
--- a/src/H5Oginfo.c
+++ b/src/H5Oginfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Oginfo.c
* Aug 23 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Group Information messages.
*
@@ -85,7 +85,6 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
@@ -95,9 +94,9 @@ H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- H5O_ginfo_t * ginfo = NULL; /* Pointer to group information message */
- unsigned char flags; /* Flags for encoding group info */
- void * ret_value; /* Return value */
+ H5O_ginfo_t * ginfo = NULL; /* Pointer to group information message */
+ unsigned char flags; /* Flags for encoding group info */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -158,7 +157,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
@@ -210,7 +208,6 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
@@ -218,9 +215,9 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
static void *
H5O_ginfo_copy(const void *_mesg, void *_dest)
{
- const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg;
- H5O_ginfo_t * dest = (H5O_ginfo_t *)_dest;
- void * ret_value; /* Return value */
+ const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg;
+ H5O_ginfo_t * dest = (H5O_ginfo_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -251,7 +248,6 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
@@ -259,8 +255,8 @@ done:
static size_t
H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
- const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg;
- size_t ret_value; /* Return value */
+ const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg;
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -282,7 +278,7 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
/*-------------------------------------------------------------------------
* Function: H5O_ginfo_free
*
- * Purpose: Free's the message
+ * Purpose: Frees the message
*
* Return: Non-negative on success/Negative on failure
*
@@ -311,7 +307,6 @@ H5O_ginfo_free(void *mesg)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 74c8c7f..4466940 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
* Purpose: Messages related to data layout.
@@ -94,7 +94,7 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *
{
H5O_layout_t *mesg = NULL;
unsigned u;
- void * ret_value; /* Return value */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -366,9 +366,9 @@ done:
static void *
H5O_layout_copy(const void *_mesg, void *_dest)
{
- const H5O_layout_t *mesg = (const H5O_layout_t *)_mesg;
- H5O_layout_t * dest = (H5O_layout_t *)_dest;
- void * ret_value; /* Return value */
+ const H5O_layout_t *mesg = (const H5O_layout_t *)_mesg;
+ H5O_layout_t * dest = (H5O_layout_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -443,14 +443,14 @@ H5O_layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi
} /* end H5O_layout_size() */
/*-------------------------------------------------------------------------
- * Function: H5O_layout_reset
+ * Function: H5O__layout_reset
*
- * Purpose: Frees resources within a data type message, but doesn't free
- * the message itself.
+ * Purpose: Frees resources within a data type message, but doesn't free
+ * the message itself.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, September 13, 2002
*
*-------------------------------------------------------------------------
diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c
index a10f03d..f17f8de 100644
--- a/src/H5Olinfo.c
+++ b/src/H5Olinfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Olinfo.c
* Aug 23 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Link Information messages.
*
@@ -102,7 +102,6 @@ H5FL_DEFINE_STATIC(H5O_linfo_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
@@ -177,7 +176,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
@@ -232,7 +230,6 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
@@ -272,7 +269,6 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
@@ -433,7 +429,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 26 2006
*
*-------------------------------------------------------------------------
@@ -534,7 +529,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5Olink.c b/src/H5Olink.c
index 98d11aa..215fc84 100644
--- a/src/H5Olink.c
+++ b/src/H5Olink.c
@@ -15,7 +15,7 @@
*
* Created: H5Olink.c
* Aug 29 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Link messages.
*
@@ -108,7 +108,6 @@ H5FL_DEFINE_STATIC(H5O_link_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
@@ -286,7 +285,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
@@ -411,7 +409,6 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
@@ -478,7 +475,6 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
@@ -801,7 +797,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index d0347b5..53d5456 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -95,7 +95,6 @@ static herr_t H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, cons
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 1 2006
*
*-------------------------------------------------------------------------
@@ -142,7 +141,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Dec 31 2002
*
*-------------------------------------------------------------------------
@@ -184,7 +182,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 8 2006
*
*-------------------------------------------------------------------------
@@ -226,7 +223,7 @@ done:
* Purpose: Modifies an existing message or creates a new message.
*
* The UPDATE_FLAGS argument are flags that allow the caller
- * to skip updating the modification time or reseting the message
+ * to skip updating the modification time or resetting the message
* data. This is useful when several calls to H5O_msg_write will be
* made in a sequence.
*
@@ -235,7 +232,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -282,7 +278,7 @@ done:
* Purpose: Modifies an existing message or creates a new message.
*
* The UPDATE_FLAGS argument are flags that allow the caller
- * to skip updating the modification time or reseting the message
+ * to skip updating the modification time or resetting the message
* data. This is useful when several calls to H5O_msg_write will be
* made in a sequence.
*
@@ -290,7 +286,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 6 2007
*
*-------------------------------------------------------------------------
@@ -328,7 +323,7 @@ done:
* Purpose: Modifies an existing message or creates a new message.
*
* The UPDATE_FLAGS argument are flags that allow the caller
- * to skip updating the modification time or reseting the message
+ * to skip updating the modification time or resetting the message
* data. This is useful when several calls to H5O_msg_write will be
* made in a sequence.
*
@@ -337,7 +332,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -438,7 +432,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -446,8 +439,8 @@ done:
void *
H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, hid_t dxpl_id)
{
- H5O_t *oh = NULL; /* Object header to use */
- void * ret_value; /* Return value */
+ H5O_t *oh = NULL; /* Object header to use */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -490,7 +483,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -546,7 +538,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
*-------------------------------------------------------------------------
@@ -582,7 +573,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
*-------------------------------------------------------------------------
@@ -628,8 +618,8 @@ done:
void *
H5O_msg_free(unsigned type_id, void *mesg)
{
- const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
- void * ret_value; /* Return value */
+ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -677,7 +667,6 @@ H5O_msg_free_mesg(H5O_mesg_t *mesg)
* pointer.
*
* Return: Success: NULL
- *
* Failure: NULL
*
* Programmer: Robb Matzke
@@ -722,8 +711,8 @@ H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native)
void *
H5O_msg_copy(unsigned type_id, const void *mesg, void *dst)
{
- const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
- void * ret_value; /* Return value */
+ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -759,10 +748,10 @@ done:
int
H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id)
{
- H5O_t * oh = NULL; /* Object header to operate on */
- const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
- unsigned msg_count; /* Message count */
- int ret_value; /* Return value */
+ H5O_t * oh = NULL; /* Object header to operate on */
+ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
+ unsigned msg_count; /* Message count */
+ int ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -807,8 +796,8 @@ done:
unsigned
H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type)
{
- unsigned u; /* Local index variable */
- unsigned ret_value; /* Return value */
+ unsigned u; /* Local index variable */
+ unsigned ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -845,8 +834,8 @@ H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type)
htri_t
H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id)
{
- H5O_t *oh = NULL; /* Object header for location */
- htri_t ret_value; /* Return value */
+ H5O_t *oh = NULL; /* Object header for location */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -925,7 +914,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 28 1997
*
*-------------------------------------------------------------------------
@@ -975,7 +963,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -1024,13 +1011,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
- * Modifications:
- * Vailin Choi; Sept 2011
- * Indicate that the object header is modified and might possibly need
- * to condense messages in the object header
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1094,7 +1076,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 28 1997
*
*-------------------------------------------------------------------------
@@ -1151,7 +1132,6 @@ done:
* object headers were processed.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 19 2004
*
* Description:
@@ -1216,7 +1196,6 @@ done:
* object headers were processed.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
* Description:
@@ -1235,12 +1214,6 @@ done:
* C. Negative causes the iterator to immediately return that value,
* indicating failure.
*
- * Modifications:
- * Vailin Choi; September 2011
- * Change "oh_modified" from boolean to unsigned so as to know:
- * 1) object header is just modified
- * 2) object header is modified and possibly need to condense messages there
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1321,7 +1294,6 @@ done:
* Return: Size of message on success, 0 on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 13 2003
*
*-------------------------------------------------------------------------
@@ -1362,7 +1334,6 @@ done:
* Return: Size of message on success, 0 on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -1423,7 +1394,6 @@ done:
* Return: Size of message on success, 0 on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 7 2007
*
*-------------------------------------------------------------------------
@@ -1556,7 +1526,6 @@ H5O_msg_can_share_in_ohdr(unsigned type_id)
* Object is not shared: FALSE
*
* Programmer: James Laird
- * jlaird@ncsa.uiuc.edu
* April 5 2006
*
*-------------------------------------------------------------------------
@@ -1600,7 +1569,6 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg)
* Failure: Negative
*
* Programmer: James Laird
- * jlaird@hdfgroup.org
* November 1 2006
*
*-------------------------------------------------------------------------
@@ -1650,7 +1618,6 @@ done:
* Failure: Negative
*
* Programmer: James Laird
- * jlaird@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -1719,7 +1686,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5O_msg_encode
*
- * Purpose: Encode an object(data type and simple data space only)
+ * Purpose: Encode an object(data type and simple dataspace only)
* description into a buffer.
*
* Return: Success: Non-negative
@@ -1727,7 +1694,6 @@ done:
* Failure: Negative
*
* Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
* July 13, 2004
*
*-------------------------------------------------------------------------
@@ -1765,23 +1731,17 @@ done:
* Failure: NULL
*
* Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
* July 14, 2004
*
- * Modifications: Neil Fortner
- * Feb 4 2009
- * Added open_oh parameter. This parameter is optional and
- * contains this message's protected object header
- *
*-------------------------------------------------------------------------
*/
void *
H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, size_t buf_size,
const unsigned char *buf)
{
- const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
- void * ret_value; /* Return value */
- unsigned ioflags = 0; /* Flags for decode routine */
+ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
+ unsigned ioflags = 0; /* Flags for decode routine */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1822,7 +1782,7 @@ H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *native_src
hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata,
hid_t dxpl_id)
{
- void *ret_value;
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -2032,7 +1992,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* September 26 2003
*
*-------------------------------------------------------------------------
@@ -2072,7 +2031,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 14 2007
*
*-------------------------------------------------------------------------
@@ -2172,7 +2130,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 21 2005
*
*-------------------------------------------------------------------------
@@ -2220,7 +2177,6 @@ done:
* Failure: <0
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Apr 22 2010
*
*-------------------------------------------------------------------------
@@ -2274,7 +2230,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Apr 22 2010
*
*-------------------------------------------------------------------------
@@ -2331,7 +2286,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Apr 22 2010
*
*-------------------------------------------------------------------------
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 1a8b610..6c3361e 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -11,10 +11,10 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
- * Friday, July 24, 1998
+/* Programmer: Robb Matzke
+ * Friday, July 24, 1998
*
- * Purpose: The object modification time message.
+ * Purpose: The object modification time message.
*/
#define H5O_PACKAGE /*suppress error about including H5Opkg */
@@ -99,18 +99,20 @@ static hbool_t ntzset = FALSE;
H5FL_DEFINE(time_t);
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_new_decode
+ * Function: H5O_mtime_new_decode
*
- * Purpose: Decode a new modification time message and return a pointer to a
- * new time_t value.
+ * Purpose: Decode a new modification time message and return a pointer to
+ * a new time_t value.
*
- * Return: Success: Ptr to new message in native struct.
+ * The new modification time message format was added due to the
+ * performance overhead of the old format.
*
- * Failure: NULL
+ * Return: Success: Ptr to new message in native struct.
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jan 3 2002
+ * Failure: NULL
+ *
+ * Programmer: Quincey Koziol
+ * Jan 3 2002
*
*-------------------------------------------------------------------------
*/
@@ -152,18 +154,20 @@ done:
} /* end H5O_mtime_new_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_decode
+ * Function: H5O_mtime_decode
+ *
+ * Purpose: Decode a modification time message and return a pointer to a
+ * new time_t value.
*
- * Purpose: Decode a modification time message and return a pointer to a
- * new time_t value.
+ * The new modification time message format was added due to the
+ * performance overhead of the old format.
*
- * Return: Success: Ptr to new message in native struct.
+ * Return: Success: Ptr to new message in native struct.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
+ * Programmer: Robb Matzke
+ * Jul 24 1998
*
*-------------------------------------------------------------------------
*/
@@ -173,8 +177,8 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
time_t * mesg, the_time;
- int i;
struct tm tm;
+ int i; /* Local index variable */
void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -213,15 +217,14 @@ done:
} /* end H5O_mtime_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_new_encode
+ * Function: H5O_mtime_new_encode
*
- * Purpose: Encodes a new modification time message.
+ * Purpose: Encodes a new modification time message.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jan 3 2002
+ * Programmer: Quincey Koziol
+ * Jan 3 2002
*
*-------------------------------------------------------------------------
*/
@@ -253,17 +256,14 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
} /* end H5O_mtime_new_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_encode
+ * Function: H5O_mtime_encode
*
- * Purpose: Encodes a modification time message.
+ * Purpose: Encodes a modification time message.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Robb Matzke
+ * Jul 24 1998
*
*-------------------------------------------------------------------------
*/
@@ -290,20 +290,17 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
}
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_copy
- *
- * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
- * necessary.
+ * Function: H5O_mtime_copy
*
- * Return: Success: Ptr to _DEST
+ * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
+ * necessary.
*
- * Failure: NULL
+ * Return: Success: Ptr to _DEST
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
+ * Failure: NULL
*
- * Modifications:
+ * Programmer: Robb Matzke
+ * Jul 24 1998
*
*-------------------------------------------------------------------------
*/
@@ -332,22 +329,19 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_new_size
+ * Function: H5O_mtime_new_size
*
- * Purpose: Returns the size of the raw message in bytes not
- * counting the message type or size fields, but only the data
- * fields. This function doesn't take into account
- * alignment.
+ * Purpose: Returns the size of the raw message in bytes not
+ * counting the message type or size fields, but only the data
+ * fields. This function doesn't take into account
+ * alignment.
*
- * Return: Success: Message data size in bytes w/o alignment.
+ * Return: Success: Message data size in bytes w/o alignment.
*
- * Failure: 0
+ * Failure: 0
*
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Jan 3 2002
- *
- * Modifications:
+ * Programmer: Quincey Koziol
+ * Jan 3 2002
*
*-------------------------------------------------------------------------
*/
@@ -365,22 +359,19 @@ H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable
} /* end H5O_mtime_new_size() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_size
+ * Function: H5O_mtime_size
*
- * Purpose: Returns the size of the raw message in bytes not
- * counting the message type or size fields, but only the data
- * fields. This function doesn't take into account
- * alignment.
+ * Purpose: Returns the size of the raw message in bytes not
+ * counting the message type or size fields, but only the data
+ * fields. This function doesn't take into account
+ * alignment.
*
- * Return: Success: Message data size in bytes w/o alignment.
+ * Return: Success: Message data size in bytes w/o alignment.
*
- * Failure: 0
+ * Failure: 0
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 14 1998
- *
- * Modifications:
+ * Programmer: Robb Matzke
+ * Jul 14 1998
*
*-------------------------------------------------------------------------
*/
@@ -398,7 +389,7 @@ H5O_mtime_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
}
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_reset
+ * Function: H5O_mtime_reset
*
* Purpose: Frees resources within a modification time message, but doesn't free
* the message itself.
@@ -421,13 +412,13 @@ H5O_mtime_reset(void H5_ATTR_UNUSED *_mesg)
}
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_free
+ * Function: H5O_mtime_free
*
- * Purpose: Frees the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, March 30, 2000
*
*-------------------------------------------------------------------------
@@ -445,15 +436,14 @@ H5O_mtime_free(void *mesg)
} /* end H5O_mtime_free() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_debug
+ * Function: H5O_mtime_debug
*
- * Purpose: Prints debugging info for the message.
+ * Purpose: Prints debugging info for the message.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jul 24 1998
+ * Programmer: Robb Matzke
+ * Jul 24 1998
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Oname.c b/src/H5Oname.c
index d60d1c3..1591dbf 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -15,7 +15,7 @@
*
* Created: H5Oname.c
* Aug 12 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Object name message.
*
@@ -24,10 +24,10 @@
#define H5O_PACKAGE /*suppress error about including H5Opkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
static void * H5O_name_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
@@ -74,7 +74,6 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
*-------------------------------------------------------------------------
@@ -103,10 +102,9 @@ H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_
ret_value = mesg;
done:
- if (NULL == ret_value) {
+ if (NULL == ret_value)
if (mesg)
mesg = (H5O_name_t *)H5MM_xfree(mesg);
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_name_decode() */
@@ -119,11 +117,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -155,19 +150,16 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
H5O_name_copy(const void *_mesg, void *_dest)
{
- const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
- H5O_name_t * dest = (H5O_name_t *)_dest;
- void * ret_value; /* Return value */
+ const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
+ H5O_name_t * dest = (H5O_name_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -206,18 +198,15 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
- const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
- size_t ret_value;
+ const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -239,11 +228,8 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -270,11 +256,8 @@ H5O_name_reset(void *_mesg)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Onull.c b/src/H5Onull.c
index bfde430..781e03c 100644
--- a/src/H5Onull.c
+++ b/src/H5Onull.c
@@ -15,7 +15,6 @@
*
* Created: H5Onull.c
* Aug 6 1997
- * Robb Matzke <matzke@llnl.gov>
*
* Purpose: The null message.
*
diff --git a/src/H5Opline.c b/src/H5Opline.c
index f6b7de7..01479e4 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -12,22 +12,22 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Wednesday, April 15, 1998
+ * Programmer: Robb Matzke
+ * Wednesday, April 15, 1998
*
- * Purpose: Data filter pipeline message.
+ * Purpose: Data filter pipeline message.
*/
-#define H5O_PACKAGE /*suppress error about including H5Opkg */
-#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+#define H5O_PACKAGE /*suppress error about including H5Opkg */
+#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Zpkg.h" /* Data filters */
/* PRIVATE PROTOTYPES */
static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg);
@@ -65,40 +65,40 @@ static herr_t H5O_pline_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_PLINE[1] = {{
- H5O_PLINE_ID, /* message id number */
- "filter pipeline", /* message name for debugging */
- sizeof(H5O_pline_t), /* native message size */
+ H5O_PLINE_ID, /* message id number */
+ "filter pipeline", /* message name for debugging */
+ sizeof(H5O_pline_t), /* native message size */
H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_pline_shared_decode, /* decode message */
- H5O_pline_shared_encode, /* encode message */
- H5O_pline_copy, /* copy the native value */
- H5O_pline_shared_size, /* size of raw message */
- H5O_pline_reset, /* reset method */
- H5O_pline_free, /* free method */
- H5O_pline_shared_delete, /* file delete method */
- H5O_pline_shared_link, /* link method */
- NULL, /* set share method */
- NULL, /*can share method */
+ H5O_pline_shared_decode, /* decode message */
+ H5O_pline_shared_encode, /* encode message */
+ H5O_pline_copy, /* copy the native value */
+ H5O_pline_shared_size, /* size of raw message */
+ H5O_pline_reset, /* reset method */
+ H5O_pline_free, /* free method */
+ H5O_pline_shared_delete, /* file delete method */
+ H5O_pline_shared_link, /* link method */
+ NULL, /* set share method */
+ NULL, /*can share method */
H5O_pline_pre_copy_file, /* pre copy native value to file */
H5O_pline_shared_copy_file, /* copy native value to file */
H5O_pline_shared_post_copy_file, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O_pline_shared_debug /* debug the message */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O_pline_shared_debug /* debug the message */
}};
/* Declare a free list to manage the H5O_pline_t struct */
H5FL_DEFINE(H5O_pline_t);
/*-------------------------------------------------------------------------
- * Function: H5O_pline_decode
+ * Function: H5O_pline_decode
*
- * Purpose: Decodes a filter pipeline message.
+ * Purpose: Decodes a filter pipeline message.
*
- * Return: Success: Ptr to the native message.
- * Failure: NULL
+ * Return: Success: Ptr to the native message.
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -235,13 +235,13 @@ done:
} /* end H5O_pline_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_encode
+ * Function: H5O_pline_encode
*
- * Purpose: Encodes message MESG into buffer P.
+ * Purpose: Encodes message MESG into buffer P.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -332,17 +332,17 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p /*out*/, const void *mesg)
} /* end H5O_pline_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_copy
+ * Function: H5O_pline_copy
*
- * Purpose: Copies a filter pipeline message from SRC to DST allocating
- * DST if necessary. If DST is already allocated then we assume
- * that it isn't initialized.
+ * Purpose: Copies a filter pipeline message from SRC to DST allocating
+ * DST if necessary. If DST is already allocated then we assume
+ * that it isn't initialized.
*
- * Return: Success: Ptr to DST or allocated result.
+ * Return: Success: Ptr to DST or allocated result.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -353,7 +353,7 @@ H5O_pline_copy(const void *_src, void *_dst /*out*/)
const H5O_pline_t *src = (const H5O_pline_t *)_src; /* Source pipeline message */
H5O_pline_t * dst = (H5O_pline_t *)_dst; /* Destination pipeline message */
size_t i; /* Local index variable */
- H5O_pline_t * ret_value; /* Return value */
+ H5O_pline_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -426,15 +426,15 @@ done:
} /* end H5O_pline_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_size
+ * Function: H5O_pline_size
*
- * Purpose: Determines the size of a raw filter pipeline message.
+ * Purpose: Determines the size of a raw filter pipeline message.
*
- * Return: Success: Size of message.
+ * Return: Success: Size of message.
*
- * Failure: zero
+ * Failure: zero
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -444,14 +444,14 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
{
const H5O_pline_t *pline = (const H5O_pline_t *)mesg; /* Pipeline message */
size_t i; /* Local index variable */
- size_t ret_value; /* Return value */
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Message header */
- ret_value = 1 + /*version */
- 1 + /*number of filters */
- (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0); /*reserved */
+ ret_value = 1 + /*version */
+ 1 + /*number of filters */
+ (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0); /*reserved */
/* Calculate size of each filter in pipeline */
for (i = 0; i < pline->nused; i++) {
@@ -471,14 +471,14 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
} /* end else */
ret_value +=
- 2 + /*filter identification number */
+ 2 + /*filter identification number */
(size_t)((pline->version == H5O_PLINE_VERSION_1 || pline->filter[i].id >= H5Z_FILTER_RESERVED)
? 2
- : 0) + /*name length */
- 2 + /*flags */
- 2 + /*number of client data values */
+ : 0) + /*name length */
+ 2 + /*flags */
+ 2 + /*number of client data values */
(pline->version == H5O_PLINE_VERSION_1 ? (size_t)H5O_ALIGN_OLD(name_len)
- : name_len); /*length of the filter name */
+ : name_len); /*length of the filter name */
ret_value += pline->filter[i].cd_nelmts * 4;
if (pline->version == H5O_PLINE_VERSION_1)
@@ -490,14 +490,14 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
} /* end H5O_pline_size() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_reset
+ * Function: H5O_pline_reset
*
- * Purpose: Resets a filter pipeline message by clearing all filters.
- * The MESG buffer is not freed.
+ * Purpose: Resets a filter pipeline message by clearing all filters.
+ * The MESG buffer is not freed.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -518,7 +518,6 @@ H5O_pline_reset(void *mesg)
/* Free the filter information and array */
if (pline->filter) {
-
/* Free information for each filter */
for (i = 0; i < pline->nused; i++) {
if (pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name)
@@ -545,13 +544,13 @@ H5O_pline_reset(void *mesg)
} /* end H5O_pline_reset() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_free
+ * Function: H5O_pline_free
*
- * Purpose: Free's the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, March 11, 2000
*
*-------------------------------------------------------------------------
@@ -609,15 +608,15 @@ done:
} /* end H5O_pline_pre_copy_file() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_debug
+ * Function: H5O_pline_debug
*
- * Purpose: Prints debugging information for filter pipeline message MESG
- * on output stream STREAM. Each line is indented INDENT
- * characters and the field name takes up FWIDTH characters.
+ * Purpose: Prints debugging information for filter pipeline message MESG
+ * on output stream STREAM. Each line is indented INDENT
+ * characters and the field name takes up FWIDTH characters.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -677,7 +676,7 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi
*
* Purpose: Set the encoding for a I/O filter pipeline to the latest version.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Tuesday, July 24, 2007
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 8665c49..6b5c8f7 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5Oprivate.h
* Aug 5 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Object header private include file.
*
@@ -105,6 +105,7 @@ typedef struct H5O_t H5O_t;
#define H5O_BOGUS_MSG_ID_SIZE sizeof(unsigned)
#endif /* H5O_ENABLE_BOGUS */
+
#ifdef H5O_ENABLE_BAD_MESG_COUNT
#define H5O_BAD_MESG_COUNT_NAME "bad message count" /* Flag setting bad message count */
#define H5O_BAD_MESG_COUNT_SIZE sizeof(hbool_t)
@@ -210,7 +211,6 @@ typedef struct H5O_copy_t {
#define H5O_REFCOUNT_ID 0x0016 /* Reference count message. */
#define H5O_UNKNOWN_ID 0x0017 /* Placeholder message ID for unknown message. */
/* (this should never exist in a file) */
-
/*
* Note: Must increment H5O_MSG_TYPES in H5Opkg.h and update H5O_msg_class_g
* in H5O.c when creating a new message type. Also bump the value of
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index 0080a37..f7d0dbd 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -15,7 +15,7 @@
*
* Created: H5Opublic.h
* Aug 5 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Public declarations for the H5O (object header)
* package.
@@ -83,10 +83,10 @@
/* Types of objects in file */
typedef enum H5O_type_t {
- H5O_TYPE_UNKNOWN = -1, /* Unknown object type */
- H5O_TYPE_GROUP, /* Object is a group */
- H5O_TYPE_DATASET, /* Object is a dataset */
- H5O_TYPE_NAMED_DATATYPE, /* Object is a named data type */
+ H5O_TYPE_UNKNOWN = -1, /* Unknown object type */
+ H5O_TYPE_GROUP, /* Object is a group */
+ H5O_TYPE_DATASET, /* Object is a dataset */
+ H5O_TYPE_NAMED_DATATYPE, /* Object is a named data type */
H5O_TYPE_NTYPES /* Number of different object types (must be last!) */
} H5O_type_t;
@@ -111,13 +111,13 @@ typedef struct H5O_hdr_info_t {
/* Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */
typedef struct H5O_info_t {
unsigned long fileno; /* File number that object is located in */
- haddr_t addr; /* Object address in file */
+ haddr_t addr; /* Object address in file */
H5O_type_t type; /* Basic object type (group, dataset, etc.) */
unsigned rc; /* Reference count of object */
- time_t atime; /* Access time */
- time_t mtime; /* Modification time */
- time_t ctime; /* Change time */
- time_t btime; /* Birth time */
+ time_t atime; /* Access time */
+ time_t mtime; /* Modification time */
+ time_t ctime; /* Change time */
+ time_t btime; /* Birth time */
hsize_t num_attrs; /* # of attributes attached to object */
H5O_hdr_info_t hdr; /* Object header information */
/* Extra metadata storage for obj & attributes */
@@ -148,13 +148,13 @@ typedef H5O_mcdt_search_ret_t (*H5O_mcdt_search_cb_t)(void *op_data);
/* Public Variables */
/********************/
+/*********************/
+/* Public Prototypes */
+/*********************/
#ifdef __cplusplus
extern "C" {
#endif
-/*********************/
-/* Public Prototypes */
-/*********************/
H5_DLL hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id);
H5_DLL hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr);
H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
@@ -190,7 +190,7 @@ H5_DLL herr_t H5Oclose(hid_t object_id);
/* Typedefs */
-/* A struct that's part of the H5G_stat_t routine (deprecated) */
+/* A struct that's part of the H5G_stat_t structure (deprecated) */
typedef struct H5O_stat_t {
hsize_t size; /* Total size of object header in file */
hsize_t free; /* Free space within object header */
@@ -199,7 +199,6 @@ typedef struct H5O_stat_t {
} H5O_stat_t;
/* Function prototypes */
-
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c
index bd679c1..a5be3a3 100644
--- a/src/H5Orefcount.c
+++ b/src/H5Orefcount.c
@@ -15,7 +15,7 @@
*
* Created: H5Orefcount.c
* Mar 10 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object ref. count messages.
*
@@ -80,7 +80,6 @@ H5FL_DEFINE_STATIC(H5O_refcount_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
@@ -128,7 +127,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
@@ -165,7 +163,6 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
@@ -173,9 +170,9 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
static void *
H5O_refcount_copy(const void *_mesg, void *_dest)
{
- const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg;
- H5O_refcount_t * dest = (H5O_refcount_t *)_dest;
- void * ret_value; /* Return value */
+ const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg;
+ H5O_refcount_t * dest = (H5O_refcount_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -205,7 +202,6 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
@@ -228,7 +224,7 @@ H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_
/*-------------------------------------------------------------------------
* Function: H5O_refcount_free
*
- * Purpose: Free's the message
+ * Purpose: Frees the message
*
* Return: Non-negative on success/Negative on failure
*
@@ -290,7 +286,6 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index b9c1530..df58460 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -112,9 +112,9 @@ H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5S_extent_t *sdim = NULL; /* New extent dimensionality structure */
- void * ret_value;
- unsigned i; /* local counting variable */
unsigned flags, version;
+ unsigned i; /* Local counting variable */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -295,9 +295,9 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg)
static void *
H5O_sdspace_copy(const void *_mesg, void *_dest)
{
- const H5S_extent_t *mesg = (const H5S_extent_t *)_mesg;
- H5S_extent_t * dest = (H5S_extent_t *)_dest;
- void * ret_value; /* Return value */
+ const H5S_extent_t *mesg = (const H5S_extent_t *)_mesg;
+ H5S_extent_t * dest = (H5S_extent_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -377,8 +377,6 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg)
* Programmer: Robb Matzke
* Thursday, April 30, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -396,7 +394,7 @@ H5O_sdspace_reset(void *_mesg)
/*-------------------------------------------------------------------------
* Function: H5O_sdsdpace_free
*
- * Purpose: Free's the message
+ * Purpose: Frees the message
*
* Return: Non-negative on success/Negative on failure
*
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 4803c91..d9ae2df 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Wednesday, April 1, 1998
*
* Purpose: Functions that operate on a shared message. The shared
@@ -90,7 +90,6 @@
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 24 2003
*
*-------------------------------------------------------------------------
@@ -205,7 +204,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 26 2003
*
*-------------------------------------------------------------------------
@@ -301,9 +299,9 @@ void *
H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, const uint8_t *buf,
const H5O_msg_class_t *type)
{
- H5O_shared_t sh_mesg; /* Shared message info */
- unsigned version; /* Shared message version */
- void * ret_value; /* Return value */
+ H5O_shared_t sh_mesg; /* Shared message info */
+ unsigned version; /* Shared message version */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -428,7 +426,6 @@ H5O_shared_encode(const H5F_t *f, uint8_t *buf /*out*/, const H5O_shared_t *sh_m
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 26 2003
*
*-------------------------------------------------------------------------
@@ -464,7 +461,7 @@ H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src)
size_t
H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg)
{
- size_t ret_value; /* Return value */
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -560,8 +557,7 @@ done:
*
* Purpose: Copies a message from _MESG to _DEST in file
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* January 22, 2007
@@ -618,17 +614,16 @@ done:
/*-------------------------------------------------------------------------
* Function: H5O_shared_post_copy_file
*
- * Purpose: Delate a shared message and replace with a new one.
+ * Purpose: Delete a shared message and replace with a new one.
* The function is needed at cases such as coping a shared reg_ref attribute.
* When a shared reg_ref attribute is copied from one file to
* another, the values in file need to be replaced. The only way
* to complish that is to delete the old message and write the
* new message with the correct values.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Peter Cao
- * xcao@hdfgroup.org
* May 24 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Oshared.h b/src/H5Oshared.h
index f293234..25b395a 100644
--- a/src/H5Oshared.h
+++ b/src/H5Oshared.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Friday, January 19, 2007
*
* Purpose: This file contains inline definitions for "generic" routines
@@ -48,7 +48,7 @@ static H5_INLINE void *
H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p)
{
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -163,7 +163,7 @@ H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg)
{
const H5O_shared_t *sh_mesg =
(const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */
- size_t ret_value; /* Return value */
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -316,8 +316,8 @@ static H5_INLINE void *
H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size,
unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id)
{
- void *dst_mesg = NULL; /* Destination message */
- void *ret_value; /* Return value */
+ void *dst_mesg = NULL; /* Destination message */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c
index 1392d10..f1a9066 100644
--- a/src/H5Oshmesg.c
+++ b/src/H5Oshmesg.c
@@ -150,9 +150,9 @@ H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
static void *
H5O_shmesg_copy(const void *_mesg, void *_dest)
{
- const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg;
- H5O_shmesg_table_t * dest = (H5O_shmesg_table_t *)_dest;
- void * ret_value;
+ const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg;
+ H5O_shmesg_table_t * dest = (H5O_shmesg_table_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -190,7 +190,7 @@ done:
static size_t
H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg)
{
- size_t ret_value;
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
diff --git a/src/H5Ostab.c b/src/H5Ostab.c
index a756b01..b831fdd 100644
--- a/src/H5Ostab.c
+++ b/src/H5Ostab.c
@@ -15,7 +15,7 @@
*
* Created: H5Ostab.c
* Aug 6 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Symbol table messages.
*
@@ -86,7 +86,6 @@ H5FL_DEFINE_STATIC(H5O_stab_t);
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -96,8 +95,8 @@ H5O_stab_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *op
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
- H5O_stab_t *stab = NULL;
- void * ret_value; /* Return value */
+ H5O_stab_t *stab = NULL;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -115,10 +114,9 @@ H5O_stab_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *op
ret_value = stab;
done:
- if (ret_value == NULL) {
+ if (ret_value == NULL)
if (stab != NULL)
stab = H5FL_FREE(H5O_stab_t, stab);
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_stab_decode() */
@@ -131,7 +129,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -166,7 +163,6 @@ H5O_stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -174,9 +170,9 @@ H5O_stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con
static void *
H5O_stab_copy(const void *_mesg, void *_dest)
{
- const H5O_stab_t *stab = (const H5O_stab_t *)_mesg;
- H5O_stab_t * dest = (H5O_stab_t *)_dest;
- void * ret_value; /* Return value */
+ const H5O_stab_t *stab = (const H5O_stab_t *)_mesg;
+ H5O_stab_t * dest = (H5O_stab_t *)_dest;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -207,7 +203,6 @@ done:
* Failure: zero
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -215,7 +210,7 @@ done:
static size_t
H5O_stab_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg)
{
- size_t ret_value; /* Return value */
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -235,8 +230,6 @@ H5O_stab_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void
* Programmer: Quincey Koziol
* Thursday, March 30, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -304,8 +297,8 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t H
H5O_stab_t * stab_src = (H5O_stab_t *)native_src;
H5O_stab_t * stab_dst = NULL;
H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata;
- size_t size_hint; /* Local heap initial size */
- void * ret_value; /* Return value */
+ size_t size_hint; /* Local heap initial size */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -398,11 +391,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Otest.c b/src/H5Otest.c
index 51b9d1a..9cef4d1 100644
--- a/src/H5Otest.c
+++ b/src/H5Otest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Monday, December 4, 2006
*
* Purpose: Object header testing functions.
@@ -85,10 +85,10 @@
htri_t
H5O_is_attr_dense_test(hid_t oid)
{
- H5O_t * oh = NULL; /* Object header */
- H5O_ainfo_t ainfo; /* Attribute information for object */
- H5O_loc_t * loc; /* Pointer to object's location */
- htri_t ret_value; /* Return value */
+ H5O_t * oh = NULL; /* Object header */
+ H5O_ainfo_t ainfo; /* Attribute information for object */
+ H5O_loc_t * loc; /* Pointer to object's location */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -152,7 +152,7 @@ H5O_is_attr_empty_test(hid_t oid)
htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */
H5O_loc_t * loc; /* Pointer to object's location */
hsize_t nattrs; /* Number of attributes */
- htri_t ret_value; /* Return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c
index 8484b83..f0f54ba 100644
--- a/src/H5Ounknown.c
+++ b/src/H5Ounknown.c
@@ -15,7 +15,7 @@
*
* Created: H5Ounknown.c
* Apr 19 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Handle unknown message classes in a minimal way.
*
@@ -60,11 +60,11 @@ const H5O_msg_class_t H5O_MSG_UNKNOWN[1] = {{
H5FL_DEFINE(H5O_unknown_t);
/*-------------------------------------------------------------------------
- * Function: H5O_unknown_free
+ * Function: H5O_unknown_free
*
- * Purpose: Free's the message
+ * Purpose: Frees the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Tuesday, May 1, 2007
diff --git a/src/H5P.c b/src/H5P.c
index da19955..6cd050a 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
*
* Purpose: Generic Property Functions
*/
@@ -117,7 +117,7 @@ H5P__term_pub_interface(void)
hid_t id; IN: Property list or class ID to copy
RETURNS
Success: valid property list ID on success (non-negative)
- Failure: negative
+ Failure: H5I_INVALID_HID (negative)
DESCRIPTION
Copy a property list or class and return the ID. This routine calls the
class 'copy' callback after any property 'copy' callbacks are called
@@ -131,10 +131,10 @@ H5P__term_pub_interface(void)
hid_t
H5Pcopy(hid_t id)
{
- void *obj; /* Property object to copy */
- hid_t ret_value = FALSE; /* return value */
+ void *obj; /* Property object to copy */
+ hid_t ret_value = H5I_INVALID_HID; /* return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", id);
if (H5P_DEFAULT == id)
@@ -142,14 +142,14 @@ H5Pcopy(hid_t id)
/* Check arguments. */
if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property object");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not property object");
if (NULL == (obj = H5I_object(id)))
- HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist");
+ HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "property object doesn't exist");
/* Compare property lists */
if (H5I_GENPROP_LST == H5I_get_type(id)) {
if ((ret_value = H5P_copy_plist((H5P_genplist_t *)obj, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property list");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "can't copy property list");
} /* end if */
/* Must be property classes */
else {
@@ -157,12 +157,13 @@ H5Pcopy(hid_t id)
/* Copy the class */
if ((copy_class = H5P_copy_pclass((H5P_genclass_t *)obj)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property class");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "can't copy property class");
/* Get an atom for the copied class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, TRUE)) < 0) {
H5P_close_class(copy_class);
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID,
+ "unable to atomize property list class");
} /* end if */
} /* end else */
@@ -196,7 +197,7 @@ done:
void *close_data; IN: Pointer to user data to pass along to class
close callback.
RETURNS
- Returns a valid property list class ID on success, NULL on failure.
+ Returns a valid property list class ID on success, H5I_INVALID_HID on failure.
DESCRIPTION
Allocates memory and attaches a class to the property list class hierarchy.
GLOBAL VARIABLES
@@ -209,40 +210,40 @@ H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create
H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close,
void *close_data)
{
- H5P_genclass_t *par_class = NULL; /* Pointer to the parent class */
- H5P_genclass_t *pclass = NULL; /* Property list class created */
- hid_t ret_value; /* Return value */
+ H5P_genclass_t *par_class = NULL; /* Pointer to the parent class */
+ H5P_genclass_t *pclass = NULL; /* Property list class created */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE8("i", "i*sx*xx*xx*x", parent, name, cls_create, create_data, cls_copy, copy_data, cls_close,
close_data);
/* Check arguments. */
if (H5P_DEFAULT != parent && (H5I_GENPROP_CLS != H5I_get_type(parent)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list class")
if (!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid class name")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid class name")
if ((create_data != NULL && cls_create == NULL) || (copy_data != NULL && cls_copy == NULL) ||
(close_data != NULL && cls_close == NULL))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "data specified, but no callback provided")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "data specified, but no callback provided")
/* Get the pointer to the parent class */
if (parent == H5P_DEFAULT)
par_class = NULL;
else if (NULL == (par_class = (H5P_genclass_t *)H5I_object(parent)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't retrieve parent class")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't retrieve parent class")
/* Create the new property list class */
if (NULL == (pclass = H5P_create_class(par_class, name, H5P_TYPE_USER, cls_create, create_data, cls_copy,
copy_data, cls_close, close_data)))
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list class")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list class")
/* Get an atom for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class")
done:
- if (ret_value < 0 && pclass)
+ if (H5I_INVALID_HID == ret_value && pclass)
H5P_close_class(pclass);
FUNC_LEAVE_API(ret_value)
@@ -257,7 +258,7 @@ done:
hid_t H5Pcreate(cls_id)
hid_t cls_id; IN: Property list class create list from
RETURNS
- Returns a valid property list ID on success, FAIL on failure.
+ Returns a valid property list ID on success, H5I_INVALID_HID on failure.
DESCRIPTION
Creates a property list of a given class. If a 'create' callback
exists for the property list class, it is called before the
@@ -273,19 +274,19 @@ done:
hid_t
H5Pcreate(hid_t cls_id)
{
- H5P_genclass_t *pclass; /* Property list class to modify */
- hid_t ret_value; /* return value */
+ H5P_genclass_t *pclass; /* Property list class to modify */
+ hid_t ret_value = H5I_INVALID_HID; /* return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", cls_id);
/* Check arguments. */
if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list class");
/* Create the new property list */
if ((ret_value = H5P_create_id(pclass, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list");
done:
FUNC_LEAVE_API(ret_value)
@@ -429,7 +430,7 @@ done:
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The 'set' callback function may be useful to range check the value being
- set for the property or may perform some tranformation/translation of the
+ set for the property or may perform some transformation/translation of the
value set. The 'get' callback would then [probably] reverse the
transformation, etc. A single 'get' or 'set' callback could handle
multiple properties by performing different actions based on the property
@@ -610,7 +611,7 @@ done:
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The 'set' callback function may be useful to range check the value being
- set for the property or may perform some tranformation/translation of the
+ set for the property or may perform some transformation/translation of the
value set. The 'get' callback would then [probably] reverse the
transformation, etc. A single 'get' or 'set' callback could handle
multiple properties by performing different actions based on the property
@@ -847,7 +848,7 @@ done:
hid_t plist_id; IN: Property list to query
RETURNS
Success: ID of class object
- Failure: negative
+ Failure: H5I_INVALID_HID (negative)
DESCRIPTION
This routine retrieves the class of a property list.
@@ -860,31 +861,31 @@ done:
hid_t
H5Pget_class(hid_t plist_id)
{
- H5P_genplist_t *plist; /* Property list to query */
- H5P_genclass_t *pclass = NULL; /* Property list class */
- hid_t ret_value = FAIL; /* return value */
+ H5P_genplist_t *plist; /* Property list to query */
+ H5P_genclass_t *pclass = NULL; /* Property list class */
+ hid_t ret_value = H5I_INVALID_HID; /* return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", plist_id);
/* Check arguments. */
if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list");
/* Retrieve the property list class */
if ((pclass = H5P_get_class(plist)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to query class of property list");
+ HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to query class of property list");
/* Increment the outstanding references to the class object */
if (H5P_access_class(pclass, H5P_MOD_INC_REF) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't increment class ID ref count");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ID ref count");
/* Get an atom for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class");
done:
- if (ret_value < 0 && pclass)
+ if (H5I_INVALID_HID == ret_value && pclass)
H5P_close_class(pclass);
FUNC_LEAVE_API(ret_value)
@@ -1502,7 +1503,7 @@ done:
hid_t pclass_id; IN: Property class to query
RETURNS
Success: ID of parent class object
- Failure: NULL
+ Failure: H5I_INVALID_HID (negative)
DESCRIPTION
This routine retrieves an ID for the parent class of a property class.
@@ -1518,27 +1519,27 @@ H5Pget_class_parent(hid_t pclass_id)
H5P_genclass_t *parent = NULL; /* Parent's property class */
hid_t ret_value; /* return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", pclass_id);
/* Check arguments. */
if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property class")
/* Retrieve the property class's parent */
if (NULL == (parent = H5P_get_class_parent(pclass)))
- HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to query class of property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to query class of property list")
/* Increment the outstanding references to the class object */
if (H5P_access_class(parent, H5P_MOD_INC_REF) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't increment class ID ref count")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ID ref count")
/* Get an atom for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, parent, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class")
done:
- if (ret_value < 0 && parent)
+ if (H5I_INVALID_HID == ret_value && parent)
H5P_close_class(parent);
FUNC_LEAVE_API(ret_value)
@@ -1565,7 +1566,7 @@ done:
herr_t
H5Pclose_class(hid_t cls_id)
{
- hid_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", cls_id);
diff --git a/src/H5PL.c b/src/H5PL.c
index 68fcbb5..610d61f 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -200,21 +200,22 @@ H5PL__init_interface(void)
} /* end H5PL__init_interface() */
/*-------------------------------------------------------------------------
- * Function: H5PLset_loading_state
+ * Function: H5PLset_loading_state
*
- * Purpose: Control the loading of dynamic plugin types.
+ * Purpose: Control the loading of dynamic plugin types.
*
- * This function will not allow plugin types if the pathname from the HDF5_PLUGIN_PRELOAD
- * environment variable is set to the special "::" string.
+ * This function will not allow plugin types if the pathname from the HDF5_PLUGIN_PRELOAD
+ * environment variable is set to the special "::" string.
*
- * plugin bit = 0, will prevent the use of that dynamic plugin type.
- * plugin bit = 1, will allow the use of that dynamic plugin type.
+ * plugin bit = 0, will prevent the use of that dynamic plugin type.
+ * plugin bit = 1, will allow the use of that dynamic plugin type.
*
- * H5PL_TYPE_FILTER changes just dynamic filters
- * A H5PL_ALL_PLUGIN will enable all dynamic plugin types
- * A zero value will disable all dynamic plugin types
+ * H5PL_TYPE_FILTER changes just dynamic filters
+ * A H5PL_ALL_PLUGIN will enable all dynamic plugin types
+ * A zero value will disable all dynamic plugin types
*
- * Return: Non-negative or success
+ * Return: Success: Non-negative
+ * Failture: Negative
*
*-------------------------------------------------------------------------
*/
@@ -241,14 +242,17 @@ done:
} /* end H5PLset_loading_state() */
/*-------------------------------------------------------------------------
- * Function: H5PLget_loading_state
+ * Function: H5PLget_loading_state
*
- * Purpose: Query state of the loading of dynamic plugin types.
+ * Purpose: Query state of the loading of dynamic plugin types.
*
- * This function will return the state of the global flag.
+ * This function will return the state of the global flag.
*
- * Return: Zero if all plugin types are disabled, negative if all
- * plugin types are enabled, positive if one or more of the plugin types are enabled.
+ * Zero if all plugin types are disabled, negative if all
+ * plugin types are enabled, positive if one or more of the plugin types are enabled.
+ *
+ * Return: Success: Non-negative
+ * Failture: Negative
*
*-------------------------------------------------------------------------
*/
@@ -389,11 +393,12 @@ done:
} /* end H5PL_load() */
/*-------------------------------------------------------------------------
- * Function: H5PLappend
+ * Function: H5PLappend
*
- * Purpose: Insert a plugin path at the end of the list.
+ * Purpose: Insert a plugin search path at the end of the list.
*
- * Return: Non-negative or success.
+ * Return: Success: Non-negative
+ * Failture: Negative
*
*-------------------------------------------------------------------------
*/
@@ -422,11 +427,12 @@ done:
} /* end H5PLappend() */
/*-------------------------------------------------------------------------
- * Function: H5PLprepend
+ * Function: H5PLprepend
*
- * Purpose: Insert a plugin path at the beginning of the list.
+ * Purpose: Insert a plugin search path at the beginning of the list.
*
- * Return: Non-negative or success.
+ * Return: Success: Non-negative
+ * Failture: Negative
*
*-------------------------------------------------------------------------
*/
@@ -458,11 +464,12 @@ done:
} /* end H5PLprepend() */
/*-------------------------------------------------------------------------
- * Function: H5PLreplace
+ * Function: H5PLreplace
*
- * Purpose: Replace the path at the specified index.
+ * Purpose: Replace the path at the specified index. The path at the
+ * index must exist.
*
- * Return: Non-negative or success.
+ * Return: Non-negative or success.
*
*-------------------------------------------------------------------------
*/
@@ -492,11 +499,13 @@ done:
} /* end H5PLreplace() */
/*-------------------------------------------------------------------------
- * Function: H5PLinsert
+ * Function: H5PLinsert
*
- * Purpose: Insert a plugin path at the specified index, moving other paths after the index.
+ * Purpose: Insert a plugin search path at the specified index, moving
+ * other paths after the index.
*
- * Return: Non-negative or success.
+ * Return: Success: Non-negative
+ * Failture: Negative
*
*-------------------------------------------------------------------------
*/
@@ -530,11 +539,13 @@ done:
} /* end H5PLinsert() */
/*-------------------------------------------------------------------------
- * Function: H5PLremove
+ * Function: H5PLremove
*
- * Purpose: Remove the plugin path at the specifed index and compacting the list.
+ * Purpose: Remove the plugin path at the specifed index and compact
+ * the list.
*
- * Return: Non-negative or success.
+ * Return: Success: Non-negative
+ * Failture: Negative
*
*-------------------------------------------------------------------------
*/
@@ -564,20 +575,26 @@ done:
} /* end H5PLremove() */
/*-------------------------------------------------------------------------
- * Function: H5PLget
+ * Function: H5PLget
+ *
+ * Purpose: Query the plugin path at a specified index.
+ *
+ * If 'path_buf' is non-NULL then up to 'buf_size' bytes will be written into
+ * that buffer and the length of the path name will be returned.
+ *
+ * If 'path_buf' is NULL, this function will simply return the number of
+ * characters required to store the path name, ignoring 'path_buf' and
+ * 'buf_size'
*
- * Purpose: Query the plugin path at the specified index.
+ * If an error occurs then the buffer pointed to by 'path_buf'
+ * (NULL or non-NULL) will be unchanged and the function will return a
+ * negative value.
*
- * Return: Success: The length of path.
+ * If a zero is returned for the name's length, then there is no path name
+ * associated with the index and the 'path_buf' buffer will be unchanged.
*
- * If `pathname' is non-NULL then write up to `size' bytes into that
- * buffer and always return the length of the pathname.
- * Otherwise `size' is ignored and the function does not store the pathname,
- * just returning the number of characters required to store the pathname.
- * If an error occurs then the buffer pointed to by `pathname' (NULL or non-NULL)
- * is unchanged and the function returns a negative value.
- * If a zero is returned for the name's length, then there is no pathname
- * associated with the index.
+ * Return: Success: The length of path
+ * Failure: A negative value
*
*-------------------------------------------------------------------------
*/
@@ -611,11 +628,11 @@ done:
} /* end H5PLget() */
/*-------------------------------------------------------------------------
- * Function: H5PLsize
+ * Function: H5PLsize
*
- * Purpose: Query the size of the current list of plugin paths.
+ * Purpose: Query the size of the current list of plugin paths.
*
- * Return: Plugin path size
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5PLextern.h b/src/H5PLextern.h
index e00721f..2385d54 100644
--- a/src/H5PLextern.h
+++ b/src/H5PLextern.h
@@ -11,9 +11,9 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <songyulu@hdfgroup.org>
- * 13 February 2013
+ * Purpose: Header file for writing external HDF5 plugins.
*/
+
#ifndef _H5PLextern_H
#define _H5PLextern_H
diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h
index 59516d9..6b3294d 100644
--- a/src/H5PLprivate.h
+++ b/src/H5PLprivate.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Raymond Lu <songyulu@hdfgroup.org>
- * 13 February 2013
+/*
+ * This file contains private information about the H5PL module
*/
#ifndef _H5PLprivate_H
diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h
index ded2362..97f4e15 100644
--- a/src/H5PLpublic.h
+++ b/src/H5PLpublic.h
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Raymond Lu <songyulu@hdfgroup.org>
- * 13 February 2013
+/*
+ * This file contains public declarations for the H5PL module.
*/
#ifndef _H5PLpublic_H
@@ -26,9 +26,9 @@
/* Plugin type used by the plugin library */
typedef enum H5PL_type_t {
- H5PL_TYPE_ERROR = -1, /*error */
- H5PL_TYPE_FILTER = 0, /*filter */
- H5PL_TYPE_NONE = 1 /*this must be last! */
+ H5PL_TYPE_ERROR = -1, /* Error */
+ H5PL_TYPE_FILTER = 0, /* Filter */
+ H5PL_TYPE_NONE = 1 /* This must be last! */
} H5PL_type_t;
/* Common dynamic plugin type flags used by the set/get_loading_state functions */
diff --git a/src/H5Pacpl.c b/src/H5Pacpl.c
index 2c94a70..93f04f8 100644
--- a/src/H5Pacpl.c
+++ b/src/H5Pacpl.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pacpl.c
- * January 2 2006
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * Created: H5Pacpl.c
*
- * Purpose: Attribute creation property list class routines
+ * Purpose: Attribute creation property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -56,21 +54,21 @@
/* Attribute creation property list class library initialization object */
const H5P_libclass_t H5P_CLS_ACRT[1] = {{
- "attribute create", /* Class name for debugging */
- H5P_TYPE_ATTRIBUTE_CREATE, /* Class type */
+ "attribute create", /* Class name for debugging */
+ H5P_TYPE_ATTRIBUTE_CREATE, /* Class type */
- &H5P_CLS_STRING_CREATE_g, /* Parent class */
- &H5P_CLS_ATTRIBUTE_CREATE_g, /* Pointer to class */
- &H5P_CLS_ATTRIBUTE_CREATE_ID_g, /* Pointer to class ID */
- &H5P_LST_ATTRIBUTE_CREATE_ID_g, /* Pointer to default property list ID */
- NULL, /* Default property registration routine */
+ &H5P_CLS_STRING_CREATE_g, /* Parent class */
+ &H5P_CLS_ATTRIBUTE_CREATE_g, /* Pointer to class */
+ &H5P_CLS_ATTRIBUTE_CREATE_ID_g, /* Pointer to class ID */
+ &H5P_LST_ATTRIBUTE_CREATE_ID_g, /* Pointer to default property list ID */
+ NULL, /* Default property registration routine */
- NULL, /* Class creation callback */
- NULL, /* Class creation callback info */
- NULL, /* Class copy callback */
- NULL, /* Class copy callback info */
- NULL, /* Class close callback */
- NULL /* Class close callback info */
+ NULL, /* Class creation callback */
+ NULL, /* Class creation callback info */
+ NULL, /* Class copy callback */
+ NULL, /* Class copy callback info */
+ NULL, /* Class close callback */
+ NULL /* Class close callback info */
}};
/*****************************/
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index 72afaad..787491c 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pdapl.c
+ * Created: H5Pdapl.c
* October 27, 2008
- * Neil Fortner <nfortne2@hdfgroup.org>
+ * Neil Fortner
*
- * Purpose: Dataset access property list class routines
+ * Purpose: Dataset access property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -127,9 +127,6 @@ static const char *H5D_def_efile_prefix_g =
* properties
*
* Return: Non-negative on success/Negative on failure
- *
- * Programmer: Neil Fortner
- * October 27, 2008
*-------------------------------------------------------------------------
*/
static herr_t
@@ -175,7 +172,6 @@ done:
* for a property list
*
* Return: SUCCEED/FAIL
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -200,7 +196,6 @@ H5P__dapl_efile_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
* from a property list
*
* Return: SUCCEED/FAIL
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -224,7 +219,6 @@ H5P__dapl_efile_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
* Purpose: Frees memory used to store the external file prefix string
*
* Return: SUCCEED (Can't fail)
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -246,7 +240,6 @@ H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
* Purpose: Creates a copy of the external file prefix string
*
* Return: SUCCEED/FAIL
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -269,7 +262,6 @@ H5P__dapl_efile_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED
* compared.
*
* Return: zero if VALUE1 and VALUE2 are equal, non zero otherwise.
- *
*-------------------------------------------------------------------------
*/
static int
@@ -298,7 +290,6 @@ done:
* Purpose: Frees memory used to store the external file prefix string
*
* Return: SUCCEED/FAIL
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -314,33 +305,27 @@ H5P__dapl_efile_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSE
} /* end H5P__dapl_efile_pref_close() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_chunk_cache
- *
- * Purpose: Set the number of objects in the meta data cache and the
- * maximum number of chunks and bytes in the raw data chunk cache.
- * Once set, these values will override the values in the file access
- * property list. Each of thhese values can be individually unset
- * (or not set at all) by passing the macros:
- * H5D_CHUNK_CACHE_NCHUNKS_DEFAULT,
- * H5D_CHUNK_CACHE_NSLOTS_DEFAULT, and/or
- * H5D_CHUNK_CACHE_W0_DEFAULT
- * as appropriate.
- *
- * The RDCC_W0 value should be between 0 and 1 inclusive and
- * indicates how much chunks that have been fully read or fully
- * written are favored for preemption. A value of zero means
- * fully read or written chunks are treated no differently than
- * other chunks (the preemption is strictly LRU) while a value
- * of one means fully read chunks are always preempted before
- * other chunks.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Neil Fortner
- * Monday, October 27, 2008
- *
- * Modifications:
- *
+ * Function: H5Pset_chunk_cache
+ *
+ * Purpose: Set the number of objects in the meta data cache and the
+ * maximum number of chunks and bytes in the raw data chunk cache.
+ * Once set, these values will override the values in the file access
+ * property list. Each of thhese values can be individually unset
+ * (or not set at all) by passing the macros:
+ * H5D_CHUNK_CACHE_NCHUNKS_DEFAULT,
+ * H5D_CHUNK_CACHE_NSLOTS_DEFAULT, and/or
+ * H5D_CHUNK_CACHE_W0_DEFAULT
+ * as appropriate.
+ *
+ * The RDCC_W0 value should be between 0 and 1 inclusive and
+ * indicates how much chunks that have been fully read or fully
+ * written are favored for preemption. A value of zero means
+ * fully read or written chunks are treated no differently than
+ * other chunks (the preemption is strictly LRU) while a value
+ * of one means fully read chunks are always preempted before
+ * other chunks.
+ *
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -376,23 +361,17 @@ done:
} /* end H5Pset_chunk_cache() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_chunk_cache
- *
- * Purpose: Retrieves the maximum possible number of elements in the meta
- * data cache and the maximum possible number of elements and
- * bytes and the RDCC_W0 value in the raw data chunk cache. Any
- * (or all) arguments may be null pointers in which case the
- * corresponding datum is not returned. If these properties have
- * not been set on this property list, the default values for a
- * file access property list are returned.
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5Pget_chunk_cache
*
- * Programmer: Neil Fortner
- * Monday, October 27, 2008
- *
- * Modifications:
+ * Purpose: Retrieves the maximum possible number of elements in the meta
+ * data cache and the maximum possible number of elements and
+ * bytes and the RDCC_W0 value in the raw data chunk cache. Any
+ * (or all) arguments may be null pointers in which case the
+ * corresponding datum is not returned. If these properties have
+ * not been set on this property list, the default values for a
+ * file access property list are returned.
*
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -455,8 +434,7 @@ done:
* This property can be overwritten by the environment variable
* HDF5_EXTFILE_PREFIX.
*
- * Return: Non-negative on success/Negative on failure
- *
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -481,15 +459,13 @@ done:
} /* end H5Pset_efile_prefix() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_efile_prefix
- *
- * Purpose: Gets the prefix to be used for any external files.
- *
- * If the pointer is not NULL, it points to a user-allocated
- * buffer.
+ * Function: H5Pget_efile_prefix
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Gets the prefix to be used for any external files.
+ * If the pointer is not NULL, it points to a user-allocated
+ * buffer.
*
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
ssize_t
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index e1b6b88..29588a7 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pdcpl.c
- * February 26 1998
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5Pdcpl.c
*
- * Purpose: Dataset creation property list class routines
+ * Purpose: Dataset creation property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -783,13 +781,6 @@ H5P__init_def_layout(void)
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -859,13 +850,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and get property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
H5D_layout_t
@@ -908,13 +892,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -989,13 +966,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
int
@@ -1127,13 +1097,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 3, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
int
@@ -1183,13 +1146,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 3, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and get property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1309,8 +1265,6 @@ done:
* Programmer: Kent Yang
* Wednesday, November 13, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1353,9 +1307,6 @@ done:
* Programmer: Xiaowen Wu
* Wednesday, December 22, 2004
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1414,9 +1365,6 @@ done:
* Programmer: Xiaowen Wu
* Thursday, April 14, 2005
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1470,7 +1418,7 @@ done:
* Function: H5Pset_fill_value
*
* Purpose: Set the fill value for a dataset creation property list. The
- * VALUE is interpretted as being of type TYPE, which need not
+ * VALUE is interpreted as being of type TYPE, which need not
* be the same type as the dataset but the library must be able
* to convert VALUE to the dataset type when the dataset is
* created. If VALUE is NULL, it will be interpreted as
@@ -1481,13 +1429,6 @@ done:
* Programmer: Robb Matzke
* Thursday, October 1, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1822,9 +1763,6 @@ done:
* Programmer: Raymond Lu
* Wednesday, January 16, 2002
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1998,9 +1936,6 @@ done:
* Programmer: Raymond Lu
* Wednesday, January 16, 2002
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c
index 8f3d80a..b045df4 100644
--- a/src/H5Pdeprec.c
+++ b/src/H5Pdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Pdeprec.c
* October 11 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5P interface. These
* functions are here for compatibility purposes and may be
@@ -239,7 +239,7 @@ H5P__term_deprec_interface(void)
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The 'set' callback function may be useful to range check the value being
- set for the property or may perform some tranformation/translation of the
+ set for the property or may perform some transformation/translation of the
value set. The 'get' callback would then [probably] reverse the
transformation, etc. A single 'get' or 'set' callback could handle
multiple properties by performing different actions based on the property
@@ -420,7 +420,7 @@ done:
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The 'set' callback function may be useful to range check the value being
- set for the property or may perform some tranformation/translation of the
+ set for the property or may perform some transformation/translation of the
value set. The 'get' callback would then [probably] reverse the
transformation, etc. A single 'get' or 'set' callback could handle
multiple properties by performing different actions based on the property
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 76c933f..756a6fa 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pdxpl.c
* March 16 1998
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Data transfer property list class routines
*
@@ -441,7 +441,7 @@ done:
*
* Return: Success: SUCCEED, Failure: FAIL
*
- * Programmer: Leon Arber larber@uiuc.edu
+ * Programmer: Leon Arber
*
* Date: April 9, 2004
*
@@ -473,7 +473,7 @@ done:
*
* Return: Success: SUCCEED, Failure: FAIL
*
- * Programmer: Leon Arber larber@uiuc.edu
+ * Programmer: Leon Arber
*
* Date: April 9, 2004
*
@@ -487,8 +487,10 @@ H5P__dxfr_xform_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size
FUNC_ENTER_STATIC
+ /* Sanity check */
HDassert(value);
+ /* Make copy of data transform */
if (H5Z_xform_copy((H5Z_data_xform_t **)value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error copying the data transform info")
@@ -562,7 +564,7 @@ done:
*
* Return: Success: SUCCEED, Failure: FAIL
*
- * Programmer: Leon Arber larber@uiuc.edu
+ * Programmer: Leon Arber
*
* Date: April 9, 2004
*
@@ -632,10 +634,9 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "Error setting data transform expression")
done:
- if (ret_value < 0) {
+ if (ret_value < 0)
if (data_xform_prop && H5Z_xform_destroy(data_xform_prop) < 0)
HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression")
- } /* end if */
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_data_transform() */
@@ -688,6 +689,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size)
if (NULL == (pexp = H5Z_xform_extract_xform_str(data_xform_prop)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "failed to retrieve transform expression")
+ /* Copy into application buffer */
len = HDstrlen(pexp);
if (expression) {
HDstrncpy(expression, pexp, MIN(len + 1, size));
@@ -713,7 +715,7 @@ done:
* for the type conversion buffer and background buffer and
* optionally supply pointers to application-allocated buffers.
* If the buffer size is smaller than the entire amount of data
- * being transfered between application and file, and a type
+ * being transferred between application and file, and a type
* conversion buffer or background buffer is required then
* strip mining will be used.
*
@@ -969,8 +971,6 @@ done:
* Programmer: Raymond Lu
* Jan 14, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1010,8 +1010,6 @@ done:
* Programmer: Raymond Lu
* April 15, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1051,8 +1049,6 @@ done:
* Programmer: Raymond Lu
* April 15, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1492,5 +1488,4 @@ H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_ca
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_mpio_no_collective_cause() */
-
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 35ebffe..3cc6ed6 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pfapl.c
- * February 26 1998
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5Pfapl.c
*
- * Purpose: File access property list class routines
+ * Purpose: File access property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -40,11 +38,11 @@
#include "H5MMprivate.h" /* Memory Management */
#include "H5Ppkg.h" /* Property lists */
-/* Includes needed to set as default file driver */
-#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */
-#include "H5FDstdio.h" /* Standard C buffered I/O */
+/* Includes needed to set default file driver */
+#include "H5FDsec2.h" /* POSIX unbuffered I/O */
+#include "H5FDstdio.h" /* Standard C buffered I/O */
#ifdef H5_HAVE_WINDOWS
-#include "H5FDwindows.h" /* Windows buffered I/O */
+#include "H5FDwindows.h" /* Win32 I/O */
#endif
/****************/
@@ -505,33 +503,27 @@ done:
} /* end H5P_facc_close() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_alignment
- *
- * Purpose: Sets the alignment properties of a file access property list
- * so that any file object >= THRESHOLD bytes will be aligned on
- * an address which is a multiple of ALIGNMENT. The addresses
- * are relative to the end of the user block; the alignment is
- * calculated by subtracting the user block size from the
- * absolute file address and then adjusting the address to be a
- * multiple of ALIGNMENT.
- *
- * Default values for THRESHOLD and ALIGNMENT are one, implying
- * no alignment. Generally the default values will result in
- * the best performance for single-process access to the file.
- * For MPI-IO and other parallel systems, choose an alignment
- * which is a multiple of the disk block size.
+ * Function: H5Pset_alignment
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Sets the alignment properties of a file access property list
+ * so that any file object >= THRESHOLD bytes will be aligned on
+ * an address which is a multiple of ALIGNMENT. The addresses
+ * are relative to the end of the user block; the alignment is
+ * calculated by subtracting the user block size from the
+ * absolute file address and then adjusting the address to be a
+ * multiple of ALIGNMENT.
*
- * Programmer: Robb Matzke
- * Tuesday, June 9, 1998
+ * Default values for THRESHOLD and ALIGNMENT are one, implying
+ * no alignment. Generally the default values will result in
+ * the best performance for single-process access to the file.
+ * For MPI-IO and other parallel systems, choose an alignment
+ * which is a multiple of the disk block size.
*
- * Modifications:
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, June 9, 1998
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed file access property list mechanism to the new
- * generic property list.
*-------------------------------------------------------------------------
*/
herr_t
@@ -562,15 +554,15 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Pget_alignment
+ * Function: H5Pget_alignment
*
- * Purpose: Returns the current settings for alignment properties from a
- * file access property list. The THRESHOLD and/or ALIGNMENT
- * pointers may be null pointers.
+ * Purpose: Returns the current settings for alignment properties from a
+ * file access property list. The THRESHOLD and/or ALIGNMENT
+ * pointers may be null pointers.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
*-------------------------------------------------------------------------
@@ -601,20 +593,20 @@ done:
} /* end H5Pget_alignment() */
/*-------------------------------------------------------------------------
- * Function: H5P_set_driver
+ * Function: H5P_set_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access
- * property list (PLIST_ID) and supply an optional
- * struct containing the driver-specific properites
- * (DRIVER_INFO). The driver properties will be copied into the
- * property list and the reference count on the driver will be
- * incremented, allowing the caller to close the driver ID but
- * still use the property list.
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
+ * struct containing the driver-specific properites
+ * (DRIVER_INFO). The driver properties will be copied into the
+ * property list and the reference count on the driver will be
+ * incremented, allowing the caller to close the driver ID but
+ * still use the property list.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
*-------------------------------------------------------------------------
@@ -654,20 +646,20 @@ done:
} /* end H5P_set_driver() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_driver
+ * Function: H5Pset_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access
- * property list (PLIST_ID) and supply an optional
- * struct containing the driver-specific properites
- * (DRIVER_INFO). The driver properties will be copied into the
- * property list and the reference count on the driver will be
- * incremented, allowing the caller to close the driver ID but
- * still use the property list.
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
+ * struct containing the driver-specific properites
+ * (DRIVER_INFO). The driver properties will be copied into the
+ * property list and the reference count on the driver will be
+ * incremented, allowing the caller to close the driver ID but
+ * still use the property list.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
*-------------------------------------------------------------------------
@@ -698,18 +690,18 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P_get_driver
*
- * Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list.
+ * Purpose: Return the ID of the low-level file driver. PLIST_ID should
+ * be a file access property list.
*
- * Return: Success: A low-level driver ID which is the same ID
- * used when the driver was set for the property
- * list. The driver ID is only valid as long as
- * the file driver remains registered.
+ * Return: Success: A low-level driver ID which is the same ID
+ * used when the driver was set for the property
+ * list. The driver ID is only valid as long as
+ * the file driver remains registered.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, February 26, 1998
+ * Programmer: Robb Matzke
+ * Thursday, February 26, 1998
*
*-------------------------------------------------------------------------
*/
@@ -736,20 +728,22 @@ done:
} /* end H5P_get_driver() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_driver
+ * Function: H5Pget_driver
+ *
+ * Purpose: Return the ID of the low-level file driver. PLIST_ID should
+ * be a file access property list.
*
- * Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list.
+ * Note: The ID returned should not be closed.
*
- * Return: Success: A low-level driver ID which is the same ID
- * used when the driver was set for the property
- * list. The driver ID is only valid as long as
- * the file driver remains registered.
+ * Return: Success: A low-level driver ID which is the same ID
+ * used when the driver was set for the property
+ * list. The driver ID is only valid as long as
+ * the file driver remains registered.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, February 26, 1998
+ * Programmer: Robb Matzke
+ * Thursday, February 26, 1998
*
*-------------------------------------------------------------------------
*/
@@ -776,18 +770,18 @@ done:
/*-------------------------------------------------------------------------
* Function: H5P_get_driver_info
*
- * Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access.
+ * Purpose: Returns a pointer directly to the file driver-specific
+ * information of a file access.
*
- * Return: Success: Ptr to *uncopied* driver specific data
- * structure if any.
+ * Return: Success: Ptr to *uncopied* driver specific data
+ * structure if any.
*
- * Failure: NULL. Null is also returned if the driver has
- * not registered any driver-specific properties
- * although no error is pushed on the stack in
- * this case.
+ * Failure: NULL. Null is also returned if the driver has
+ * not registered any driver-specific properties
+ * although no error is pushed on the stack in
+ * this case.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -812,20 +806,20 @@ done:
} /* end H5P_get_driver_info() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_driver_info
+ * Function: H5Pget_driver_info
*
- * Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access.
+ * Purpose: Returns a pointer directly to the file driver-specific
+ * information of a file access.
*
- * Return: Success: Ptr to *uncopied* driver specific data
- * structure if any.
+ * Return: Success: Ptr to *uncopied* driver specific data
+ * structure if any.
*
- * Failure: NULL. Null is also returned if the driver has
- * not registered any driver-specific properties
- * although no error is pushed on the stack in
- * this case.
+ * Failure: NULL. Null is also returned if the driver has
+ * not registered any driver-specific properties
+ * although no error is pushed on the stack in
+ * this case.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1007,23 +1001,23 @@ done:
} /* end H5Pget_multi_type() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_cache
+ * Function: H5Pset_cache
*
- * Purpose: Set the number of objects in the meta data cache and the
- * maximum number of chunks and bytes in the raw data chunk
- * cache.
+ * Purpose: Set the number of objects in the meta data cache and the
+ * maximum number of chunks and bytes in the raw data chunk
+ * cache.
*
- * The RDCC_W0 value should be between 0 and 1 inclusive and
- * indicates how much chunks that have been fully read or fully
- * written are favored for preemption. A value of zero means
- * fully read or written chunks are treated no differently than
- * other chunks (the preemption is strictly LRU) while a value
- * of one means fully read chunks are always preempted before
- * other chunks.
+ * The RDCC_W0 value should be between 0 and 1 inclusive and
+ * indicates how much chunks that have been fully read or fully
+ * written are favored for preemption. A value of zero means
+ * fully read or written chunks are treated no differently than
+ * other chunks (the preemption is strictly LRU) while a value
+ * of one means fully read chunks are always preempted before
+ * other chunks.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, May 19, 1998
*
*-------------------------------------------------------------------------
@@ -1060,17 +1054,17 @@ done:
} /* end H5Pset_cache() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_cache
+ * Function: H5Pget_cache
*
- * Purpose: Retrieves the maximum possible number of elements in the meta
- * data cache and the maximum possible number of elements and
- * bytes and the RDCC_W0 value in the raw data chunk cache. Any
- * (or all) arguments may be null pointers in which case the
- * corresponding datum is not returned.
+ * Purpose: Retrieves the maximum possible number of elements in the meta
+ * data cache and the maximum possible number of elements and
+ * bytes and the RDCC_W0 value in the raw data chunk cache. Any
+ * (or all) arguments may be null pointers in which case the
+ * corresponding datum is not returned.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, May 19, 1998
*
*-------------------------------------------------------------------------
@@ -1152,18 +1146,18 @@ done:
} /* H5Pset_mdc_config() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_mdc_config
+ * Function: H5Pget_mdc_config
*
- * Purpose: Retrieve the metadata cache initial resize configuration
- * from the target FAPL.
+ * Purpose: Retrieve the metadata cache initial resize configuration
+ * from the target FAPL.
*
- * Observe that the function will fail if config_ptr is
- * NULL, or if config_ptr->version specifies an unknown
- * version of H5AC_cache_config_t.
+ * Observe that the function will fail if config_ptr is
+ * NULL, or if config_ptr->version specifies an unknown
+ * version of H5AC_cache_config_t.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: J. Mainzer
+ * Programmer: J. Mainzer
* Thursday, April 7, 2005
*
*-------------------------------------------------------------------------
@@ -1189,7 +1183,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.")
/* If we ever support multiple versions of H5AC_cache_config_t, we
- * will have to get the cannonical version here, and then translate
+ * will have to get the canonical version here, and then translate
* to the version of the structure supplied.
*/
@@ -1202,33 +1196,26 @@ done:
} /* H5Pget_mdc_config() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_gc_references
- *
- * Purpose: Sets the flag for garbage collecting references for the file.
- * Dataset region references (and other reference types
- * probably) use space in the file heap. If garbage collection
- * is on and the user passes in an uninitialized value in a
- * reference structure, the heap might get corrupted. When
- * garbage collection is off however and the user re-uses a
- * reference, the previous heap block will be orphaned and not
- * returned to the free heap space. When garbage collection is
- * on, the user must initialize the reference structures to 0 or
- * risk heap corruption.
- *
- * Default value for garbage collecting references is off, just
- * to be on the safe side.
+ * Function: H5Pset_gc_references
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Sets the flag for garbage collecting references for the file.
+ * Dataset region references (and other reference types
+ * probably) use space in the file heap. If garbage collection
+ * is on and the user passes in an uninitialized value in a
+ * reference structure, the heap might get corrupted. When
+ * garbage collection is off however and the user re-uses a
+ * reference, the previous heap block will be orphaned and not
+ * returned to the free heap space. When garbage collection is
+ * on, the user must initialize the reference structures to 0 or
+ * risk heap corruption.
*
- * Programmer: Quincey Koziol
- * June, 1999
+ * Default value for garbage collecting references is off, just
+ * to be on the safe side.
*
- * Modifications:
+ * Return: Non-negative on success/Negative on failure
*
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
+ * Programmer: Quincey Koziol
+ * June, 1999
*
*-------------------------------------------------------------------------
*/
@@ -1254,23 +1241,16 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Pget_gc_references
+ * Function: H5Pget_gc_references
*
- * Purpose: Returns the current setting for the garbage collection
- * references property from a file access property list.
+ * Purpose: Returns the current setting for the garbage collection
+ * references property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* June, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1305,8 +1285,6 @@ done:
* Programmer: Raymond Lu
* November, 2001
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1340,8 +1318,6 @@ done:
* Programmer: Raymond Lu
* November, 2001
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1365,32 +1341,25 @@ done:
} /* end H5Pget_fclose_degree() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_meta_block_size
+ * Function: H5Pset_meta_block_size
*
- * Purpose: Sets the minimum size of metadata block allocations when
+ * Purpose: Sets the minimum size of metadata block allocations when
* the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver.
* Each "raw" metadata block is allocated to be this size and then
* specific pieces of metadata (object headers, local heaps, B-trees, etc)
* are sub-allocated from this block.
*
- * The default value is set to 2048 (bytes), indicating that metadata
+ * The default value is set to 2048 (bytes), indicating that metadata
* will be attempted to be bunched together in (at least) 2K blocks in
* the file. Setting the value to 0 with this API function will
* turn off the metadata aggregation, even if the VFL driver attempts to
* use that strategy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 25, 2000
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1415,23 +1384,16 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Pget_meta_block_size
+ * Function: H5Pget_meta_block_size
*
- * Purpose: Returns the current settings for the metadata block allocation
+ * Purpose: Returns the current settings for the metadata block allocation
* property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 29, 2000
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1458,32 +1420,25 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Pset_sieve_buf_size
+ * Function: H5Pset_sieve_buf_size
*
- * Purpose: Sets the maximum size of the data seive buffer used for file
+ * Purpose: Sets the maximum size of the data seive buffer used for file
* drivers which are capable of using data sieving. The data sieve
* buffer is used when performing I/O on datasets in the file. Using a
* buffer which is large anough to hold several pieces of the dataset
* being read in for hyperslab selections boosts performance by quite a
* bit.
*
- * The default value is set to 64KB, indicating that file I/O for raw data
+ * The default value is set to 64KB, indicating that file I/O for raw data
* reads and writes will occur in at least 64KB blocks.
* Setting the value to 0 with this API function will turn off the
* data sieving, even if the VFL driver attempts to use that strategy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 21, 2000
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1508,23 +1463,16 @@ done:
} /* end H5Pset_sieve_buf_size() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_sieve_buf_size
+ * Function: H5Pget_sieve_buf_size
*
- * Purpose: Returns the current settings for the data sieve buffer size
+ * Purpose: Returns the current settings for the data sieve buffer size
* property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, September 21, 2000
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1550,27 +1498,25 @@ done:
} /* end H5Pget_sieve_buf_size() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_small_data_block_size
+ * Function: H5Pset_small_data_block_size
*
- * Purpose: Sets the minimum size of "small" raw data block allocations
+ * Purpose: Sets the minimum size of "small" raw data block allocations
* when the H5FD_FEAT_AGGREGATE_SMALLDATA is set by a VFL driver.
* Each "small" raw data block is allocated to be this size and then
* pieces of raw data which are small enough to fit are sub-allocated from
* this block.
*
- * The default value is set to 2048 (bytes), indicating that raw data
+ * The default value is set to 2048 (bytes), indicating that raw data
* smaller than this value will be attempted to be bunched together in (at
* least) 2K blocks in the file. Setting the value to 0 with this API
* function will turn off the "small" raw data aggregation, even if the
* VFL driver attempts to use that strategy.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, June 5, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1595,18 +1541,16 @@ done:
} /* end H5Pset_small_data_block_size() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_small_data_block_size
+ * Function: H5Pget_small_data_block_size
*
- * Purpose: Returns the current settings for the "small" raw data block
+ * Purpose: Returns the current settings for the "small" raw data block
* allocation property from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, June 5, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1633,9 +1577,9 @@ done:
} /* end H5Pget_small_data_block_size() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_libver_bounds
+ * Function: H5Pset_libver_bounds
*
- * Purpose: Indicates which versions of the file format the library should
+ * Purpose: Indicates which versions of the file format the library should
* use when creating objects. LOW is the earliest version of the HDF5
* library that is guaranteed to be able to access the objects created
* (the format of some objects in an HDF5 file may not have changed between
@@ -1692,7 +1636,7 @@ done:
* necessary to represent features used.
* (This is the "make certain to take advantage of <new feature>
* in the file format" use case (maybe <new feature> is smaller
- * or scales better than an ealier version, which would otherwise
+ * or scales better than an earlier version, which would otherwise
* be used))
*
* LOW = H5F_FORMAT_1_2_0, HIGH = H5F_FORMAT_1_6_0 => creates objects
@@ -1749,14 +1693,14 @@ done:
} /* end H5Pset_libver_bounds() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_libver_bounds
+ * Function: H5Pget_libver_bounds
*
- * Purpose: Returns the current settings for the library version format bounds
- * from a file access property list.
+ * Purpose: Returns the current settings for the library version format bounds
+ * from a file access property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 3, 2008
*
*-------------------------------------------------------------------------
@@ -1890,7 +1834,7 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len)
/* validate parameters */
if (!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0))))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistent buf_ptr and buf_len")
/* Get the plist structure */
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
@@ -1950,23 +1894,23 @@ done:
* Function: H5Pget_file_image
*
* Purpose: If the file image exists and buf_ptr_ptr is not NULL,
- * allocate a buffer of the correct size, copy the image into
- * the new buffer, and return the buffer to the caller in
- * *buf_ptr_ptr. Do this using the file image callbacks
- * if defined.
+ * allocate a buffer of the correct size, copy the image into
+ * the new buffer, and return the buffer to the caller in
+ * *buf_ptr_ptr. Do this using the file image callbacks
+ * if defined.
*
- * NB: It is the responsibility of the caller to free the
- * buffer whose address is returned in *buf_ptr_ptr. Do
- * this using free if the file image callbacks are not
- * defined, or with whatever method is appropriate if
- * the callbacks are defined.
+ * NB: It is the responsibility of the caller to free the
+ * buffer whose address is returned in *buf_ptr_ptr. Do
+ * this using free if the file image callbacks are not
+ * defined, or with whatever method is appropriate if
+ * the callbacks are defined.
*
* If buf_ptr_ptr is not NULL, and no image exists, set
- * *buf_ptr_ptr to NULL.
+ * *buf_ptr_ptr to NULL.
*
- * If buf_len_ptr is not NULL, set *buf_len_ptr equal
- * to the length of the file image if it exists, and
- * to 0 if it does not.
+ * If buf_len_ptr is not NULL, set *buf_len_ptr equal
+ * to the length of the file image if it exists, and
+ * to 0 if it does not.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1993,7 +1937,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr)
if (H5P_get(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info")
- /* verify file image field consistancy */
+ /* verify file image field consistency */
HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) ||
((image_info.buffer == NULL) && (image_info.size == 0)));
@@ -2068,7 +2012,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
if (H5P_get(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info")
- /* verify file image field consistancy */
+ /* verify file image field consistency */
HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0)));
/* Make sure a file image hasn't already been set */
@@ -2144,7 +2088,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
if (H5P_get(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info")
- /* verify file image field consistancy */
+ /* verify file image field consistency */
HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0)));
/* verify that callbacks_ptr is not NULL */
@@ -2246,7 +2190,7 @@ H5P_file_image_info_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED
info = (H5FD_file_image_info_t *)value;
- /* verify file image field consistancy */
+ /* verify file image field consistency */
HDassert(((info->buffer != NULL) && (info->size > 0)) ||
((info->buffer == NULL) && (info->size == 0)));
@@ -2382,12 +2326,15 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Pget_core_write_tracking
+ * Function: H5Pget_core_write_tracking
*
- * Purpose: Gets information about core VFD write tracking and page
+ * Purpose: Gets information about core VFD write tracking and page
* aggregation size.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Dana Robinson
+ * Tuesday, April 8, 2014
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 957393c..1719360 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pfcpl.c
* January 6 1998
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: File creation property list class routines
*
@@ -319,11 +319,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -474,11 +469,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -501,7 +491,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value exceeds maximum B-tree entries");
if (H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree internal nodes");
btree_k[H5B_SNODE_ID] = ik;
if (H5P_set(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree nodes");
@@ -527,11 +517,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -574,11 +559,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -604,10 +584,10 @@ H5Pset_istore_k(hid_t plist_id, unsigned ik)
/* Set value */
if (H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree internal nodes");
btree_k[H5B_CHUNK_ID] = ik;
if (H5P_set(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree interanl nodes");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree internal nodes");
done:
FUNC_LEAVE_API(ret_value)
@@ -627,11 +607,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -651,7 +626,7 @@ H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out */)
/* Get value */
if (ik) {
if (H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree internal nodes");
*ik = btree_k[H5B_CHUNK_ID];
} /* end if */
@@ -941,15 +916,13 @@ H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list, unsigned *mi
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Get value */
- if (max_list) {
+ /* Get value(s) */
+ if (max_list)
if (H5P_get(plist, H5F_CRT_SHMSG_LIST_MAX_NAME, max_list) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get list maximum");
- }
- if (min_btree) {
+ if (min_btree)
if (H5P_get(plist, H5F_CRT_SHMSG_BTREE_MIN_NAME, min_btree) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get SOHM information");
- }
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c
index a6f1734..df78bec 100644
--- a/src/H5Pfmpl.c
+++ b/src/H5Pfmpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pmtpl.c
* November 1 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File mount property list class routines
*
diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c
index 0cb665e..614b360 100644
--- a/src/H5Pgcpl.c
+++ b/src/H5Pgcpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pgcpl.c
* August 29 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Group creation property list class routines
*
@@ -30,12 +30,12 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Gprivate.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Ppkg.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Ppkg.h" /* Property lists */
/****************/
/* Local Macros */
diff --git a/src/H5Pint.c b/src/H5Pint.c
index ede19be..b0c10ee 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
*
* Purpose: Generic Property Functions
*/
@@ -91,59 +91,59 @@ static int H5P_cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop
* Predefined property list classes. These are initialized at runtime by
* H5P_init_interface() in this source file.
*/
-hid_t H5P_CLS_ROOT_ID_g = FAIL;
+hid_t H5P_CLS_ROOT_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_ROOT_g = NULL;
-hid_t H5P_CLS_OBJECT_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_OBJECT_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_OBJECT_CREATE_g = NULL;
-hid_t H5P_CLS_FILE_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_FILE_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_FILE_CREATE_g = NULL;
-hid_t H5P_CLS_FILE_ACCESS_ID_g = FAIL;
+hid_t H5P_CLS_FILE_ACCESS_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_FILE_ACCESS_g = NULL;
-hid_t H5P_CLS_DATASET_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_DATASET_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_DATASET_CREATE_g = NULL;
-hid_t H5P_CLS_DATASET_ACCESS_ID_g = FAIL;
+hid_t H5P_CLS_DATASET_ACCESS_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_DATASET_ACCESS_g = NULL;
-hid_t H5P_CLS_DATASET_XFER_ID_g = FAIL;
+hid_t H5P_CLS_DATASET_XFER_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_DATASET_XFER_g = NULL;
-hid_t H5P_CLS_FILE_MOUNT_ID_g = FAIL;
+hid_t H5P_CLS_FILE_MOUNT_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_FILE_MOUNT_g = NULL;
-hid_t H5P_CLS_GROUP_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_GROUP_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_GROUP_CREATE_g = NULL;
-hid_t H5P_CLS_GROUP_ACCESS_ID_g = FAIL;
+hid_t H5P_CLS_GROUP_ACCESS_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_GROUP_ACCESS_g = NULL;
-hid_t H5P_CLS_DATATYPE_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_DATATYPE_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_DATATYPE_CREATE_g = NULL;
-hid_t H5P_CLS_DATATYPE_ACCESS_ID_g = FAIL;
+hid_t H5P_CLS_DATATYPE_ACCESS_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_DATATYPE_ACCESS_g = NULL;
-hid_t H5P_CLS_ATTRIBUTE_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_ATTRIBUTE_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_ATTRIBUTE_CREATE_g = NULL;
-hid_t H5P_CLS_OBJECT_COPY_ID_g = FAIL;
+hid_t H5P_CLS_OBJECT_COPY_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_OBJECT_COPY_g = NULL;
-hid_t H5P_CLS_LINK_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_LINK_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_LINK_CREATE_g = NULL;
-hid_t H5P_CLS_LINK_ACCESS_ID_g = FAIL;
+hid_t H5P_CLS_LINK_ACCESS_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_LINK_ACCESS_g = NULL;
-hid_t H5P_CLS_STRING_CREATE_ID_g = FAIL;
+hid_t H5P_CLS_STRING_CREATE_ID_g = H5I_INVALID_HID;
H5P_genclass_t *H5P_CLS_STRING_CREATE_g = NULL;
/*
* Predefined property lists for each predefined class. These are initialized
* at runtime by H5P_init_interface() in this source file.
*/
-hid_t H5P_LST_FILE_CREATE_ID_g = FAIL;
-hid_t H5P_LST_FILE_ACCESS_ID_g = FAIL;
-hid_t H5P_LST_DATASET_CREATE_ID_g = FAIL;
-hid_t H5P_LST_DATASET_ACCESS_ID_g = FAIL;
-hid_t H5P_LST_DATASET_XFER_ID_g = FAIL;
-hid_t H5P_LST_FILE_MOUNT_ID_g = FAIL;
-hid_t H5P_LST_GROUP_CREATE_ID_g = FAIL;
-hid_t H5P_LST_GROUP_ACCESS_ID_g = FAIL;
-hid_t H5P_LST_DATATYPE_CREATE_ID_g = FAIL;
-hid_t H5P_LST_DATATYPE_ACCESS_ID_g = FAIL;
-hid_t H5P_LST_ATTRIBUTE_CREATE_ID_g = FAIL;
-hid_t H5P_LST_OBJECT_COPY_ID_g = FAIL;
-hid_t H5P_LST_LINK_CREATE_ID_g = FAIL;
-hid_t H5P_LST_LINK_ACCESS_ID_g = FAIL;
+hid_t H5P_LST_FILE_CREATE_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_FILE_ACCESS_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_DATASET_CREATE_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_DATASET_ACCESS_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_DATASET_XFER_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_FILE_MOUNT_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_GROUP_CREATE_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_GROUP_ACCESS_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_DATATYPE_CREATE_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_DATATYPE_ACCESS_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_ATTRIBUTE_CREATE_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_OBJECT_COPY_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_LINK_CREATE_ID_g = H5I_INVALID_HID;
+hid_t H5P_LST_LINK_ACCESS_ID_g = H5I_INVALID_HID;
/* Root property list class library initialization object */
const H5P_libclass_t H5P_CLS_ROOT[1] = {{
@@ -374,14 +374,11 @@ done:
* Purpose: Initialize the interface from some other layer.
*
* Return: Success: non-negative
- *
* Failure: negative
*
* Programmer: Quincey Koziol
* Saturday, March 4, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -424,8 +421,8 @@ H5P_init_interface(void)
HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group")
/* Repeatedly pass over the list of property list classes for the library,
- * initializing each class if it's parent class is initialized, until no
- * more progress is made.
+ * initializing each class if its parent class is initialized, until no
+ * more progress is made.
*/
tot_init = 0;
do {
@@ -665,7 +662,7 @@ done:
hid_t old_plist_id; IN: Property list ID to copy
RETURNS
Success: valid property list ID on success (non-negative)
- Failure: negative
+ Failure: H5I_INVALID_HID
DESCRIPTION
Copy a property list and return the ID. This routine calls the
class 'copy' callback after any property 'copy' callbacks are called
@@ -688,9 +685,9 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
H5SL_t * seen = NULL; /* Skip list containing properties already seen */
size_t nseen; /* Number of items 'seen' */
hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */
- hid_t ret_value = FAIL; /* return value */
+ hid_t ret_value = H5I_INVALID_HID; /* return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
HDassert(old_plist);
@@ -700,7 +697,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
/* Allocate room for the property list */
if (NULL == (new_plist = H5FL_CALLOC(H5P_genplist_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed")
/* Set class state */
new_plist->pclass = old_plist->pclass;
@@ -709,11 +706,13 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
/* Initialize the skip list to hold the changed properties */
if ((new_plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "can't create skip list for changed properties")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID,
+ "can't create skip list for changed properties")
/* Create the skip list for deleted properties */
if ((new_plist->del = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "can't create skip list for deleted properties")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID,
+ "can't create skip list for deleted properties")
/* Create the skip list to hold names of properties already seen
* (This prevents a property in the class hierarchy from having it's
@@ -721,7 +720,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
* already been seen)
*/
if ((seen = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "can't create skip list for seen properties")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "can't create skip list for seen properties")
nseen = 0;
/* Cycle through the deleted properties & copy them into the new list's deleted section */
@@ -732,15 +731,17 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
/* Duplicate string for insertion into new deleted property skip list */
if ((new_name = H5MM_xstrdup((char *)H5SL_item(curr_node))) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed")
/* Insert property name into deleted list */
if (H5SL_insert(new_plist->del, new_name, new_name) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into deleted skip list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID,
+ "can't insert property into deleted skip list")
/* Add property name to "seen" list */
if (H5SL_insert(seen, new_name, new_name) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into seen skip list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID,
+ "can't insert property into seen skip list")
nseen++;
/* Get the next property node in the skip list */
@@ -757,25 +758,26 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
/* Make a copy of the list's property */
if (NULL == (new_prop = H5P_dup_prop(tmp, H5P_PROP_WITHIN_LIST)))
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "Can't copy property")
/* Call property copy callback, if it exists */
if (new_prop->copy) {
if ((new_prop->copy)(new_prop->name, new_prop->size, new_prop->value) < 0) {
H5P_free_prop(new_prop);
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "Can't copy property")
} /* end if */
} /* end if */
/* Insert the initialized property into the property list */
if (H5P_add_prop(new_plist->props, new_prop) < 0) {
H5P_free_prop(new_prop);
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "Can't insert property into list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID, "Can't insert property into list")
} /* end if */
/* Add property name to "seen" list */
if (H5SL_insert(seen, new_prop->name, new_prop->name) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into seen skip list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID,
+ "can't insert property into seen skip list")
nseen++;
/* Increment the number of properties in list */
@@ -802,17 +804,17 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
/* Only "copy" properties we haven't seen before */
if (nseen == 0 || H5SL_search(seen, tmp->name) == NULL) {
- /* Call property creation callback, if it exists */
+ /* Call property copy callback, if it exists */
if (tmp->copy) {
/* Call the callback & insert changed value into skip list (if necessary) */
if (H5P_do_prop_cb1(new_plist->props, tmp, tmp->copy) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't create property")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "Can't create property")
} /* end if */
/* Add property name to "seen" list, if we have other classes to work on */
if (has_parent_class) {
if (H5SL_insert(seen, tmp->name, tmp->name) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL,
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, H5I_INVALID_HID,
"can't insert property into seen skip list")
nseen++;
} /* end if */
@@ -832,11 +834,11 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
/* Increment the number of property lists derived from class */
if (H5P_access_class(new_plist->pclass, H5P_MOD_INC_LST) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't increment class ref count")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ref count")
/* Get an atom for the property list */
if ((new_plist_id = H5I_register(H5I_GENPROP_LST, new_plist, app_ref)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list")
/* Save the property list ID in the property list struct, for use in the property class's 'close' callback
*/
@@ -851,7 +853,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
if ((tclass->copy_func)(new_plist_id, old_plist->plist_id, old_plist->pclass->copy_data) < 0) {
/* Delete ID, ignore return value */
H5I_remove(new_plist_id);
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't initialize property")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't initialize property")
} /* end if */
} /* end if */
@@ -870,7 +872,7 @@ done:
if (seen != NULL)
H5SL_close(seen);
- if (ret_value < 0 && new_plist)
+ if (H5I_INVALID_HID == ret_value && new_plist)
H5P_close(new_plist);
FUNC_LEAVE_NOAPI(ret_value)
@@ -898,8 +900,8 @@ done:
static H5P_genprop_t *
H5P_dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type)
{
- H5P_genprop_t *prop = NULL; /* Pointer to new property copied */
- H5P_genprop_t *ret_value; /* Return value */
+ H5P_genprop_t *prop = NULL; /* Pointer to new property copied */
+ H5P_genprop_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1009,8 +1011,8 @@ H5P_create_prop(const char *name, size_t size, H5P_prop_within_t type, const voi
H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy,
H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close)
{
- H5P_genprop_t *prop = NULL; /* Pointer to new property copied */
- H5P_genprop_t *ret_value; /* Return value */
+ H5P_genprop_t *prop = NULL; /* Pointer to new property copied */
+ H5P_genprop_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1126,7 +1128,7 @@ done:
H5P_genprop_t *
H5P__find_prop_plist(const H5P_genplist_t *plist, const char *name)
{
- H5P_genprop_t *ret_value; /* Property pointer return value */
+ H5P_genprop_t *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -1185,7 +1187,7 @@ done:
static H5P_genprop_t *
H5P_find_prop_pclass(H5P_genclass_t *pclass, const char *name)
{
- H5P_genprop_t *ret_value; /* Property pointer return value */
+ H5P_genprop_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1316,7 +1318,7 @@ H5P_free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *
NAME
H5P_access_class
PURPOSE
- Internal routine to increment or decrement list & class dependancies on a
+ Internal routine to increment or decrement list & class dependencies on a
property list class
USAGE
herr_t H5P_access_class(pclass,mod)
@@ -1325,7 +1327,7 @@ H5P_free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *
RETURNS
Returns non-negative on success, negative on failure.
DESCRIPTION
- Increment/Decrement the class or list dependancies for a given class.
+ Increment/Decrement the class or list dependencies for a given class.
This routine is the final arbiter on decisions about actually releasing a
class in memory, such action is only taken when the reference counts for
both dependent classes & lists reach zero.
@@ -1343,19 +1345,19 @@ H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod)
HDassert(mod > H5P_MOD_ERR && mod < H5P_MOD_MAX);
switch (mod) {
- case H5P_MOD_INC_CLS: /* Increment the dependant class count*/
+ case H5P_MOD_INC_CLS: /* Increment the dependent class count*/
pclass->classes++;
break;
- case H5P_MOD_DEC_CLS: /* Decrement the dependant class count*/
+ case H5P_MOD_DEC_CLS: /* Decrement the dependent class count*/
pclass->classes--;
break;
- case H5P_MOD_INC_LST: /* Increment the dependant list count*/
+ case H5P_MOD_INC_LST: /* Increment the dependent list count*/
pclass->plists++;
break;
- case H5P_MOD_DEC_LST: /* Decrement the dependant list count*/
+ case H5P_MOD_DEC_LST: /* Decrement the dependent list count*/
pclass->plists--;
break;
@@ -1488,8 +1490,8 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t t
H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy,
void *copy_data, H5P_cls_close_func_t cls_close, void *close_data)
{
- H5P_genclass_t *pclass = NULL; /* Property list class created */
- H5P_genclass_t *ret_value; /* return value */
+ H5P_genclass_t *pclass = NULL; /* Property list class created */
+ H5P_genclass_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1501,12 +1503,12 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t t
/* Allocate room for the class */
if (NULL == (pclass = H5FL_CALLOC(H5P_genclass_t)))
- HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, NULL, "propery list class allocation failed")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, NULL, "property list class allocation failed")
/* Set class state */
pclass->parent = par_class;
if (NULL == (pclass->name = H5MM_xstrdup(name)))
- HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, NULL, "propery list class name allocation failed")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, NULL, "property list class name allocation failed")
pclass->type = type;
pclass->nprops = 0; /* Classes are created without properties initially */
pclass->plists = 0; /* No properties lists of this class yet */
@@ -1581,11 +1583,11 @@ done:
static H5P_genplist_t *
H5P_create(H5P_genclass_t *pclass)
{
- H5P_genclass_t *tclass; /* Temporary class pointer */
- H5P_genplist_t *plist = NULL; /* New property list created */
- H5P_genprop_t * tmp; /* Temporary pointer to parent class properties */
- H5SL_t * seen = NULL; /* Skip list to hold names of properties already seen */
- H5P_genplist_t *ret_value; /* Return value */
+ H5P_genclass_t *tclass; /* Temporary class pointer */
+ H5P_genplist_t *plist = NULL; /* New property list created */
+ H5P_genprop_t * tmp; /* Temporary pointer to parent class properties */
+ H5SL_t * seen = NULL; /* Skip list to hold names of properties already seen */
+ H5P_genplist_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1705,7 +1707,7 @@ done:
hid_t H5P_create_id(pclass)
H5P_genclass_t *pclass; IN: Property list class create list from
RETURNS
- Returns a valid property list ID on success, FAIL on failure.
+ Returns a valid property list ID on success, H5I_INVALID_HID on failure.
DESCRIPTION
Creates a property list of a given class. If a 'create' callback
exists for the property list class, it is called before the
@@ -1721,22 +1723,22 @@ done:
hid_t
H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref)
{
- H5P_genclass_t *tclass; /* Temporary class pointer */
- H5P_genplist_t *plist = NULL; /* Property list created */
- hid_t plist_id = FAIL; /* Property list ID */
- hid_t ret_value; /* return value */
+ H5P_genclass_t *tclass; /* Temporary class pointer */
+ H5P_genplist_t *plist = NULL; /* Property list created */
+ hid_t plist_id = FAIL; /* Property list ID */
+ hid_t ret_value = H5I_INVALID_HID; /* return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
HDassert(pclass);
/* Create the new property list */
if ((plist = H5P_create(pclass)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list")
/* Get an atom for the property list */
if ((plist_id = H5I_register(H5I_GENPROP_LST, plist, app_ref)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list")
/* Save the property list ID in the property list struct, for use in the property class's 'close' callback
*/
@@ -1751,7 +1753,7 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref)
if ((tclass->create_func)(plist_id, tclass->create_data) < 0) {
/* Delete ID, ignore return value */
H5I_remove(plist_id);
- HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't initialize property")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't initialize property")
} /* end if */
} /* end if */
@@ -1766,7 +1768,7 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref)
ret_value = plist_id;
done:
- if (ret_value < 0 && plist)
+ if (H5I_INVALID_HID == ret_value && plist)
H5P_close(plist);
FUNC_LEAVE_NOAPI(ret_value)
@@ -1910,7 +1912,7 @@ done:
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The 'set' callback function may be useful to range check the value being
- set for the property or may perform some tranformation/translation of the
+ set for the property or may perform some transformation/translation of the
value set. The 'get' callback would then [probably] reverse the
transformation, etc. A single 'get' or 'set' callback could handle
multiple properties by performing different actions based on the property
@@ -2108,7 +2110,7 @@ done:
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The 'set' callback function may be useful to range check the value being
- set for the property or may perform some tranformation/translation of the
+ set for the property or may perform some transformation/translation of the
value set. The 'get' callback would then [probably] reverse the
transformation, etc. A single 'get' or 'set' callback could handle
multiple properties by performing different actions based on the property
@@ -2315,7 +2317,7 @@ done:
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The 'set' callback function may be useful to range check the value being
- set for the property or may perform some tranformation/translation of the
+ set for the property or may perform some transformation/translation of the
value set. The 'get' callback would then [probably] reverse the
transformation, etc. A single 'get' or 'set' callback could handle
multiple properties by performing different actions based on the property
@@ -3258,7 +3260,7 @@ done:
htri_t
H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2)
{
- htri_t ret_value;
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -3309,9 +3311,9 @@ done:
htri_t
H5P_isa_class(hid_t plist_id, hid_t pclass_id)
{
- H5P_genplist_t *plist; /* Property list to query */
- H5P_genclass_t *pclass; /* Property list class */
- htri_t ret_value; /* return value */
+ H5P_genplist_t *plist; /* Property list to query */
+ H5P_genclass_t *pclass; /* Property list class */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -3563,7 +3565,7 @@ H5P_iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx,
/* Check for iterating over all properties, or just non-default ones */
if (iter_all_prop) {
- /* Walk up the class hiearchy */
+ /* Walk up the class hierarchy */
tclass = plist->pclass;
while (tclass != NULL) {
/* Iterate over properties in property list class */
@@ -3933,6 +3935,7 @@ H5P_get(const H5P_genplist_t *plist, const char *name, void *value)
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity check */
HDassert(plist);
HDassert(name);
HDassert(value);
@@ -4082,6 +4085,7 @@ H5P_remove(hid_t plist_id, H5P_genplist_t *plist, const char *name)
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity check */
HDassert(plist);
HDassert(name);
@@ -4331,7 +4335,7 @@ H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name)
/* Sanity check */
HDassert(name);
- /* Get propery list classes */
+ /* Get property list classes */
if (NULL == (src_pclass = (H5P_genclass_t *)H5I_object(src_id)))
HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "source property class object doesn't exist")
if (NULL == (dst_pclass = (H5P_genclass_t *)H5I_object(dst_id)))
@@ -4447,8 +4451,8 @@ done:
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
The property list class 'close' callback routine is not called from
- here, it must have been check for and called properly prior to this routine
- being called
+ here, it must have been checked for and called properly prior to this routine
+ being called.
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
@@ -4576,7 +4580,7 @@ H5P_close(void *_plist)
tclass = tclass->parent;
} /* end while */
- /* Decrement class's dependant property list value! */
+ /* Decrement class's dependent property list value! */
if (H5P_access_class(plist->pclass, H5P_MOD_DEC_LST) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "Can't decrement class ref count")
@@ -4624,7 +4628,7 @@ done:
char *
H5P_get_class_name(H5P_genclass_t *pclass)
{
- char *ret_value; /* return value */
+ char *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -4661,7 +4665,7 @@ done:
char *
H5P_get_class_path(H5P_genclass_t *pclass)
{
- char *ret_value; /* return value */
+ char *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -4721,12 +4725,12 @@ done:
H5P_genclass_t *
H5P_open_class_path(const char *path)
{
- char * tmp_path = NULL; /* Temporary copy of the path */
- char * curr_name; /* Pointer to current component of path name */
- char * delimit; /* Pointer to path delimiter during traversal */
- H5P_genclass_t * curr_class; /* Pointer to class during path traversal */
- H5P_check_class_t check_info; /* Structure to hold the information for checking duplicate names */
- H5P_genclass_t * ret_value; /* Return value */
+ char * tmp_path = NULL; /* Temporary copy of the path */
+ char * curr_name; /* Pointer to current component of path name */
+ char * delimit; /* Pointer to path delimiter during traversal */
+ H5P_genclass_t * curr_class; /* Pointer to class during path traversal */
+ H5P_check_class_t check_info; /* Structure to hold the information for checking duplicate names */
+ H5P_genclass_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -4861,9 +4865,9 @@ done:
* H5P_genplist_t data structure)
*
* Return: Success: Non-negative ID of property list.
- * Failure: negative.
+ * Failure: H5I_INVALID_HID
*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* April 22, 2014
*
*-------------------------------------------------------------------------
@@ -4890,7 +4894,7 @@ H5P_get_plist_id(const H5P_genplist_t *plist)
* Return: Success: Non-NULL class of property list.
* Failure: NULL
*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* April 22, 2014
*
*-------------------------------------------------------------------------
diff --git a/src/H5Plapl.c b/src/H5Plapl.c
index 7f83c71..0a2c7af 100644
--- a/src/H5Plapl.c
+++ b/src/H5Plapl.c
@@ -15,7 +15,7 @@
*
* Created: H5Plapl.c
* July 14 2006
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * James Laird
*
* Purpose: Link access property list class routines
*
@@ -139,10 +139,6 @@ const H5P_libclass_t H5P_CLS_LACC[1] = {{
* Programmer: Quincey Koziol
* October 31, 2006
*
- * Modifications:
- * Vailin Choi, Sept. 12th 2008
- * Register the setting of file access property list for link access
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -193,13 +189,13 @@ done:
/*--------------------------------------------------------------------------
* Function: H5P_lacc_elink_fapl_del
*
- * Purpose: Close the FAPL for link access
+ * Purpose: Close the FAPL for link access
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Vailin Choi
- * Tuesday, Sept 23, 2008
+ * Programmer: Vailin Choi
+ * Tuesday, Sept 23, 2008
*
*--------------------------------------------------------------------------
*/
@@ -213,11 +209,14 @@ H5P_lacc_elink_fapl_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity check */
HDassert(value);
+ /* Get the FAPL ID */
l_fapl_id = (*(const hid_t *)value);
- if ((l_fapl_id > H5P_DEFAULT) && (H5I_dec_ref(l_fapl_id) < 0))
+ /* Close the FAPL */
+ if (l_fapl_id != H5P_DEFAULT && H5I_dec_ref(l_fapl_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close atom for file access property list")
done:
@@ -227,13 +226,13 @@ done:
/*--------------------------------------------------------------------------
* Function: H5P_lacc_elink_fapl_copy
*
- * Purpose: Copy the FAPL for link access
+ * Purpose: Copy the FAPL for link access
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Vailin Choi
- * Tuesday, Sept 23, 2008
+ * Programmer: Vailin Choi
+ * Tuesday, Sept 23, 2008
*
*--------------------------------------------------------------------------
*/
@@ -246,11 +245,14 @@ H5P_lacc_elink_fapl_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity check */
HDassert(value);
+ /* Get the FAPL ID */
l_fapl_id = (*(const hid_t *)value);
- if (l_fapl_id > H5P_DEFAULT) {
+ /* Duplicate the FAPL, if it's non-default */
+ if (l_fapl_id != H5P_DEFAULT) {
H5P_genplist_t *l_fapl_plist;
if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS)))
@@ -317,13 +319,13 @@ done:
/*--------------------------------------------------------------------------
* Function: H5P_lacc_elink_fapl_close
*
- * Purpose: Close the FAPL for link access
+ * Purpose: Close the FAPL for link access
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Vailin Choi
- * Tuesday, Sept 23, 2008
+ * Programmer: Vailin Choi
+ * Tuesday, Sept 23, 2008
*
*---------------------------------------------------------------------------
*/
@@ -336,9 +338,13 @@ H5P_lacc_elink_fapl_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED
FUNC_ENTER_NOAPI_NOINIT
+ /* Sanity check */
HDassert(value);
+ /* Get the FAPL ID */
l_fapl_id = (*(const hid_t *)value);
+
+ /* Close the FAPL */
if ((l_fapl_id > H5P_DEFAULT) && (H5I_dec_ref(l_fapl_id) < 0))
HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close atom for file access property list")
@@ -742,7 +748,7 @@ done:
* external link. This should be either H5F_ACC_RDONLY or
* H5F_ACC_RDWR, or H5F_ACC_DEFAULT to unset the value.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
* Tuesday, December 9, 2008
@@ -780,7 +786,7 @@ done:
* Purpose: Gets the file access flags to be used when traversing an
* external link.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
* Tuesday, December 9, 2008
@@ -816,7 +822,7 @@ done:
* external link. This should be either H5F_ACC_RDONLY or
* H5F_ACC_RDWR.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
* Tuesday, December 15, 2008
@@ -860,7 +866,7 @@ done:
* Purpose: Gets the file access flags to be used when traversing an
* external link.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
* Tuesday, December 15, 2008
@@ -887,7 +893,6 @@ H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data)
if (func)
*func = cb_info.func;
-
if (op_data)
*op_data = cb_info.user_data;
diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c
index f85592d..ad86f7f 100644
--- a/src/H5Plcpl.c
+++ b/src/H5Plcpl.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Plcpl.c
- * May 8 2006
- * Peter Cao <xcao@ncsa.uiuc.edu>
+ * Created: H5Plcpl.c
*
- * Purpose: Link creation property list class routines
+ * Purpose: Link creation property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -30,11 +28,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Lprivate.h" /* Links */
-#include "H5Ppkg.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Lprivate.h" /* Links */
+#include "H5Ppkg.h" /* Property lists */
/****************/
/* Local Macros */
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index 00c5811..019510e 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Pocpl.c
- * Nov 28 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Pocpl.c
+ * Nov 28 2006
+ * Quincey Koziol
*
- * Purpose: Object creation property list class routines
+ * Purpose: Object creation property list class routines
*
*-------------------------------------------------------------------------
*/
@@ -90,7 +90,7 @@ const H5P_libclass_t H5P_CLS_OCRT[1] = {{
&H5P_CLS_ROOT_g, /* Parent class */
&H5P_CLS_OBJECT_CREATE_g, /* Pointer to class */
&H5P_CLS_OBJECT_CREATE_ID_g, /* Pointer to class ID */
- NULL, /* Pointer to default property list ID */
+ NULL, /* Pointer to default property list ID */
H5P__ocrt_reg_prop, /* Default property registration routine */
NULL, /* Class creation callback */
@@ -249,7 +249,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_attr_phase_change
*
- * Purpose: Sets the cutoff values for indexes storing attributes
+ * Purpose: Sets the cutoff values for indexes storing attributes
* in object headers for this file. If more than max_compact
* attributes are in an object header, the attributes will be
* moved to a heap and indexed with a B-tree.
@@ -261,10 +261,10 @@ done:
* never be stored in the object header but will be always be
* stored in a heap.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, November 28, 2006
+ * Programmer: Quincey Koziol
+ * Tuesday, November 28, 2006
*
*-------------------------------------------------------------------------
*/
@@ -300,14 +300,14 @@ done:
} /* end H5Pset_attr_phase_change */
/*-------------------------------------------------------------------------
- * Function: H5Pget_attr_phase_change
+ * Function: H5Pget_attr_phase_change
*
- * Purpose: Gets the phase change values for attribute storage
+ * Purpose: Gets the phase change values for attribute storage
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, November 28, 2006
+ * Programmer: Quincey Koziol
+ * Tuesday, November 28, 2006
*
*-------------------------------------------------------------------------
*/
@@ -535,37 +535,37 @@ done:
} /* end H5Pget_obj_track_times() */
/*-------------------------------------------------------------------------
- * Function: H5P_modify_filter
- *
- * Purpose: Modifies the specified FILTER in the
- * transient or permanent output filter pipeline
- * depending on whether PLIST is a dataset creation or dataset
- * transfer property list. The FLAGS argument specifies certain
- * general properties of the filter and is documented below.
- * The CD_VALUES is an array of CD_NELMTS integers which are
- * auxiliary data for the filter. The integer vlues will be
- * stored in the dataset object header as part of the filter
- * information.
- *
- * The FLAGS argument is a bit vector of the following fields:
- *
- * H5Z_FLAG_OPTIONAL(0x0001)
- * If this bit is set then the filter is optional. If the
- * filter fails during an H5Dwrite() operation then the filter
- * is just excluded from the pipeline for the chunk for which it
- * failed; the filter will not participate in the pipeline
- * during an H5Dread() of the chunk. If this bit is clear and
- * the filter fails then the entire I/O operation fails.
+ * Function: H5P_modify_filter
+ *
+ * Purpose: Modifies the specified FILTER in the
+ * transient or permanent output filter pipeline
+ * depending on whether PLIST is a dataset creation or dataset
+ * transfer property list. The FLAGS argument specifies certain
+ * general properties of the filter and is documented below.
+ * The CD_VALUES is an array of CD_NELMTS integers which are
+ * auxiliary data for the filter. The integer vlues will be
+ * stored in the dataset object header as part of the filter
+ * information.
+ *
+ * The FLAGS argument is a bit vector of the following fields:
+ *
+ * H5Z_FLAG_OPTIONAL(0x0001)
+ * If this bit is set then the filter is optional. If the
+ * filter fails during an H5Dwrite() operation then the filter
+ * is just excluded from the pipeline for the chunk for which it
+ * failed; the filter will not participate in the pipeline
+ * during an H5Dread() of the chunk. If this bit is clear and
+ * the filter fails then the entire I/O operation fails.
* If this bit is set but encoding is disabled for a filter,
* attempting to write will generate an error.
*
- * Note: This function currently supports only the permanent filter
- * pipeline. That is, PLIST_ID must be a dataset creation
- * property list.
+ * Note: This function currently supports only the permanent filter
+ * pipeline. That is, PLIST_ID must be a dataset creation
+ * property list.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, October 17, 2007
*
*-------------------------------------------------------------------------
@@ -629,13 +629,6 @@ done:
* Programmer: Quincey Koziol
* Friday, April 5, 2003
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, March 26, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -669,47 +662,35 @@ done:
} /* end H5Pmodify_filter() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_filter
- *
- * Purpose: Adds the specified FILTER and corresponding properties to the
- * end of the data or link output filter pipeline
- * depending on whether PLIST is a dataset creation or group
- * creation property list. The FLAGS argument specifies certain
- * general properties of the filter and is documented below.
- * The CD_VALUES is an array of CD_NELMTS integers which are
- * auxiliary data for the filter. The integer vlues will be
- * stored in the dataset object header as part of the filter
- * information.
- *
- * The FLAGS argument is a bit vector of the following fields:
- *
- * H5Z_FLAG_OPTIONAL(0x0001)
- * If this bit is set then the filter is optional. If the
- * filter fails during an H5Dwrite() operation then the filter
- * is just excluded from the pipeline for the chunk for which it
- * failed; the filter will not participate in the pipeline
- * during an H5Dread() of the chunk. If this bit is clear and
- * the filter fails then the entire I/O operation fails.
+ * Function: H5Pset_filter
+ *
+ * Purpose: Adds the specified FILTER and corresponding properties to the
+ * end of the data or link output filter pipeline
+ * depending on whether PLIST is a dataset creation or group
+ * creation property list. The FLAGS argument specifies certain
+ * general properties of the filter and is documented below.
+ * The CD_VALUES is an array of CD_NELMTS integers which are
+ * auxiliary data for the filter. The integer vlues will be
+ * stored in the dataset object header as part of the filter
+ * information.
+ *
+ * The FLAGS argument is a bit vector of the following fields:
+ *
+ * H5Z_FLAG_OPTIONAL(0x0001)
+ * If this bit is set then the filter is optional. If the
+ * filter fails during an H5Dwrite() operation then the filter
+ * is just excluded from the pipeline for the chunk for which it
+ * failed; the filter will not participate in the pipeline
+ * during an H5Dread() of the chunk. If this bit is clear and
+ * the filter fails then the entire I/O operation fails.
* If this bit is set but encoding is disabled for a filter,
* attempting to write will generate an error.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
- * Neil Fortner
- * Wednesday, May 20, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -743,36 +724,36 @@ done:
} /* end H5Pset_filter() */
/*-------------------------------------------------------------------------
- * Function: H5P__set_filter
- *
- * Purpose: Adds the specified FILTER and corresponding properties to the
- * end of the data or link output filter pipeline
- * depending on whether PLIST is a dataset creation or group
- * creation property list. The FLAGS argument specifies certain
- * general properties of the filter and is documented below.
- * The CD_VALUES is an array of CD_NELMTS integers which are
- * auxiliary data for the filter. The integer vlues will be
- * stored in the dataset object header as part of the filter
- * information.
- *
- * The FLAGS argument is a bit vector of the following fields:
- *
- * H5Z_FLAG_OPTIONAL(0x0001)
- * If this bit is set then the filter is optional. If the
- * filter fails during an H5Dwrite() operation then the filter
- * is just excluded from the pipeline for the chunk for which it
- * failed; the filter will not participate in the pipeline
- * during an H5Dread() of the chunk. If this bit is clear and
- * the filter fails then the entire I/O operation fails.
- * If this bit is set but encoding is disabled for a filter,
- * attempting to write will generate an error.
+ * Function: H5P__set_filter
+ *
+ * Purpose: Adds the specified FILTER and corresponding properties to the
+ * end of the data or link output filter pipeline
+ * depending on whether PLIST is a dataset creation or group
+ * creation property list. The FLAGS argument specifies certain
+ * general properties of the filter and is documented below.
+ * The CD_VALUES is an array of CD_NELMTS integers which are
+ * auxiliary data for the filter. The integer vlues will be
+ * stored in the dataset object header as part of the filter
+ * information.
+ *
+ * The FLAGS argument is a bit vector of the following fields:
+ *
+ * H5Z_FLAG_OPTIONAL(0x0001)
+ * If this bit is set then the filter is optional. If the
+ * filter fails during an H5Dwrite() operation then the filter
+ * is just excluded from the pipeline for the chunk for which it
+ * failed; the filter will not participate in the pipeline
+ * during an H5Dread() of the chunk. If this bit is clear and
+ * the filter fails then the entire I/O operation fails.
+ * If this bit is set but encoding is disabled for a filter,
+ * attempting to write will generate an error.
*
* If the filter is not registered, this function tries to load
* it dynamically during run time.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -808,30 +789,23 @@ done:
} /* end H5P__set_filter() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_nfilters
+ * Function: H5Pget_nfilters
*
- * Purpose: Returns the number of filters in the data or link
- * pipeline depending on whether PLIST_ID is a dataset creation
- * or group creation property list. In each pipeline the
- * filters are numbered from zero through N-1 where N is the
- * value returned by this function. During output to the file
- * the filters of a pipeline are applied in increasing order
- * (the inverse is true for input).
+ * Purpose: Returns the number of filters in the data or link
+ * pipeline depending on whether PLIST_ID is a dataset creation
+ * or group creation property list. In each pipeline the
+ * filters are numbered from zero through N-1 where N is the
+ * value returned by this function. During output to the file
+ * the filters of a pipeline are applied in increasing order
+ * (the inverse is true for input).
*
- * Return: Success: Number of filters or zero if there are none.
+ * Return: Success: Number of filters or zero if there are none.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, August 4, 1998
*
- * Modifications:
- *
- * Neil Fortner
- * Wednesday, May 20, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
int
@@ -860,34 +834,27 @@ done:
} /* end H5Pget_nfilters */
/*-------------------------------------------------------------------------
- * Function: H5Pget_filter2
- *
- * Purpose: This is the query counterpart of H5Pset_filter() and returns
- * information about a particular filter number in a permanent
- * or transient pipeline depending on whether PLIST_ID is a
- * dataset creation or transfer property list. On input,
- * CD_NELMTS indicates the number of entries in the CD_VALUES
- * array allocated by the caller while on exit it contains the
- * number of values defined by the filter. FILTER_CONFIG is a bit
+ * Function: H5Pget_filter2
+ *
+ * Purpose: This is the query counterpart of H5Pset_filter() and returns
+ * information about a particular filter number in a permanent
+ * or transient pipeline depending on whether PLIST_ID is a
+ * dataset creation or transfer property list. On input,
+ * CD_NELMTS indicates the number of entries in the CD_VALUES
+ * array allocated by the caller while on exit it contains the
+ * number of values defined by the filter. FILTER_CONFIG is a bit
* field contaning encode/decode flags from H5Zpublic.h. The IDX
* should be a value between zero and N-1 as described for
* H5Pget_nfilters() and the function will return failure if the
* filter number is out of range.
*
- * Return: Success: Filter identification number.
+ * Return: Success: Filter identification number.
*
- * Failure: H5Z_FILTER_ERROR (Negative)
+ * Failure: H5Z_FILTER_ERROR (Negative)
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- *
- * Neil Fortner
- * Wednesday, May 20, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
H5Z_filter_t
@@ -952,23 +919,23 @@ done:
} /* end H5Pget_filter2() */
/*-------------------------------------------------------------------------
- * Function: H5P_get_filter_by_id
+ * Function: H5P_get_filter_by_id
*
- * Purpose: This is an additional query counterpart of H5Pset_filter() and
+ * Purpose: This is an additional query counterpart of H5Pset_filter() and
* returns information about a particular filter in a permanent
- * or transient pipeline depending on whether PLIST_ID is a
- * dataset creation or transfer property list. On input,
- * CD_NELMTS indicates the number of entries in the CD_VALUES
- * array allocated by the caller while on exit it contains the
- * number of values defined by the filter. FILTER_CONFIG is a bit
+ * or transient pipeline depending on whether PLIST_ID is a
+ * dataset creation or transfer property list. On input,
+ * CD_NELMTS indicates the number of entries in the CD_VALUES
+ * array allocated by the caller while on exit it contains the
+ * number of values defined by the filter. FILTER_CONFIG is a bit
* field contaning encode/decode flags from H5Zpublic.h. The ID
* should be the filter ID to retrieve the parameters for. If the
* filter is not set for the property list, an error will be returned.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, October 17, 2007
*
*-------------------------------------------------------------------------
@@ -1001,32 +968,25 @@ done:
} /* end H5P_get_filter_by_id() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_filter_by_id2
+ * Function: H5Pget_filter_by_id2
*
- * Purpose: This is an additional query counterpart of H5Pset_filter() and
+ * Purpose: This is an additional query counterpart of H5Pset_filter() and
* returns information about a particular filter in a permanent
- * or transient pipeline depending on whether PLIST_ID is a
- * dataset creation or transfer property list. On input,
- * CD_NELMTS indicates the number of entries in the CD_VALUES
- * array allocated by the caller while on exit it contains the
- * number of values defined by the filter. FILTER_CONFIG is a bit
+ * or transient pipeline depending on whether PLIST_ID is a
+ * dataset creation or transfer property list. On input,
+ * CD_NELMTS indicates the number of entries in the CD_VALUES
+ * array allocated by the caller while on exit it contains the
+ * number of values defined by the filter. FILTER_CONFIG is a bit
* field contaning encode/decode flags from H5Zpublic.h. The ID
* should be the filter ID to retrieve the parameters for. If the
* filter is not set for the property list, an error will be returned.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, April 5, 2003
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, May 21, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1076,25 +1036,18 @@ done:
} /* end H5Pget_filter_by_id2() */
/*-------------------------------------------------------------------------
- * Function: H5Pall_filters_avail
+ * Function: H5Pall_filters_avail
*
- * Purpose: This is a query routine to verify that all the filters set
+ * Purpose: This is a query routine to verify that all the filters set
* in the dataset creation property list are available currently.
*
- * Return: Success: TRUE if all filters available, FALSE if one or
+ * Return: Success: TRUE if all filters available, FALSE if one or
* more filters not currently available.
- * Failure: FAIL on error
+ * Failure: FAIL on error
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 8, 2003
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, May 21, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -1124,17 +1077,17 @@ done:
} /* end H5Pall_filters_avail() */
/*-------------------------------------------------------------------------
- * Function: H5P_filter_in_pline
+ * Function: H5P_filter_in_pline
*
- * Purpose: Check whether the filter is in the pipeline of the object
+ * Purpose: Check whether the filter is in the pipeline of the object
* creation property list.
*
- * Return: TRUE: found
- * FALSE: not found
- * FAIL: error
+ * Return: TRUE: found
+ * FALSE: not found
+ * FAIL: error
*
- * Programmer: Raymond Lu
- * 14 May 2013
+ * Programmer: Raymond Lu
+ * 26 April 2013
*
*-------------------------------------------------------------------------
*/
@@ -1169,13 +1122,6 @@ done:
* Programmer: Pedro Vicente
* January 26, 2004
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, May 21, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1224,21 +1170,9 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
- * Neil Fortner
- * Thursday, March 26, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1283,16 +1217,9 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Dec 19, 2002
*
- * Modifications:
- *
- * Neil Fortner
- * Wednesday, May 6, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1326,13 +1253,13 @@ done:
} /* end H5Pset_fletcher32() */
/*-------------------------------------------------------------------------
- * Function: H5P_get_filter
+ * Function: H5P__get_filter
*
- * Purpose: Internal component of H5Pget_filter & H5Pget_filter_id
+ * Purpose: Internal component of H5Pget_filter & H5Pget_filter_id
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, October 23, 2006
*
*-------------------------------------------------------------------------
@@ -1499,24 +1426,24 @@ done:
#ifndef H5_NO_DEPRECATED_SYMBOLS
/*-------------------------------------------------------------------------
- * Function: H5Pget_filter1
- *
- * Purpose: This is the query counterpart of H5Pset_filter() and returns
- * information about a particular filter number in a permanent
- * or transient pipeline depending on whether PLIST_ID is a
- * dataset creation or transfer property list. On input,
- * CD_NELMTS indicates the number of entries in the CD_VALUES
- * array allocated by the caller while on exit it contains the
- * number of values defined by the filter. The IDX
+ * Function: H5Pget_filter1
+ *
+ * Purpose: This is the query counterpart of H5Pset_filter() and returns
+ * information about a particular filter number in a permanent
+ * or transient pipeline depending on whether PLIST_ID is a
+ * dataset creation or transfer property list. On input,
+ * CD_NELMTS indicates the number of entries in the CD_VALUES
+ * array allocated by the caller while on exit it contains the
+ * number of values defined by the filter. The IDX
* should be a value between zero and N-1 as described for
* H5Pget_nfilters() and the function will return failure if the
* filter number is out of range.
*
- * Return: Success: Filter identification number.
+ * Return: Success: Filter identification number.
*
- * Failure: H5Z_FILTER_ERROR (Negative)
+ * Failure: H5Z_FILTER_ERROR (Negative)
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -1582,22 +1509,22 @@ done:
} /* end H5Pget_filter1() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_filter_by_id1
+ * Function: H5Pget_filter_by_id1
*
- * Purpose: This is an additional query counterpart of H5Pset_filter() and
+ * Purpose: This is an additional query counterpart of H5Pset_filter() and
* returns information about a particular filter in a permanent
- * or transient pipeline depending on whether PLIST_ID is a
- * dataset creation or transfer property list. On input,
- * CD_NELMTS indicates the number of entries in the CD_VALUES
- * array allocated by the caller while on exit it contains the
- * number of values defined by the filter. The ID
+ * or transient pipeline depending on whether PLIST_ID is a
+ * dataset creation or transfer property list. On input,
+ * CD_NELMTS indicates the number of entries in the CD_VALUES
+ * array allocated by the caller while on exit it contains the
+ * number of values defined by the filter. The ID
* should be the filter ID to retrieve the parameters for. If the
* filter is not set for the property list, an error will be returned.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, April 5, 2003
*
*-------------------------------------------------------------------------
diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c
index 8dfa786..86d01fc 100644
--- a/src/H5Pocpypl.c
+++ b/src/H5Pocpypl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pocpypl.c
* Mar 13 2006
- * Peter Cao <xcao@ncsa.uiuc.edu>
+ * Peter Cao
*
* Purpose: Object copying property list class routines
*
@@ -170,6 +170,7 @@ done:
*
* Programmer: Neil Fortner
* October 27, 2011
+ *
*-------------------------------------------------------------------------
*/
static H5O_copy_dtype_merge_list_t *
@@ -182,8 +183,10 @@ H5P__free_merge_comm_dtype_list(H5O_copy_dtype_merge_list_t *dt_list)
/* Free the list */
while (dt_list) {
tmp_node = dt_list->next;
+
(void)H5MM_xfree(dt_list->path);
(void)H5FL_FREE(H5O_copy_dtype_merge_list_t, dt_list);
+
dt_list = tmp_node;
} /* end while */
@@ -193,13 +196,13 @@ H5P__free_merge_comm_dtype_list(H5O_copy_dtype_merge_list_t *dt_list)
/*--------------------------------------------------------------------------
* Function: H5P__ocpy_merge_comm_dt_list_copy
*
- * Purpose: Copy the merge committed datatype list
+ * Purpose: Copy a merge committed datatype list
*
* Return: Success: Non-negative
* Failure: Negative
*
* Programmer: Quincey Koziol
- * Friday, August 31, 2012
+ * Wednesday, September 2, 2015
*
*--------------------------------------------------------------------------
*/
@@ -215,6 +218,7 @@ H5P__ocpy_merge_comm_dt_list_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATT
FUNC_ENTER_STATIC
+ /* Sanity check */
HDassert(value);
/* Make copy of merge committed dtype list */
diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h
index 0b264eb..7c27eee 100644
--- a/src/H5Ppkg.h
+++ b/src/H5Ppkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, November 16, 2001
*
* Purpose: This file contains declarations which are visible only within
@@ -50,10 +50,10 @@ typedef enum {
/* Define enum for modifications to class */
typedef enum {
H5P_MOD_ERR = (-1), /* Indicate an error */
- H5P_MOD_INC_CLS, /* Increment the dependant class count*/
- H5P_MOD_DEC_CLS, /* Decrement the dependant class count*/
- H5P_MOD_INC_LST, /* Increment the dependant list count*/
- H5P_MOD_DEC_LST, /* Decrement the dependant list count*/
+ H5P_MOD_INC_CLS, /* Increment the dependent class count*/
+ H5P_MOD_DEC_CLS, /* Decrement the dependent class count*/
+ H5P_MOD_INC_LST, /* Increment the dependent list count*/
+ H5P_MOD_DEC_LST, /* Decrement the dependent list count*/
H5P_MOD_INC_REF, /* Increment the ID reference count*/
H5P_MOD_DEC_REF, /* Decrement the ID reference count*/
H5P_MOD_MAX /* Upper limit on class modifications */
@@ -87,7 +87,7 @@ struct H5P_genclass_t {
unsigned
plists; /* Number of property lists that have been created since the last modification to the class */
unsigned classes; /* Number of classes that have been derived since the last modification to the class */
- unsigned ref_count; /* Number of oustanding ID's open on this class object */
+ unsigned ref_count; /* Number of outstanding ID's open on this class object */
hbool_t deleted; /* Whether this class has been deleted and is waiting for dependent classes & proplists
to close */
unsigned revision; /* Revision number of a particular class (global) */
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 817e829..be42d55 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -132,7 +132,7 @@ typedef enum H5D_mpio_actual_chunk_opt_mode_t {
typedef enum H5D_mpio_actual_io_mode_t {
/* The following four values are conveniently defined as a bit field so that
- * we can switch from the default to indpendent or collective and then to
+ * we can switch from the default to independent or collective and then to
* mixed without having to check the original value.
*
* NO_COLLECTIVE means that either collective I/O wasn't requested or that
diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c
index bc3b614..1778939 100644
--- a/src/H5Pstrcpl.c
+++ b/src/H5Pstrcpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pstrcpl.c
* October 26 2005
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * James Laird
*
* Purpose: String creation property list class routines
*
diff --git a/src/H5Ptest.c b/src/H5Ptest.c
index 79e4dc8..814fef7 100644
--- a/src/H5Ptest.c
+++ b/src/H5Ptest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Saturday May 31, 2003
*
* Purpose: Generic Property Testing Functions
@@ -56,8 +56,8 @@
char *
H5P_get_class_path_test(hid_t pclass_id)
{
- H5P_genclass_t *pclass; /* Property class to query */
- char * ret_value; /* return value */
+ H5P_genclass_t *pclass; /* Property class to query */
+ char * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -83,7 +83,7 @@ done:
const char *path; IN: Full path name of class to open [copy of]
RETURNS
Success: ID of generic property class
- Failure: NULL
+ Failure: H5I_INVALID_HID
DESCRIPTION
This routine opens [a copy] of the class indicated by the full path.
@@ -96,25 +96,25 @@ done:
hid_t
H5P_open_class_path_test(const char *path)
{
- H5P_genclass_t *pclass = NULL; /* Property class to query */
- hid_t ret_value; /* Return value */
+ H5P_genclass_t *pclass = NULL; /* Property class to query */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
/* Check arguments. */
if (NULL == path || *path == '\0')
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid class path");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid class path");
/* Open the property list class */
if ((pclass = H5P_open_class_path(path)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to find class with full path");
+ HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to find class with full path");
/* Get an atom for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class");
done:
- if (ret_value < 0 && pclass)
+ if (H5I_INVALID_HID == ret_value && pclass)
H5P_close_class(pclass);
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5R.c b/src/H5R.c
index 75506b0..18bc8b3 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -550,9 +550,9 @@ done:
hid_t
H5Rdereference(hid_t id, H5R_type_t ref_type, const void *_ref)
{
- H5G_loc_t loc; /* Group location */
- H5F_t * file = NULL; /* File object */
- hid_t ret_value;
+ H5G_loc_t loc; /* Group location */
+ H5F_t * file = NULL; /* File object */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("i", "iRt*x", id, ref_type, _ref);
@@ -665,7 +665,7 @@ done:
void *ref; IN: Reference to open.
RETURNS
- Valid ID on success, Negative on failure
+ Valid ID on success, H5I_INVALID_HID on failure
DESCRIPTION
Given a reference to some object, creates a copy of the dataset pointed
to's dataspace and defines a selection in the copy which is the region
@@ -678,28 +678,28 @@ done:
hid_t
H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
{
- H5G_loc_t loc; /* Object's group location */
- H5S_t * space = NULL; /* Dataspace object */
- hid_t ret_value;
+ H5G_loc_t loc; /* Object's group location */
+ H5S_t * space = NULL; /* Dataspace object */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE3("i", "iRt*x", id, ref_type, ref);
/* Check args */
if (H5G_loc(id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location")
if (ref_type != H5R_DATASET_REGION)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type")
if (ref == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer")
/* Get the dataspace with the correct region selected */
if ((space = H5R_get_region(loc.oloc->file, H5AC_ind_dxpl_id, ref)) == NULL)
- HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create dataspace")
/* Atomize */
if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index eaa1618..a6a24dc 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -13,11 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Rdeprec.c
- * September 13 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Rdeprec.c
*
- * Purpose: Deprecated functions from the H5R interface. These
+ * Purpose: Deprecated functions from the H5R interface. These
* functions are here for compatibility purposes and may be
* removed in the future. Applications should switch to the
* newer APIs.
diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h
index 08ce908..ee849de 100644
--- a/src/H5Rpkg.h
+++ b/src/H5Rpkg.h
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * Thursday, September 13, 2007
- *
- * Purpose: This file contains declarations which are visible
+/* Purpose: This file contains declarations which are visible
* only within the H5R package. Source files outside the
* H5R package should include H5Rprivate.h instead.
*/
diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h
index ceb38cb..62c0d10 100644
--- a/src/H5Rpublic.h
+++ b/src/H5Rpublic.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * This file contains public declarations for the H5S module.
+ * This file contains public declarations for the H5R module.
*/
#ifndef _H5Rpublic_H
#define _H5Rpublic_H
@@ -34,8 +34,8 @@ typedef enum {
/* Note! Be careful with the sizes of the references because they should really
* depend on the run-time values in the file. Unfortunately, the arrays need
- * to be defined at compile-time, so we have to go with the worst case sizes for
- * them. -QAK
+ * to be defined at compile-time, so we have to go with the worst case sizes
+ * for them. -QAK
*/
#define H5R_OBJ_REF_BUF_SIZE sizeof(haddr_t)
/* Object reference structure for user's code */
@@ -71,10 +71,6 @@ H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, c
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
-/* Macros */
-
-/* Typedefs */
-
/* Function prototypes */
H5_DLL H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *_ref);
diff --git a/src/H5S.c b/src/H5S.c
index cff9c7e..8f3baca 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -27,16 +27,16 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
#include "H5FLprivate.h" /* Free lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Spkg.h" /* Dataspaces */
/****************/
/* Local Macros */
/****************/
-/* Version of datatype encoding */
+/* Version of dataspace encoding */
#define H5S_ENCODE_VERSION 0
/******************/
@@ -55,14 +55,6 @@ static H5S_t *H5S_decode(const unsigned char *buf);
/* Package Variables */
/*********************/
-/*****************************/
-/* Library Private Variables */
-/*****************************/
-
-/*******************/
-/* Local Variables */
-/*******************/
-
/* Declare a free list to manage the H5S_extent_t struct */
H5FL_DEFINE(H5S_extent_t);
@@ -72,6 +64,10 @@ H5FL_DEFINE(H5S_t);
/* Declare a free list to manage the array's of hsize_t's */
H5FL_ARR_DEFINE(hsize_t, H5S_MAX_RANK);
+/*******************/
+/* Local Variables */
+/*******************/
+
/* Dataspace ID class */
static const H5I_class_t H5I_DATASPACE_CLS[1] = {{
H5I_DATASPACE, /* ID class value */
@@ -90,7 +86,6 @@ RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
Initializes any interface-specific data or routines.
-
--------------------------------------------------------------------------*/
static herr_t
H5S_init_interface(void)
@@ -99,7 +94,7 @@ H5S_init_interface(void)
FUNC_ENTER_NOAPI_NOINIT
- /* Initialize the atom group for the file IDs */
+ /* Initialize the atom group for the dataspace IDs */
if (H5I_register_type(H5I_DATASPACE_CLS) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize interface")
@@ -170,8 +165,8 @@ H5S_term_interface(void)
H5S_t *
H5S_create(H5S_class_t type)
{
- H5S_t *new_ds = NULL; /* New dataspace created */
- H5S_t *ret_value; /* Return value */
+ H5S_t *new_ds = NULL; /* New dataspace created */
+ H5S_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -219,10 +214,9 @@ H5S_create(H5S_class_t type)
ret_value = new_ds;
done:
- if (ret_value == NULL) {
+ if (ret_value == NULL)
if (new_ds && H5S_close(new_ds) < 0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, NULL, "unable to release dataspace")
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_create() */
@@ -266,25 +260,22 @@ H5Screate(H5S_class_t type)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
done:
- if (ret_value < 0) {
+ if (ret_value < 0)
if (new_ds && H5S_close(new_ds) < 0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace")
- } /* end if */
FUNC_LEAVE_API(ret_value)
} /* end H5Screate() */
/*-------------------------------------------------------------------------
- * Function: H5S_extent_release
+ * Function: H5S_extent_release
*
- * Purpose: Releases all memory associated with a dataspace extent.
+ * Purpose: Releases all memory associated with a dataspace extent.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, July 23, 1998
- *
- * Modifications:
+ * Programmer: Quincey Koziol
+ * Thursday, July 23, 1998
*
*-------------------------------------------------------------------------
*/
@@ -310,14 +301,14 @@ done:
} /* end H5S_extent_release() */
/*-------------------------------------------------------------------------
- * Function: H5S_close
+ * Function: H5S_close
*
- * Purpose: Releases all memory associated with a dataspace.
+ * Purpose: Releases all memory associated with a dataspace.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
@@ -346,18 +337,14 @@ done:
} /* end H5S_close() */
/*-------------------------------------------------------------------------
- * Function: H5Sclose
+ * Function: H5Sclose
*
- * Purpose: Release access to a dataspace object.
+ * Purpose: Release access to a dataspace object.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Errors:
- *
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
- *
- * Modifications:
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
@@ -382,63 +369,58 @@ done:
} /* end H5Sclose() */
/*-------------------------------------------------------------------------
- * Function: H5Scopy
+ * Function: H5Scopy
*
- * Purpose: Copies a dataspace.
+ * Purpose: Copies a dataspace.
*
- * Return: Success: ID of the new dataspace
+ * Return: Success: ID of the new dataspace
*
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Friday, January 30, 1998
+ * Failure: H5I_INVALID_HID
*
- * Modifications:
+ * Programmer: Robb Matzke
+ * Friday, January 30, 1998
*
*-------------------------------------------------------------------------
*/
hid_t
H5Scopy(hid_t space_id)
{
- H5S_t *src;
- H5S_t *dst = NULL;
- hid_t ret_value;
+ H5S_t *src = NULL;
+ H5S_t *dst = NULL;
+ hid_t ret_value = H5I_INVALID_HID;
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", space_id);
/* Check args */
if (NULL == (src = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataspace")
/* Copy */
if (NULL == (dst = H5S_copy(src, FALSE, TRUE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace")
/* Atomize */
if ((ret_value = H5I_register(H5I_DATASPACE, dst, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
done:
- if (ret_value < 0) {
+ if (H5I_INVALID_HID == ret_value)
if (dst && H5S_close(dst) < 0)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace")
- } /* end if */
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release dataspace")
FUNC_LEAVE_API(ret_value)
} /* end H5Scopy() */
/*-------------------------------------------------------------------------
- * Function: H5Sextent_copy
+ * Function: H5Sextent_copy
*
- * Purpose: Copies a dataspace extent.
+ * Purpose: Copies a dataspace extent.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, July 23, 1998
- *
- * Modifications:
+ * Programmer: Quincey Koziol
+ * Thursday, July 23, 1998
*
*-------------------------------------------------------------------------
*/
@@ -447,7 +429,7 @@ H5Sextent_copy(hid_t dst_id, hid_t src_id)
{
H5S_t *src;
H5S_t *dst;
- hid_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ii", dst_id, src_id);
@@ -473,16 +455,14 @@ done:
} /* end H5Sextent_copy() */
/*-------------------------------------------------------------------------
- * Function: H5S_extent_copy
- *
- * Purpose: Copies a dataspace extent
+ * Function: H5S_extent_copy
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Copies a dataspace extent
*
- * Programmer: Quincey Koziol
- * Wednesday, June 3, 1998
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
+ * Programmer: Neil Fortner
+ * Monday, February 23, 2015
*
*-------------------------------------------------------------------------
*/
@@ -543,31 +523,29 @@ done:
} /* end H5S_extent_copy() */
/*-------------------------------------------------------------------------
- * Function: H5S_copy
+ * Function: H5S_copy
*
- * Purpose: Copies a dataspace, by copying the extent and selection through
- * H5S_extent_copy and H5S_select_copy. If the SHARE_SELECTION flag
- * is set, then the selection can be shared between the source and
- * destination dataspaces. (This should only occur in situations
- * where the destination dataspace will immediately change to a new
- * selection)
+ * Purpose: Copies a dataspace, by copying the extent and selection through
+ * H5S_extent_copy and H5S_select_copy. If the SHARE_SELECTION flag
+ * is set, then the selection can be shared between the source and
+ * destination dataspaces. (This should only occur in situations
+ * where the destination dataspace will immediately change to a new
+ * selection)
*
- * Return: Success: A pointer to a new copy of SRC
+ * Return: Success: A pointer to a new copy of SRC
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * Thursday, December 4, 1997
- *
- * Modifications:
+ * Programmer: Robb Matzke
+ * Thursday, December 4, 1997
*
*-------------------------------------------------------------------------
*/
H5S_t *
H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max)
{
- H5S_t *dst = NULL;
- H5S_t *ret_value; /* Return value */
+ H5S_t *dst = NULL;
+ H5S_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -594,30 +572,27 @@ done:
} /* end H5S_copy() */
/*-------------------------------------------------------------------------
- * Function: H5S_get_simple_extent_npoints
+ * Function: H5S_get_simple_extent_npoints
*
- * Purpose: Determines how many data points a dataset extent has.
+ * Purpose: Determines how many data points a dataset extent has.
*
- * Return: Success: Number of data points in the dataset extent.
+ * Return: Success: Number of data points in the dataset extent.
*
- * Failure: negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
* Note: This routine participates in the "Inlining C function pointers"
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- * Changed Name - QAK 7/7/98
- *
*-------------------------------------------------------------------------
*/
hssize_t
H5S_get_simple_extent_npoints(const H5S_t *ds)
{
- hssize_t ret_value;
+ hssize_t ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(-1)
@@ -632,19 +607,15 @@ done:
} /* end H5S_get_simple_extent_npoints() */
/*-------------------------------------------------------------------------
- * Function: H5Sget_simple_extent_npoints
- *
- * Purpose: Determines how many data points a dataset extent has.
+ * Function: H5Sget_simple_extent_npoints
*
- * Return: Success: Number of data points in the dataset.
+ * Purpose: Determines how many data points a dataset extent has.
*
- * Failure: negative
- *
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Return: Success: Number of data points in the dataset.
+ * Failure: Negative
*
- * Modifications:
- * Changed Name - QAK 7/7/98
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
@@ -668,31 +639,28 @@ done:
} /* end H5Sget_simple_extent_npoints() */
/*-------------------------------------------------------------------------
- * Function: H5S_get_npoints_max
+ * Function: H5S_get_npoints_max
*
- * Purpose: Determines the maximum number of data points a dataspace may
- * have. If the `max' array is null then the maximum number of
- * data points is the same as the current number of data points
- * without regard to the hyperslab. If any element of the `max'
- * array is zero then the maximum possible size is returned.
+ * Purpose: Determines the maximum number of data points a dataspace may
+ * have. If the `max' array is null then the maximum number of
+ * data points is the same as the current number of data points
+ * without regard to the hyperslab. If any element of the `max'
+ * array is zero then the maximum possible size is returned.
*
- * Return: Success: Maximum number of data points the dataspace
- * may have.
- *
- * Failure: 0
- *
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Return: Success: Maximum number of data points the dataspace
+ * may have.
+ * Failure: 0
*
- * Modifications:
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
hsize_t
H5S_get_npoints_max(const H5S_t *ds)
{
- hsize_t ret_value;
unsigned u;
+ hsize_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI(0)
@@ -719,10 +687,9 @@ H5S_get_npoints_max(const H5S_t *ds)
ret_value *= ds->extent.max[u];
}
}
- else {
+ else
for (ret_value = 1, u = 0; u < ds->extent.rank; u++)
ret_value *= ds->extent.size[u];
- }
break;
case H5S_NO_CLASS:
@@ -733,21 +700,18 @@ H5S_get_npoints_max(const H5S_t *ds)
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5S_get_npoints_max() */
/*-------------------------------------------------------------------------
- * Function: H5Sget_simple_extent_ndims
- *
- * Purpose: Determines the dimensionality of a dataspace.
+ * Function: H5Sget_simple_extent_ndims
*
- * Return: Success: The number of dimensions in a dataspace.
+ * Purpose: Determines the dimensionality of a dataspace.
*
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Thursday, December 11, 1997
+ * Return: Success: The number of dimensions in a dataspace.
+ * Failure: Negative
*
- * Modifications:
+ * Programmer: Robb Matzke
+ * Thursday, December 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -755,14 +719,14 @@ int
H5Sget_simple_extent_ndims(hid_t space_id)
{
H5S_t *ds;
- int ret_value;
+ int ret_value = -1;
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE1("Is", "i", space_id);
/* Check args */
if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace")
ret_value = (int)H5S_GET_EXTENT_NDIMS(ds);
@@ -771,30 +735,28 @@ done:
} /* end H5Sget_simple_extent_ndims() */
/*-------------------------------------------------------------------------
- * Function: H5S_get_simple_extent_ndims
+ * Function: H5S_get_simple_extent_ndims
*
- * Purpose: Returns the number of dimensions in a dataspace.
+ * Purpose: Returns the number of dimensions in a dataspace.
*
- * Return: Success: Non-negative number of dimensions. Zero
- * implies a scalar.
+ * Return: Success: Non-negative number of dimensions.
+ * Zero implies a scalar.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, December 11, 1997
+ * Programmer: Robb Matzke
+ * hursday, December 11, 1997
*
* Note: This routine participates in the "Inlining C function pointers"
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
H5S_get_simple_extent_ndims(const H5S_t *ds)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -819,24 +781,18 @@ done:
} /* end H5S_get_simple_extent_ndims() */
/*-------------------------------------------------------------------------
- * Function: H5Sget_simple_extent_dims
+ * Function: H5Sget_simple_extent_dims
*
- * Purpose: Returns the size and maximum sizes in each dimension of
- * a dataspace DS through the DIMS and MAXDIMS arguments.
+ * Purpose: Returns the size and maximum sizes in each dimension of
+ * a dataspace DS through the DIMS and MAXDIMS arguments.
*
- * Return: Success: Number of dimensions, the same value as
- * returned by H5Sget_simple_extent_ndims().
+ * Return: Success: Number of dimensions, the same value as
+ * returned by H5Sget_simple_extent_ndims().
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, December 11, 1997
- *
- * Modifications:
- * June 18, 1998 Albert Cheng
- * Added maxdims argument. Removed dims argument check
- * since it can still return ndims even if both dims and
- * maxdims are NULLs.
+ * Programmer: Robb Matzke
+ * Thursday, December 11, 1997
*
*-------------------------------------------------------------------------
*/
@@ -844,40 +800,40 @@ int
H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[] /*out*/, hsize_t maxdims[] /*out*/)
{
H5S_t *ds;
- int ret_value;
+ int ret_value = -1;
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE3("Is", "ixx", space_id, dims, maxdims);
/* Check args */
if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a dataspace")
ret_value = H5S_get_simple_extent_dims(ds, dims, maxdims);
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Sget_simple_extent_dims() */
/*-------------------------------------------------------------------------
- * Function: H5S_extent_get_dims
+ * Function: H5S_extent_get_dims
*
- * Purpose: Returns the size in each dimension of a dataspace. This
- * function may not be meaningful for all types of dataspaces.
+ * Purpose: Returns the size in each dimension of a dataspace. This
+ * function may not be meaningful for all types of dataspaces.
*
- * Return: Success: Number of dimensions. Zero implies scalar.
- * Failure: Negative
+ * Return: Success: Number of dimensions. Zero implies scalar.
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
- * Tuesday, June 30, 2009
+ * Programmer: Quincey Koziol
+ * Tuesday, June 30, 2009
*
*-------------------------------------------------------------------------
*/
int
H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[])
{
- int i; /* Local index variable */
- int ret_value; /* Return value */
+ int i; /* Local index variable */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -915,26 +871,23 @@ done:
} /* end H5S_extent_get_dims() */
/*-------------------------------------------------------------------------
- * Function: H5S_get_simple_extent_dims
+ * Function: H5S_get_simple_extent_dims
*
- * Purpose: Returns the size in each dimension of a dataspace. This
- * function may not be meaningful for all types of dataspaces.
+ * Purpose: Returns the size in each dimension of a dataspace. This
+ * function may not be meaningful for all types of dataspaces.
*
- * Return: Success: Number of dimensions. Zero implies scalar.
+ * Return: Success: Number of dimensions. Zero implies scalar.
+ * Failure: Negative
*
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Thursday, December 11, 1997
- *
- * Modifications:
+ * Programmer: Robb Matzke
+ * Thursday, December 11, 1997
*
*-------------------------------------------------------------------------
*/
int
H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[])
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -950,15 +903,15 @@ done:
} /* end H5S_get_simple_extent_dims() */
/*-------------------------------------------------------------------------
- * Function: H5S_write
+ * Function: H5S_write
*
- * Purpose: Updates a dataspace by writing a message to an object
- * header.
+ * Purpose: Updates a dataspace by writing a message to an object
+ * header.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
@@ -983,22 +936,14 @@ done:
} /* end H5S_write() */
/*-------------------------------------------------------------------------
- * Function: H5S_append
- *
- * Purpose: Updates a dataspace by adding a message to an object
- * header.
+ * Function: H5S_append
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Updates a dataspace by adding a message to an object header.
*
- * Programmer: Quincey Koziol
- * Tuesday, December 31, 2002
+ * Return: Non-negative on success/Negative on failure
*
- * Modifications:
- *
- * John Mainzer, 6/6/05
- * Updated function to use the new dirtied parameter of
- * H5AC_unprotect() instead of manipulating the is_dirty
- * field of the cache info.
+ * Programmer: Quincey Koziol
+ * Tuesday, December 31, 2002
*
*-------------------------------------------------------------------------
*/
@@ -1023,24 +968,24 @@ done:
} /* end H5S_append() */
/*-------------------------------------------------------------------------
- * Function: H5S_read
+ * Function: H5S_read
*
- * Purpose: Reads the dataspace from an object header.
+ * Purpose: Reads the dataspace from an object header.
*
- * Return: Success: Pointer to a new dataspace.
+ * Return: Success: Pointer to a new dataspace.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
H5S_t *
H5S_read(const H5O_loc_t *loc, hid_t dxpl_id)
{
- H5S_t *ds = NULL; /* Dataspace to return */
- H5S_t *ret_value; /* Return value */
+ H5S_t *ds = NULL; /* Dataspace to return */
+ H5S_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1061,10 +1006,9 @@ H5S_read(const H5O_loc_t *loc, hid_t dxpl_id)
ret_value = ds;
done:
- if (ret_value == NULL) {
+ if (ret_value == NULL)
if (ds != NULL)
ds = H5FL_FREE(H5S_t, ds);
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_read() */
@@ -1080,13 +1024,13 @@ done:
RETURNS
TRUE/FALSE/FAIL
DESCRIPTION
- This function determines the if a dataspace is "simple". ie. if it
+ This function determines the if a dataspace is "simple". ie. if it
has orthogonal, evenly spaced dimensions.
--------------------------------------------------------------------------*/
static htri_t
H5S_is_simple(const H5S_t *sdim)
{
- htri_t ret_value;
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1107,18 +1051,18 @@ H5S_is_simple(const H5S_t *sdim)
Check if a dataspace is simple
USAGE
htri_t H5Sis_simple(space_id)
- hid_t space_id; IN: ID of dataspace object to query
+ hid_t space_id; IN: ID of dataspace object to query
RETURNS
TRUE/FALSE/FAIL
DESCRIPTION
- This function determines the if a dataspace is "simple". ie. if it
+ This function determines the if a dataspace is "simple". ie. if it
has orthogonal, evenly spaced dimensions.
--------------------------------------------------------------------------*/
htri_t
H5Sis_simple(hid_t space_id)
{
- H5S_t *space; /* dataspace to modify */
- htri_t ret_value;
+ H5S_t *space; /* Dataspace to check */
+ htri_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("t", "i", space_id);
@@ -1140,11 +1084,11 @@ done:
Sets the size of a simple dataspace
USAGE
herr_t H5Sset_extent_simple(space_id, rank, dims, max)
- hid_t space_id; IN: Dataspace object to query
- int rank; IN: # of dimensions for the dataspace
- const size_t *dims; IN: Size of each dimension for the dataspace
- const size_t *max; IN: Maximum size of each dimension for the
- dataspace
+ hid_t space_id; IN: Dataspace object to query
+ int rank; IN: # of dimensions for the dataspace
+ const size_t *dims; IN: Size of each dimension for the dataspace
+ const size_t *max; IN: Maximum size of each dimension for the
+ dataspace
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -1158,21 +1102,12 @@ done:
Currently, only the first dimension in the array (the slowest) may be
unlimited in size.
- MODIFICATION
- A null dataspace cannot be created from simple space with this function.
-
- Christian Chilan 01/17/2007
- Verifies that each element of DIMS is not equal to H5S_UNLIMITED.
-
- Raymond Lu 03/30/2011
- We allow 0 dimension size for non-unlimited dimension starting from 1.8.7
- release.
--------------------------------------------------------------------------*/
herr_t
H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], const hsize_t max[/*rank*/])
{
- H5S_t *space; /* dataspace to modify */
- int u; /* local counting variable */
+ H5S_t *space; /* Dataspace to modify */
+ int u; /* Local counting variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1185,21 +1120,18 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], con
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified")
if (rank < 0 || rank > H5S_MAX_RANK)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid rank")
- if (dims) {
- for (u = 0; u < rank; u++) {
+ if (dims)
+ for (u = 0; u < rank; u++)
if (H5S_UNLIMITED == dims[u])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"current dimension must have a specific size, not H5S_UNLIMITED")
- }
- }
if (max != NULL) {
if (dims == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"maximum dimension specified, but no current dimensions specified")
- for (u = 0; u < rank; u++) {
+ for (u = 0; u < rank; u++)
if (max[u] != H5S_UNLIMITED && max[u] < dims[u])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid maximum dimension size")
- }
}
/* Do it */
@@ -1208,21 +1140,18 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], con
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Sset_extent_simple() */
/*-------------------------------------------------------------------------
- * Function: H5S_set_extent_simple
+ * Function: H5S_set_extent_simple
*
- * Purpose: This is where the real work happens for
- * H5Sset_extent_simple().
+ * Purpose: This is where the real work happens for H5Sset_extent_simple().
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke (copied from H5Sset_extent_simple)
+ * Programmer: Robb Matzke
* Wednesday, July 8, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1287,31 +1216,26 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, const hs
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_set_extent_simple() */
+} /* end H5S_set_extent_simple() */
/*-------------------------------------------------------------------------
- * Function: H5Screate_simple
+ * Function: H5Screate_simple
*
- * Purpose: Creates a new simple dataspace object and opens it for
- * access. The DIMS argument is the size of the simple dataset
- * and the MAXDIMS argument is the upper limit on the size of
- * the dataset. MAXDIMS may be the null pointer in which case
- * the upper limit is the same as DIMS. If an element of
- * MAXDIMS is H5S_UNLIMITED then the corresponding dimension is
- * unlimited, otherwise no element of MAXDIMS should be smaller
- * than the corresponding element of DIMS.
+ * Purpose: Creates a new simple dataspace object and opens it for
+ * access. The DIMS argument is the size of the simple dataset
+ * and the MAXDIMS argument is the upper limit on the size of
+ * the dataset. MAXDIMS may be the null pointer in which case
+ * the upper limit is the same as DIMS. If an element of
+ * MAXDIMS is H5S_UNLIMITED then the corresponding dimension is
+ * unlimited, otherwise no element of MAXDIMS should be smaller
+ * than the corresponding element of DIMS.
*
- * Return: Success: The ID for the new simple dataspace object.
- *
- * Failure: Negative
+ * Return: Success: The ID for the new simple dataspace object.
*
- * Programmer: Quincey Koziol
- * Tuesday, January 27, 1998
+ * Failure: H5I_INVALID_HID
*
- * Modification:
- * Raymond Lu 03/30/2011
- * We allow 0-dimension for non-unlimited dimension starting
- * from 1.8.7 release.
+ * Programmer: Quincey Koziol
+ * Tuesday, January 27, 1998
*
*-------------------------------------------------------------------------
*/
@@ -1320,72 +1244,65 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/
{
H5S_t *space = NULL;
int i;
- hid_t ret_value;
+ hid_t ret_value = H5I_INVALID_HID;
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE3("i", "Is*[a0]h*[a0]h", rank, dims, maxdims);
/* Check arguments */
if (rank < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimensionality cannot be negative")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality cannot be negative")
if (rank > H5S_MAX_RANK)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimensionality is too large")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "dimensionality is too large")
/* We allow users to use this function to create scalar or null dataspace.
* Check DIMS isn't set when the RANK is 0.
*/
if (!dims && rank != 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dataspace information")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dataspace information")
/* Check whether the current dimensions are valid */
for (i = 0; i < rank; i++) {
if (H5S_UNLIMITED == dims[i])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID,
"current dimension must have a specific size, not H5S_UNLIMITED")
if (maxdims && H5S_UNLIMITED != maxdims[i] && maxdims[i] < dims[i])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "maxdims is smaller than dims")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "maxdims is smaller than dims")
} /* end for */
/* Create the space and set the extent */
if (NULL == (space = H5S_create_simple((unsigned)rank, dims, maxdims)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, H5I_INVALID_HID, "can't create simple dataspace")
/* Atomize */
if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
done:
- if (ret_value < 0) {
+ if (ret_value < 0)
if (space && H5S_close(space) < 0)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace")
- } /* end if */
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release dataspace")
FUNC_LEAVE_API(ret_value)
} /* end H5Screate_simple() */
/*-------------------------------------------------------------------------
- * Function: H5S_create_simple
+ * Function: H5S_create_simple
*
- * Purpose: Internal function to create simple dataspace
+ * Purpose: Internal function to create simple dataspace
*
- * Return: Success: The ID for the new simple dataspace object.
- * Failure: Negative
+ * Return: Success: A pointer to a dataspace object
+ * Failure: NULL
*
- * Errors:
- *
- * Programmer: Quincey Koziol
- * Thursday, April 3, 2003
- *
- * Modifications:
- * Extracted from H5Screate_simple
- * Quincey Koziol, Thursday, April 3, 2003
+ * Programmer: Quincey Koziol
+ * Thursday, April 3, 2003
*
*-------------------------------------------------------------------------
*/
H5S_t *
H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/*rank*/])
{
- H5S_t *ret_value; /* Return value */
+ H5S_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1403,21 +1320,17 @@ done:
} /* end H5S_create_simple() */
/*-------------------------------------------------------------------------
- * Function: H5Sencode
+ * Function: H5Sencode
*
- * Purpose: Given a dataspace ID, converts the object description
+ * Purpose: Given a dataspace ID, converts the object description
* (including selection) into binary in a buffer.
*
- * Return: Success: non-negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Failure: negative
- *
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
+ * Programmer: Raymond Lu
* July 14, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1438,20 +1351,18 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc)
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Sencode() */
/*-------------------------------------------------------------------------
- * Function: H5S_encode
+ * Function: H5S_encode
*
- * Purpose: Private function for H5Sencode. Converts an object
+ * Purpose: Private function for H5Sencode. Converts an object
* description for dataspace and its selection into binary
* in a buffer.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
+ * Programmer: Raymond Lu
* July 14, 2004
*
*-------------------------------------------------------------------------
@@ -1459,11 +1370,11 @@ done:
static herr_t
H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc)
{
- size_t extent_size; /* Size of serialized dataspace extent */
- hssize_t sselect_size; /* Signed size of serialized dataspace selection */
- size_t select_size; /* Size of serialized dataspace selection */
- H5F_t * f = NULL; /* Fake file structure*/
- herr_t ret_value = SUCCEED;
+ H5F_t * f = NULL; /* Fake file structure*/
+ size_t extent_size; /* Size of serialized dataspace extent */
+ hssize_t sselect_size; /* Signed size of serialized dataspace selection */
+ size_t select_size; /* Size of serialized dataspace selection */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1516,17 +1427,16 @@ done:
} /* end H5S_encode() */
/*-------------------------------------------------------------------------
- * Function: H5Sdecode
+ * Function: H5Sdecode
*
- * Purpose: Decode a binary object description of dataspace and
+ * Purpose: Decode a binary object description of dataspace and
* return a new object handle.
*
- * Return: Success: dataspace ID(non-negative)
+ * Return: Success: dataspace ID(non-negative)
*
- * Failure: negative
+ * Failure: H5I_INVALID_HID
*
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
+ * Programmer: Raymond Lu
* July 14, 2004
*
*-------------------------------------------------------------------------
@@ -1537,35 +1447,34 @@ H5Sdecode(const void *buf)
H5S_t *ds;
hid_t ret_value;
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "*x", buf);
if (buf == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "empty buffer")
if ((ds = H5S_decode((const unsigned char *)buf)) == NULL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, FAIL, "can't decode object")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, H5I_INVALID_HID, "can't decode object")
/* Register the type and return the ID */
if ((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Sdecode() */
/*-------------------------------------------------------------------------
- * Function: H5S_decode
+ * Function: H5S_decode
*
- * Purpose: Private function for H5Sdecode. Reconstructs a binary
+ * Purpose: Private function for H5Sdecode. Reconstructs a binary
* description of dataspace and returns a new object handle.
*
- * Return: Success: dataspace ID(non-negative)
+ * Return: Success: Pointer to a dataspace buffer
*
- * Failure: negative
+ * Failure: NULL
*
- * Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
+ * Programmer: Raymond Lu
* July 14, 2004
*
*-------------------------------------------------------------------------
@@ -1573,12 +1482,12 @@ done:
static H5S_t *
H5S_decode(const unsigned char *buf)
{
- H5S_t * ds;
- H5S_extent_t *extent;
- size_t extent_size; /* size of the extent message*/
- H5F_t * f = NULL; /* Fake file structure*/
- uint8_t sizeof_size; /* 'Size of sizes' for file */
- H5S_t * ret_value;
+ H5F_t * f = NULL; /* Fake file structure*/
+ H5S_t * ds; /* Decoded dataspace */
+ H5S_extent_t * extent; /* Entent of decoded dataspace */
+ size_t extent_size; /* size of the extent message*/
+ uint8_t sizeof_size; /* 'Size of sizes' for file */
+ H5S_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1637,31 +1546,27 @@ done:
} /* end H5S_decode() */
/*-------------------------------------------------------------------------
- * Function: H5S_get_simple_extent_type
- *
- * Purpose: Internal function for retrieving the type of extent for a dataspace object
+ * Function: H5S_get_simple_extent_type
*
- * Return: Success: The class of the dataspace object
+ * Purpose: Internal function for retrieving the type of extent for a dataspace object
*
- * Failure: N5S_NO_CLASS
+ * Return: Success: The class of the dataspace object
*
- * Errors:
+ * Failure: N5S_NO_CLASS
*
- * Programmer: Quincey Koziol
- * Thursday, September 28, 2000
+ * Programmer: Quincey Koziol
+ * Thursday, September 28, 2000
*
* Note: This routine participates in the "Inlining C function pointers"
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5S_class_t
H5S_get_simple_extent_type(const H5S_t *space)
{
- H5S_class_t ret_value;
+ H5S_class_t ret_value = H5S_NO_CLASS; /* Return value */
FUNC_ENTER_NOAPI(H5S_NO_CLASS)
@@ -1671,23 +1576,19 @@ H5S_get_simple_extent_type(const H5S_t *space)
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5S_get_simple_extent_type() */
/*-------------------------------------------------------------------------
- * Function: H5Sget_simple_extent_type
- *
- * Purpose: Retrieves the type of extent for a dataspace object
- *
- * Return: Success: The class of the dataspace object
+ * Function: H5Sget_simple_extent_type
*
- * Failure: N5S_NO_CLASS
+ * Purpose: Retrieves the type of extent for a dataspace object
*
- * Errors:
+ * Return: Success: The class of the dataspace object
*
- * Programmer: Quincey Koziol
- * Thursday, July 23, 1998
+ * Failure: N5S_NO_CLASS
*
- * Modifications:
+ * Programmer: Quincey Koziol
+ * Thursday, July 23, 1998
*
*-------------------------------------------------------------------------
*/
@@ -1695,7 +1596,7 @@ H5S_class_t
H5Sget_simple_extent_type(hid_t sid)
{
H5S_t * space;
- H5S_class_t ret_value;
+ H5S_class_t ret_value; /* Return value */
FUNC_ENTER_API(H5S_NO_CLASS)
H5TRACE1("Sc", "i", sid);
@@ -1708,7 +1609,7 @@ H5Sget_simple_extent_type(hid_t sid)
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Sget_simple_extent_type() */
/*--------------------------------------------------------------------------
NAME
@@ -1717,17 +1618,17 @@ done:
Resets the extent of a dataspace back to "none"
USAGE
herr_t H5Sset_extent_none(space_id)
- hid_t space_id; IN: Dataspace object to reset
+ hid_t space_id; IN: Dataspace object to reset
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
- This function resets the type of a dataspace back to "none" with no
+ This function resets the type of a dataspace to H5S_NULL with no
extent information stored for the dataspace.
--------------------------------------------------------------------------*/
herr_t
H5Sset_extent_none(hid_t space_id)
{
- H5S_t *space; /* dataspace to modify */
+ H5S_t *space; /* Dataspace to modify */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1792,12 +1693,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5S_set_extent
*
- * Purpose: Modify the dimensions of a dataspace. Based on H5S_extend
+ * Purpose: Modify the dimensions of a dataspace.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: TRUE/FALSE/FAIL
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* March 13, 2002
*
*-------------------------------------------------------------------------
@@ -1815,7 +1715,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size)
HDassert(size);
/* Verify that the dimensions being changed are allowed to change */
- for (u = 0; u < space->extent.rank; u++) {
+ for (u = 0; u < space->extent.rank; u++)
if (space->extent.size[u] != size[u]) {
/* Check for invalid dimension size modification */
if (space->extent.max && H5S_UNLIMITED != space->extent.max[u] && space->extent.max[u] < size[u])
@@ -1826,7 +1726,6 @@ H5S_set_extent(H5S_t *space, const hsize_t *size)
/* Indicate that dimension size can be modified */
ret_value = TRUE;
} /* end if */
- } /* end for */
/* Update dimension size(s) */
if (ret_value)
@@ -1855,7 +1754,7 @@ done:
hbool_t
H5S_has_extent(const H5S_t *ds)
{
- hbool_t ret_value;
+ hbool_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1872,12 +1771,12 @@ H5S_has_extent(const H5S_t *ds)
/*-------------------------------------------------------------------------
* Function: H5S_set_extent_real
*
- * Purpose: Modify the dimensions of a dataspace. Based on H5S_extend
+ * Purpose: Modify the dimensions of a dataspace.
*
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* March 13, 2002
*
*-------------------------------------------------------------------------
@@ -1916,23 +1815,24 @@ done:
} /* end H5S_set_extent_real() */
/*-------------------------------------------------------------------------
- * Function: H5Sextent_equal
+ * Function: H5Sextent_equal
*
- * Purpose: Determines if two dataspace extents are equal.
+ * Purpose: Determines if two dataspace extents are equal.
*
- * Return: Success: TRUE if equal, FALSE if unequal
+ * Return: Success: TRUE if equal, FALSE if unequal
*
- * Failure: Negative
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Monday, October 24, 2005
+ * Programmer: Quincey Koziol
+ * Monday, October 24, 2005
*
*-------------------------------------------------------------------------
*/
htri_t
H5Sextent_equal(hid_t space1_id, hid_t space2_id)
{
- const H5S_t *ds1, *ds2; /* Dataspaces to compare */
+ const H5S_t *ds1; /* Dataspaces to compare */
+ const H5S_t *ds2;
htri_t ret_value;
FUNC_ENTER_API(FAIL)
@@ -1958,11 +1858,11 @@ done:
Check if two dataspaces have equal extents
USAGE
htri_t H5S_extent_equal(ds1, ds2)
- H5S_t *ds1, *ds2; IN: Dataspace objects to compare
+ H5S_t *ds1, *ds2; IN: Dataspace objects to compare
RETURNS
TRUE if equal, FALSE if unequal on succeess/Negative on failure
DESCRIPTION
- Compare two dataspaces if their extents are identical.
+ Compare two dataspaces if their extents are identical.
--------------------------------------------------------------------------*/
htri_t
H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2)
@@ -2011,15 +1911,15 @@ done:
} /* end H5S_extent_equal() */
/*-------------------------------------------------------------------------
- * Function: H5S_extent_nelem
+ * Function: H5S_extent_nelem
*
- * Purpose: Determines how many elements a dataset extent describes.
+ * Purpose: Determines how many elements a dataset extent describes.
*
- * Return: Success: Number of data points in the dataset extent.
- * Failure: negative
+ * Return: Success: Number of data points in the dataset extent.
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
- * Thursday, November 30, 2006
+ * Programmer: Quincey Koziol
+ * Thursday, November 30, 2006
*
*-------------------------------------------------------------------------
*/
@@ -2040,7 +1940,7 @@ H5S_extent_nelem(const H5S_extent_t *ext)
*
* Purpose: Set the encoding for a dataspace to the latest version.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Tuesday, July 24, 2007
diff --git a/src/H5SL.c b/src/H5SL.c
index 7f02ef6..2828e0d 100644
--- a/src/H5SL.c
+++ b/src/H5SL.c
@@ -64,8 +64,8 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5SLprivate.h" /* Skip list routines */
#include "H5MMprivate.h" /* Memory management */
+#include "H5SLprivate.h" /* Skip list routines */
/* Local Macros */
@@ -640,7 +640,7 @@ H5SL_init_interface(void)
static H5SL_node_t *
H5SL_new_node(void *item, const void *key, uint32_t hashval)
{
- H5SL_node_t *ret_value; /* New skip list node */
+ H5SL_node_t *ret_value = NULL; /* New skip list node */
FUNC_ENTER_NOAPI_NOINIT
@@ -926,7 +926,7 @@ H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp)
{
H5SL_t * new_slist = NULL; /* Pointer to new skip list object created */
H5SL_node_t *header; /* Pointer to skip list header node */
- H5SL_t * ret_value; /* Return value */
+ H5SL_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1082,7 +1082,7 @@ done:
H5SL_node_t *
H5SL_add(H5SL_t *slist, void *item, const void *key)
{
- H5SL_node_t *ret_value; /* Return value */
+ H5SL_node_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1408,9 +1408,9 @@ done:
void *
H5SL_less(H5SL_t *slist, const void *key)
{
- H5SL_node_t *x; /* Current node to examine */
- uint32_t hashval = 0; /* Hash value for key */
- void * ret_value; /* Return value */
+ H5SL_node_t *x; /* Current node to examine */
+ uint32_t hashval = 0; /* Hash value for key */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1516,9 +1516,9 @@ done:
void *
H5SL_greater(H5SL_t *slist, const void *key)
{
- H5SL_node_t *x; /* Current node to examine */
- uint32_t hashval = 0; /* Hash value for key */
- void * ret_value; /* Return value */
+ H5SL_node_t *x; /* Current node to examine */
+ uint32_t hashval = 0; /* Hash value for key */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1706,9 +1706,9 @@ done:
H5SL_node_t *
H5SL_below(H5SL_t *slist, const void *key)
{
- H5SL_node_t *x; /* Current node to examine */
- uint32_t hashval = 0; /* Hash value for key */
- H5SL_node_t *ret_value; /* Return value */
+ H5SL_node_t *x; /* Current node to examine */
+ uint32_t hashval = 0; /* Hash value for key */
+ H5SL_node_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1811,9 +1811,9 @@ done:
H5SL_node_t *
H5SL_above(H5SL_t *slist, const void *key)
{
- H5SL_node_t *x; /* Current node to examine */
- uint32_t hashval = 0; /* Hash value for key */
- H5SL_node_t *ret_value; /* Return value */
+ H5SL_node_t *x; /* Current node to examine */
+ uint32_t hashval = 0; /* Hash value for key */
+ H5SL_node_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
diff --git a/src/H5SM.c b/src/H5SM.c
index 35fe355..19075e2 100644
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -855,7 +855,7 @@ done:
static htri_t
H5SM_can_share_common(const H5F_t *f, unsigned type_id, const void *mesg)
{
- htri_t ret_value; /* Return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -1651,7 +1651,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -2241,10 +2240,6 @@ done:
* Programmer: James Laird
* Wednesday, February 21, 2006
*
- * Modifications:
- * Vailin Choi; September 2011
- * Change "oh_modified" from boolean to unsigned
- * (See H5Oprivate.h for possible flags)
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c
index 473f62d..7576aa8 100644
--- a/src/H5SMbtree2.c
+++ b/src/H5SMbtree2.c
@@ -89,9 +89,9 @@ H5FL_DEFINE_STATIC(H5SM_bt2_ctx_t);
static void *
H5SM_bt2_crt_context(void *_f)
{
- H5F_t * f = (H5F_t *)_f; /* User data for building callback context */
- H5SM_bt2_ctx_t *ctx; /* Callback context structure */
- void * ret_value; /* Return value */
+ H5F_t * f = (H5F_t *)_f; /* User data for building callback context */
+ H5SM_bt2_ctx_t *ctx; /* Callback context structure */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 3197e36..d685154 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -11,6 +11,17 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/*-------------------------------------------------------------------------
+ *
+ * Created: H5SMcache.c
+ * Nov 13 2006
+ * James Laird <jlaird@hdfgroup.org>
+ *
+ * Purpose: Implement shared message metadata cache methods.
+ *
+ *-------------------------------------------------------------------------
+ */
+
/****************/
/* Module Setup */
/****************/
@@ -62,6 +73,7 @@ static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t H5_ATTR_UNUSED *l
/*********************/
/* Package Variables */
/*********************/
+
/* H5SM inherits cache-like properties from H5AC */
const H5AC_class_t H5AC_SOHM_TABLE[1] = {{
H5AC_SOHM_TABLE_ID,
diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c
index b143c6a..872c444 100644
--- a/src/H5SMmessage.c
+++ b/src/H5SMmessage.c
@@ -109,10 +109,6 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata)
* Programmer: James Laird
* Wednesday, February 7, 2007
*
- * Modifications:
- * Vailin Choi; September 2011
- * Change "oh_modified" from boolean to unsigned
- * (See H5Oprivate.h for possible flags)
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h
index a0aa3e7..ec68525 100644
--- a/src/H5SMpkg.h
+++ b/src/H5SMpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: James Laird <jlaird@ncsa.uiuc.edu>
+ * Programmer: James Laird
* Thursday, March 30, 2006
*
* Purpose: This file contains declarations which are visible only within
@@ -93,7 +93,7 @@
#define H5SM_B2_SPLIT_PERCENT 100
#define H5SM_B2_MERGE_PERCENT 40
-#define H5SM_LIST_VERSION 0 /* Verion of Shared Object Header Message List Indexes */
+#define H5SM_LIST_VERSION 0 /* Version of Shared Object Header Message List Indexes */
/****************************/
/* Package Typedefs */
diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h
index 8f694b6..708ca7c 100644
--- a/src/H5SMprivate.h
+++ b/src/H5SMprivate.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: James Laird <jlaird@ncsa.uiuc.edu>
+ * Programmer: James Laird
* Thursday, March 2, 2006
*
* Purpose: This file contains private declarations for the H5SM
diff --git a/src/H5ST.c b/src/H5ST.c
index 1823da6..bca9a8e 100644
--- a/src/H5ST.c
+++ b/src/H5ST.c
@@ -725,19 +725,19 @@ H5ST_dump_internal(H5ST_ptr_t p)
FUNC_ENTER_NOAPI_NOINIT_NOERR
if (p) {
- printf("p=%p\n", p);
- printf("\tp->up=%p\n", p->up);
- printf("\tp->parent=%p\n", p->parent);
- printf("\tp->lokid=%p\n", p->lokid);
- printf("\tp->hikid=%p\n", p->hikid);
- printf("\tp->eqkid=%p\n", p->eqkid);
- printf("\tp->splitchar=%c\n", p->splitchar);
+ HDprintf("p=%p\n", (void *)p);
+ HDprintf("\tp->up=%p\n", (void *)p->up);
+ HDprintf("\tp->parent=%p\n", (void *)p->parent);
+ HDprintf("\tp->lokid=%p\n", (void *)p->lokid);
+ HDprintf("\tp->hikid=%p\n", (void *)p->hikid);
+ HDprintf("\tp->eqkid=%p\n", (void *)p->eqkid);
+ HDprintf("\tp->splitchar=%c\n", p->splitchar);
H5ST_dump_internal(p->lokid);
if (p->splitchar)
H5ST_dump_internal(p->eqkid);
else
- printf("%s\n", (char *)p->eqkid);
+ HDprintf("%s\n", (char *)p->eqkid);
H5ST_dump_internal(p->hikid);
} /* end if */
diff --git a/src/H5Sall.c b/src/H5Sall.c
index d071a88..f34520d 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Purpose: "All" selection data space I/O functions.
+ * Purpose: "All" selection dataspace I/O functions.
*/
#define H5S_PACKAGE /*suppress error about including H5Spkg */
@@ -98,13 +98,11 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{
*
* Purpose: Initializes iteration information for "all" selection.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -135,13 +133,11 @@ H5S_all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
* Purpose: Retrieve the current coordinates of iterator for current
* selection
*
- * Return: non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
* Tuesday, April 22, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -169,13 +165,11 @@ done:
* Purpose: Retrieve the current block of iterator for current
* selection
*
- * Return: non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
* Monday, June 2, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -208,13 +202,11 @@ H5S_all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
*
* Purpose: Return number of elements left to process in iterator
*
- * Return: non-negative number of elements on success, zero on failure
+ * Return: Non-negative number of elements on success, zero on failure
*
* Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hsize_t
@@ -423,7 +415,7 @@ H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED
TRUE if the selection fits within the extent, FALSE if it does not and
Negative on an error.
DESCRIPTION
- Determines if the current selection at the current offet fits within the
+ Determines if the current selection at the current offset fits within the
extent for the dataspace. Offset is irrelevant for this type of selection.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
@@ -787,7 +779,7 @@ H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
* Purpose: Projects an 'all' selection onto/into a simple dataspace
* of a different rank
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
* Sunday, July 18, 2010
@@ -885,7 +877,7 @@ H5Sselect_all(hid_t spaceid)
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Call internal routine to do the work */
if (H5S_select_all(space, TRUE) < 0)
diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c
index 25badbb..cea0e5a 100644
--- a/src/H5Sdbg.c
+++ b/src/H5Sdbg.c
@@ -13,11 +13,12 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Sdbg.c
- * Jul 24 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Sdbg.c
+ * Quincey Koziol
+ * Jul 24 2007
*
- * Purpose: Dump debugging information about a dataspace
+ *
+ * Purpose: Dump debugging information about a dataspace
*
*-------------------------------------------------------------------------
*/
@@ -31,9 +32,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Spkg.h" /* Dataspaces */
/****************/
/* Local Macros */
@@ -51,26 +52,26 @@
/* Local Prototypes */
/********************/
-/*********************/
-/* Package Variables */
-/*********************/
-
/*****************************/
/* Library Private Variables */
/*****************************/
+/*********************/
+/* Package Variables */
+/*********************/
+
/*******************/
/* Local Variables */
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5S_debug
+ * Function: H5S_debug
*
- * Purpose: Prints debugging information about a data space.
+ * Purpose: Prints debugging information about a dataspace.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, July 21, 1998
*
*-------------------------------------------------------------------------
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index da2a380..203b14f 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, June 18, 1998
*
- * Purpose: Hyperslab selection data space I/O functions.
+ * Purpose: Hyperslab selection dataspace I/O functions.
*/
#define H5S_PACKAGE /*suppress error about including H5Spkg */
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index bef70d6..40a63ce 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -16,8 +16,6 @@
*
* Purpose: Functions to read/write directly between app buffer and file.
*
- * Beware of the ifdef'ed print statements.
- * I didn't make them portable.
*/
#define H5S_PACKAGE /*suppress error about including H5Spkg */
@@ -60,7 +58,7 @@ static herr_t H5S_obtain_datatype(const hsize_t down[], H5S_hyper_span_t *span,
*
* Purpose: Translate an HDF5 "all" selection into an MPI type.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
* *count how many objects of the new_type in selection
@@ -106,7 +104,7 @@ done:
*
* Purpose: Translate an HDF5 "none" selection into an MPI type.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
* *count how many objects of the new_type in selection
@@ -135,7 +133,7 @@ H5S_mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type)
*
* Purpose: Create a derived datatype for point selections.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
*
@@ -192,7 +190,7 @@ done:
* Purpose: Translate an HDF5 "point" selection into an MPI type.
* Create a permutation array to handle out-of-order point selections.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
* *count how many objects of the new_type in selection
@@ -328,7 +326,7 @@ done:
* Note: This routine is called from H5S_mpio_space_type(), which is
* called first for the file dataspace and creates
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
* *count how many objects of the new_type in selection
@@ -457,9 +455,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5S_mpio_hyper_type
*
- * Purpose: Translate an HDF5 hyperslab selection into an MPI type.
+ * Purpose: Translate a regular HDF5 hyperslab selection into an MPI type.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
* *count how many objects of the new_type in selection
@@ -512,7 +510,7 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
diminfo = sel_iter.u.hyp.diminfo;
HDassert(diminfo);
- /* make a local copy of the dimension info so we can operate with them */
+ /* Make a local copy of the dimension info so we can operate with them */
/* Check if this is a "flattened" regular hyperslab selection */
if (sel_iter.u.hyp.iter_rank != 0 && sel_iter.u.hyp.iter_rank < space->extent.rank) {
@@ -530,6 +528,7 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
d[u].block = diminfo[u].block;
d[u].count = diminfo[u].count;
d[u].xtent = sel_iter.u.hyp.size[u];
+
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", FUNC,
@@ -565,6 +564,7 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
d[u].block = diminfo[u].block;
d[u].count = diminfo[u].count;
d[u].xtent = space->extent.size[u];
+
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", FUNC,
@@ -608,7 +608,8 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
/* Create a type covering the selected hyperslab.
* Multidimensional dataspaces are stored in row-major order.
* The type is built from the inside out, going from the
- * fastest-changing (i.e., inner) dimension * to the slowest (outer). */
+ * fastest-changing (i.e., inner) dimension * to the slowest (outer).
+ */
/*******************************************************
* Construct contig type for inner contig dims:
@@ -641,7 +642,7 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
HDfprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", FUNC, i);
#endif
/****************************************
- * Build vector type of the selection.
+ * Build vector type of the selection.
****************************************/
mpi_code = MPI_Type_vector((int)(d[i].count), /* count */
(int)(d[i].block), /* blocklength */
@@ -686,10 +687,9 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
else
inner_type = outer_type;
} /* end for */
- /***************************
- * End of loop, walking
- * thru dimensions.
- ***************************/
+ /******************************************
+ * End of loop, walking through dimensions.
+ *******************************************/
/* At this point inner_type is actually the outermost type, even for 0-trip loop */
*new_type = inner_type;
@@ -726,7 +726,7 @@ done:
* Purpose: Translate an HDF5 irregular hyperslab selection into an
MPI type.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
* *count how many objects of the new_type in selection
@@ -792,7 +792,7 @@ done:
* Purpose: Obtain an MPI derived datatype based on span-tree
* implementation
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *span_type the MPI type corresponding to the selection
*
@@ -804,8 +804,8 @@ static herr_t
H5S_obtain_datatype(const hsize_t *down, H5S_hyper_span_t *span, const MPI_Datatype *elmt_type,
MPI_Datatype *span_type, size_t elmt_size)
{
- size_t alloc_count; /* Number of span tree nodes allocated at this level */
- size_t outercount; /* Number of span tree nodes at this level */
+ size_t alloc_count = 0; /* Number of span tree nodes allocated at this level */
+ size_t outercount = 0; /* Number of span tree nodes at this level */
MPI_Datatype * inner_type = NULL;
hbool_t inner_types_freed = FALSE; /* Whether the inner_type MPI datatypes have been freed */
hbool_t span_type_valid = FALSE; /* Whether the span_type MPI datatypes is valid */
@@ -974,7 +974,7 @@ done:
* Purpose: Translate an HDF5 dataspace selection into an MPI type.
* Currently handle only hyperslab and "all" selections.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Outputs: *new_type the MPI type corresponding to the selection
* *count how many objects of the new_type in selection
@@ -1087,4 +1087,5 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_mpio_space_type() */
+
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Snone.c b/src/H5Snone.c
index 354a9e3..31cf8c5 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, November 10, 1998
*
- * Purpose: "None" selection data space I/O functions.
+ * Purpose: "None" selection dataspace I/O functions.
*/
#define H5S_PACKAGE /*suppress error about including H5Spkg */
@@ -95,17 +95,15 @@ static const H5S_sel_iter_class_t H5S_sel_iter_none[1] = {{
}};
/*-------------------------------------------------------------------------
- * Function: H5S_none_iter_init
+ * Function: H5S_none_iter_init
*
- * Purpose: Initializes iteration information for "none" selection.
+ * Purpose: Initializes iteration information for "none" selection.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -124,18 +122,16 @@ H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t H5_ATTR_UNUSED *space)
} /* H5S_none_iter_init() */
/*-------------------------------------------------------------------------
- * Function: H5S_none_iter_coords
+ * Function: H5S_none_iter_coords
*
- * Purpose: Retrieve the current coordinates of iterator for current
+ * Purpose: Retrieve the current coordinates of iterator for current
* selection
*
- * Return: non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 22, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -151,18 +147,16 @@ H5S_none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_
} /* H5S_none_iter_coords() */
/*-------------------------------------------------------------------------
- * Function: H5S_none_iter_block
+ * Function: H5S_none_iter_block
*
- * Purpose: Retrieve the current block of iterator for current
+ * Purpose: Retrieve the current block of iterator for current
* selection
*
- * Return: non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 2, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -180,17 +174,15 @@ H5S_none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_U
} /* H5S_none_iter_block() */
/*-------------------------------------------------------------------------
- * Function: H5S_none_iter_nelmts
+ * Function: H5S_none_iter_nelmts
*
- * Purpose: Return number of elements left to process in iterator
+ * Purpose: Return number of elements left to process in iterator
*
- * Return: non-negative number of elements on success, zero on failure
+ * Return: Non-negative number of elements on success, zero on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hsize_t
@@ -392,7 +384,7 @@ H5S_none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSE
TRUE if the selection fits within the extent, FALSE if it does not and
Negative on an error.
DESCRIPTION
- Determines if the current selection at the current offet fits within the
+ Determines if the current selection at the current offset fits within the
extent for the dataspace. Offset is irrelevant for this type of selection.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
@@ -708,11 +700,11 @@ H5S_none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *off
} /* H5S_none_adjust_u() */
/*-------------------------------------------------------------------------
- * Function: H5S_none_project_scalar
+ * Function: H5S_none_project_scalar
*
- * Purpose: Projects a 'none' selection into a scalar dataspace
+ * Purpose: Projects a 'none' selection into a scalar dataspace
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
* Sunday, July 18, 2010
@@ -732,14 +724,14 @@ H5S_none_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSE
} /* H5S_none_project_scalar() */
/*-------------------------------------------------------------------------
- * Function: H5S_none_project_simple
+ * Function: H5S_none_project_simple
*
- * Purpose: Projects an 'none' selection onto/into a simple dataspace
+ * Purpose: Projects an 'none' selection onto/into a simple dataspace
* of a different rank
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Sunday, July 18, 2010
*
*-------------------------------------------------------------------------
@@ -833,7 +825,7 @@ H5Sselect_none(hid_t spaceid)
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Change to "none" selection */
if (H5S_select_none(space) < 0)
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index c5785f5..ab5238b 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, September 28, 2000
*
* Purpose: This file contains declarations which are visible only within
@@ -26,6 +26,7 @@
#ifndef _H5Spkg_H
#define _H5Spkg_H
+/* Get package's private header */
#include "H5Sprivate.h"
/* Flags to indicate special dataspace features are active */
@@ -38,7 +39,7 @@
/* Version for point selection info */
#define H5S_POINT_VERSION_1 1
-#define H5S_POINT_VERSION_LATEST H5S_HYPER_VERSION_1
+#define H5S_POINT_VERSION_LATEST H5S_POINT_VERSION_1
/* Versions for H5S_SEL_NONE selection info */
#define H5S_NONE_VERSION_1 1
@@ -84,6 +85,7 @@ struct H5S_extent_t {
/*
* Dataspace selection information
*/
+
/* Node in point selection list (typedef'd in H5Sprivate.h) */
struct H5S_pnt_node_t {
hsize_t * pnt; /* Pointer to a selected point */
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index 8364bde..96e5940 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Purpose: Point selection data space I/O functions.
+ * Purpose: Point selection dataspace I/O functions.
*/
#define H5S_PACKAGE /*suppress error about including H5Spkg */
@@ -103,17 +103,15 @@ H5FL_DEFINE_STATIC(H5S_pnt_node_t);
H5FL_DEFINE_STATIC(H5S_pnt_list_t);
/*-------------------------------------------------------------------------
- * Function: H5S_point_iter_init
+ * Function: H5S_point_iter_init
*
- * Purpose: Initializes iteration information for point selection.
+ * Purpose: Initializes iteration information for point selection.
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -138,18 +136,16 @@ H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
} /* H5S_point_iter_init() */
/*-------------------------------------------------------------------------
- * Function: H5S_point_iter_coords
+ * Function: H5S_point_iter_coords
*
- * Purpose: Retrieve the current coordinates of iterator for current
+ * Purpose: Retrieve the current coordinates of iterator for current
* selection
*
- * Return: non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 22, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -168,18 +164,16 @@ H5S_point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords)
} /* H5S_point_iter_coords() */
/*-------------------------------------------------------------------------
- * Function: H5S_point_iter_block
+ * Function: H5S_point_iter_block
*
- * Purpose: Retrieve the current block of iterator for current
+ * Purpose: Retrieve the current block of iterator for current
* selection
*
- * Return: non-negative on success, negative on failure
+ * Return: Non-negative on success, negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 2, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -200,17 +194,15 @@ H5S_point_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
} /* H5S_point_iter_block() */
/*-------------------------------------------------------------------------
- * Function: H5S_point_iter_nelmts
+ * Function: H5S_point_iter_nelmts
*
- * Purpose: Return number of elements left to process in iterator
+ * Purpose: Return number of elements left to process in iterator
*
- * Return: non-negative number of elements on success, zero on failure
+ * Return: Non-negative number of elements on success, zero on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hsize_t
@@ -535,7 +527,7 @@ H5S_point_release(H5S_t *space)
herr_t
H5S_select_elements(H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize_t *coord)
{
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -657,7 +649,7 @@ done:
TRUE if the selection fits within the extent, FALSE if it does not and
Negative on an error.
DESCRIPTION
- Determines if the current selection at the current offet fits within the
+ Determines if the current selection at the current offset fits within the
extent for the dataspace.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
@@ -722,7 +714,7 @@ H5Sget_select_elem_npoints(hid_t spaceid)
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if (H5S_GET_SELECT_TYPE(space) != H5S_SEL_POINTS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an element selection")
@@ -1037,7 +1029,7 @@ H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoint
if (NULL == buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer")
if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if (H5S_GET_SELECT_TYPE(space) != H5S_SEL_POINTS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a point selection")
@@ -1203,7 +1195,7 @@ done:
static htri_t
H5S_point_is_contiguous(const H5S_t *space)
{
- htri_t ret_value; /* return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1240,7 +1232,7 @@ H5S_point_is_contiguous(const H5S_t *space)
static htri_t
H5S_point_is_single(const H5S_t *space)
{
- htri_t ret_value; /* return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1347,14 +1339,14 @@ H5S_point_adjust_u(H5S_t *space, const hsize_t *offset)
} /* H5S_point_adjust_u() */
/*-------------------------------------------------------------------------
- * Function: H5S_point_project_scalar
+ * Function: H5S_point_project_scalar
*
- * Purpose: Projects a single element point selection into a scalar
+ * Purpose: Projects a single element point selection into a scalar
* dataspace
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Sunday, July 18, 2010
*
*-------------------------------------------------------------------------
@@ -1387,14 +1379,14 @@ done:
} /* H5S_point_project_scalar() */
/*-------------------------------------------------------------------------
- * Function: H5S_point_project_simple
+ * Function: H5S_point_project_simple
*
- * Purpose: Projects a point selection onto/into a simple dataspace
+ * Purpose: Projects a point selection onto/into a simple dataspace
* of a different rank
*
- * Return: non-negative on success, negative on failure.
+ * Return: Non-negative on success, negative on failure.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Sunday, July 18, 2010
*
*-------------------------------------------------------------------------
diff --git a/src/H5Spublic.h b/src/H5Spublic.h
index 105202d..6eeb886 100644
--- a/src/H5Spublic.h
+++ b/src/H5Spublic.h
@@ -32,8 +32,8 @@
typedef enum H5S_class_t {
H5S_NO_CLASS = -1, /*error */
H5S_SCALAR = 0, /*scalar variable */
- H5S_SIMPLE = 1, /*simple data space */
- H5S_NULL = 2 /*null data space */
+ H5S_SIMPLE = 1, /*simple dataspace */
+ H5S_NULL = 2 /*null dataspace */
} H5S_class_t;
/* Different ways of combining selections */
@@ -79,8 +79,8 @@ typedef enum H5S_seloper_t {
typedef enum {
H5S_SEL_ERROR = -1, /* Error */
H5S_SEL_NONE = 0, /* Nothing selected */
- H5S_SEL_POINTS = 1, /* Sequence of points selected */
- H5S_SEL_HYPERSLABS = 2, /* "New-style" hyperslab selection defined */
+ H5S_SEL_POINTS = 1, /* Points / elements selected */
+ H5S_SEL_HYPERSLABS = 2, /* Hyperslab selected */
H5S_SEL_ALL = 3, /* Entire extent selected */
H5S_SEL_N /*THIS MUST BE LAST */
} H5S_sel_type;
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index d13fce9..4fc116b 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -11,22 +11,22 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.ued>
+/* Programmer: Quincey Koziol
* Friday, May 29, 1998
*
- * Purpose: Dataspace selection functions.
+ * Purpose: Dataspace selection functions.
*/
-#define H5S_PACKAGE /*suppress error about including H5Spkg */
+#define H5S_PACKAGE /*suppress error about including H5Spkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
+#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Spkg.h" /* Dataspaces */
-#include "H5VMprivate.h" /* Vector and array functions */
+#include "H5Spkg.h" /* Dataspaces */
+#include "H5VMprivate.h" /* Vector and array functions */
#include "H5WBprivate.h" /* Wrapped Buffers */
/* Local functions */
@@ -43,7 +43,7 @@ static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter);
Set the selection offset for a datapace
USAGE
herr_t H5S_select_offset(space, offset)
- H5S_t *space; IN/OUT: Dataspace object to set selection offset
+ H5S_t *space; IN/OUT: Dataspace object to set selection offset
const hssize_t *offset; IN: Offset to position the selection at
RETURNS
Non-negative on success/Negative on failure
@@ -101,7 +101,7 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset)
herr_t
H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -121,21 +121,19 @@ done:
} /* H5S_select_copy() */
/*-------------------------------------------------------------------------
- * Function: H5S_select_release
+ * Function: H5S_select_release
*
- * Purpose: Releases all memory associated with a dataspace selection.
+ * Purpose: Releases all memory associated with a dataspace selection.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Friday, May 30, 2003
+ * Programmer: Quincey Koziol
+ * Friday, May 30, 2003
*
* Note: This routine participates in the "Inlining C function pointers"
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -154,15 +152,15 @@ H5S_select_release(H5S_t *ds)
} /* end H5S_select_release() */
/*-------------------------------------------------------------------------
- * Function: H5S_select_get_seq_list
+ * Function: H5S_select_get_seq_list
*
- * Purpose: Retrieves the next sequence of offset/length pairs for an
+ * Purpose: Retrieves the next sequence of offset/length pairs for an
* iterator on a dataspace
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, May 18, 2004
+ * Programmer: Quincey Koziol
+ * Tuesday, May 18, 2004
*
* Note: This routine participates in the "Inlining C function pointers"
* pattern, don't call it directly, use the appropriate macro
@@ -190,28 +188,26 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter
} /* end H5S_select_get_seq_list() */
/*-------------------------------------------------------------------------
- * Function: H5S_select_serial_size
+ * Function: H5S_select_serial_size
*
- * Purpose: Determines the number of bytes required to store the current
+ * Purpose: Determines the number of bytes required to store the current
* selection
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Tuesday, May 18, 2004
+ * Programmer: Quincey Koziol
+ * Tuesday, May 18, 2004
*
* Note: This routine participates in the "Inlining C function pointers"
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hssize_t
H5S_select_serial_size(const H5S_t *space)
{
- hssize_t ret_value; /* Return value */
+ hssize_t ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -341,14 +337,12 @@ H5S_get_select_npoints(const H5S_t *space)
TRUE if the selection fits within the extent, FALSE if it does not and
Negative on an error.
DESCRIPTION
- Determines if the current selection at the current offet fits within the
+ Determines if the current selection at the current offset fits within the
extent for the dataspace.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
- Christian Chilan 01/17/2007
- Changed the error return value from 0 to FAIL.
--------------------------------------------------------------------------*/
htri_t
H5Sselect_valid(hid_t spaceid)
@@ -382,7 +376,7 @@ done:
TRUE if the selection fits within the extent, FALSE if it does not and
Negative on an error.
DESCRIPTION
- Determines if the current selection at the current offet fits within the
+ Determines if the current selection at the current offset fits within the
extent for the dataspace.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
@@ -395,7 +389,7 @@ done:
htri_t
H5S_select_valid(const H5S_t *space)
{
- htri_t ret_value; /* Return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -461,6 +455,7 @@ H5S_select_deserialize(H5S_t *space, const uint8_t *buf)
default:
break;
}
+
if (ret_value < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTLOAD, FAIL, "can't deserialize selection")
@@ -549,7 +544,7 @@ done:
herr_t
H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -589,7 +584,7 @@ H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
herr_t
H5S_get_select_offset(const H5S_t *space, hsize_t *offset)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -626,7 +621,7 @@ H5S_get_select_offset(const H5S_t *space, hsize_t *offset)
htri_t
H5S_select_is_contiguous(const H5S_t *space)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -662,7 +657,7 @@ H5S_select_is_contiguous(const H5S_t *space)
htri_t
H5S_select_is_single(const H5S_t *space)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -698,7 +693,7 @@ H5S_select_is_single(const H5S_t *space)
htri_t
H5S_select_is_regular(const H5S_t *space)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -734,13 +729,14 @@ H5S_select_is_regular(const H5S_t *space)
herr_t
H5S_select_adjust_u(H5S_t *space, const hsize_t *offset)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
HDassert(space);
+ /* Perform operation */
ret_value = (*space->select.type->adjust_u)(space, offset);
FUNC_LEAVE_NOAPI(ret_value)
@@ -771,7 +767,7 @@ H5S_select_adjust_u(H5S_t *space, const hsize_t *offset)
herr_t
H5S_select_project_scalar(const H5S_t *space, hsize_t *offset)
{
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -810,7 +806,7 @@ H5S_select_project_scalar(const H5S_t *space, hsize_t *offset)
herr_t
H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset)
{
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -844,7 +840,7 @@ H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset)
herr_t
H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_size)
{
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -898,7 +894,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s
herr_t
H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -979,7 +975,7 @@ H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
hsize_t
H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter)
{
- hsize_t ret_value; /* return value */
+ hsize_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1057,7 +1053,7 @@ H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter)
herr_t
H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1139,7 +1135,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter)
herr_t
H5S_select_iter_release(H5S_sel_iter_t *sel_iter)
{
- herr_t ret_value; /* return value */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1274,10 +1270,12 @@ H5S_select_iterate(void *buf, const H5T_t *type, const H5S_t *space, const H5S_s
/* Make the application callback */
user_ret = (op->u.app_op.op)(loc, op->u.app_op.type_id, ndims, coords, op_data);
break;
+
case H5S_SEL_ITER_OP_LIB:
/* Call the library's callback */
user_ret = (op->u.lib_op)(loc, type, ndims, coords, op_data);
break;
+
default:
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "unsupported op type")
} /* end switch */
@@ -1312,7 +1310,7 @@ done:
Retrieve the type of selection in a dataspace
USAGE
H5S_sel_type H5Sget_select_type(space_id)
- hid_t space_id; IN: Dataspace object to query
+ hid_t space_id; IN: Dataspace object to query
RETURNS
Non-negative on success/Negative on failure. Return value is from the
set of values in the H5S_sel_type enumerated type.
@@ -1347,7 +1345,7 @@ done:
Retrieve the type of selection in a dataspace
USAGE
H5S_sel_type H5Sget_select_type(space)
- const H5S_t *space; IN: Dataspace object to query
+ const H5S_t *space; IN: Dataspace object to query
RETURNS
Non-negative on success/Negative on failure. Return value is from the
set of values in the H5S_sel_type enumerated type.
@@ -1362,7 +1360,7 @@ done:
H5S_sel_type
H5S_get_select_type(const H5S_t *space)
{
- H5S_sel_type ret_value; /* Return value */
+ H5S_sel_type ret_value = H5S_SEL_ERROR; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -1389,23 +1387,22 @@ H5S_get_select_type(const H5S_t *space)
DESCRIPTION
Checks to see if the current selection in the dataspaces are the same
dimensionality and shape.
+
This is primarily used for reading the entire selection in one swoop.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Assumes that there is only a single "block" for hyperslab selections.
EXAMPLES
REVISION LOG
- Modified function to view identical shapes with different dimensions
- as being the same under some circumstances.
--------------------------------------------------------------------------*/
htri_t
H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
{
H5S_sel_iter_t iter_a; /* Selection a iteration info */
H5S_sel_iter_t iter_b; /* Selection b iteration info */
- hbool_t iter_a_init = 0; /* Selection a iteration info has been initialized */
- hbool_t iter_b_init = 0; /* Selection b iteration info has been initialized */
- htri_t ret_value = TRUE; /* Return value */
+ hbool_t iter_a_init = FALSE; /* Selection a iteration info has been initialized */
+ hbool_t iter_b_init = FALSE; /* Selection b iteration info has been initialized */
+ htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1425,7 +1422,7 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
unsigned space_a_rank; /* Number of dimensions of dataspace A */
unsigned space_b_rank; /* Number of dimensions of dataspace B */
- /* need to be able to handle spaces of different rank:
+ /* Need to be able to handle spaces of different rank:
*
* To simplify logic, let space_a point to the element of the set
* {space1, space2} with the largest rank or space1 if the ranks
@@ -1436,9 +1433,8 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
*
* Let: space_a_rank be the rank of space_a,
* space_b_rank be the rank of space_b,
- * delta_rank = space_a_rank - space_b_rank.
*
- * Set all this up below.
+ * Set all this up here.
*/
if (space1->extent.rank >= space2->extent.rank) {
space_a = space1;
@@ -1475,12 +1471,6 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
space_a_dim = (int)space_a_rank - 1;
space_b_dim = (int)space_b_rank - 1;
-
- /* recall that space_a_rank >= space_b_rank.
- *
- * In the following while loop, we test to see if space_a and space_b
- * have identical size in all dimensions they have in common.
- */
while (space_b_dim >= 0) {
if (dims1[space_a_dim] != dims2[space_b_dim])
HGOTO_DONE(FALSE)
@@ -1615,7 +1605,7 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
} /* end if */
/* Check over the blocks for each selection */
else {
- /* for dimensions that space_a and space_b have in common: */
+ /* For dimensions that space_a and space_b have in common: */
while (space_b_dim >= 0) {
/* Check if the blocks are in the same relative location */
if ((start_a[space_a_dim] - off_a[space_a_dim]) !=
@@ -1665,7 +1655,7 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
} /* end else */
} /* end while */
} /* end else */
- } /* end else */
+ } /* end if */
done:
if (iter_a_init)
@@ -1688,7 +1678,7 @@ done:
topologically identical to that in b (as verified by
H5S_select_shape_same().
- This function exists, as some I/O code chokes of topologically
+ This function exists, as some I/O code chokes on topologically
identical selections with different ranks. At least to begin
with, we will deal with the issue by constructing projections
of the memory dataspace with ranks equaling those of the file
@@ -1709,7 +1699,7 @@ done:
const H5S_t *base_space; IN: Ptr to Dataspace to project
H5S_t ** new_space_ptr; OUT: Ptr to location in which to return
the address of the projected space
- int new_space_rank; IN: Rank of the projected space.
+ int new_space_rank; IN: Rank of the projected space.
const void * buf; IN: Base address of the buffer
associated with the base space.
May be NULL.
@@ -1944,13 +1934,12 @@ H5S_select_construct_projection(const H5S_t *base_space, H5S_t **new_space_ptr,
done:
/* Cleanup on error */
- if (ret_value < 0) {
+ if (ret_value < 0)
if (new_space && H5S_close(new_space) < 0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace")
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_select_construct_projection() */
+} /* end H5S_select_construct_projection() */
/*--------------------------------------------------------------------------
NAME
@@ -1980,7 +1969,7 @@ herr_t
H5S_select_fill(const void *fill, size_t fill_size, const H5S_t *space, void *_buf)
{
H5S_sel_iter_t iter; /* Selection iteration info */
- hbool_t iter_init = 0; /* Selection iteration info has been initialized */
+ hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
hssize_t nelmts; /* Number of elements in selection */
size_t max_elem; /* Total number of elements in selection */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Stest.c b/src/H5Stest.c
index 860534c..cf7cf22 100644
--- a/src/H5Stest.c
+++ b/src/H5Stest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Saturday, May 31, 2003
*
* Purpose: Dataspace selection testing functions.
diff --git a/src/H5T.c b/src/H5T.c
index 4f6b929..f739689 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -336,7 +336,7 @@ static herr_t H5T_set_size(H5T_t *dt, size_t size);
/* Library Private Variables */
/*****************************/
-/* The native endianess of the platform */
+/* The native endianness of the platform */
H5T_order_t H5T_native_order_g = H5T_ORDER_ERROR;
/*********************/
@@ -1786,42 +1786,36 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Tcopy
*
- * Purpose: Copies a datatype. The resulting datatype is not locked.
- * The datatype should be closed when no longer needed by
- * calling H5Tclose().
+ * Purpose: Copies a datatype. The resulting datatype is not locked.
+ * The datatype should be closed when no longer needed by
+ * calling H5Tclose().
*
- * Return: Success: The ID of a new datatype.
+ * Return: Success: The ID of a new datatype
*
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
- *
- * Modifications:
+ * Failure: H5I_INVALID_HID
*
- * Robb Matzke, 4 Jun 1998
- * The returned type is always transient and unlocked. If the TYPE_ID
- * argument is a dataset instead of a datatype then this function
- * returns a transient, modifiable datatype which is a copy of the
- * dataset's datatype.
+ * Note: The returned type is always transient and unlocked. If the
+ * TYPE_ID argument is a dataset instead of a datatype then
+ * this function returns a transient, modifiable datatype
+ * which is a copy of the dataset's datatype.
*
*-------------------------------------------------------------------------
*/
hid_t
H5Tcopy(hid_t type_id)
{
- H5T_t *dt; /* Pointer to the datatype to copy */
- H5T_t *new_dt = NULL;
- hid_t ret_value; /* Return value */
+ H5T_t *dt = NULL; /* Pointer to the datatype to copy */
+ H5T_t *new_dt = NULL; /* Pointer to the new datatype */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", type_id);
switch (H5I_get_type(type_id)) {
case H5I_DATATYPE:
/* The argument is a datatype handle */
if (NULL == (dt = (H5T_t *)H5I_object(type_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype")
break;
case H5I_DATASET: {
@@ -1829,9 +1823,11 @@ H5Tcopy(hid_t type_id)
/* The argument is a dataset handle */
if (NULL == (dset = (H5D_t *)H5I_object(type_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataset")
+
+ /* Get the datatype from the dataset */
if (NULL == (dt = H5D_typeof(dset)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get the dataset datatype")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to get the dataset datatype")
} break;
case H5I_UNINIT:
@@ -1849,21 +1845,22 @@ H5Tcopy(hid_t type_id)
case H5I_ERROR_STACK:
case H5I_NTYPES:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype or dataset")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype or dataset")
} /* end switch */
/* Copy datatype */
if (NULL == (new_dt = H5T_copy(dt, H5T_COPY_TRANSIENT)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy");
/* Atomize result */
if ((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype atom")
done:
- if (ret_value < 0)
+ /* Close the new datatype on errors */
+ if (H5I_INVALID_HID == ret_value)
if (new_dt && H5T_close(new_dt) < 0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to release datatype info")
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release datatype info")
FUNC_LEAVE_API(ret_value)
} /* end H5Tcopy() */
@@ -1941,8 +1938,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Tlock
*
- * Purpose: Locks a type, making it read only and non-destructable. This
- * is normally done by the library for predefined datatypes so
+ * Purpose: Locks a type, making it read only and non-destructable.
+ * This is normally done by the library for predefined datatypes so
* the application doesn't inadvertently change or delete a
* predefined type.
*
@@ -1954,12 +1951,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- *
- * Robb Matzke, 1 Jun 1998
- * It is illegal to lock a named datatype since we must allow named
- * types to be closed (to release file resources) but locking a type
- * prevents that.
*-------------------------------------------------------------------------
*/
herr_t
@@ -2030,9 +2021,6 @@ done:
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
- * Modifications:
- * Broke out from H5Tget_class - QAK - 6/4/99
- *
*-------------------------------------------------------------------------
*/
H5T_class_t
@@ -2105,15 +2093,6 @@ done:
* Programmer: Quincey Koziol
* Wednesday, November 29, 2000
*
- * Modifications:
- * Raymond Lu
- * 4 December 2009
- * Added a flag as a parameter to indicate whether the caller is
- * H5Tdetect_class. I also added the check for VL string type
- * just like the public function. Because we want to tell users
- * VL string is a string type but we treat it as a VL type
- * internally, H5T_detect_class needs to know where the caller
- * is from.
*-------------------------------------------------------------------------
*/
htri_t
@@ -2340,24 +2319,25 @@ done:
hid_t
H5Tget_super(hid_t type)
{
- H5T_t *dt; /* Datatype to query */
- H5T_t *super = NULL; /* Supertype */
- hid_t ret_value; /* Return value */
+ H5T_t *dt; /* Datatype to query */
+ H5T_t *super = NULL; /* Supertype */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", type);
if (NULL == (dt = (H5T_t *)H5I_object_verify(type, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype")
if (NULL == (super = H5T_get_super(dt)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "not a datatype")
if ((ret_value = H5I_register(H5I_DATATYPE, super, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register parent datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register parent datatype")
done:
- if (ret_value < 0)
+ if (H5I_INVALID_HID == ret_value)
if (super && H5T_close(super) < 0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to release super datatype info")
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID,
+ "unable to release super datatype info")
FUNC_LEAVE_API(ret_value)
} /* end H5Tget_super() */
@@ -2370,11 +2350,11 @@ done:
* the return value is an integer type.
*
* Return: Success: Data type for base data type.
- *
* Failure: NULL
*
* Programmer: Raymond Lu
- * October 9, 2002
+ * October 9, 2002
+ *
*-------------------------------------------------------------------------
*/
H5T_t *
@@ -2393,7 +2373,7 @@ H5T_get_super(const H5T_t *dt)
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5T_get_super() */
/*-------------------------------------------------------------------------
* Function: H5T_register
@@ -2441,8 +2421,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_conv
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
+ /* Notify all other functions to recalculate private data since some
* functions might cache a list of conversion functions. For
* instance, the compound type converter caches a list of conversion
* functions for the members, so adding a new function should cause
@@ -2618,15 +2597,11 @@ done:
* The special no-op path cannot be removed.
*
* Return: Succeess: non-negative
- *
* Failure: negative
*
* Programmer: Robb Matzke
* Tuesday, January 13, 1998
*
- * Modifications:
- * Adapted to non-API function - QAK, 11/17/99
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2937,10 +2912,6 @@ done:
* Programmer: Raymond Lu
* July 14, 2004
*
- * Modification:Raymond Lu
- * 17 February 2011
- * I changed the value for the APP_REF parameter of H5I_register
- * from FALSE to TRUE.
*-------------------------------------------------------------------------
*/
hid_t
@@ -3098,10 +3069,6 @@ done:
* Programmer: Robb Matzke
* Friday, December 5, 1997
*
- * Modifications:
- * Raymond Lu
- * 19 May 2011
- * We support fixed size or variable-length string now.
*-------------------------------------------------------------------------
*/
H5T_t *
@@ -3200,8 +3167,8 @@ done:
if (dt) {
dt->shared = H5FL_FREE(H5T_shared_t, dt->shared);
dt = H5FL_FREE(H5T_t, dt);
- } /* end if */
- } /* end if */
+ }
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__create() */
@@ -3510,13 +3477,12 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method)
ret_value = new_dt;
done:
- if (ret_value == NULL) {
+ if (ret_value == NULL)
if (new_dt) {
if (new_dt->shared)
new_dt->shared = H5FL_FREE(H5T_shared_t, new_dt->shared);
new_dt = H5FL_FREE(H5T_t, new_dt);
} /* end if */
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_copy() */
@@ -3660,9 +3626,7 @@ H5T__free(H5T_t *dt)
/* Free the ID to name info */
H5G_name_free(&(dt->path));
- /*
- * Don't free locked datatypes.
- */
+ /* Don't free locked datatypes */
if (H5T_STATE_IMMUTABLE == dt->shared->state)
HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close immutable datatype")
@@ -3730,6 +3694,7 @@ H5T_close(H5T_t *dt)
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity check */
HDassert(dt && dt->shared);
if (dt->shared->state == H5T_STATE_OPEN)
@@ -3801,10 +3766,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, December 22, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3844,9 +3805,8 @@ H5T_set_size(H5T_t *dt, size_t size)
if (prec > 8 * size)
prec = 8 * size;
}
- else {
+ else
prec = offset = 0;
- }
switch (dt->shared->type) {
case H5T_INTEGER:
@@ -3873,21 +3833,21 @@ H5T_set_size(H5T_t *dt, size_t size)
if (memb_offset > max_offset) {
max_offset = memb_offset;
max_index = i;
- }
- }
+ } /* end if */
+ } /* end for */
max_size = H5T__get_member_size(dt, max_index);
if (size < (max_offset + max_size))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"size shrinking will cut off last member ");
- }
+ } /* end if */
/* Compound must not have been packed previously */
/* We will check if resizing changed the packed state of
* this type at the end of this function */
HDassert(!dt->shared->u.compnd.packed);
- }
+ } /* end if */
break;
@@ -3927,7 +3887,7 @@ H5T_set_size(H5T_t *dt, size_t size)
/* Set up VL information */
if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location");
- }
+ } /* end if */
else {
prec = 8 * size;
offset = 0;
@@ -3953,14 +3913,16 @@ H5T_set_size(H5T_t *dt, size_t size)
case H5T_REFERENCE:
HDassert("can't happen" && 0);
break;
+
case H5T_NO_CLASS:
case H5T_NCLASSES:
HDassert("invalid type" && 0);
break;
+
default:
HDassert("not implemented yet" && 0);
break;
- }
+ } /* end switch */
/* Commit (if we didn't convert this type to a VL string) */
if (dt->shared->type != H5T_VLEN) {
@@ -3974,11 +3936,11 @@ H5T_set_size(H5T_t *dt, size_t size)
/* Check if the new compound type is packed */
if (dt->shared->type == H5T_COMPOUND)
H5T__update_packed(dt);
- }
+ } /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5T_set_size() */
/*-------------------------------------------------------------------------
* Function: H5T_get_size
@@ -4005,7 +3967,7 @@ H5T_get_size(const H5T_t *dt)
HDassert(dt);
FUNC_LEAVE_NOAPI(dt->shared->size)
-}
+} /* end H5T_get_size() */
/*-------------------------------------------------------------------------
* Function: H5T_cmp
@@ -4507,24 +4469,13 @@ done:
* first path in the path table.
*
* Return: Success: Pointer to the path, valid until the path
- * database is modified.
+ * database is modified.
*
* Failure: NULL if the path does not exist and no
- * function can be found to apply to the new
- * path.
- *
- * Programmer: Robb Matzke
- * Tuesday, January 13, 1998
+ * function can be found to apply to the new path.
*
- * Modifications:
- * Added a parameter IS_API to indicate whether to an API
- * function issued a call to this function. If a API
- * function like H5Tregister() is calling this function to
- * register a new hard conversion function, IS_API is TRUE
- * and the old path is replaced. If a private function like
- * H5T_init_interface() is trying to register hard conversions,
- * IS_API is FALSE and the old hard path is not replaced.
- * Tuesday, Sept 13, 2005
+ * Programmer: Robb Matzke
+ * Tuesday, January 13, 1998
*
*-------------------------------------------------------------------------
*/
@@ -4574,8 +4525,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_t f
H5T_g.npaths = 1;
} /* end if */
- /*
- * Find the conversion path. If source and destination types are equal
+ /* Find the conversion path. If source and destination types are equal
* then use entry[0], otherwise do a binary search over the
* remaining entries.
*
@@ -4615,8 +4565,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_t f
*/
old_npaths = H5T_g.npaths;
- /*
- * If we didn't find the path, if the caller is an API function specifying
+ /* If we didn't find the path, if the caller is an API function specifying
* a new hard conversion function, or if the caller is a private function
* specifying a new hard conversion and the path is a soft conversion, then
* create a new path and add the new function to the path.
@@ -4638,8 +4587,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_t f
else
path = table;
- /*
- * If a hard conversion function is specified and none is defined for the
+ /* If a hard conversion function is specified and none is defined for the
* path, or the caller is an API function, or the caller is a private function but
* the existing path is a soft function, then add the new conversion to the path
* and initialize its conversion data.
@@ -4747,7 +4695,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_t f
table = H5FL_FREE(H5T_path_t, table);
table = path;
H5T_g.path[md] = path;
- }
+ } /* end if */
else if (path != table) {
HDassert(cmp);
if ((size_t)H5T_g.npaths >= H5T_g.apaths) {
@@ -4836,11 +4784,6 @@ H5T_path_noop(const H5T_path_t *p)
* Programmer: Raymond Lu
* 8 June 2007
*
- * Modifications: Neil Fortner
- * 19 September 2008
- * Changed return value to H5T_subset_info_t
- * (to allow it to return copy_size)
- *
*-------------------------------------------------------------------------
*/
H5T_subset_info_t *
@@ -4910,7 +4853,7 @@ H5T_compiler_conv(H5T_t *src, H5T_t *dst)
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5T_compiler_conv() */
/*-------------------------------------------------------------------------
* Function: H5T_convert
@@ -4925,32 +4868,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, December 15, 1998
*
- * Modifications:
- * Robb Matzke, 1999-06-16
- * The timers are updated only if H5T debugging is enabled at
- * runtime in addition to compile time.
- *
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
- *
- * Quincey Koziol, 1999-07-01
- * Added dataset transfer properties, to allow custom VL
- * datatype allocation function to be passed down to VL
- * conversion routine.
- *
- * Robb Matzke, 2000-05-17
- * Added the BKG_STRIDE argument which gets passed to all the
- * conversion functions. If BUF_STRIDE is non-zero then each
- * data element is at a multiple of BUF_STRIDE bytes in BUF
- * (on both input and output). If BKG_STRIDE is also set then
- * the BKG buffer is used in such a way that temporary space
- * for each element is aligned on a BKG_STRIDE byte boundary.
- * If either BUF_STRIDE or BKG_STRIDE are zero then the BKG
- * buffer will be accessed as though it were a packed array
- * of destination datatype.
*-------------------------------------------------------------------------
*/
herr_t
@@ -4958,7 +4875,7 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t
size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist)
{
#ifdef H5T_DEBUG
- H5_timer_t timer;
+ H5_timer_t timer; /* Timer for conversion */
#endif
herr_t ret_value = SUCCEED; /* Return value */
@@ -4977,12 +4894,12 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t
H5_timer_end(&(tpath->stats.timer), &timer);
tpath->stats.ncalls++;
tpath->stats.nelmts += nelmts;
- }
+ } /* end if */
#endif
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5T_convert() */
/*-------------------------------------------------------------------------
* Function: H5T_oloc
@@ -5095,14 +5012,10 @@ done:
/*-------------------------------------------------------------------------
* Function: H5T_is_named
*
- * Purpose: Check if a datatype is named.
- *
- * Return: TRUE
+ * Purpose: Check if a datatype is named/committed.
*
- * FALSE
+ * Return: TRUE/FALSE/FAIL
*
- * Programmer: Pedro Vicente
- * Tuesday, Sep 3, 2002
*-------------------------------------------------------------------------
*/
htri_t
@@ -5158,7 +5071,7 @@ H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to reset path")
dt->shared->state = H5T_STATE_TRANSIENT;
- }
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -5618,8 +5531,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5T_patch_vlen_file
*
- * Purpose: Patch the top-level file pointer contained in (dt->shared->u.vlen.f)
- * to point to f. This is possible because
+ * Purpose: Patch the top-level file pointer contained in (dt->shared->u.vlen.file)
+ * to point to file. This is possible because
* the top-level file pointer can be closed out from under
* dt while dt is contained in the shared file's cache.
*
@@ -5628,17 +5541,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_patch_vlen_file(H5T_t *dt, H5F_t *f)
+H5T_patch_vlen_file(H5T_t *dt, H5F_t *file)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
HDassert(dt);
HDassert(dt->shared);
- HDassert(f);
+ HDassert(file);
- if ((dt->shared->type == H5T_VLEN) && dt->shared->u.vlen.f != f)
- dt->shared->u.vlen.f = f;
+ if ((dt->shared->type == H5T_VLEN) && dt->shared->u.vlen.f != file)
+ dt->shared->u.vlen.f = file;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5T_patch_vlen_file() */
diff --git a/src/H5TS.c b/src/H5TS.c
index a76ed5a..98e7d1b 100644
--- a/src/H5TS.c
+++ b/src/H5TS.c
@@ -249,7 +249,10 @@ H5TS_cancel_count_inc(void)
if (!cancel_counter) {
/*
* First time thread calls library - create new counter and associate
- * with key
+ * with key.
+ *
+ * Don't use H5MM calls here since the destructor has to use HDfree in
+ * order to avoid codestack calls.
*/
cancel_counter = (H5TS_cancel_t *)H5MM_calloc(sizeof(H5TS_cancel_t));
@@ -408,7 +411,6 @@ H5TS_win32_process_exit(void)
/* Clean up per-process thread local storage */
TlsFree(H5TS_errstk_key_g);
-
#ifdef H5_HAVE_CODESTACK
TlsFree(H5TS_funcstk_key_g);
#endif /* H5_HAVE_CODESTACK */
diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h
index ea03828..a153425 100644
--- a/src/H5TSprivate.h
+++ b/src/H5TSprivate.h
@@ -19,8 +19,6 @@
*
* Purpose: Private non-prototype header.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef H5TSprivate_H_
diff --git a/src/H5Tarray.c b/src/H5Tarray.c
index f9a8da0..6678b58 100644
--- a/src/H5Tarray.c
+++ b/src/H5Tarray.c
@@ -113,33 +113,32 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */])
unsigned u; /* local index variable */
hid_t ret_value; /* return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE3("i", "iIu*h", base_id, ndims, dim);
/* Check args */
if (ndims < 1 || ndims > H5S_MAX_RANK)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimensionality")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dimensionality")
if (!dim)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no dimensions specified")
for (u = 0; u < ndims; u++)
if (!(dim[u] > 0))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "zero-sized dimension specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "zero-sized dimension specified")
if (NULL == (base = (H5T_t *)H5I_object_verify(base_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an valid base datatype")
/* Create the array datatype */
if (NULL == (dt = H5T__array_create(base, ndims, dim)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype")
/* Atomize the type */
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype")
done:
- if (ret_value < 0) {
+ if (H5I_INVALID_HID == ret_value)
if (dt && H5T_close(dt) < 0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't release datatype")
- } /* end if */
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "can't release datatype")
FUNC_LEAVE_API(ret_value)
} /* end H5Tarray_create2() */
@@ -164,8 +163,8 @@ done:
H5T_t *
H5T__array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */])
{
- H5T_t * ret_value; /* new array data type */
- unsigned u; /* local index variable */
+ unsigned u; /* Local index variable */
+ H5T_t * ret_value = NULL; /* New array data type */
FUNC_ENTER_PACKAGE
@@ -364,33 +363,32 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */],
unsigned u; /* local index variable */
hid_t ret_value; /* return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE4("i", "iIs*h*Is", base_id, ndims, dim, perm);
/* Check args */
if (ndims < 1 || ndims > H5S_MAX_RANK)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimensionality")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dimensionality")
if (!dim)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no dimensions specified")
for (u = 0; u < (unsigned)ndims; u++)
if (!(dim[u] > 0))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "zero-sized dimension specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "zero-sized dimension specified")
if (NULL == (base = (H5T_t *)H5I_object_verify(base_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an valid base datatype")
/* Create the array datatype */
if (NULL == (dt = H5T__array_create(base, (unsigned)ndims, dim)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype")
/* Atomize the type */
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype")
done:
- if (ret_value < 0) {
+ if (H5I_INVALID_HID == ret_value)
if (dt && H5T_close(dt) < 0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't release datatype")
- } /* end if */
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "can't release datatype")
FUNC_LEAVE_API(ret_value)
} /* end H5Tarray_create1() */
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index 178e0bf..506cf9a 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -11,10 +11,9 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Module Info: Operations on bit vectors. A bit vector is an array of bytes
- * with the least-significant bits in the first byte. That is,
- * the bytes are in little-endian order.
+/* Module Info: Operations on bit vectors. A bit vector is an array of bytes
+ * with the least-significant bits in the first byte. That is,
+ * the bytes are in little-endian order.
*/
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
@@ -26,14 +25,11 @@
#include "H5WBprivate.h" /* Wrapped Buffers */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_copy
+ * Function: H5T__bit_copy
*
- * Purpose: Copies bits from one vector to another.
+ * Purpose: Copies bits from one vector to another.
*
- * Return: void
- *
- * Programmer: Robb Matzke
- * Wednesday, June 10, 1998
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -46,8 +42,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_of
FUNC_ENTER_PACKAGE_NOERR
- /*
- * Normalize the offset to be a byte number and a bit offset within that
+ /* Normalize the offset to be a byte number and a bit offset within that
* byte.
*/
s_idx = src_offset / 8;
@@ -55,8 +50,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_of
src_offset %= 8;
dst_offset %= 8;
- /*
- * Get things rolling. This means copying bits until we're aligned on a
+ /* Get things rolling. This means copying bits until we're aligned on a
* source byte. This the following example, five bits are copied to the
* destination.
*
@@ -82,19 +76,18 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_of
if (src_offset >= 8) {
s_idx++;
src_offset %= 8;
- } /* end if */
+ }
dst_offset += nbits;
if (dst_offset >= 8) {
d_idx++;
dst_offset %= 8;
- } /* end if */
+ }
size -= nbits;
- } /* end while */
+ }
- /*
- * The middle bits. We are aligned on a source byte which needs to be
+ /* The middle bits. We are aligned on a source byte which needs to be
* copied to two (or one in the degenerate case) destination bytes.
*
* src[s_idx]
@@ -124,10 +117,10 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_of
dst[d_idx + 0] |= (uint8_t)((src[s_idx] & mask_lo) << shift);
dst[d_idx + 1] &= (uint8_t)(~(mask_hi >> (8 - shift)));
dst[d_idx + 1] |= (uint8_t)((src[s_idx] & mask_hi) >> (8 - shift));
- } /* end if */
+ }
else
dst[d_idx] = src[s_idx];
- } /* end for */
+ }
/* Finish up */
while (size > 0) {
@@ -141,24 +134,24 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_of
if (src_offset >= 8) {
s_idx++;
src_offset %= 8;
- } /* end if */
+ }
dst_offset += nbits;
if (dst_offset >= 8) {
d_idx++;
dst_offset %= 8;
- } /* end if */
+ }
size -= nbits;
- } /* end while */
+ }
FUNC_LEAVE_NOAPI_VOID
} /* end H5T__bit_copy() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_shift
+ * Function: H5T__bit_shift
*
- * Purpose: Simulation of hardware shifting. Shifts a bit vector
+ * Purpose: Simulation of hardware shifting. Shifts a bit vector
* in a way similar to shifting a variable value, like
* value <<= 3, or value >>= 16. SHIFT_DIST is positive for
* left shift, negative for right shift. The bit vector starts
@@ -168,10 +161,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_of
* For example, if we have a bit sequence 00011100, offset=2,
* size=3, shift_dist=2, the result will be 00010000.
*
- * Return: void
- *
- * Programmer: Raymond Lu
- * Monday, April 12, 2004
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -215,14 +205,14 @@ H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size)
/* Zero-set the left part*/
H5T__bit_set(buf, offset, abs_shift_dist, 0);
- } /* end if */
+ }
else { /* right shift */
H5T__bit_copy(shift_buf, (size_t)0, buf, offset + abs_shift_dist, size - abs_shift_dist);
H5T__bit_copy(buf, offset, shift_buf, (size_t)0, size - abs_shift_dist);
H5T__bit_set(buf, offset + size - abs_shift_dist, abs_shift_dist, 0);
- } /* end else */
- } /* end else */
- } /* end if */
+ }
+ } /* end else */
+ } /* end if */
done:
/* Release resources */
@@ -233,18 +223,15 @@ done:
} /* end H5T__bit_shift() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_get_d
+ * Function: H5T__bit_get_d
*
- * Purpose: Return a small bit sequence as a number. Bit vector starts
+ * Purpose: Return a small bit sequence as a number. Bit vector starts
* at OFFSET and is SIZE bits long.
*
- * Return: Success: The bit sequence interpretted as an unsigned
- * integer.
+ * Return: Success: The bit sequence interpretted as an unsigned
+ * integer.
*
- * Failure: 0
- *
- * Programmer: Robb Matzke
- * Tuesday, June 23, 1998
+ * Failure: 0
*
*-------------------------------------------------------------------------
*/
@@ -253,7 +240,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size)
{
uint64_t val = 0;
size_t i, hs;
- uint64_t ret_value; /* Return value */
+ uint64_t ret_value = 0; /* Return value */
FUNC_ENTER_PACKAGE_NOERR
@@ -269,7 +256,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size)
uint8_t tmp = ((uint8_t *)&val)[i];
((uint8_t *)&val)[i] = ((uint8_t *)&val)[sizeof(val) - (i + 1)];
((uint8_t *)&val)[sizeof(val) - (i + 1)] = tmp;
- } /* end for */
+ }
break;
case H5T_ORDER_ERROR:
@@ -279,7 +266,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size)
default:
/* Unknown endianness. Bail out. */
HGOTO_DONE(UFAIL)
- } /* end switch */
+ }
/* Set return value */
ret_value = val;
@@ -289,14 +276,11 @@ done:
} /* end H5T__bit_get_d() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_set_d
+ * Function: H5T__bit_set_d
*
- * Purpose: Sets part of a bit vector to the specified unsigned value.
+ * Purpose: Sets part of a bit vector to the specified unsigned value.
*
- * Return: void
- *
- * Programmer: Robb Matzke
- * Wednesday, June 24, 1998
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -318,7 +302,7 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val)
uint8_t tmp = ((uint8_t *)&val)[i];
((uint8_t *)&val)[i] = ((uint8_t *)&val)[sizeof(val) - (i + 1)];
((uint8_t *)&val)[sizeof(val) - (i + 1)] = tmp;
- } /* end for */
+ }
break;
case H5T_ORDER_ERROR:
@@ -327,7 +311,7 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val)
case H5T_ORDER_MIXED:
default:
HDabort();
- } /* end switch */
+ }
H5T__bit_copy(buf, offset, (uint8_t *)&val, (size_t)0, size);
@@ -335,17 +319,12 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val)
} /* end H5T__bit_set_d() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_set
- *
- * Purpose: Sets or clears bits in a contiguous region of a vector
- * beginning at bit OFFSET and continuing for SIZE bits.
+ * Function: H5T__bit_set
*
- * Return: void
+ * Purpose: Sets or clears bits in a contiguous region of a vector
+ * beginning at bit OFFSET and continuing for SIZE bits.
*
- * Programmer: Robb Matzke
- * Wednesday, June 10, 1998
- *
- * Modifications:
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -370,13 +349,13 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value)
else
buf[idx++] &= (uint8_t)(~(mask << offset));
size -= nbits;
- } /* end if */
+ }
/* The middle bytes */
while (size >= 8) {
buf[idx++] = value ? 0xff : 0x00;
size -= 8;
- } /* end while */
+ }
/* The last partial byte */
if (size) {
@@ -384,28 +363,25 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value)
buf[idx] |= (uint8_t)(((unsigned)1 << size) - 1);
else
buf[idx] &= (uint8_t)(~(((unsigned)1 << size) - 1));
- } /* end if */
+ }
FUNC_LEAVE_NOAPI_VOID
} /* end H5T__bit_set() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_find
- *
- * Purpose: Finds the first bit with the specified VALUE within a region
- * of a bit vector. The region begins at OFFSET and continues
- * for SIZE bits, but the region can be searched from the least
- * significat end toward the most significant end(H5T_BIT_LSB
- * as DIRECTION), or from the most significant end to the least
- * significant end(H5T_BIT_MSB as DIRECTION).
+ * Function: H5T__bit_find
*
- * Return: Success: The position of the bit found, relative to
- * the offset.
+ * Purpose: Finds the first bit with the specified VALUE within a region
+ * of a bit vector. The region begins at OFFSET and continues
+ * for SIZE bits, but the region can be searched from the least
+ * significat end toward the most significant end(H5T_BIT_LSB
+ * as DIRECTION), or from the most significant end to the least
+ * significant end(H5T_BIT_MSB as DIRECTION).
*
- * Failure: -1
+ * Return: Success: The position of the bit found, relative to
+ * the offset.
*
- * Programmer: Robb Matzke
- * Wednesday, June 10, 1998
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -487,7 +463,7 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hb
for (iu = offset + size; iu > offset; --iu)
if (value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01))
HGOTO_DONE(8 * idx + (ssize_t)(iu - 1) - base);
- } /* end if */
+ }
break;
default:
@@ -499,18 +475,12 @@ done:
} /* end H5T__bit_find() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_inc
+ * Function: H5T__bit_inc
*
- * Purpose: Increment part of a bit field by adding 1. The bit field
+ * Purpose: Increment part of a bit field by adding 1. The bit field
* starts with bit position START and is SIZE bits long.
*
- * Return: Success: The carry-out value. One if overflows,
- * zero otherwise.
- *
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Friday, June 26, 1998
+ * Return: The carry-out value. TRUE if overflows, FALSE otherwise.
*
*-------------------------------------------------------------------------
*/
@@ -542,7 +512,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size)
size -= MIN(size, 8 - start);
start = 0;
idx++;
- } /* end if */
+ }
/* The middle */
while (carry && size >= 8) {
@@ -552,7 +522,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size)
buf[idx] = acc & 0xff;
idx++;
size -= 8;
- } /* end while */
+ }
/* The last bits */
if (carry && size > 0) {
@@ -562,24 +532,19 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size)
carry = acc & ((unsigned)1 << size);
buf[idx] &= (uint8_t)(~mask);
buf[idx] |= (uint8_t)(acc & mask);
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(carry ? TRUE : FALSE)
} /* end H5T__bit_inc() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_dec
+ * Function: H5T__bit_dec
*
- * Purpose: decrement part of a bit field by substracting 1. The bit
+ * Purpose: Decrement part of a bit field by substracting 1. The bit
* field starts with bit position START and is SIZE bits long.
*
- * Return: Success: The "borrow-in" value. It's one if underflows,
- * zero otherwise.
- *
- * Failure: Negative
- *
- * Programmer: Raymond Lu
- * March 17, 2004
+ * Return: The "borrow-in" value. It's TRUE if underflows, FALSE
+ * otherwise.
*
*-------------------------------------------------------------------------
*/
@@ -618,7 +583,7 @@ H5T__bit_dec(uint8_t *buf, size_t start, size_t size)
idx++;
size -= 8;
- } /* end while */
+ }
/* The last partial byte */
if (borrow && size > 0) {
@@ -627,9 +592,11 @@ H5T__bit_dec(uint8_t *buf, size_t start, size_t size)
buf[idx]--;
if ((buf[idx] >> size) != tmp >> size)
buf[idx] = (uint8_t)(buf[idx] + (1 << size));
- } /* end if */
- } /* end if */
- else { /* bit sequence ends in the same byte as starts */
+ }
+ }
+ else {
+ /* The bit sequence ends in the same byte as starts */
+
/* Example: a sequence like 11000100 and pos=3, size=3. We substract 00001000
* and get 10111100. A bit is borrowed from 6th bit(buf[idx]>>6=00000010, tmp>>6=00000011,
* not equal). We need to put this bit back by increment 1000000.
@@ -639,22 +606,19 @@ H5T__bit_dec(uint8_t *buf, size_t start, size_t size)
if ((buf[idx] >> (pos + size)) != tmp >> (pos + size)) {
buf[idx] = (uint8_t)(buf[idx] + (1 << (pos + size)));
borrow = 1;
- } /* end if */
- } /* end else */
+ }
+ }
FUNC_LEAVE_NOAPI(borrow ? TRUE : FALSE)
} /* end H5T__bit_dec() */
/*-------------------------------------------------------------------------
- * Function: H5T__bit_neg
- *
- * Purpose: negate part of a bit sequence. The bit
- * field starts with bit position START and is SIZE bits long.
+ * Function: H5T__bit_neg
*
- * Return: void
+ * Purpose: Negate part of a bit sequence. The bit field starts with
+ * bit position START and is SIZE bits long.
*
- * Programmer: Raymond Lu
- * March 19, 2004
+ * Return: void
*
*-------------------------------------------------------------------------
*/
@@ -685,17 +649,19 @@ H5T__bit_neg(uint8_t *buf, size_t start, size_t size)
buf[idx] = (uint8_t) ~(buf[idx]);
idx++;
size -= 8;
- } /* end while */
+ }
/* The last partial byte */
if (size > 0) {
/* Similar to the first byte case, where sequence ends in the same byte as starts */
tmp[0] = (uint8_t)~buf[idx];
H5T__bit_copy(&(buf[idx]), (size_t)0, tmp, (size_t)0, size);
- } /* end if */
- } /* end if */
- else /* bit sequence ends in the same byte as starts */
+ }
+ }
+ else {
+ /* bit sequence ends in the same byte as starts */
H5T__bit_copy(&(buf[idx]), pos, tmp, pos, size);
+ }
FUNC_LEAVE_NOAPI_VOID
} /* end H5T__bit_neg() */
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 438637f..907409f 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -92,12 +92,12 @@ H5T_init_commit_interface(void)
} /* H5T_init_commit_interface() */
/*-------------------------------------------------------------------------
- * Function: H5Tcommit2
+ * Function: H5Tcommit2
*
- * Purpose: Save a transient datatype to a file and turn the type handle
- * into a "named", immutable type.
+ * Purpose: Save a transient datatype to a file and turn the type handle
+ * into a "named", immutable type.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* April 5, 2007
@@ -231,18 +231,18 @@ done:
} /* end H5T__commit_named() */
/*-------------------------------------------------------------------------
- * Function: H5Tcommit_anon
+ * Function: H5Tcommit_anon
*
- * Purpose: Save a transient datatype to a file and turn the type handle
- * into a "named", immutable type.
+ * Purpose: Save a transient datatype to a file and turn the type handle
+ * into a "named", immutable type.
*
* The resulting ID should be linked into the file with
* H5Olink or it will be deleted when closed.
*
- * Note: Datatype access property list is unused currently, but is
- * checked for sanity anyway.
+ * Note: The datatype access property list is unused currently, but
+ * is checked for sanity anyway.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Peter Cao
* May 17, 2005
@@ -364,7 +364,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id)
if (H5T_set_latest_version(type) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype")
- /* Calculate message size infomation, for creating object header */
+ /* Calculate message size information, for creating object header */
dtype_size = H5O_msg_size_f(file, tcpl_id, H5O_DTYPE_ID, type, (size_t)0);
HDassert(dtype_size);
@@ -425,13 +425,11 @@ done:
} /* H5T__commit() */
/*-------------------------------------------------------------------------
- * Function: H5Tcommitted
+ * Function: H5Tcommitted
*
- * Purpose: Determines if a datatype is committed or not.
+ * Purpose: Determines if a datatype is committed or not.
*
- * Return: Success: TRUE if committed, FALSE otherwise.
- *
- * Failure: Negative
+ * Return: TRUE/FALSE/Negative
*
* Programmer: Robb Matzke
* Thursday, June 4, 1998
@@ -488,7 +486,7 @@ H5T_committed(const H5T_t *type)
* ADJUST to the link count.
*
* Return: Success: New link count
- * Failure: Negative
+ * Failure: -1
*
* Programmer: Quincey Koziol
* Friday, September 26, 2003
@@ -498,29 +496,30 @@ H5T_committed(const H5T_t *type)
int
H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI((-1))
HDassert(type);
HDassert(type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED);
/* Adjust the link count on the named datatype */
if ((ret_value = H5O_link(&type->oloc, adjust, dxpl_id)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_LINKCOUNT, FAIL, "unable to adjust named datatype link count")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_LINKCOUNT, (-1), "unable to adjust named datatype link count")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_link() */
/*-------------------------------------------------------------------------
- * Function: H5Topen2
+ * Function: H5Topen2
*
- * Purpose: Opens a named datatype using a Datatype Access Property
+ * Purpose: Opens a named datatype using a Datatype Access Property
* List.
*
- * Return: Success: Object ID of the named datatype.
- * Failure: Negative
+ * Return: Success: Object ID of the named datatype
+ *
+ * Failure: H5I_INVALID_HID
*
* Programmer: James Laird
* Thursday July 27, 2006
@@ -538,22 +537,22 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id)
H5G_loc_t type_loc; /* Group object for datatype */
hbool_t obj_found = FALSE; /* Object at 'name' found */
hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datatype */
- hid_t ret_value = FAIL; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE3("i", "i*si", loc_id, name, tapl_id);
/* Check args */
if (H5G_loc(loc_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location")
if (!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name")
/* Get correct property list */
if (H5P_DEFAULT == tapl_id)
tapl_id = H5P_DATATYPE_ACCESS_DEFAULT;
else if (TRUE != H5P_isa_class(tapl_id, H5P_DATATYPE_ACCESS))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not datatype access property list")
/* Set up datatype location to fill in */
type_loc.oloc = &oloc;
@@ -565,25 +564,25 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id)
* from it.
*/
if (H5G_loc_find(&loc, name, &type_loc /*out*/, tapl_id, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, H5I_INVALID_HID, "not found")
obj_found = TRUE;
/* Check that the object found is the correct type */
if (H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object type")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object type")
if (obj_type != H5O_TYPE_NAMED_DATATYPE)
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "not a named datatype")
/* Open it */
if (NULL == (type = H5T_open(&type_loc, dxpl_id)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype")
/* Register the type and return the ID */
if ((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype")
done:
- if (ret_value < 0) {
+ if (H5I_INVALID_HID == ret_value) {
if (type != NULL)
H5T_close(type);
else {
@@ -596,15 +595,18 @@ done:
} /* end H5Topen2() */
/*-------------------------------------------------------------------------
- * Function: H5Tget_create_plist
+ * Function: H5Tget_create_plist
*
- * Purpose: Returns a copy of the datatype creation property list.
+ * Purpose: Returns a copy of the datatype creation property list.
*
- * Return: Success: ID for a copy of the datatype creation
- * property list. The property list ID should be
- * released by calling H5Pclose().
+ * Note: There are no datatype creation properties currently, just
+ * object creation ones.
*
- * Failure: FAIL
+ * Return: Success: ID for a copy of the datatype creation
+ * property list. The property list ID should be
+ * released by calling H5Pclose().
+ *
+ * Failure: H5I_INVALID_HID
*
* Programmer: Quincey Koziol
* Tuesday, November 28, 2006
@@ -618,24 +620,24 @@ H5Tget_create_plist(hid_t dtype_id)
H5P_genplist_t *tcpl_plist; /* Existing datatype creation propertty list */
hid_t new_tcpl_id = FAIL; /* New datatype creation property list */
herr_t status; /* Generic status value */
- hid_t ret_value; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", dtype_id);
/* Check arguments */
if (NULL == (type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype")
/* Copy the default datatype creation property list */
if (NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default creation property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get default creation property list")
if ((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to copy the creation property list")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list")
/* Check if the datatype is committed */
if ((status = H5T_committed(type)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't check whether datatype is committed")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't check whether datatype is committed")
/* Retrieve further information, if the datatype is committed */
if (status > 0) {
@@ -643,21 +645,21 @@ H5Tget_create_plist(hid_t dtype_id)
/* Get property list object for new TCPL */
if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_tcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get property list")
/* Retrieve any object creation properties */
if (H5O_get_create_plist(&type->oloc, H5AC_ind_dxpl_id, new_plist) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info")
} /* end if */
/* Set the return value */
ret_value = new_tcpl_id;
done:
- if (ret_value < 0)
+ if (H5I_INVALID_HID == ret_value)
if (new_tcpl_id > 0)
if (H5I_dec_app_ref(new_tcpl_id) < 0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to close temporary object")
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, H5I_INVALID_HID, "unable to close temporary object")
FUNC_LEAVE_API(ret_value)
} /* end H5Tget_create_plist() */
@@ -681,7 +683,7 @@ H5T_open(const H5G_loc_t *loc, hid_t dxpl_id)
{
H5T_shared_t *shared_fo = NULL;
H5T_t * dt = NULL;
- H5T_t * ret_value;
+ H5T_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -795,8 +797,8 @@ done:
static H5T_t *
H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id)
{
- H5T_t *dt = NULL; /* Datatype from the file */
- H5T_t *ret_value; /* Return value */
+ H5T_t *dt = NULL; /* Datatype from the file */
+ H5T_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c
index ba067be..d7a60da 100644
--- a/src/H5Tcompound.c
+++ b/src/H5Tcompound.c
@@ -103,8 +103,6 @@ H5T_init_compound_interface(void)
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
size_t
@@ -171,8 +169,6 @@ H5T_get_member_offset(const H5T_t *dt, unsigned membno)
* Programmer: Quincey Koziol
* Thursday, November 9, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5T_class_t
@@ -210,7 +206,7 @@ done:
* modifying the returned datatype does not
* modify the member type.
*
- * Failure: Negative
+ * Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
@@ -224,23 +220,27 @@ H5Tget_member_type(hid_t type_id, unsigned membno)
H5T_t *memb_dt = NULL; /* Member datatype */
hid_t ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE2("i", "iIu", type_id, membno);
/* Check args */
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a compound datatype")
if (membno >= dt->shared->u.compnd.nmembs)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid member number")
+
+ /* Retrieve the datatype for the member */
if (NULL == (memb_dt = H5T_get_member_type(dt, membno, H5T_COPY_REOPEN)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to retrieve member type")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type")
+
+ /* Get an ID for the datatype */
if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable register datatype atom")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype atom")
done:
- if (ret_value < 0)
+ if (H5I_INVALID_HID == ret_value)
if (memb_dt && H5T_close(memb_dt) < 0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close datatype")
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype")
FUNC_LEAVE_API(ret_value)
} /* end H5Tget_member_type() */
@@ -248,8 +248,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5T_get_member_type
*
- * Purpose: Private function for H5Tget_member_type. Returns the data
- * type of the specified member.
+ * Purpose: Returns a copy of the data type of the specified member.
*
* Return: Success: A copy of the member datatype;
* modifying the returned datatype does not
@@ -265,10 +264,11 @@ done:
H5T_t *
H5T_get_member_type(const H5T_t *dt, unsigned membno, H5T_copy_t method)
{
- H5T_t *ret_value; /* Return value */
+ H5T_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
+ /* Sanity checks */
HDassert(dt);
HDassert(membno < dt->shared->u.compnd.nmembs);
@@ -324,8 +324,6 @@ H5T__get_member_size(const H5T_t *dt, unsigned membno)
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -370,8 +368,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -577,8 +573,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, September 11, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -595,9 +589,8 @@ H5T_is_packed(const H5T_t *dt)
dt = dt->shared->parent;
/* If this is a compound datatype, check if it is packed */
- if (dt->shared->type == H5T_COMPOUND) {
+ if (dt->shared->type == H5T_COMPOUND)
ret_value = (htri_t)(dt->shared->u.compnd.packed);
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_is_packed() */
@@ -615,8 +608,6 @@ H5T_is_packed(const H5T_t *dt)
* Programmer: Neil Fortner
* Monday, October 19, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 46bb738..c3168f4 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -109,7 +109,7 @@
* least as large as the destination. Overflows can occur when
* the destination is narrower than the source.
*
- * xF: Integers to float-point(float or double) values where the desination
+ * xF: Integers to float-point(float or double) values where the destination
* is at least as wide as the source. This case cannot generate
* overflows.
*
@@ -1121,8 +1121,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 25, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1533,14 +1531,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, January 13, 1998
*
- * Modifications:
- * Robb Matzke, 1999-06-16
- * Added the `stride' argument. If its value is non-zero then we
- * stride through memory converting one value at each location;
- * otherwise we assume that the values should be packed.
- *
- * Robb Matzke, 1999-06-16
- * Added support for bitfields.
*-------------------------------------------------------------------------
*/
herr_t
@@ -1638,12 +1628,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 20, 1999
*
- * Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
*-------------------------------------------------------------------------
*/
herr_t
@@ -1897,8 +1881,6 @@ done:
* Programmer: Neil Fortner
* Wednesday, October 1, 2008
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5T_conv_struct_t *
@@ -1946,16 +1928,9 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv)
* source member doesn't have a corresponding destination member
* then the src2dst[i]=-1.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Monday, January 26, 1998
- *
- * Modifications:
- * Raymond Lu, 3 May 2007
- * Added the detection for a special optimization case when the
- * source and destination members are a subset of each other, and
- * the order is the same, and no conversion is needed. For example:
+ * Special optimization case when the source and destination
+ * members are a subset of each other, and the order is the same,
+ * and no conversion is needed. For example:
* struct source { struct destination {
* TYPE1 A; --> TYPE1 A;
* TYPE2 B; --> TYPE2 B;
@@ -1974,6 +1949,11 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv)
* The optimization is simply moving data to the appropriate
* places in the buffer.
*
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Monday, January 26, 1998
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2158,7 +2138,7 @@ done:
H5T_subset_info_t *
H5T__conv_struct_subset(const H5T_cdata_t *cdata)
{
- H5T_conv_struct_t *priv;
+ H5T_conv_struct_t *priv = NULL;
FUNC_ENTER_PACKAGE_NOERR
@@ -2403,37 +2383,7 @@ done:
*
* Copy BKG to BUF for all elements
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Thursday, January 22, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is
- * non-zero then convert one value at each memory location
- * advancing BUF_STRIDE bytes each time; otherwise assume both
- * source and destination values are packed.
- *
- * Robb Matzke, 1999-06-16
- * If the source and destination data structs are the same size
- * then we can convert on a field-by-field basis instead of an
- * element by element basis. In other words, for all struct
- * elements being converted by this function call, first convert
- * all of the field1's, then all field2's, etc. This can
- * drastically reduce the number of calls to H5T_convert() and
- * thereby eliminate most of the conversion constant overhead.
- *
- * Robb Matzke, 2000-05-17
- * Added the BKG_STRIDE argument to fix a design bug. If
- * BUF_STRIDE and BKG_STRIDE are both non-zero then each
- * data element converted will be placed temporarily at a
- * multiple of BKG_STRIDE in the BKG buffer; otherwise the
- * BKG buffer is assumed to be a packed array of destination
- * datatype.
- *
- * Raymond Lu, 3 May 2007
- * Optimize a special case when the source and destination members
+ * Special case when the source and destination members
* are a subset of each other, and the order is the same, and no
* conversion is needed. For example:
* struct source { struct destination {
@@ -2446,6 +2396,11 @@ done:
* The optimization is simply moving data to the appropriate
* places in the buffer.
*
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Thursday, January 22, 1998
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2523,7 +2478,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
if (dst_memb->size > src->shared->size - offset) {
cdata->priv = H5T_conv_struct_free(priv);
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
- "convertion is unsupported by this function")
+ "conversion is unsupported by this function")
} /* end if */
} /* end if */
} /* end for */
@@ -2691,8 +2646,6 @@ done:
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2973,7 +2926,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si
/* Use O(log N) lookup */
unsigned lt = 0;
unsigned rt = src->shared->u.enumer.nmembs;
- unsigned md;
+ unsigned md = 0;
int cmp;
while (lt < rt) {
@@ -3126,22 +3079,6 @@ done:
* Programmer: Quincey Koziol
* Wednesday, May 26, 1999
*
- * Modifications:
- *
- * Quincey Koziol, 2 July, 1999
- * Enabled support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
- *
- * Raymond Lu, 26 June, 2002
- * Background buffer is used for freeing heap objects storing
- * old data. At this moment, it only frees the first level of
- * VL datatype. It doesn't handle nested VL datatypes.
- *
- * Raymond Lu, 8 November 2011
- * I put a condition check to prevent the conversion of VL strings
- * between ASCII and UTF8.
*-------------------------------------------------------------------------
*/
herr_t
@@ -3500,8 +3437,6 @@ done:
* Programmer: Quincey Koziol
* Monday, November 6, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3657,20 +3592,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, June 10, 1998
*
- * Modifications:
- * Robb Matzke, 7 Jul 1998
- * Added overflow handling.
- *
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
- *
- * Raymond Lu
- * Wednesday, April 21, 2004
- * There is a new design for exception handling like overflow,
- * which is passed in as a transfer property.
*-------------------------------------------------------------------------
*/
herr_t
@@ -4114,23 +4035,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, June 23, 1998
*
- * Modifications:
- * Robb Matzke, 7 Jul 1998
- * Added overflow handling.
- *
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
- *
- * Robb Matzke, 2001-02-02
- * Oops, forgot to increment the exponent when rounding the
- * significand resulted in a carry. Thanks to Guillaume Colin
- * de Verdiere for finding this one!
- *
- * Raymond Lu, 2006-03-13
- * Added support for VAX floating-point types.
*-------------------------------------------------------------------------
*/
herr_t
@@ -4721,16 +4625,6 @@ done:
* Programmer: Robb Matzke
* Friday, August 7, 1998
*
- * Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
- *
- * Raymond Lu, 8 November 2011
- * I put a condition check to prevent the conversion of strings
- * between ASCII and UTF8.
*-------------------------------------------------------------------------
*/
herr_t
@@ -4977,8 +4871,6 @@ done:
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5001,8 +4893,6 @@ H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5025,8 +4915,6 @@ H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5049,8 +4937,6 @@ H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5073,8 +4959,6 @@ H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5097,8 +4981,6 @@ H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5121,8 +5003,6 @@ H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5145,8 +5025,6 @@ H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5169,8 +5047,6 @@ H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5193,8 +5069,6 @@ H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5217,8 +5091,6 @@ H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5241,8 +5113,6 @@ H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5265,8 +5135,6 @@ H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5289,8 +5157,6 @@ H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5313,8 +5179,6 @@ H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5337,8 +5201,6 @@ H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5361,8 +5223,6 @@ H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5385,8 +5245,6 @@ H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5409,8 +5267,6 @@ H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5433,8 +5289,6 @@ H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5457,8 +5311,6 @@ H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5481,8 +5333,6 @@ H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5505,8 +5355,6 @@ H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5529,8 +5377,6 @@ H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5553,8 +5399,6 @@ H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5577,8 +5421,6 @@ H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5601,8 +5443,6 @@ H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5625,8 +5465,6 @@ H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5649,8 +5487,6 @@ H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5673,8 +5509,6 @@ H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5697,8 +5531,6 @@ H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5721,8 +5553,6 @@ H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5745,8 +5575,6 @@ H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5769,8 +5597,6 @@ H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5793,8 +5619,6 @@ H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5817,8 +5641,6 @@ H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5841,8 +5663,6 @@ H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5865,8 +5685,6 @@ H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5889,8 +5707,6 @@ H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5913,8 +5729,6 @@ H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5937,8 +5751,6 @@ H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5961,8 +5773,6 @@ H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -5985,8 +5795,6 @@ H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6009,8 +5817,6 @@ H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6033,8 +5839,6 @@ H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6057,8 +5861,6 @@ H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6081,8 +5883,6 @@ H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6105,8 +5905,6 @@ H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6129,8 +5927,6 @@ H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6153,8 +5949,6 @@ H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6177,8 +5971,6 @@ H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6201,8 +5993,6 @@ H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6225,8 +6015,6 @@ H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6249,8 +6037,6 @@ H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6273,8 +6059,6 @@ H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6297,8 +6081,6 @@ H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6321,8 +6103,6 @@ H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6345,8 +6125,6 @@ H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6369,8 +6147,6 @@ H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6393,8 +6169,6 @@ H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6417,8 +6191,6 @@ H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6441,8 +6213,6 @@ H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6465,8 +6235,6 @@ H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6489,8 +6257,6 @@ H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6513,8 +6279,6 @@ H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6537,8 +6301,6 @@ H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6561,8 +6323,6 @@ H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6585,8 +6345,6 @@ H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6609,8 +6367,6 @@ H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6633,8 +6389,6 @@ H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6657,8 +6411,6 @@ H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6681,8 +6433,6 @@ H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6705,8 +6455,6 @@ H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6729,8 +6477,6 @@ H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6753,8 +6499,6 @@ H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6777,8 +6521,6 @@ H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6801,8 +6543,6 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6825,8 +6565,6 @@ H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6849,8 +6587,6 @@ H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6873,8 +6609,6 @@ H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6897,8 +6631,6 @@ H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6921,8 +6653,6 @@ H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6945,8 +6675,6 @@ H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6969,8 +6697,6 @@ H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -6993,8 +6719,6 @@ H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7017,8 +6741,6 @@ H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7041,8 +6763,6 @@ H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7065,8 +6785,6 @@ H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Robb Matzke
* Friday, November 13, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7089,8 +6807,6 @@ H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7113,8 +6829,6 @@ H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Monday, November 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7136,12 +6850,6 @@ H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Robb Matzke
* Tuesday, June 23, 1998
*
- * Modifications:
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
*-------------------------------------------------------------------------
*/
herr_t
@@ -7163,8 +6871,6 @@ H5T__conv_float_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Friday, Feb 25, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#if H5_SIZEOF_LONG_DOUBLE != 0
@@ -7188,15 +6894,6 @@ H5T__conv_float_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Robb Matzke
* Tuesday, June 23, 1998
*
- * Modifications:
- * Robb Matzke, 7 Jul 1998
- * Added overflow handling.
- *
- * Robb Matzke, 1999-06-16
- * Added support for non-zero strides. If BUF_STRIDE is non-zero
- * then convert one value at each memory location advancing
- * BUF_STRIDE bytes each time; otherwise assume both source and
- * destination values are packed.
*-------------------------------------------------------------------------
*/
herr_t
@@ -7218,8 +6915,6 @@ H5T__conv_double_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Friday, Feb 25, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#if H5_SIZEOF_LONG_DOUBLE != 0
@@ -7243,8 +6938,6 @@ H5T__conv_double_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t
* Programmer: Raymond Lu
* Friday, Feb 25, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#if H5_SIZEOF_LONG_DOUBLE != 0
@@ -7268,8 +6961,6 @@ H5T__conv_ldouble_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Friday, Feb 25, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#if H5_SIZEOF_LONG_DOUBLE != 0
@@ -7293,8 +6984,6 @@ H5T__conv_ldouble_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7316,8 +7005,6 @@ H5T__conv_schar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7339,8 +7026,6 @@ H5T__conv_schar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7362,8 +7047,6 @@ H5T__conv_schar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7385,8 +7068,6 @@ H5T__conv_uchar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7408,8 +7089,6 @@ H5T__conv_uchar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7431,8 +7110,6 @@ H5T__conv_uchar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7454,8 +7131,6 @@ H5T__conv_short_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7477,8 +7152,6 @@ H5T__conv_short_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7500,8 +7173,6 @@ H5T__conv_short_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7523,8 +7194,6 @@ H5T__conv_ushort_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7546,8 +7215,6 @@ H5T__conv_ushort_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7569,8 +7236,6 @@ H5T__conv_ushort_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7592,8 +7257,6 @@ H5T__conv_int_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7615,8 +7278,6 @@ H5T__conv_int_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7638,8 +7299,6 @@ H5T__conv_int_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7661,8 +7320,6 @@ H5T__conv_uint_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7684,8 +7341,6 @@ H5T__conv_uint_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7707,8 +7362,6 @@ H5T__conv_uint_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7730,8 +7383,6 @@ H5T__conv_long_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7753,8 +7404,6 @@ H5T__conv_long_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7776,8 +7425,6 @@ H5T__conv_long_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7799,8 +7446,6 @@ H5T__conv_ulong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7822,8 +7467,6 @@ H5T__conv_ulong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7845,8 +7488,6 @@ H5T__conv_ulong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7868,8 +7509,6 @@ H5T__conv_llong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7891,8 +7530,6 @@ H5T__conv_llong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#if H5T_CONV_INTERNAL_LLONG_LDOUBLE
@@ -7916,8 +7553,6 @@ H5T__conv_llong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7939,8 +7574,6 @@ H5T__conv_ullong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -7962,8 +7595,6 @@ H5T__conv_ullong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n
* Programmer: Raymond Lu
* Tuesday, Febuary 1, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#if H5T_CONV_INTERNAL_ULLONG_LDOUBLE
@@ -7987,8 +7618,6 @@ H5T__conv_ullong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -8012,8 +7641,6 @@ H5T__conv_float_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -8313,8 +7940,6 @@ H5T__conv_float_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm
* Programmer: Raymond Lu
* Friday, November 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -9322,16 +8947,6 @@ done:
* Programmer: Raymond Lu
* Friday, Feb 6, 2004
*
- * Modifications:
- *
- * Raymond Lu
- * Wednesday, April 21, 2004
- * There is a new design for exception handling like overflow,
- * which is passed in as a transfer property.
- *
- * Raymond Lu
- * Monday, March 13, 2006
- * Added support for VAX floating-point types.
*-------------------------------------------------------------------------
*/
herr_t
@@ -9765,11 +9380,6 @@ done:
* Programmer: Raymond Lu
* April 26, 2004
*
- * Modifications:
- *
- * Raymond Lu
- * March 13, 2006
- * Add support for VAX floating-point types.
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Tcset.c b/src/H5Tcset.c
index f9e0540..259e7af 100644
--- a/src/H5Tcset.c
+++ b/src/H5Tcset.c
@@ -61,10 +61,6 @@ H5T_init_cset_interface(void)
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
- *
*-------------------------------------------------------------------------
*/
H5T_cset_t
@@ -107,10 +103,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c
index 11268c4..25fa808 100644
--- a/src/H5Tdbg.c
+++ b/src/H5Tdbg.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Tdbg.c
- * Jul 19 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5Tdbg.c
+ * Jul 19 2007
+ * Quincey Koziol
*
- * Purpose: Dump debugging information about a datatype
+ * Purpose: Dump debugging information about a datatype
*
*-------------------------------------------------------------------------
*/
@@ -31,9 +31,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Tpkg.h" /* Datatypes */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Tpkg.h" /* Datatypes */
/****************/
/* Local Macros */
@@ -64,28 +64,21 @@
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5T__print_stats
+ * Function: H5T__print_stats
*
- * Purpose: Print statistics about a conversion path. Statistics are
- * printed only if all the following conditions are true:
+ * Purpose: Print statistics about a conversion path. Statistics are
+ * printed only if all the following conditions are true:
*
- * 1. The library was compiled with H5T_DEBUG defined.
- * 2. Data type debugging is turned on at run time.
- * 3. The path was called at least one time.
+ * 1. The library was compiled with H5T_DEBUG defined.
+ * 2. Data type debugging is turned on at run time.
+ * 3. The path was called at least one time.
*
- * The optional NPRINT argument keeps track of the number of
- * conversions paths for which statistics have been shown. If
- * its value is zero then table headers are printed before the
- * first line of output.
+ * The optional NPRINT argument keeps track of the number of
+ * conversions paths for which statistics have been shown. If
+ * its value is zero then table headers are printed before the
+ * first line of output.
*
- * Return: Success: non-negative
- *
- * Failure: negative
- *
- * Programmer: Robb Matzke
- * Monday, December 14, 1998
- *
- * Modifications:
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
@@ -107,7 +100,8 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*i
"User", "System", "Elapsed", "Bandwidth");
HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", "----------", "-----", "-----",
"----", "------", "-------", "---------");
- }
+ } /* end if */
+
if (path->src && path->dst)
nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst));
else if (path->src)
@@ -116,6 +110,7 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*i
nbytes = H5T_get_size(path->dst);
else
nbytes = 0;
+
nbytes *= path->stats.nelmts;
H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime);
HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", path->name, path->stats.nelmts,
@@ -123,27 +118,24 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*i
path->stats.timer.etime, bandwidth);
}
#endif
+
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5T__print_stats() */
/*-------------------------------------------------------------------------
- * Function: H5T_debug
- *
- * Purpose: Prints information about a data type.
+ * Function: H5T_debug
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Prints information about a data type.
*
- * Programmer: Robb Matzke
- * Wednesday, January 7, 1998
- *
- * Modifications:
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
H5T_debug(const H5T_t *dt, FILE *stream)
{
- const char *s1 = "", *s2 = "";
+ const char *s1 = "";
+ const char *s2 = "";
unsigned i;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -254,6 +246,7 @@ H5T_debug(const H5T_t *dt, FILE *stream)
HDfprintf(stream, ", offset=%lu", (unsigned long)(dt->shared->u.atomic.offset));
if (dt->shared->u.atomic.prec != 8 * dt->shared->size)
HDfprintf(stream, ", prec=%lu", (unsigned long)(dt->shared->u.atomic.prec));
+
switch (dt->shared->type) {
case H5T_INTEGER:
switch (dt->shared->u.atomic.u.i.sign) {
diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c
index 1a49fef..073753e 100644
--- a/src/H5Tdeprec.c
+++ b/src/H5Tdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Tdeprec.c
* April 5 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5T interface. These
* functions are here for compatibility purposes and may be
@@ -169,7 +169,7 @@ done:
*
* Return: Success: Object ID of the named datatype.
*
- * Failure: Negative
+ * Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Monday, June 1, 1998
@@ -187,16 +187,16 @@ H5Topen1(hid_t loc_id, const char *name)
H5G_loc_t type_loc; /* Group object for datatype */
hbool_t obj_found = FALSE; /* Object at 'name' found */
hid_t dxpl_id = H5AC_ind_dxpl_id; /* dxpl to use to open datatype */
- hid_t ret_value = FAIL;
+ hid_t ret_value = H5I_INVALID_HID;
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE2("i", "i*s", loc_id, name);
/* Check args */
if (H5G_loc(loc_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location")
if (!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name")
/* Set up datatype location to fill in */
type_loc.oloc = &oloc;
@@ -208,25 +208,25 @@ H5Topen1(hid_t loc_id, const char *name)
* from it.
*/
if (H5G_loc_find(&loc, name, &type_loc /*out*/, H5P_DEFAULT, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, H5I_INVALID_HID, "not found")
obj_found = TRUE;
/* Check that the object found is the correct type */
if (H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object type")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, H5I_INVALID_HID, "can't get object type")
if (obj_type != H5O_TYPE_NAMED_DATATYPE)
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5I_INVALID_HID, "not a named datatype")
/* Open it */
if ((type = H5T_open(&type_loc, dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype")
/* Register the type and return the ID */
if ((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype")
done:
- if (ret_value < 0) {
+ if (H5I_INVALID_HID == ret_value) {
if (type != NULL)
H5T_close(type);
else {
diff --git a/src/H5Tenum.c b/src/H5Tenum.c
index 115e56d..d70c004 100644
--- a/src/H5Tenum.c
+++ b/src/H5Tenum.c
@@ -65,8 +65,6 @@ H5T_init_enum_interface(void)
* Programmer: Robb Matzke
* Tuesday, December 22, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hid_t
@@ -76,24 +74,25 @@ H5Tenum_create(hid_t parent_id)
H5T_t *dt = NULL; /*new enumeration data type */
hid_t ret_value; /*return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE1("i", "i", parent_id);
/* Check args */
if (NULL == (parent = (H5T_t *)H5I_object_verify(parent_id, H5I_DATATYPE)) ||
H5T_INTEGER != parent->shared->type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an integer data type")
/* Build new type */
if (NULL == (dt = H5T__enum_create(parent)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot create enum type")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "cannot create enum type")
+
/* Atomize the type */
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type atom")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Tenum_create() */
/*-------------------------------------------------------------------------
* Function: H5T__enum_create
@@ -109,14 +108,12 @@ done:
* Programmer: Raymond Lu
* October 9, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5T_t *
H5T__enum_create(const H5T_t *parent)
{
- H5T_t *ret_value; /*new enumeration data type */
+ H5T_t *ret_value = NULL; /* New enumeration data type */
FUNC_ENTER_PACKAGE
@@ -151,8 +148,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, December 23, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -197,8 +192,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, December 23, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -260,8 +253,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, December 23, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -302,8 +293,6 @@ done:
* Programmer: Raymond Lu
* October 9, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -337,8 +326,6 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value /*out*/)
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -388,11 +375,6 @@ done:
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- * Raymond Lu
- * Wednesday, Febuary 9, 2005
- * Made a copy of original datatype and do sorting and search
- * on that copy, to protect the original order of members.
*-------------------------------------------------------------------------
*/
static char *
@@ -402,7 +384,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t s
unsigned lt, md = 0, rt; /* Indices for binary search */
int cmp = (-1); /* Comparison result */
hbool_t alloc_name = FALSE; /* Whether name has been allocated */
- char * ret_value; /* Return value */
+ char * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -481,11 +463,6 @@ done:
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- * Raymond Lu
- * Wednesday, Febuary 9, 2005
- * Made a copy of original datatype and do sorting and search
- * on that copy, to protect the original order of members.
*-------------------------------------------------------------------------
*/
herr_t
@@ -529,11 +506,6 @@ done:
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- * Raymond Lu
- * Wednesday, Febuary 9, 2005
- * Made a copy of original datatype and do sorting and search
- * on that copy, to protect the original order of members.
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Tfields.c b/src/H5Tfields.c
index 2453e2a..e67c617 100644
--- a/src/H5Tfields.c
+++ b/src/H5Tfields.c
@@ -63,9 +63,6 @@ H5T_init_fields_interface(void)
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with enumeration datatypes.
*-------------------------------------------------------------------------
*/
int
@@ -104,14 +101,12 @@ done:
* Programmer: Raymond Lu
* October 8, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
H5T_get_nmembers(const H5T_t *dt)
{
- int ret_value;
+ int ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -144,9 +139,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with enumeration datatypes.
*-------------------------------------------------------------------------
*/
char *
@@ -185,13 +177,12 @@ done:
* Programmer: Raymond Lu
* October 9, 2002
*
- * Modifications:
*-------------------------------------------------------------------------
*/
char *
H5T__get_member_name(H5T_t const *dt, unsigned membno)
{
- char *ret_value;
+ char *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -243,8 +234,6 @@ done:
* Programmer: Raymond Lu
* Thursday, April 4, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -413,8 +402,6 @@ H5T__sort_value(const H5T_t *dt, int *map)
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c
index 3d6e448..28f7616 100644
--- a/src/H5Tfixed.c
+++ b/src/H5Tfixed.c
@@ -59,9 +59,6 @@ H5T_init_fixed_interface(void)
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived datatypes.
*-------------------------------------------------------------------------
*/
H5T_sign_t
@@ -96,8 +93,6 @@ done:
* Programmer: Raymond Lu
* October 8, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5T_sign_t
@@ -134,10 +129,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived datatypes.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c
index cb470c3..1e8feae 100644
--- a/src/H5Tfloat.c
+++ b/src/H5Tfloat.c
@@ -211,10 +211,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived datatypes.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index 9a53557..afbb7df 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -99,32 +99,33 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction)
size_t comp_size = 0; /* Compound datatype's size */
hid_t ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
H5TRACE2("i", "iTd", type_id, direction);
- /* check argument */
+ /* Check arguments */
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a data type")
if (direction != H5T_DIR_DEFAULT && direction != H5T_DIR_ASCEND && direction != H5T_DIR_DESCEND)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not valid direction value")
+ /* Get the native type */
if ((new_dt = H5T_get_native_type(dt, direction, NULL, NULL, &comp_size)) == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot retrieve native type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "cannot retrieve native type")
+ /* Get an ID for the new type */
if ((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type")
done:
/* Error cleanup */
- if (ret_value < 0) {
+ if (H5I_INVALID_HID == ret_value) {
if (new_dt)
if (H5T_close(new_dt) < 0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype")
+ HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype")
} /* end if */
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Tget_native_type() */
/*-------------------------------------------------------------------------
* Function: H5T_get_native_type
@@ -163,7 +164,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
int snmemb; /* Number of members in compound & enum types */
unsigned nmemb = 0; /* Number of members in compound & enum types */
unsigned u; /* Local index variable */
- H5T_t * ret_value; /* Return value */
+ H5T_t * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -945,7 +946,7 @@ H5_GCC_DIAG_ON("duplicated-branches")
*
* Return: Success: Non-negative value.
*
- * Failure: Negative value.
+ * Failure: Negative value.
*
* Programmer: Raymond Lu
* December 10, 2002
diff --git a/src/H5Toffset.c b/src/H5Toffset.c
index c26cf6c..4e18249 100644
--- a/src/H5Toffset.c
+++ b/src/H5Toffset.c
@@ -54,12 +54,12 @@ H5T_init_offset_interface(void)
* Function: H5Tget_offset
*
* Purpose: Retrieves the bit offset of the first significant bit. The
- * signficant bits of an atomic datum can be offset from the
+ * significant bits of an atomic datum can be offset from the
* beginning of the memory for that datum by an amount of
* padding. The `offset' property specifies the number of bits
* of padding that appear to the "right of" the value. That is,
* if we have a 32-bit datum with 16-bits of precision having
- * the value 0x1122 then it will be layed out in memory as (from
+ * the value 0x1122 then it will be laid out in memory as (from
* small byte address toward larger byte addresses):
*
* Big Big Little Little
@@ -104,12 +104,12 @@ done:
* Function: H5T_get_offset
*
* Purpose: Retrieves the bit offset of the first significant bit. The
- * signficant bits of an atomic datum can be offset from the
+ * significant bits of an atomic datum can be offset from the
* beginning of the memory for that datum by an amount of
* padding. The `offset' property specifies the number of bits
* of padding that appear to the "right of" the value. That is,
* if we have a 32-bit datum with 16-bits of precision having
- * the value 0x1122 then it will be layed out in memory as (from
+ * the value 0x1122 then it will be laid out in memory as (from
* small byte address toward larger byte addresses):
*
* Big Big Little Little
@@ -132,7 +132,7 @@ done:
int
H5T_get_offset(const H5T_t *dt)
{
- int ret_value;
+ int ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(-1)
@@ -153,12 +153,12 @@ done:
* Function: H5Tset_offset
*
* Purpose: Sets the bit offset of the first significant bit. The
- * signficant bits of an atomic datum can be offset from the
+ * significant bits of an atomic datum can be offset from the
* beginning of the memory for that datum by an amount of
* padding. The `offset' property specifies the number of bits
* of padding that appear to the "right of" the value. That is,
* if we have a 32-bit datum with 16-bits of precision having
- * the value 0x1122 then it will be layed out in memory as (from
+ * the value 0x1122 then it will be laid out in memory as (from
* small byte address toward larger byte addresses):
*
* Big Big Little Little
@@ -182,10 +182,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Moved real work to a private function.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -222,12 +218,12 @@ done:
* Function: H5T_set_offset
*
* Purpose: Sets the bit offset of the first significant bit. The
- * signficant bits of an atomic datum can be offset from the
+ * significant bits of an atomic datum can be offset from the
* beginning of the memory for that datum by an amount of
* padding. The `offset' property specifies the number of bits
* of padding that appear to the "right of" the value. That is,
* if we have a 32-bit datum with 16-bits of precision having
- * the value 0x1122 then it will be layed out in memory as (from
+ * the value 0x1122 then it will be laid out in memory as (from
* small byte address toward larger byte addresses):
*
* Big Big Little Little
@@ -251,10 +247,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Toh.c b/src/H5Toh.c
index 2772c79..9096b13 100644
--- a/src/H5Toh.c
+++ b/src/H5Toh.c
@@ -90,7 +90,7 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{
static htri_t
H5O_dtype_isa(struct H5O_t *oh)
{
- htri_t ret_value; /* Return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -119,8 +119,8 @@ done:
static hid_t
H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref)
{
- H5T_t *type = NULL; /* Datatype opened */
- hid_t ret_value; /* Return value */
+ H5T_t *type = NULL; /* Datatype opened */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -158,8 +158,8 @@ done:
static void *
H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id)
{
- H5T_obj_create_t *crt_info = (H5T_obj_create_t *)_crt_info; /* Named datatype creation parameters */
- void * ret_value; /* Return value */
+ H5T_obj_create_t *crt_info = (H5T_obj_create_t *)_crt_info; /* Named datatype creation parameters */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -201,8 +201,8 @@ done:
static H5O_loc_t *
H5O_dtype_get_oloc(hid_t obj_id)
{
- H5T_t * type; /* Datatype opened */
- H5O_loc_t *ret_value; /* Return value */
+ H5T_t * type = NULL; /* Datatype opened */
+ H5O_loc_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5Topaque.c b/src/H5Topaque.c
index 2243900..d0bb53b 100644
--- a/src/H5Topaque.c
+++ b/src/H5Topaque.c
@@ -58,8 +58,6 @@ H5T_init_opaque_interface(void)
* Programmer: Robb Matzke
* Thursday, May 20, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -104,8 +102,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 20, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
char *
diff --git a/src/H5Torder.c b/src/H5Torder.c
index bb7ff99..6a6424c 100644
--- a/src/H5Torder.c
+++ b/src/H5Torder.c
@@ -116,7 +116,7 @@ H5Tget_order(hid_t type_id)
/* Get order */
if (H5T_ORDER_ERROR == (ret_value = H5T_get_order(dt)))
- HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_ORDER_ERROR, "cant't get order for specified datatype")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_ORDER_ERROR, "can't get order for specified datatype")
done:
FUNC_LEAVE_API(ret_value)
@@ -210,7 +210,7 @@ done:
herr_t
H5Tset_order(hid_t type_id, H5T_order_t order)
{
- H5T_t *dt; /* Datatype to modify */
+ H5T_t *dt = NULL; /* Datatype to modify */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
diff --git a/src/H5Tpad.c b/src/H5Tpad.c
index 923a4ae..c592b72 100644
--- a/src/H5Tpad.c
+++ b/src/H5Tpad.c
@@ -59,10 +59,6 @@ H5T_init_pad_interface(void)
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -102,10 +98,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index d96d809..d170a81 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, December 8, 1997
*
* Purpose: This file contains declarations which are visible only within
@@ -161,36 +161,36 @@ struct H5T_path_t {
};
typedef struct H5T_atomic_t {
- H5T_order_t order; /*byte order */
- size_t prec; /*precision in bits */
- size_t offset; /*bit position of lsb of value */
- H5T_pad_t lsb_pad; /*type of lsb padding */
- H5T_pad_t msb_pad; /*type of msb padding */
+ H5T_order_t order; /* byte order */
+ size_t prec; /* precision in bits */
+ size_t offset; /* bit position of lsb of value */
+ H5T_pad_t lsb_pad; /* type of lsb padding */
+ H5T_pad_t msb_pad; /* type of msb padding */
union {
struct {
- H5T_sign_t sign; /*type of integer sign */
- } i; /*integer; integer types */
+ H5T_sign_t sign; /* type of integer sign */
+ } i; /* integer; integer types */
struct {
- size_t sign; /*bit position of sign bit */
- size_t epos; /*position of lsb of exponent */
- size_t esize; /*size of exponent in bits */
- uint64_t ebias; /*exponent bias */
- size_t mpos; /*position of lsb of mantissa */
- size_t msize; /*size of mantissa */
- H5T_norm_t norm; /*normalization */
- H5T_pad_t pad; /*type of padding for internal bits */
- } f; /*floating-point types */
+ size_t sign; /* bit position of sign bit */
+ size_t epos; /* position of lsb of exponent */
+ size_t esize; /* size of exponent in bits */
+ uint64_t ebias; /* exponent bias */
+ size_t mpos; /* position of lsb of mantissa */
+ size_t msize; /* size of mantissa */
+ H5T_norm_t norm; /* normalization */
+ H5T_pad_t pad; /* type of padding for internal bits */
+ } f; /* floating-point types */
struct {
- H5T_cset_t cset; /*character set */
- H5T_str_t pad; /*space or null padding of extra bytes */
- } s; /*string types */
+ H5T_cset_t cset; /* character set */
+ H5T_str_t pad; /* space or null padding of extra bytes */
+ } s; /* string types */
struct {
- H5R_type_t rtype; /*type of reference stored */
- H5T_loc_t loc; /* Location of data in buffer */
- } r; /*reference types */
+ H5R_type_t rtype; /* type of reference stored */
+ H5T_loc_t loc; /* location of data in buffer */
+ } r; /* reference types */
} u;
} H5T_atomic_t;
@@ -249,8 +249,8 @@ typedef enum {
typedef struct H5T_vlen_t {
H5T_vlen_type_t type; /* Type of VL data in buffer */
H5T_loc_t loc; /* Location of VL data in buffer */
- H5T_cset_t cset; /* For VL string. character set */
- H5T_str_t pad; /* For VL string. space or null padding of
+ H5T_cset_t cset; /* For VL string: character set */
+ H5T_str_t pad; /* For VL string: space or null padding of
* extra bytes */
H5F_t * f; /* File ID (if VL data is on disk) */
H5T_vlen_getptrfunc_t getptr; /* Function to get VL sequence pointer */
diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c
index 2319d83..c960696 100644
--- a/src/H5Tprecis.c
+++ b/src/H5Tprecis.c
@@ -66,10 +66,6 @@ H5T_init_precis_interface(void)
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
size_t
@@ -113,7 +109,7 @@ done:
size_t
H5T_get_precision(const H5T_t *dt)
{
- size_t ret_value;
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI(0)
@@ -153,10 +149,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Moved real work to a private function.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -213,10 +205,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index a996169..7e807a4 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -24,9 +24,9 @@
#include "H5MMpublic.h" /* Memory management */
/* Private headers needed by this file */
-#include "H5private.h" /* Generic Functions */
-#include "H5Gprivate.h" /* Groups */
-#include "H5Rprivate.h" /* References */
+#include "H5private.h" /* Generic Functions */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Rprivate.h" /* References */
/* Macro for size of temporary buffers to contain a single element */
#define H5T_ELEM_BUF_SIZE 256
@@ -94,7 +94,7 @@ typedef struct H5T_subset_info_t {
/* Forward declarations for prototype arguments */
struct H5O_t;
-/* The native endianess of the platform */
+/* The native endianness of the platform */
H5_DLLVAR H5T_order_t H5T_native_order_g;
/* Private functions */
diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c
index 119e390..efbf6ee 100644
--- a/src/H5Tstrpad.c
+++ b/src/H5Tstrpad.c
@@ -62,10 +62,6 @@ H5T_init_strpad_interface(void)
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
H5T_str_t
@@ -118,10 +114,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c
index 2a130df..9ff2cb3 100644
--- a/src/H5Tvisit.c
+++ b/src/H5Tvisit.c
@@ -22,7 +22,7 @@
*
* Created: H5Tvisit.c
* Jul 19 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Visit all the components of a datatype
*
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c
index 5c08130..50f721a 100644
--- a/src/H5Tvlen.c
+++ b/src/H5Tvlen.c
@@ -140,8 +140,8 @@ done:
H5T_t *
H5T__vlen_create(const H5T_t *base)
{
- H5T_t *dt = NULL; /*new VL datatype */
- H5T_t *ret_value; /*return value */
+ H5T_t *dt = NULL; /* New VL datatype */
+ H5T_t *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -219,7 +219,7 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc)
dt->shared->u.vlen.loc = H5T_LOC_MEMORY;
if (dt->shared->u.vlen.type == H5T_VLEN_SEQUENCE) {
- /* size in memory, disk size is different */
+ /* Size in memory, disk size is different */
dt->shared->size = sizeof(hvl_t);
/* Set up the function pointers to access the VL sequence in memory */
@@ -229,9 +229,9 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc)
dt->shared->u.vlen.read = H5T_vlen_seq_mem_read;
dt->shared->u.vlen.write = H5T_vlen_seq_mem_write;
dt->shared->u.vlen.setnull = H5T_vlen_seq_mem_setnull;
- }
+ } /* end if */
else if (dt->shared->u.vlen.type == H5T_VLEN_STRING) {
- /* size in memory, disk size is different */
+ /* Size in memory, disk size is different */
dt->shared->size = sizeof(char *);
/* Set up the function pointers to access the VL string in memory */
@@ -241,12 +241,11 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc)
dt->shared->u.vlen.read = H5T_vlen_str_mem_read;
dt->shared->u.vlen.write = H5T_vlen_str_mem_write;
dt->shared->u.vlen.setnull = H5T_vlen_str_mem_setnull;
- }
- else {
+ } /* end else-if */
+ else
HDassert(0 && "Invalid VL type");
- }
- /* Reset file ID (since this VL is in memory) */
+ /* Reset file pointer (since this VL is in memory) */
dt->shared->u.vlen.f = NULL;
break;
@@ -317,7 +316,7 @@ H5T_vlen_seq_mem_getlen(const void *_vl)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- /* check parameters, return result */
+ /* Check parameters, return result */
#ifdef H5_NO_ALIGNMENT_RESTRICTIONS
HDassert(vl);
@@ -378,7 +377,6 @@ H5T_vlen_seq_mem_getptr(void *_vl)
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static htri_t
H5T_vlen_seq_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl)
{
@@ -415,7 +413,6 @@ H5T_vlen_seq_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl)
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len)
{
@@ -456,7 +453,6 @@ H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, voi
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_seq_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf,
@@ -514,7 +510,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_seq_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl,
void H5_ATTR_UNUSED *_bg)
@@ -616,7 +611,6 @@ H5T_vlen_str_mem_getptr(void *_vl)
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static htri_t
H5T_vlen_str_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl)
{
@@ -647,7 +641,6 @@ H5T_vlen_str_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl)
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len)
{
@@ -687,7 +680,6 @@ H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, voi
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf,
@@ -712,6 +704,7 @@ H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for VL data")
} /* end else */
+ /* 'write' the string into the buffer, with memcpy() */
len = (seq_len * base_size);
HDmemcpy(t, buf, len);
t[len] = '\0';
@@ -735,7 +728,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl,
void H5_ATTR_UNUSED *_bg)
@@ -747,7 +739,7 @@ H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
/* Set pointer in user's buffer with memcpy, to avoid alignment issues */
HDmemcpy(_vl, &t, sizeof(char *));
- FUNC_LEAVE_NOAPI(SUCCEED) /*lint !e429 The pointer in 't' has been copied */
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5T_vlen_str_mem_setnull() */
/*-------------------------------------------------------------------------
@@ -765,12 +757,12 @@ H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
static ssize_t
H5T_vlen_disk_getlen(const void *_vl)
{
- const uint8_t *vl = (const uint8_t *)_vl; /* Pointer to the disk VL information */
- size_t seq_len; /* Sequence length */
+ const uint8_t *vl = (const uint8_t *)_vl; /* Pointer to the disk VL information */
+ size_t seq_len = 0; /* Sequence length */
FUNC_ENTER_NOAPI_NOINIT_NOERR
- /* check parameters */
+ /* Check parameters */
HDassert(vl);
UINT32DECODE(vl, seq_len);
@@ -790,13 +782,12 @@ H5T_vlen_disk_getlen(const void *_vl)
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static void *
H5T_vlen_disk_getptr(void H5_ATTR_UNUSED *vl)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- /* check parameters */
+ /* Check parameters */
HDassert(vl);
FUNC_LEAVE_NOAPI(NULL)
@@ -846,7 +837,6 @@ H5T_vlen_disk_isnull(const H5F_t *f, void *_vl)
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR_UNUSED len)
{
@@ -856,7 +846,7 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR
FUNC_ENTER_NOAPI_NOINIT
- /* check parameters */
+ /* Check parameters */
HDassert(vl);
HDassert(buf);
HDassert(f);
@@ -869,11 +859,10 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR
UINT32DECODE(vl, hobjid.idx);
/* Check if this sequence actually has any data */
- if (hobjid.addr > 0) {
+ if (hobjid.addr > 0)
/* Read the VL information from disk */
if (H5HG_read(f, dxpl_id, &hobjid, buf, NULL) == NULL)
HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "Unable to read VL information")
- } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -891,7 +880,6 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR_UNUSED *vl_alloc_info,
void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size)
@@ -921,12 +909,11 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR
UINT32DECODE(bg, bg_hobjid.idx);
/* Free heap object for old data */
- if (bg_hobjid.addr > 0) {
+ if (bg_hobjid.addr > 0)
/* Free heap object */
if (H5HG_remove(f, dxpl_id, &bg_hobjid) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object")
- } /* end if */
- } /* end if */
+ } /* end if */
/* Set the length of the sequence */
UINT32ENCODE(vl, seq_len);
@@ -966,7 +953,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg)
FUNC_ENTER_NOAPI_NOINIT
- /* check parameters */
+ /* Check parameters */
HDassert(f);
HDassert(vl);
@@ -1043,7 +1030,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi
for (u = 0; u < dt->shared->u.array.nelem; u++) {
off = ((uint8_t *)elem) + u * (dt->shared->parent->shared->size);
if (H5T_vlen_reclaim_recurse(off, dt->shared->parent, free_func, free_info) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Unable to free array element")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free array element")
} /* end for */
} /* end if */
break;
@@ -1059,7 +1046,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi
off = ((uint8_t *)elem) + dt->shared->u.compnd.memb[u].offset;
if (H5T_vlen_reclaim_recurse(off, dt->shared->u.compnd.memb[u].type, free_func,
free_info) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Unable to free compound field")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free compound field")
} /* end if */
} /* end for */
break;
@@ -1079,7 +1066,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi
while (vl->len > 0) {
off = ((uint8_t *)vl->p) + (vl->len - 1) * dt->shared->parent->shared->size;
if (H5T_vlen_reclaim_recurse(off, dt->shared->parent, free_func, free_info) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Unable to free VL element")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free VL element")
vl->len--;
} /* end while */
} /* end if */
@@ -1105,6 +1092,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi
default:
break;
+
} /* end switch */ /*lint !e788 All appropriate cases are covered */
done:
@@ -1135,7 +1123,6 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-/* ARGSUSED */
herr_t
H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point,
void *op_data)
diff --git a/src/H5VM.c b/src/H5VM.c
index a4dda6a..e878b7f 100644
--- a/src/H5VM.c
+++ b/src/H5VM.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, October 10, 1997
*/
@@ -57,8 +57,6 @@ static void H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n,
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -101,11 +99,6 @@ H5VM_stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, co
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- * Unrolled loops for common cases
- * Quincey Koziol
- * ?, ? ?, 2001?
- *
*-------------------------------------------------------------------------
*/
static void
@@ -236,11 +229,6 @@ H5VM_stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, co
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- * Unrolled loops for common cases
- * Quincey Koziol
- * ?, ? ?, 2001?
- *
*-------------------------------------------------------------------------
*/
hsize_t
@@ -337,8 +325,6 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, co
* Programmer: Robb Matzke
* Friday, October 17, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -435,8 +421,6 @@ done:
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -507,11 +491,6 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- * Unrolled loops for common cases
- * Quincey Koziol
- * ?, ? ?, 2001?
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -673,8 +652,6 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size,
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -732,8 +709,6 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -800,8 +775,6 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -866,8 +839,6 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -939,8 +910,6 @@ H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
* Programmer: Quincey Koziol
* Thursday, June 18, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -994,8 +963,6 @@ H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count)
* Programmer: Quincey Koziol
* Monday, April 28, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1036,11 +1003,6 @@ H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
* Programmer: Quincey Koziol
* Tuesday, June 22, 1999
*
- * Modifications:
- * Use precomputed accumulator array
- * Quincey Koziol
- * Saturday, April 26, 2003
- *
*-------------------------------------------------------------------------
*/
hsize_t
@@ -1078,8 +1040,6 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
* Programmer: Quincey Koziol
* Tuesday, June 22, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hsize_t
@@ -1159,8 +1119,6 @@ H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *co
* Programmer: Quincey Koziol
* Wednesday, April 16, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1221,13 +1179,11 @@ done:
* The chunk index is placed in the CHUNK_IDX location for return
* from this function
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Chunk index on success (can't fail)
*
* Programmer: Quincey Koziol
* Monday, April 21, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1464,7 +1420,7 @@ done:
*
* Purpose: Given source and destination buffers in memory (SRC & DST)
* copy sequences of from the source buffer into the destination
- * buffer. Each set of sequnces has an array of lengths, an
+ * buffer. Each set of sequences has an array of lengths, an
* array of offsets, the maximum number of sequences and the
* current sequence to start at in the sequence.
*
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index 48422b3..ab3bd21 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -92,6 +92,10 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s
* elements in an array and array dimensions are always of type
* size_t.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: Success: Product of elements
*
* Failure: 1 if N is zero
@@ -99,8 +103,6 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5_INLINE hsize_t H5_ATTR_UNUSED
@@ -125,6 +127,10 @@ done:
*
* Purpose: Determines if all elements of a vector are zero.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: Success: TRUE if all elements are zero,
* FALSE otherwise
*
@@ -133,8 +139,6 @@ done:
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5_INLINE htri_t H5_ATTR_UNUSED
@@ -160,6 +164,10 @@ done:
*
* Purpose: Determines if all elements of a vector are zero.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: Success: TRUE if all elements are zero,
* FALSE otherwise
*
@@ -168,8 +176,6 @@ done:
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5_INLINE htri_t H5_ATTR_UNUSED
@@ -196,6 +202,10 @@ done:
* Purpose: Compares two vectors of the same size and determines if V1 is
* lexicographically less than, equal, or greater than V2.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: Success: -1 if V1 is less than V2
* 0 if they are equal
* 1 if V1 is greater than V2
@@ -205,8 +215,6 @@ done:
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5_INLINE int H5_ATTR_UNUSED
@@ -242,6 +250,10 @@ done:
* Purpose: Compares two vectors of the same size and determines if V1 is
* lexicographically less than, equal, or greater than V2.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: Success: -1 if V1 is less than V2
* 0 if they are equal
* 1 if V1 is greater than V2
@@ -251,8 +263,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, April 8, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5_INLINE int H5_ATTR_UNUSED
@@ -287,13 +297,15 @@ done:
*
* Purpose: Increments V1 by V2
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: void
*
* Programmer: Robb Matzke
* Monday, October 13, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5_INLINE void H5_ATTR_UNUSED
@@ -329,6 +341,10 @@ static const unsigned char LogTable256[] = {
* The version on the web-site is for 32-bit quantities and this
* version has been extended for 64-bit quantities.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: log2(n) (always - no failure condition)
*
* Programmer: Quincey Koziol
@@ -374,6 +390,10 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = {0, 1, 28, 2, 29, 14,
* This is from the "Bit Twiddling Hacks" at:
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: log2(n) (always - no failure condition)
*
* Programmer: Quincey Koziol
@@ -396,6 +416,10 @@ H5VM_log2_of2(uint32_t n)
* Purpose: Determine the # of bytes needed to encode values within a
* range from 0 to a given limit
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: Number of bytes needed
*
* Programmer: Quincey Koziol
@@ -417,13 +441,17 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7,
*
* Purpose: Determine the value of the n'th bit in a buffer.
*
- * Note: No range checking on <offset> is performed!
+ * Note: No range checking on <offset> is performed!
*
- * Note #2: Bits are sequentially stored in the buffer, starting with bit
+ * Note #2: Bits are sequentially stored in the buffer, starting with bit
* offset 0 in the first byte's high-bit position, proceeding down
* to bit offset 7 in the first byte's low-bit position, then to
* bit offset 8 in the second byte's high-bit position, etc.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: TRUE/FALSE
*
* Programmer: Quincey Koziol
@@ -443,13 +471,17 @@ H5VM_bit_get(const unsigned char *buf, size_t offset)
*
* Purpose: Set/reset the n'th bit in a buffer.
*
- * Note: No range checking on <offset> is performed!
+ * Note: No range checking on <offset> is performed!
*
- * Note #2: Bits are sequentially stored in the buffer, starting with bit
+ * Note #2: Bits are sequentially stored in the buffer, starting with bit
* offset 0 in the first byte's high-bit position, proceeding down
* to bit offset 7 in the first byte's low-bit position, then to
* bit offset 8 in the second byte's high-bit position, etc.
*
+ * Note: Although this routine is 'static' in this file, that's intended
+ * only as an optimization and the naming (with a single underscore)
+ * reflects its inclusion in a "private" header file.
+ *
* Return: None
*
* Programmer: Quincey Koziol
diff --git a/src/H5WB.c b/src/H5WB.c
index 8d0bcd1..f177a9b 100644
--- a/src/H5WB.c
+++ b/src/H5WB.c
@@ -15,7 +15,7 @@
*
* Created: H5WB.c
* Jun 26 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implements the "wrapped buffer" code for wrapping
* an existing [staticly sized] buffer, in order to
@@ -88,7 +88,6 @@ H5FL_BLK_DEFINE_STATIC(extra_buf);
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
@@ -141,7 +140,6 @@ done:
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
@@ -208,7 +206,6 @@ done:
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
@@ -245,7 +242,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5WBprivate.h b/src/H5WBprivate.h
index 34077a6..6ab07f7 100644
--- a/src/H5WBprivate.h
+++ b/src/H5WBprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5WBprivate.h
* Jun 26 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Private header for library accessible wrapped buffer routines.
*
diff --git a/src/H5Z.c b/src/H5Z.c
index 354e6e6..d79e1c5 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -16,17 +16,17 @@
/* Interface initialization */
#define H5_INTERFACE_INIT_FUNC H5Z_init_interface
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5PLprivate.h" /* Plugins */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Dataset functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5PLprivate.h" /* Plugins */
#include "H5Sprivate.h" /* Dataspace functions */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5Zpkg.h" /* Data filters */
#ifdef H5_HAVE_SZLIB_H
#include "szlib.h"
@@ -143,7 +143,7 @@ H5Z_term_interface(void)
"Errors", "User", "System", "Elapsed", "Bandwidth");
HDfprintf(H5DEBUG(Z), " %-16s %10s %10s %8s %8s %8s %10s\n", "------", "-----",
"------", "----", "------", "-------", "---------");
- }
+ } /* end if */
/* Truncate the comment to fit in the field */
HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment);
@@ -257,7 +257,7 @@ done:
* Function: H5Z_register
*
* Purpose: Same as the public version except this one allows filters
- * to be set for predefined method numbers <H5Z_FILTER_RESERVED
+ * to be set for predefined method numbers < H5Z_FILTER_RESERVED
*
* Return: Non-negative on success
* Negative on failure
@@ -316,12 +316,12 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Zunregister
+ * Function: H5Zunregister
*
- * Purpose: This function unregisters a filter.
+ * Purpose: This function unregisters a filter.
*
- * Return: Non-negative on success
- * Negative on failure
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -347,20 +347,20 @@ done:
} /* end H5Zunregister() */
/*-------------------------------------------------------------------------
- * Function: H5Z_unregister
+ * Function: H5Z_unregister
*
- * Purpose: Same as the public version except this one allows filters
- * to be unset for predefined method numbers <H5Z_FILTER_RESERVED
+ * Purpose: Same as the public version except this one allows filters
+ * to be unset for predefined method numbers <H5Z_FILTER_RESERVED
+ *
+ * Return: SUCCEED/FAIL
*
- * Return: Non-negative on success
- * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
H5Z_unregister(H5Z_filter_t filter_id)
{
- size_t filter_index; /* Local index variable for filter */
- H5Z_object_t object;
+ size_t filter_index; /* Local index variable for filter */
+ H5Z_object_t object; /* Object to pass to callbacks */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -415,12 +415,14 @@ done:
} /* end H5Z_unregister() */
/*-------------------------------------------------------------------------
- * Function: H5Z__check_unregister
+ * Function: H5Z__check_unregister
+ *
+ * Purpose: Check if an object uses the filter to be unregistered.
*
- * Purpose: Check if an object uses the filter to be unregistered.
+ * Return: TRUE if the object uses the filter
+ * FALSE if not
+ * NEGATIVE on error
*
- * Return: TRUE if the object uses the filter.
- * FALSE if not, NEGATIVE on error.
*-------------------------------------------------------------------------
*/
static htri_t
@@ -444,18 +446,16 @@ done:
} /* end H5Z__check_unregister() */
/*-------------------------------------------------------------------------
- * Function: H5Z__check_unregister_group_cb
+ * Function: H5Z__check_unregister_group_cb
*
- * Purpose: The callback function for H5Z_unregister. It iterates
+ * Purpose: The callback function for H5Z_unregister. It iterates
* through all opened objects. If the object is a dataset
* or a group and it uses the filter to be unregistered, the
* function returns TRUE.
*
- * Return: TRUE if the object uses the filter.
- * FALSE otherwise.
- *
- * Programmer: Raymond Lu
- * 6 May 2013
+ * Return: TRUE if the object uses the filter
+ * FALSE if not
+ * NEGATIVE on error
*
*-------------------------------------------------------------------------
*/
@@ -485,7 +485,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void
if (filter_in_pline) {
object->found = TRUE;
ret_value = TRUE;
- } /* end if */
+ }
done:
if (ocpl_id > 0)
@@ -496,18 +496,16 @@ done:
} /* end H5Z__check_unregister_group_cb() */
/*-------------------------------------------------------------------------
- * Function: H5Z__check_unregister_dset_cb
+ * Function: H5Z__check_unregister_dset_cb
*
- * Purpose: The callback function for H5Z_unregister. It iterates
+ * Purpose: The callback function for H5Z_unregister. It iterates
* through all opened objects. If the object is a dataset
* or a group and it uses the filter to be unregistered, the
* function returns TRUE.
*
- * Return: TRUE if the object uses the filter.
- * FALSE otherwise.
- *
- * Programmer: Raymond Lu
- * 6 May 2013
+ * Return: TRUE if the object uses the filter
+ * FALSE if not
+ * NEGATIVE on error
*
*-------------------------------------------------------------------------
*/
@@ -537,7 +535,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *
if (filter_in_pline) {
object->found = TRUE;
ret_value = TRUE;
- } /* end if */
+ }
done:
if (ocpl_id > 0)
@@ -548,17 +546,13 @@ done:
} /* end H5Z__check_unregister_dset_cb() */
/*-------------------------------------------------------------------------
- * Function: H5Z__flush_file_cb
+ * Function: H5Z__flush_file_cb
*
- * Purpose: The callback function for H5Z_unregister. It iterates
+ * Purpose: The callback function for H5Z_unregister. It iterates
* through all opened files and flush them.
*
- * Return: FALSE if finishes flushing and moves on
- * FAIL if there is an error
- *
- * Programmer: Raymond Lu
- * 6 May 2013
- *
+ * Return: NON-NEGATIVE if finishes flushing and moves on
+ * NEGATIVE if there is an error
*-------------------------------------------------------------------------
*/
static int
@@ -568,6 +562,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUS
FUNC_ENTER_STATIC
+ /* Sanity checks */
HDassert(obj_ptr);
/* Call the flush routine for mounted file hierarchies. Do a global flush
@@ -582,17 +577,11 @@ done:
} /* end H5Z__flush_file_cb() */
/*-------------------------------------------------------------------------
- * Function: H5Zfilter_avail
- *
- * Purpose: Check if a filter is available
- *
- * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Thursday, November 14, 2002
+ * Function: H5Zfilter_avail
*
- * Modifications:
+ * Purpose: Check if a filter is available
*
+ * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*-------------------------------------------------------------------------
*/
htri_t
@@ -615,15 +604,11 @@ done:
} /* end H5Zfilter_avail() */
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_avail
+ * Function: H5Z_filter_avail
*
- * Purpose: Private function to check if a filter is available
- *
- * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * 13 February 2013
+ * Purpose: Private function to check if a filter is available
*
+ * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*-------------------------------------------------------------------------
*/
htri_t
@@ -650,21 +635,16 @@ done:
} /* end H5Z_filter_avail() */
/*-------------------------------------------------------------------------
- * Function: H5Z_prelude_callback
- *
- * Purpose: Makes a dataset creation "prelude" callback for the "can_apply"
- * or "set_local" routines.
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5Z_prelude_callback
*
- * Programmer: Quincey Koziol
- * Friday, April 4, 2003
+ * Purpose: Makes a dataset creation "prelude" callback for the "can_apply"
+ * or "set_local" routines.
*
- * Notes:
- * The chunk dimensions are used to create a dataspace, instead
- * of passing in the dataset's dataspace, since the chunk
- * dimensions are what the I/O filter will actually see
+ * Return: Non-negative on success/Negative on failure
*
+ * Notes: The chunk dimensions are used to create a dataspace, instead
+ * of passing in the dataset's dataspace, since the chunk
+ * dimensions are what the I/O filter will actually see
*-------------------------------------------------------------------------
*/
static herr_t
@@ -736,21 +716,16 @@ done:
} /* end H5Z_prelude_callback() */
/*-------------------------------------------------------------------------
- * Function: H5Z_prepare_prelude_callback_dcpl
- *
- * Purpose: Prepares to make a dataset creation "prelude" callback
- * for the "can_apply" or "set_local" routines.
+ * Function: H5Z_prepare_prelude_callback_dcpl
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Prepares to make a dataset creation "prelude" callback
+ * for the "can_apply" or "set_local" routines.
*
- * Programmer: Quincey Koziol
- * Friday, April 4, 2003
- *
- * Notes:
- * The chunk dimensions are used to create a dataspace, instead
- * of passing in the dataset's dataspace, since the chunk
- * dimensions are what the I/O filter will actually see
+ * Return: Non-negative on success/Negative on failure
*
+ * Notes: The chunk dimensions are used to create a dataspace, instead
+ * of passing in the dataset's dataspace, since the chunk
+ * dimensions are what the I/O filter will actually see
*-------------------------------------------------------------------------
*/
static herr_t
@@ -801,14 +776,14 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type
if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) {
(void)H5S_close(space);
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
- } /* end if */
+ }
/* Make the callbacks */
if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter")
- } /* end if */
- } /* end if */
- } /* end if */
+ }
+ }
+ }
done:
if (space_id > 0 && H5I_dec_ref(space_id) < 0)
@@ -818,22 +793,18 @@ done:
} /* end H5Z_prepare_prelude_callback_dcpl() */
/*-------------------------------------------------------------------------
- * Function: H5Z_can_apply
- *
- * Purpose: Checks if all the filters defined in the dataset creation
- * property list can be applied to a particular combination of
- * datatype and dataspace for a dataset.
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5Z_can_apply
*
- * Programmer: Quincey Koziol
- * Thursday, April 3, 2003
+ * Purpose: Checks if all the filters defined in the dataset creation
+ * property list can be applied to a particular combination of
+ * datatype and dataspace for a dataset.
*
- * Notes:
- * The chunk dimensions are used to create a dataspace, instead
- * of passing in the dataset's dataspace, since the chunk
- * dimensions are what the I/O filter will actually see
+ * Return: Non-negative on success
+ * Negative on failure
*
+ * Notes: The chunk dimensions are used to create a dataspace, instead
+ * of passing in the dataset's dataspace, since the chunk
+ * dimensions are what the I/O filter will actually see
*-------------------------------------------------------------------------
*/
herr_t
@@ -852,22 +823,18 @@ done:
} /* end H5Z_can_apply() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local
- *
- * Purpose: Makes callbacks to modify dataset creation list property
- * settings for filters on a new dataset, based on the datatype
- * and dataspace of that dataset (chunk).
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5Z_set_local
*
- * Programmer: Quincey Koziol
- * Friday, April 4, 2003
+ * Purpose: Makes callbacks to modify dataset creation list property
+ * settings for filters on a new dataset, based on the datatype
+ * and dataspace of that dataset (chunk).
*
- * Notes:
- * The chunk dimensions are used to create a dataspace, instead
- * of passing in the dataset's dataspace, since the chunk
- * dimensions are what the I/O filter will actually see
+ * Return: Non-negative on success
+ * Negative on failure
*
+ * Notes: The chunk dimensions are used to create a dataspace, instead
+ * of passing in the dataset's dataspace, since the chunk
+ * dimensions are what the I/O filter will actually see
*-------------------------------------------------------------------------
*/
herr_t
@@ -886,17 +853,14 @@ done:
} /* end H5Z_set_local() */
/*-------------------------------------------------------------------------
- * Function: H5Z_can_apply_direct
- *
- * Purpose: Checks if all the filters defined in the pipeline can be
- * applied to an opaque byte stream (currently only a group).
- * The pipeline is assumed to have at least one filter.
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5Z_can_apply_direct
*
- * Programmer: Neil Fortner
- * Tuesday, September 22, 2009
+ * Purpose: Checks if all the filters defined in the pipeline can be
+ * applied to an opaque byte stream (currently only a group).
+ * The pipeline is assumed to have at least one filter.
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -917,22 +881,18 @@ done:
} /* end H5Z_can_apply_direct() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local_direct
- *
- * Purpose: Makes callbacks to modify local settings for filters on a
- * new opaque object. The pipeline is assumed to have at
- * least one filter.
+ * Function: H5Z_set_local_direct
*
- * Return: Non-negative on success/Negative on failure
+ * Purpose: Makes callbacks to modify local settings for filters on a
+ * new opaque object. The pipeline is assumed to have at
+ * least one filter.
*
- * Programmer: Neil Fortner
- * Tuesday, September 22, 2009
- *
- * Notes:
- * This callback will almost certainly not do anything
- * useful, other than to make certain that the filter will
- * accept opque data.
+ * Return: Non-negative on success
+ * Negative on failure
*
+ * Notes: This callback will almost certainly not do anything
+ * useful, other than to make certain that the filter will
+ * accept opaque data.
*-------------------------------------------------------------------------
*/
herr_t
@@ -953,17 +913,12 @@ done:
} /* end H5Z_set_local_direct() */
/*-------------------------------------------------------------------------
- * Function: H5Z_modify
- *
- * Purpose: Modify filter parameters for specified pipeline.
+ * Function: H5Z_modify
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Friday, April 5, 2003
- *
- * Modifications:
+ * Purpose: Modify filter parameters for specified pipeline.
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -1022,17 +977,12 @@ done:
} /* end H5Z_modify() */
/*-------------------------------------------------------------------------
- * Function: H5Z_append
- *
- * Purpose: Append another filter to the specified pipeline.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Tuesday, August 4, 1998
+ * Function: H5Z_append
*
- * Modifications:
+ * Purpose: Append another filter to the specified pipeline.
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -1125,19 +1075,13 @@ done:
} /* end H5Z_append() */
/*-------------------------------------------------------------------------
- * Function: H5Z_find_idx
- *
- * Purpose: Given a filter ID return the offset in the global array
- * that holds all the registered filters.
+ * Function: H5Z__find_idx
*
- * Return: Success: Non-negative index of entry in global filter table.
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Friday, April 5, 2003
- *
- * Modifications:
+ * Purpose: Given a filter ID return the offset in the global array
+ * that holds all the registered filters.
*
+ * Return: Success: Non-negative index of entry in global filter table.
+ * Failure: Negative
*-------------------------------------------------------------------------
*/
static int
@@ -1157,21 +1101,13 @@ done:
} /* end H5Z_find_idx() */
/*-------------------------------------------------------------------------
- * Function: H5Z_find
- *
- * Purpose: Given a filter ID return a pointer to a global struct that
- * defines the filter.
- *
- * Return: Success: Ptr to entry in global filter table.
- * Failure: NULL
+ * Function: H5Z_find
*
- * Programmer: Robb Matzke
- * Wednesday, August 5, 1998
- *
- * Modifications:
- * Use H5Z_find_idx now
- * Quincey Koziol, April 5, 2003
+ * Purpose: Given a filter ID return a pointer to a global struct that
+ * defines the filter.
*
+ * Return: Success: Ptr to entry in global filter table.
+ * Failure: NULL
*-------------------------------------------------------------------------
*/
H5Z_class2_t *
@@ -1194,31 +1130,26 @@ done:
} /* H5Z_find() */
/*-------------------------------------------------------------------------
- * Function: H5Z_pipeline
- *
- * Purpose: Process data through the filter pipeline. The FLAGS argument
- * is the filter invocation flags (definition flags come from
- * the PLINE->filter[].flags). The filters are processed in
- * definition order unless the H5Z_FLAG_REVERSE is set. The
- * FILTER_MASK is a bit-mask to indicate which filters to skip
- * and on exit will indicate which filters failed. Each
- * filter has an index number in the pipeline and that index
- * number is the filter's bit in the FILTER_MASK. NBYTES is the
- * number of bytes of data to filter and on exit should be the
- * number of resulting bytes while BUF_SIZE holds the total
- * allocated size of the buffer, which is pointed to BUF.
- *
- * If the buffer must grow during processing of the pipeline
- * then the pipeline function should free the original buffer
- * and return a fresh buffer, adjusting BUF_SIZE accordingly.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Tuesday, August 4, 1998
- *
- * Modifications:
+ * Function: H5Z_pipeline
+ *
+ * Purpose: Process data through the filter pipeline. The FLAGS argument
+ * is the filter invocation flags (definition flags come from
+ * the PLINE->filter[].flags). The filters are processed in
+ * definition order unless the H5Z_FLAG_REVERSE is set. The
+ * FILTER_MASK is a bit-mask to indicate which filters to skip
+ * and on exit will indicate which filters failed. Each
+ * filter has an index number in the pipeline and that index
+ * number is the filter's bit in the FILTER_MASK. NBYTES is the
+ * number of bytes of data to filter and on exit should be the
+ * number of resulting bytes while BUF_SIZE holds the total
+ * allocated size of the buffer, which is pointed to BUF.
+ *
+ * If the buffer must grow during processing of the pipeline
+ * then the pipeline function should free the original buffer
+ * and return a fresh buffer, adjusting BUF_SIZE accordingly.
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -1226,7 +1157,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
H5Z_cb_t cb_struct, size_t *nbytes /*in,out*/, size_t *buf_size /*in,out*/,
void **buf /*in,out*/)
{
- size_t i, idx, new_nbytes;
+ size_t idx;
+ size_t new_nbytes;
int fclass_idx; /* Index of filter class in global table */
H5Z_class2_t *fclass = NULL; /* Filter class pointer */
#ifdef H5Z_DEBUG
@@ -1235,6 +1167,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
#endif
unsigned failed = 0;
unsigned tmp_flags;
+ size_t i;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1249,10 +1182,9 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */
for (i = pline->nused; i > 0; --i) {
idx = i - 1;
-
if (*filter_mask & ((unsigned)1 << idx)) {
failed |= (unsigned)1 << idx;
- continue; /*filter excluded*/
+ continue; /* filter excluded */
}
/* If the filter isn't registered and the application doesn't
@@ -1275,7 +1207,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
* and registered */
if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0)
issue_error = TRUE;
- } /* end if */
+ }
else
issue_error = TRUE;
@@ -1289,14 +1221,16 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
else
HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL,
"required filter (name unavailable) is not registered")
- } /* end if */
- } /* end if */
+ }
+ } /* end if */
fclass = &H5Z_table_g[fclass_idx];
+
#ifdef H5Z_DEBUG
fstats = &H5Z_stat_table_g[fclass_idx];
H5_timer_begin(&timer);
#endif
+
tmp_flags = flags | (pline->filter[idx].flags);
tmp_flags |= (edc_read == H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0;
new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts,
@@ -1319,16 +1253,15 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
failed |= (unsigned)1 << idx;
H5E_clear_stack(NULL);
}
- else {
+ else
*nbytes = new_nbytes;
- }
}
}
else if (pline) { /* Write */
for (idx = 0; idx < pline->nused; idx++) {
if (*filter_mask & ((unsigned)1 << idx)) {
failed |= (unsigned)1 << idx;
- continue; /*filter excluded*/
+ continue; /* filter excluded */
}
if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) {
/* Check if filter is optional -- If it isn't, then error */
@@ -1337,21 +1270,26 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
failed |= (unsigned)1 << idx;
H5E_clear_stack(NULL);
- continue; /*filter excluded*/
- }
+ continue; /* filter excluded */
+ } /* end if */
+
fclass = &H5Z_table_g[fclass_idx];
+
#ifdef H5Z_DEBUG
fstats = &H5Z_stat_table_g[fclass_idx];
H5_timer_begin(&timer);
#endif
+
new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts,
pline->filter[idx].cd_values, *nbytes, buf_size, buf);
+
#ifdef H5Z_DEBUG
H5_timer_end(&(fstats->stats[0].timer), &timer);
fstats->stats[0].total += MAX(*nbytes, new_nbytes);
if (0 == new_nbytes)
fstats->stats[0].errors += *nbytes;
#endif
+
if (0 == new_nbytes) {
if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) {
if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf,
@@ -1361,14 +1299,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
*nbytes = *buf_size;
}
-
failed |= (unsigned)1 << idx;
H5E_clear_stack(NULL);
}
- else {
+ else
*nbytes = new_nbytes;
- }
- }
+ } /* end for */
}
*filter_mask = failed;
@@ -1378,24 +1314,19 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_info
- *
- * Purpose: Get pointer to filter info for pipeline
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Friday, April 5, 2003
+ * Function: H5Z_filter_info
*
- * Modifications:
+ * Purpose: Get pointer to filter info for pipeline
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
H5Z_filter_info_t *
H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter)
{
- size_t idx; /* Index of filter in pipeline */
- H5Z_filter_info_t *ret_value; /* Return value */
+ size_t idx; /* Index of filter in pipeline */
+ H5Z_filter_info_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1419,20 +1350,14 @@ done:
} /* end H5Z_filter_info() */
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_in_pline
- *
- * Purpose: Check wheter a filter is in the filter pipeline using the
- * filter ID. This function is very similar to H5Z_filter_info
- *
- * Return: TRUE - found filter
- * FALSE - not found
- * FAIL - error
+ * Function: H5Z_filter_in_pline
*
- * Programmer: Raymond Lu
- * 26 April 2013
- *
- * Modifications:
+ * Purpose: Check wheter a filter is in the filter pipeline using the
+ * filter ID. This function is very similar to H5Z_filter_info
*
+ * Return: TRUE - found filter
+ * FALSE - not found
+ * FAIL - error
*-------------------------------------------------------------------------
*/
htri_t
@@ -1460,18 +1385,13 @@ done:
} /* end H5Z_filter_in_pline() */
/*-------------------------------------------------------------------------
- * Function: H5Z_all_filters_avail
- *
- * Purpose: Verify that all the filters in a pipeline are currently
- * available (i.e. registered)
- *
- * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * Tuesday, April 8, 2003
+ * Function: H5Z_all_filters_avail
*
- * Modifications:
+ * Purpose: Verify that all the filters in a pipeline are currently
+ * available (i.e. registered)
*
+ * Return: Non-negative (TRUE/FALSE) on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
htri_t
@@ -1487,7 +1407,6 @@ H5Z_all_filters_avail(const H5O_pline_t *pline)
/* Iterate through all the filters in pipeline */
for (i = 0; i < pline->nused; i++) {
-
/* Look for each filter in the list of registered filters */
for (j = 0; j < H5Z_table_used_g; j++)
if (H5Z_table_g[j].id == pline->filter[i].id)
@@ -1505,16 +1424,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_delete
*
- * Purpose: Delete filter FILTER from pipeline PLINE;
- * deletes all filters if FILTER is H5Z_FILTER_NONE
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Pedro Vicente
- * Monday, January 26, 2004
- *
- * Modifications:
+ * Purpose: Delete filter FILTER from pipeline PLINE;
+ * deletes all filters if FILTER is H5Z_FILTER_NONE
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -1536,7 +1450,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter)
if (H5Z_FILTER_ALL == filter) {
if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info")
- } /* end if */
+ }
/* Delete filter */
else {
size_t idx; /* Index of filter in pipeline */
@@ -1547,7 +1461,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter)
if (pline->filter[idx].id == filter) {
found = TRUE;
break;
- } /* end if */
+ }
/* filter was not found in the pipeline */
if (!found)
@@ -1572,8 +1486,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter)
pline->filter[idx].name = pline->filter[idx]._name;
if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES)
pline->filter[idx].cd_values = pline->filter[idx]._cd_values;
- } /* end for */
- } /* end if */
+ }
+ }
/* Decrement number of used filters */
pline->nused--;
@@ -1589,14 +1503,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Zget_filter_info
*
- * Purpose: Gets information about a pipeline data filter and stores it
- * in filter_config_flags.
- *
- * Return: zero on success / negative on failure
- *
- * Programmer: James Laird and Nat Furrer
- * Monday, June 7, 2004
+ * Purpose: Gets information about a pipeline data filter and stores it
+ * in filter_config_flags.
*
+ * Return: zero on success
+ * negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -1618,14 +1529,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_get_filter_info
*
- * Purpose: Gets information about a pipeline data filter and stores it
- * in filter_config_flags.
- *
- * Return: zero on success / negative on failure
- *
- * Programmer: Quincey Koziol
- * Saturday, May 11, 2013
+ * Purpose: Gets information about a pipeline data filter and stores it
+ * in filter_config_flags.
*
+ * Return: zero on success
+ * negative on failure
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index a2a2443..308a741 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, August 27, 1999
*/
@@ -62,8 +62,6 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{
* Programmer: Robb Matzke
* Thursday, April 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -72,7 +70,7 @@ H5Z_filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
{
void * outbuf = NULL; /* Pointer to new buffer */
int status; /* Status from zlib operation */
- size_t ret_value; /* Return value */
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI(0)
diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c
index 1779910..a7514cb 100644
--- a/src/H5Zfletcher32.c
+++ b/src/H5Zfletcher32.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu<slu@ncsa.uiuc.edu>
+ * Programmer: Raymond Lu
* Jan 3, 2003
*/
@@ -53,20 +53,8 @@ const H5Z_class2_t H5Z_FLETCHER32[1] = {{
* Programmer: Raymond Lu
* Jan 3, 2003
*
- * Modifications:
- * Raymond Lu
- * July 8, 2005
- * There was a bug in the calculating code of the Fletcher32
- * checksum in the library before v1.6.3. The checksum
- * value wasn't consistent between big-endian and little-endian
- * systems. This bug was fixed in Release 1.6.3. However,
- * after fixing the bug, the checksum value is no longer the
- * same as before on little-endian system. We'll check both
- * the correct checksum and the wrong checksum to be consistent
- * with Release 1.6.2 and before.
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static size_t
H5Z_filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf)
@@ -77,7 +65,7 @@ H5Z_filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts,
uint32_t reversed_fletcher; /* Possible wrong checksum value */
uint8_t c[4];
uint8_t tmp;
- size_t ret_value; /* Return value */
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI(0)
diff --git a/src/H5Znbit.c b/src/H5Znbit.c
index 7b02240..2b5e299 100644
--- a/src/H5Znbit.c
+++ b/src/H5Znbit.c
@@ -123,8 +123,6 @@ static unsigned parms_index = 0;
* Programmer: Xiaowen Wu
* Tuesday, December 21, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -161,8 +159,6 @@ done:
* Programmer: Xiaowen Wu
* Thursday, March 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -185,8 +181,6 @@ H5Z_calc_parms_nooptype(void)
* Programmer: Xiaowen Wu
* Saturday, January 29, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -221,8 +215,6 @@ H5Z_calc_parms_atomic(void)
* Programmer: Xiaowen Wu
* Wednesday, January 19, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -291,8 +283,6 @@ done:
* Programmer: Xiaowen Wu
* Wednesday, January 19, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -382,8 +372,6 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, April 5, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -420,8 +408,6 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, January 11, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -505,8 +491,6 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, April 5, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -515,7 +499,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned cd_values[])
H5T_t * dtype_base = NULL; /* Array datatype's base datatype */
H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */
size_t dtype_size; /* Array datatype's size (in bytes) */
- htri_t is_vlstring; /* flag indicating if datatype is varible-length string */
+ htri_t is_vlstring; /* flag indicating if datatype is variable-length string */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -591,8 +575,6 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, April 5, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -604,7 +586,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned cd_values[])
size_t dtype_member_offset; /* Compound datatype's current member datatype's offset (in bytes) */
size_t dtype_next_member_offset; /* Compound datatype's next member datatype's offset (in bytes) */
size_t dtype_size; /* Compound datatype's size (in bytes) */
- htri_t is_vlstring; /* flag indicating if datatype is varible-length string */
+ htri_t is_vlstring; /* flag indicating if datatype is variable-length string */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -715,8 +697,6 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, January 11, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -788,7 +768,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get dataspace */
if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Get total number of elements in the chunk */
if ((npoints = H5S_GET_EXTENT_NPOINTS(ds)) < 0)
@@ -1070,6 +1050,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned
for (i = 0; i < n; i++)
H5Z_nbit_decompress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, p);
break;
+
case H5Z_NBIT_ARRAY:
base_size = parms[parms_index]; /* read in advance */
n = total_size / base_size; /* number of base_type elements inside the array datatype */
@@ -1081,6 +1062,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned
parms_index = begin_index;
}
break;
+
case H5Z_NBIT_COMPOUND:
base_size = parms[parms_index]; /* read in advance */
n = total_size / base_size; /* number of base_type elements inside the array datatype */
@@ -1092,10 +1074,12 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned
parms_index = begin_index;
}
break;
+
case H5Z_NBIT_NOOPTYPE:
parms_index++; /* skip size of no-op type */
H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size);
break;
+
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
@@ -1141,11 +1125,13 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig
H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, p);
break;
+
case H5Z_NBIT_ARRAY:
if (H5Z__nbit_decompress_one_array(data, data_offset + member_offset, buffer, j, buf_len,
parms) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array")
break;
+
case H5Z_NBIT_COMPOUND:
if (H5Z__nbit_decompress_one_compound(data, data_offset + member_offset, buffer, j, buf_len,
parms) < 0)
@@ -1157,6 +1143,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig
H5Z_nbit_decompress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len,
member_size);
break;
+
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
@@ -1188,7 +1175,6 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff
switch (parms[3]) {
case H5Z_NBIT_ATOMIC:
- /* set the index before goto function call */
p.size = parms[4];
p.order = parms[5];
p.precision = parms[6];
@@ -1202,24 +1188,27 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff
H5Z_nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p);
}
break;
+
case H5Z_NBIT_ARRAY:
size = parms[4];
- parms_index = 4;
+ parms_index = 4; /* set the index before goto function call */
for (i = 0; i < d_nelmts; i++) {
if (H5Z__nbit_decompress_one_array(data, i * size, buffer, &j, &buf_len, parms) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array")
parms_index = 4;
}
break;
+
case H5Z_NBIT_COMPOUND:
size = parms[4];
- parms_index = 4;
+ parms_index = 4; /* set the index before goto function call */
for (i = 0; i < d_nelmts; i++) {
if (H5Z__nbit_decompress_one_compound(data, i * size, buffer, &j, &buf_len, parms) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound")
parms_index = 4;
}
break;
+
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
@@ -1349,6 +1338,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch
for (i = 0; i < n; i++)
H5Z_nbit_compress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, p);
break;
+
case H5Z_NBIT_ARRAY:
base_size = parms[parms_index]; /* read in advance */
n = total_size / base_size; /* number of base_type elements inside the array datatype */
@@ -1358,6 +1348,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch
parms_index = begin_index;
}
break;
+
case H5Z_NBIT_COMPOUND:
base_size = parms[parms_index]; /* read in advance */
n = total_size / base_size; /* number of base_type elements inside the array datatype */
@@ -1367,10 +1358,12 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch
parms_index = begin_index;
}
break;
+
case H5Z_NBIT_NOOPTYPE:
parms_index++; /* skip size of no-op type */
H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size);
break;
+
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
@@ -1398,16 +1391,20 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned
p.offset = parms[parms_index++];
H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, p);
break;
+
case H5Z_NBIT_ARRAY:
H5Z_nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms);
break;
+
case H5Z_NBIT_COMPOUND:
H5Z_nbit_compress_one_compound(data, data_offset + member_offset, buffer, j, buf_len, parms);
break;
+
case H5Z_NBIT_NOOPTYPE:
size = parms[parms_index++];
H5Z_nbit_compress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len, size);
break;
+
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
@@ -1420,7 +1417,8 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
{
/* i: index of data, new_size: index of buffer,
buf_len: number of bits to be filled in current byte */
- size_t i, size;
+ unsigned i;
+ size_t size;
size_t new_size = 0;
int buf_len;
parms_atomic p;
@@ -1433,7 +1431,6 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
switch (parms[3]) {
case H5Z_NBIT_ATOMIC:
- /* set the index before goto function call */
p.size = parms[4];
p.order = parms[5];
p.precision = parms[6];
@@ -1443,6 +1440,7 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
H5Z_nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, p);
}
break;
+
case H5Z_NBIT_ARRAY:
size = parms[4];
parms_index = 4;
@@ -1451,6 +1449,7 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
parms_index = 4;
}
break;
+
case H5Z_NBIT_COMPOUND:
size = parms[4];
parms_index = 4;
@@ -1459,6 +1458,7 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
parms_index = 4;
}
break;
+
default:
HDassert(0 && "This Should never be executed!");
} /* end switch */
diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h
index 2e227e6..018a043 100644
--- a/src/H5Zprivate.h
+++ b/src/H5Zprivate.h
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Thursday, April 16, 1998
*/
diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h
index 78227b1..97da13c 100644
--- a/src/H5Zpublic.h
+++ b/src/H5Zpublic.h
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Thursday, April 16, 1998
*/
@@ -25,7 +25,7 @@
* Filter identifiers. Values 0 through 255 are for filters defined by the
* HDF5 library. Values 256 through 511 are available for testing new
* filters. Subsequent values should be obtained from the HDF5 development
- * team at hdf5dev@ncsa.uiuc.edu. These values will never change because they
+ * team at help@hdfgroup.org. These values will never change because they
* appear in the HDF5 files.
*/
typedef int H5Z_filter_t;
@@ -50,7 +50,7 @@ typedef int H5Z_filter_t;
* unlimited amount, but currently each
* filter uses a bit in a 32-bit field,
* so the format would have to be
- * changed to accomodate that)
+ * changed to accommodate that)
*/
/* Flags for filter definition (stored) */
@@ -203,14 +203,14 @@ typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, const unsigne
* contain a pointers to the filter function and timing statistics.
*/
typedef struct H5Z_class2_t {
- int version; /* Version number of the H5Z_class_t struct */
- H5Z_filter_t id; /* Filter ID number */
- unsigned encoder_present; /* Does this filter have an encoder? */
- unsigned decoder_present; /* Does this filter have a decoder? */
- const char * name; /* Comment for debugging */
- H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */
- H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */
- H5Z_func_t filter; /* The actual filter function */
+ int version; /* Version number of the H5Z_class_t struct */
+ H5Z_filter_t id; /* Filter ID number */
+ unsigned encoder_present; /* Does this filter have an encoder? */
+ unsigned decoder_present; /* Does this filter have a decoder? */
+ const char * name; /* Comment for debugging */
+ H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */
+ H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */
+ H5Z_func_t filter; /* The actual filter function */
} H5Z_class2_t;
H5_DLL herr_t H5Zregister(const void *cls);
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index fdfaa2f..a234a6d 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -13,16 +13,16 @@
#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
-#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#include "H5Oprivate.h" /* Object headers */
-#include "H5Sprivate.h" /* Dataspaces */
-#include "H5Tprivate.h" /* Datatypes */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5Sprivate.h" /* Dataspaces */
+#include "H5Tprivate.h" /* Datatypes */
+#include "H5Zpkg.h" /* Data filters */
/* Struct of parameters needed for compressing/decompressing one atomic datatype */
typedef struct {
@@ -727,19 +727,17 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
}
/*-------------------------------------------------------------------------
- * Function: H5Z_can_apply_scaleoffset
+ * Function: H5Z_can_apply_scaleoffset
*
- * Purpose: Check the parameters for scaleoffset compression for
+ * Purpose: Check the parameters for scaleoffset compression for
* validity and whether they fit a particular dataset.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Xiaowen Wu
* Friday, February 4, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -781,26 +779,24 @@ done:
} /* end H5Z_can_apply_scaleoffset() */
/*-------------------------------------------------------------------------
- * Function: H5Z_scaleoffset_get_type
+ * Function: H5Z_scaleoffset_get_type
*
- * Purpose: Get the specific integer type based on datatype size and sign
+ * Purpose: Get the specific integer type based on datatype size and sign
* or floating-point type based on size
*
- * Return: Success: id number of integer type
- * Failure: 0
+ * Return: Success: id number of integer type
+ * Failure: 0
*
- * Programmer: Xiaowen Wu
+ * Programmer: Xiaowen Wu
* Wednesday, April 13, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static enum H5Z_scaleoffset_t
H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign)
{
- enum H5Z_scaleoffset_t type = t_bad; /* integer type */
- enum H5Z_scaleoffset_t ret_value; /* return value */
+ enum H5Z_scaleoffset_t type = t_bad; /* integer type */
+ enum H5Z_scaleoffset_t ret_value = t_bad; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -853,12 +849,12 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_scaleoffset_set_parms_fillval
+ * Function: H5Z_scaleoffset_set_parms_fillval
*
- * Purpose: Get the fill value of the dataset and store in cd_values[]
+ * Purpose: Get the fill value of the dataset and store in cd_values[]
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Xiaowen Wu
* Monday, March 7, 2005
@@ -908,19 +904,17 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum
} /* end H5Z_scaleoffset_set_parms_fillval() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local_scaleoffset
+ * Function: H5Z_set_local_scaleoffset
*
- * Purpose: Set the "local" dataset parameters for scaleoffset
+ * Purpose: Set the "local" dataset parameters for scaleoffset
* compression.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Xiaowen Wu
+ * Programmer: Xiaowen Wu
* Friday, February 4, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -963,7 +957,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get dataspace */
if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Get total number of elements in the chunk */
if ((npoints = H5S_GET_EXTENT_NPOINTS(ds)) < 0)
@@ -1059,7 +1053,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
if (status == H5D_FILL_VALUE_UNDEFINED)
cd_values[H5Z_SCALEOFFSET_PARM_FILAVAIL] = H5Z_SCALEOFFSET_FILL_UNDEFINED;
else {
- int need_convert = FALSE; /* Flag indicating convertion of byte order */
+ int need_convert = FALSE; /* Flag indicating conversion of byte order */
cd_values[H5Z_SCALEOFFSET_PARM_FILAVAIL] = H5Z_SCALEOFFSET_FILL_DEFINED;
@@ -1089,19 +1083,17 @@ done:
} /* end H5Z_set_local_scaleoffset() */
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_scaleoffset
+ * Function: H5Z_filter_scaleoffset
*
- * Purpose: Implement an I/O filter for storing packed integer
+ * Purpose: Implement an I/O filter for storing packed integer
* data using scale and offset method.
*
- * Return: Success: Size of buffer filtered
- * Failure: 0
+ * Return: Success: Size of buffer filtered
+ * Failure: 0
*
- * Programmer: Xiaowen Wu
+ * Programmer: Xiaowen Wu
* Monday, February 7, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -1120,17 +1112,17 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
uint32_t minbits = 0; /* minimum number of bits to store values */
unsigned long long minval = 0; /* minimum value of input buffer */
enum H5Z_scaleoffset_t type; /* memory type corresponding to dataset datatype */
- int need_convert = FALSE; /* flag indicating convertion of byte order */
+ int need_convert = FALSE; /* flag indicating conversion of byte order */
unsigned char * outbuf = NULL; /* pointer to new output buffer */
unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */
unsigned i; /* index */
- parms_atomic p; /* paramters needed for compress/decompress functions */
+ parms_atomic p; /* parameters needed for compress/decompress functions */
FUNC_ENTER_NOAPI_NOINIT
/* check arguments */
if (cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of paramters")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters")
/* Check if memory byte order matches dataset datatype byte order */
switch (H5T_native_order_g) {
@@ -1202,7 +1194,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
minbits = (uint32_t)scale_factor;
}
- /* prepare paramters to pass to compress/decompress functions */
+ /* prepare parameters to pass to compress/decompress functions */
p.size = cd_values[H5Z_SCALEOFFSET_PARM_SIZE];
p.mem_order = H5T_native_order_g;
diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c
index 71b3d22..4d5f456 100644
--- a/src/H5Zshuffle.c
+++ b/src/H5Zshuffle.c
@@ -53,11 +53,8 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{
* Programmer: Quincey Koziol
* Monday, April 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static herr_t
H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
{
@@ -112,10 +109,6 @@ done:
* Programmer: Kent Yang
* Wednesday, November 13, 2002
*
- * Modifications:
- * Quincey Koziol, November 13, 2002
- * Cleaned up code.
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -129,10 +122,10 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
size_t numofelements; /* Number of elements in buffer */
size_t i; /* Local index variables */
#ifdef NO_DUFFS_DEVICE
- size_t j; /* Local index variable */
-#endif /* NO_DUFFS_DEVICE */
- size_t leftover; /* Extra bytes at end of buffer */
- size_t ret_value; /* Return value */
+ size_t j; /* Local index variable */
+#endif /* NO_DUFFS_DEVICE */
+ size_t leftover; /* Extra bytes at end of buffer */
+ size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI(0)
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 301490c..1dfa6af 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -67,8 +67,6 @@ H5Z_class2_t H5Z_SZIP[1] = {{
* Programmer: Quincey Koziol
* Monday, April 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -117,14 +115,6 @@ done:
* Programmer: Quincey Koziol
* Monday, April 7, 2003
*
- * Modifications: Used new logic to set the size of the scanline parameter.
- * Now SZIP compression can be applied to the chunk
- * of any shape and size with only one restriction: the number
- * of elements in the chunk has to be not less than number
- * of elements (pixels) in the block (cd_values[H5Z_SZIP_PARM_PPB]
- * parameter).
- * Elena Pourmal, July 20, 2004
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -262,10 +252,6 @@ done:
* Programmer: Kent Yang
* Tuesday, April 1, 2003
*
- * Modifications:
- * Quincey Koziol, April 2, 2003
- * Cleaned up code.
- *
*-------------------------------------------------------------------------
*/
static size_t
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index be0472f..c98fd59 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -264,7 +264,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
}
/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand
- * is empty, like -x or +x. The reason that it's seperated from H5Z_XFORM_DO_OP3 is because compilers don't
+ * is empty, like -x or +x. The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't
* accept operations like *x or /x. So in H5Z_do_op, these two macros are called in different ways. (SLU
* 2012/3/20)
*/
@@ -306,7 +306,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
}
/*
- * Programmer: Bill Wendling <wendling@ncsa.uiuc.edu>
+ * Programmer: Bill Wendling
* 25. August 2003
*/
@@ -331,11 +331,11 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
* Purpose: Rollback the H5Z_token to the previous H5Z_token retrieved. There
* should only need to be one level of rollback necessary
* for our grammar.
+ *
* Return: Always succeeds.
+ *
* Programmer: Bill Wendling
* 26. August 2003
- * Modifications:
- * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs
*
*-------------------------------------------------------------------------
*/
@@ -509,8 +509,6 @@ done:
* Return: Nothing
* Programmer: Bill Wendling
* 25. August 2003
- * Modifications:
- * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs
*
*-------------------------------------------------------------------------
*/
@@ -535,7 +533,7 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree)
* Purpose: Entry function for parsing the expression string.
*
* Return: Success: Valid H5Z_node ptr to an expression tree.
- * NULLure: NULL
+ * Failure: NULL
*
* Programmer: Bill Wendling
* 26. August 2003
@@ -546,7 +544,7 @@ static void *
H5Z_xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers)
{
H5Z_token tok;
- void * ret_value;
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -572,11 +570,10 @@ done:
* expr := term | term '+' term | term '-' term
*
* Return: Success: Valid H5Z_node ptr to expression tree
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
- * Modifications:
- * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs
*
*-------------------------------------------------------------------------
*/
@@ -584,7 +581,7 @@ static H5Z_node *
H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
{
H5Z_node *expr;
- H5Z_node *ret_value; /* Return value */
+ H5Z_node *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -665,19 +662,18 @@ done:
* term := factor | factor '*' factor | factor '/' factor
*
* Return: Success: Valid H5Z_node ptr to expression tree
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
- * Modifications:
- * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs
*
*-------------------------------------------------------------------------
*/
static H5Z_node *
H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
{
- H5Z_node *term = NULL;
- H5Z_node *ret_value;
+ H5Z_node *term = NULL;
+ H5Z_node *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -754,11 +750,10 @@ done:
* '(' expr ')'
*
* Return: Success: Valid H5Z_node ptr to expression tree
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
- * Modifications:
- * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs
*
*-------------------------------------------------------------------------
*/
@@ -767,7 +762,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
{
H5Z_node *factor = NULL;
H5Z_node *new_node;
- H5Z_node *ret_value;
+ H5Z_node *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -779,7 +774,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
- sscanf(current->tok_begin, "%ld", &factor->value.int_val);
+ HDsscanf(current->tok_begin, "%ld", &factor->value.int_val);
break;
case H5Z_XFORM_FLOAT:
@@ -787,7 +782,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
- sscanf(current->tok_begin, "%lf", &factor->value.float_val);
+ HDsscanf(current->tok_begin, "%lf", &factor->value.float_val);
break;
case H5Z_XFORM_SYMBOL:
@@ -893,20 +888,21 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_new_node
- * Purpose: Create and initilize a new H5Z_node structure.
+ *
+ * Purpose: Create and initialize a new H5Z_node structure.
+ *
* Return: Success: Valid H5Z_node ptr
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
- * Modifications:
- * Leon Arber: Added FUNC_ENTER / FUNC_LEAVE pairs
*
*-------------------------------------------------------------------------
*/
static H5Z_node *
H5Z_new_node(H5Z_token_type type)
{
- H5Z_node *ret_value;
+ H5Z_node *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -923,12 +919,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_xform_eval
* Purpose: If the transform is trivial, this function applies it.
- * Otherwise, it calls H5Z_xform_eval_full to do the full
+ * Otherwise, it calls H5Z__xform_eval_full to do the full
* transform.
- * Return: SUCCEED if transform applied succesfully, FAIL otherwise
+ * Return: SUCCEED if transform applied successfully, FAIL otherwise
* Programmer: Leon Arber
* 5/1/04
- * Modifications:
*
*-------------------------------------------------------------------------
*/
@@ -1037,15 +1032,17 @@ done:
* Function: H5Z_xform_eval_full
* Purpose: Does a full evaluation of the parse tree contained in tree
* and applies this transform to array.
+ *
+ * Notes: In the case of a polynomial data transform (ie, the left and right
+ * subtree are both of type H5Z_XFORM_SYMBOL), the convention is
+ * that the left hand side will accumulate changes and, at the end,
+ * the new data will be copied from the lhs.
+ *
* Return: Nothing
+ *
* Programmer: Leon Arber
* 5/1/04
- * Modifications:
- *
*
- * Notes: In the case of a polynomial data transform (ie, the left and right subtree
- * are both of type H5Z_XFORM_SYMBOL), the convention is that the left hand side
- * will accumulate changes and, at the end, the new data will be copied from the lhs.
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1090,7 +1087,6 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_t
* 1. See if "x" is on left hand side, right hand side, or if both sides are "x"
* 2. Figure out what type of data we're going to be manipulating
* 3. Do the operation on the data. */
-
switch (tree->type) {
case H5Z_XFORM_PLUS:
H5Z_XFORM_TYPE_OP(resl, resr, array_type, +, array_size)
@@ -1129,10 +1125,10 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_find_type
+ *
* Return: Native type of datatype that is passed in
- * Programmer: Leon Arber, 4/20/04
- * Modifications:
*
+ * Programmer: Leon Arber, 4/20/04
*
*-------------------------------------------------------------------------
*/
@@ -1199,12 +1195,14 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_xform_copy_tree
+ *
* Purpose: Makes a copy of the parse tree passed in.
+ *
* Return: A pointer to a root for a new parse tree which is a copy
* of the one passed in.
+ *
* Programmer: Leon Arber
* April 1, 2004.
- * Modifications:
*
*-------------------------------------------------------------------------
*/
@@ -1257,7 +1255,6 @@ H5Z_xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, H5Z_datva
H5Z_XFORM_DO_OP4(H5Z_XFORM_MINUS)
else if (tree->type == H5Z_XFORM_DIVIDE)
H5Z_XFORM_DO_OP4(H5Z_XFORM_DIVIDE)
-
else
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error in parse tree while trying to copy")
@@ -1267,12 +1264,14 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_op_is_numbs
+ *
* Purpose: Internal function to facilitate the condition check in
- * H5Z_xform_reduce_tree to reduce the bulkiness of the code.
+ * H5Z__xform_reduce_tree to reduce the bulkiness of the code.
+ *
* Return: TRUE or FALSE
+ *
* Programmer: Raymond Lu
* 15 March 2012
- * Modifications:
*
*-------------------------------------------------------------------------
*/
@@ -1294,14 +1293,16 @@ H5Z_op_is_numbs(H5Z_node *_tree)
/*-------------------------------------------------------------------------
* Function: H5Z_op_is_numbs2
+ *
* Purpose: Internal function to facilitate the condition check in
* H5Z_xform_reduce_tree to reduce the bulkiness of the code.
* The difference from H5Z_op_is_numbs is that the left child
* can be empty, like -x or +x.
+ *
* Return: TRUE or FALSE
+ *
* Programmer: Raymond Lu
* 15 March 2012
- * Modifications:
*
*-------------------------------------------------------------------------
*/
@@ -1327,13 +1328,14 @@ H5Z_op_is_numbs2(H5Z_node *_tree)
/*-------------------------------------------------------------------------
* Function: H5Z_xform_reduce_tree
+ *
* Purpose: Simplifies parse tree passed in by performing any obvious
* and trivial arithemtic calculations.
*
* Return: None.
+ *
* Programmer: Leon Arber
* April 1, 2004.
- * Modifications:
*
*-------------------------------------------------------------------------
*/
@@ -1381,16 +1383,13 @@ H5Z_xform_reduce_tree(H5Z_node *tree)
* Purpose: If the root of the tree passed in points to a simple
* arithmetic operation and the left and right subtrees are both
* integer or floating point values, this function does that
- * operation, free the left and rigt subtrees, and replaces
+ * operation, free the left and right subtrees, and replaces
* the root with the result of the operation.
+ *
* Return: None.
+ *
* Programmer: Leon Arber
* April 1, 2004.
- * Modifications:
- * Raymond Lu
- * 15 March 2012
- * I added a new macro H5Z_XFORM_DO_OP6 to handle the special
- * operations like -x or +x when the left operand is empty.
*
*-------------------------------------------------------------------------
*/
@@ -1420,23 +1419,19 @@ H5Z_do_op(H5Z_node *tree)
* Success: SUCCEED
* Failure: FAIL
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
*
* Date: May 4, 2004
*
- * Comments:
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5Z_data_xform_t *
H5Z_xform_create(const char *expr)
{
H5Z_data_xform_t *data_xform_prop = NULL;
- H5Z_data_xform_t *ret_value;
unsigned int i;
- unsigned int count = 0;
+ unsigned int count = 0;
+ H5Z_data_xform_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1474,7 +1469,7 @@ H5Z_xform_create(const char *expr)
* of the data we have for polynomial transforms */
data_xform_prop->dat_val_pointers->num_ptrs = 0;
- /* we generate the parse tree right here and store a poitner to its root in the property. */
+ /* we generate the parse tree right here and store a pointer to its root in the property. */
if ((data_xform_prop->parse_root =
(H5Z_node *)H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers)) == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression")
@@ -1516,14 +1511,10 @@ done:
* Success: SUCCEED
* Failure: FAIL
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
*
* Date: May 4, 2004
*
- * Comments:
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1561,7 +1552,7 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop)
* Success: SUCCEED
* Failure: FAIL
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
*
* Date: May 4, 2004
*
@@ -1569,8 +1560,6 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop)
* after the top-level copy has been performed and this routine finishes
* the "deep" part of the copy.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1652,14 +1641,12 @@ done:
*
* Return: TRUE for no data transform, FALSE for a data transform
*
- * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ * Programmer: Quincey Koziol
*
* Date: May 4, 2004
*
* Comments: Can't fail
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hbool_t
@@ -1682,12 +1669,10 @@ H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop)
* Return:
* Pointer to a copy of the string in the data_xform property.
*
- * Programmer: Leon Arber, larber@ncsa.uiuc.edu
+ * Programmer: Leon Arber
*
* Date: Sept. 4, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
const char *
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index 44768dd..617d1f5 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -32,9 +32,8 @@ static const char *FileHeader = "\n\
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <time.h>
#include "H5private.h"
+
/* Do NOT use HDfprintf in this file as it is not linked with the library,
* which contains the H5system.c file in which the function is defined.
*/
@@ -65,7 +64,7 @@ insert_libhdf5_settings(FILE *flibinfo)
if (NULL == (fsettings = HDfopen(LIBSETTINGSFNAME, "r"))) {
HDperror(LIBSETTINGSFNAME);
HDexit(EXIT_FAILURE);
- } /* end if */
+ }
/* print variable definition and the string */
/* Do not use const else AIX strings does not show it. */
@@ -76,30 +75,31 @@ insert_libhdf5_settings(FILE *flibinfo)
/* Start a new line */
fprintf(flibinfo, "\t\"");
bol = 0;
- } /* end if */
+ }
if (inchar == '\n') {
/* end of a line */
fprintf(flibinfo, "\\n\"\n");
bol++;
- } /* end if */
+ }
else
HDputc(inchar, flibinfo);
- } /* end while */
+ }
+
if (HDfeof(fsettings)) {
/* wrap up */
if (!bol)
/* EOF found without a new line */
fprintf(flibinfo, "\\n\"\n");
fprintf(flibinfo, ";\n\n");
- } /* end if */
+ }
else {
fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME);
HDexit(EXIT_FAILURE);
- } /* end else */
+ }
if (0 != HDfclose(fsettings)) {
HDperror(LIBSETTINGSFNAME);
HDexit(EXIT_FAILURE);
- } /* end if */
+ }
#else
/* print variable definition and an empty string */
/* Do not use const else AIX strings does not show it. */
@@ -165,12 +165,12 @@ information about the library build configuration\n";
n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos));
HDstrncpy(real_name, pwd->pw_gecos, n);
real_name[n] = '\0';
- } /* end if */
+ }
else {
HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
real_name[sizeof(real_name) - 1] = '\0';
- } /* end else */
- } /* end if */
+ }
+ }
else
real_name[0] = '\0';
}
@@ -209,13 +209,15 @@ information about the library build configuration\n";
if (real_name[0])
fprintf(rawoutstream, ">");
HDfputc('\n', rawoutstream);
- } /* end if */
+ }
+
fprintf(rawoutstream, " *\n * Purpose:\t\t");
+
for (s = purpose; *s; s++) {
HDfputc(*s, rawoutstream);
if ('\n' == *s && s[1])
fprintf(rawoutstream, " *\t\t\t");
- } /* end for */
+ }
fprintf(rawoutstream, " *\n * Modifications:\n *\n");
fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n");
diff --git a/src/H5private.h b/src/H5private.h
index e7cbd81..bde24f5 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Friday, October 30, 1998
*
* Purpose: This file is included by all HDF5 library source files to
@@ -885,7 +885,7 @@ typedef off_t h5_stat_size_t;
#endif /* HDgetgroups */
#ifndef HDgethostname
#define HDgethostname(N, L) gethostname(N, L)
-#endif /* HDgetlogin */
+#endif /* HDgethostname */
#ifndef HDgetlogin
#define HDgetlogin() getlogin()
#endif /* HDgetlogin */
@@ -910,6 +910,7 @@ typedef off_t h5_stat_size_t;
#ifndef HDgets
#define HDgets(S) gets(S)
#endif /* HDgets */
+
#ifndef HDgettimeofday
#define HDgettimeofday(S, P) gettimeofday(S, P)
#endif /* HDgettimeofday */
@@ -1823,12 +1824,11 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ
/* global library version information string */
extern char H5_lib_vers_info_g[];
+#include "H5TSprivate.h"
+
/* Lock headers */
#ifdef H5_HAVE_THREADSAFE
-/* Include required thread-safety header */
-#include "H5TSprivate.h"
-
/* replacement structure for original global variable */
typedef struct H5_api_struct {
H5TS_mutex_t init_lock; /* API entrance mutex */
diff --git a/src/H5public.h b/src/H5public.h
index 2a33fe4..a98af42 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -91,7 +91,7 @@ extern "C" {
#define H5_GCC_DIAG_ON(x)
#endif
-/* Version numbers TAB char must surround the H5_VERS_xxx number */
+/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 8 /* For minor interface/format changes */
#define H5_VERS_RELEASE 22 /* For tweaks, bug-fixes, or development */
@@ -223,11 +223,11 @@ typedef unsigned long long haddr_t;
*/
#if H5_SIZEOF_UINT32_T >= 4
#elif H5_SIZEOF_SHORT >= 4
-typedef short uint32_t;
+typedef short uint32_t;
#undef H5_SIZEOF_UINT32_T
#define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT
#elif H5_SIZEOF_INT >= 4
-typedef unsigned int uint32_t;
+typedef unsigned int uint32_t;
#undef H5_SIZEOF_UINT32_T
#define H5_SIZEOF_UINT32_T H5_SIZEOF_INT
#elif H5_SIZEOF_LONG >= 4
@@ -243,11 +243,11 @@ typedef unsigned long uint32_t;
*/
#if H5_SIZEOF_INT64_T >= 8
#elif H5_SIZEOF_INT >= 8
-typedef int int64_t;
+typedef int int64_t;
#undef H5_SIZEOF_INT64_T
#define H5_SIZEOF_INT64_T H5_SIZEOF_INT
#elif H5_SIZEOF_LONG >= 8
-typedef long int64_t;
+typedef long int64_t;
#undef H5_SIZEOF_INT64_T
#define H5_SIZEOF_INT64_T H5_SIZEOF_LONG
#elif H5_SIZEOF_LONG_LONG >= 8
@@ -263,11 +263,11 @@ typedef long long int64_t;
*/
#if H5_SIZEOF_UINT64_T >= 8
#elif H5_SIZEOF_INT >= 8
-typedef unsigned uint64_t;
+typedef unsigned uint64_t;
#undef H5_SIZEOF_UINT64_T
#define H5_SIZEOF_UINT64_T H5_SIZEOF_INT
#elif H5_SIZEOF_LONG >= 8
-typedef unsigned long uint64_t;
+typedef unsigned long uint64_t;
#undef H5_SIZEOF_UINT64_T
#define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG
#elif H5_SIZEOF_LONG_LONG >= 8
diff --git a/src/H5timer.c b/src/H5timer.c
index e5aded7..09f085d 100644
--- a/src/H5timer.c
+++ b/src/H5timer.c
@@ -12,12 +12,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
- *
* Created: H5timer.c
* Aug 21 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
- * Purpose: Internal 'timer' routines & support routines.
+ * Purpose: Internal, platform-independent 'timer' support routines.
*
*-------------------------------------------------------------------------
*/
@@ -253,7 +252,7 @@ H5_now(void)
now = now_tv.tv_sec;
}
#else /* H5_HAVE_GETTIMEOFDAY */
- now = HDtime(NULL);
+ now = HDtime(NULL);
#endif /* H5_HAVE_GETTIMEOFDAY */
return (now);
diff --git a/src/H5trace.c b/src/H5trace.c
index 3d8dc4a..deb5776 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -13,11 +13,11 @@
/*-------------------------------------------------------------------------
*
- * Created: H5trace.c
- * Aug 21 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5trace.c
+ * Aug 21 2006
+ * Quincey Koziol
*
- * Purpose: Internal code for tracing API calls
+ * Purpose: Internal code for tracing API calls
*
*-------------------------------------------------------------------------
*/
@@ -30,12 +30,12 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5Ipkg.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5Ipkg.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
#ifdef H5_HAVE_PARALLEL
/* datatypes of predefined drivers needed by H5_trace() */
@@ -71,36 +71,36 @@
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5_trace
+ * Function: H5_trace
*
- * Purpose: This function is called whenever an API function is called
- * and tracing is turned on. If RETURNING is non-zero then
- * the caller is about to return and RETURNING points to the
+ * Purpose: This function is called whenever an API function is called
+ * and tracing is turned on. If RETURNING is non-zero then
+ * the caller is about to return and RETURNING points to the
* time for the corresponding function call event. Otherwise
* we print the function name and the arguments.
*
- * The TYPE argument is a string which gives the type of each of
- * the following argument pairs. Each type is zero or more
- * asterisks (one for each level of indirection, although some
- * types have one level of indirection already implied) followed
- * by either one letter (lower case) or two letters (first one
- * uppercase).
+ * The TYPE argument is a string which gives the type of each of
+ * the following argument pairs. Each type is zero or more
+ * asterisks (one for each level of indirection, although some
+ * types have one level of indirection already implied) followed
+ * by either one letter (lower case) or two letters (first one
+ * uppercase).
*
- * The variable argument list consists of pairs of values. Each
- * pair is a string which is the formal argument name in the
- * calling function, followed by the argument value. The type
- * of the argument value is given by the TYPE string.
+ * The variable argument list consists of pairs of values. Each
+ * pair is a string which is the formal argument name in the
+ * calling function, followed by the argument value. The type
+ * of the argument value is given by the TYPE string.
*
- * Note: The TYPE string is meant to be terse and is generated by a
- * separate perl script.
+ * Note: The TYPE string is meant to be terse and is generated by a
+ * separate perl script.
*
- * WARNING: DO NOT CALL ANY HDF5 FUNCTION THAT CALLS FUNC_ENTER(). DOING
- * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY
- * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED.
+ * WARNING: DO NOT CALL ANY HDF5 FUNCTION THAT CALLS FUNC_ENTER(). DOING
+ * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY
+ * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED.
*
- * Return: Execution time for an API call
+ * Return: Execution time for an API call
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, June 16, 1998
*
*-------------------------------------------------------------------------
@@ -125,7 +125,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
if (!out)
return 0.0F; /*tracing is off*/
- va_start(ap, type);
+ HDva_start(ap, type);
if (H5_debug_g.ttop) {
if (returning) {
@@ -164,7 +164,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
if (current_depth < last_call_depth) {
/* We are at the beginning of a line */
if (H5_debug_g.ttimes) {
- char tmp[128];
+ char tmp[320];
HDsprintf(tmp, "%.6f", event_time.etime - first_time.etime);
HDfprintf(out, " %*s ", (int)HDstrlen(tmp), "");
@@ -219,10 +219,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
* name is the null pointer then don't print the argument or the
* following `='. This is used for return values.
*/
- argname = va_arg(ap, char *); /*lint !e64 Type mismatch not really occuring */
+ argname = HDva_arg(ap, char *);
if (argname) {
- unsigned n = (unsigned)MAX(0, (int)HDstrlen(argname) -
- 3); /*lint !e666 Allow expression with side effects */
+ unsigned n = (unsigned)MAX(0, (int)HDstrlen(argname) - 3);
if (!HDstrcmp(argname + n, "_id")) {
HDstrncpy(buf, argname, (size_t)MIN((int)sizeof(buf) - 1, n));
@@ -236,17 +235,17 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
/* The value */
if (ptr)
- vp = va_arg(ap, void *); /*lint !e64 Type mismatch not really occuring */
+ vp = HDva_arg(ap, void *);
switch (type[0]) {
case 'a':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- haddr_t addr = va_arg(ap, haddr_t); /*lint !e732 Loss of sign not really occuring */
+ haddr_t addr = HDva_arg(ap, haddr_t);
HDfprintf(out, "%a", addr);
} /* end else */
@@ -255,13 +254,13 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'b':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- hbool_t bool_var = va_arg(ap, hbool_t); /*lint !e732 Loss of sign not really occuring */
-
+ /* Can't pass hbool_t to HDva_arg() */
+ hbool_t bool_var = (hbool_t)HDva_arg(ap, int);
if (TRUE == bool_var)
HDfprintf(out, "TRUE");
else if (!bool_var)
@@ -274,12 +273,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- double dbl = va_arg(ap, double);
+ double dbl = HDva_arg(ap, double);
HDfprintf(out, "%g", dbl);
} /* end else */
@@ -290,12 +289,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)va_arg(ap, int);
+ H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)HDva_arg(ap, int);
switch (alloc_time) {
case H5D_ALLOC_TIME_ERROR:
@@ -328,12 +327,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)va_arg(ap, int);
+ H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)HDva_arg(ap, int);
switch (opt) {
case H5FD_MPIO_COLLECTIVE_IO:
@@ -354,12 +353,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5D_fill_time_t fill_time = (H5D_fill_time_t)va_arg(ap, int);
+ H5D_fill_time_t fill_time = (H5D_fill_time_t)HDva_arg(ap, int);
switch (fill_time) {
case H5D_FILL_TIME_ERROR:
@@ -388,12 +387,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'F':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5D_fill_value_t fill_value = (H5D_fill_value_t)va_arg(ap, int);
+ H5D_fill_value_t fill_value = (H5D_fill_value_t)HDva_arg(ap, int);
switch (fill_value) {
case H5D_FILL_VALUE_ERROR:
@@ -422,12 +421,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'h':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)va_arg(ap, int);
+ H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)HDva_arg(ap, int);
switch (opt) {
case H5FD_MPIO_CHUNK_DEFAULT:
@@ -452,13 +451,13 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
H5D_mpio_actual_io_mode_t actual_io_mode =
- (H5D_mpio_actual_io_mode_t)va_arg(ap, int);
+ (H5D_mpio_actual_io_mode_t)HDva_arg(ap, int);
switch (actual_io_mode) {
case H5D_MPIO_NO_COLLECTIVE:
@@ -491,12 +490,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5D_layout_t layout = (H5D_layout_t)va_arg(ap, int);
+ H5D_layout_t layout = (H5D_layout_t)HDva_arg(ap, int);
switch (layout) {
case H5D_LAYOUT_ERROR:
@@ -529,13 +528,13 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'n':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
H5D_mpio_no_collective_cause_t nocol_cause_mode =
- (H5D_mpio_no_collective_cause_t)va_arg(ap, int);
+ (H5D_mpio_no_collective_cause_t)HDva_arg(ap, int);
hbool_t flag_already_displayed = FALSE;
/* Check for all bit-flags which might be set */
@@ -587,13 +586,13 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode =
- (H5D_mpio_actual_chunk_opt_mode_t)va_arg(ap, int);
+ (H5D_mpio_actual_chunk_opt_mode_t)HDva_arg(ap, int);
switch (chunk_opt_mode) {
case H5D_MPIO_NO_CHUNK_OPTIMIZATION:
@@ -618,12 +617,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5D_space_status_t space_status = (H5D_space_status_t)va_arg(ap, int);
+ H5D_space_status_t space_status = (H5D_space_status_t)HDva_arg(ap, int);
switch (space_status) {
case H5D_SPACE_STATUS_NOT_ALLOCATED:
@@ -652,12 +651,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)va_arg(ap, int);
+ H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)HDva_arg(ap, int);
switch (transfer) {
case H5FD_MPIO_INDEPENDENT:
@@ -684,12 +683,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- herr_t status = va_arg(ap, herr_t);
+ herr_t status = HDva_arg(ap, herr_t);
if (status >= 0)
HDfprintf(out, "SUCCEED");
@@ -703,12 +702,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5E_direction_t direction = (H5E_direction_t)va_arg(ap, int);
+ H5E_direction_t direction = (H5E_direction_t)HDva_arg(ap, int);
switch (direction) {
case H5E_WALK_UPWARD:
@@ -729,27 +728,26 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5E_error2_t *error =
- va_arg(ap, H5E_error2_t *); /*lint !e64 Type mismatch not really occuring */
+ H5E_error2_t *error = HDva_arg(ap, H5E_error2_t *);
- HDfprintf(out, "0x%lx", (unsigned long)error);
+ HDfprintf(out, "0x%p", error);
} /* end else */
break;
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5E_type_t etype = (H5E_type_t)va_arg(ap, int);
+ H5E_type_t etype = (H5E_type_t)HDva_arg(ap, int);
switch (etype) {
case H5E_MAJOR:
@@ -778,12 +776,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5F_close_degree_t degree = (H5F_close_degree_t)va_arg(ap, int);
+ H5F_close_degree_t degree = (H5F_close_degree_t)HDva_arg(ap, int);
switch (degree) {
case H5F_CLOSE_DEFAULT:
@@ -812,12 +810,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'm':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5F_mem_t mem_type = (H5F_mem_t)va_arg(ap, int);
+ H5F_mem_t mem_type = (H5F_mem_t)HDva_arg(ap, int);
switch (mem_type) {
case H5FD_MEM_NOLIST:
@@ -863,12 +861,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5F_scope_t scope = (H5F_scope_t)va_arg(ap, int);
+ H5F_scope_t scope = (H5F_scope_t)HDva_arg(ap, int);
switch (scope) {
case H5F_SCOPE_LOCAL:
@@ -889,12 +887,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'v':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5F_libver_t libver_vers = (H5F_libver_t)va_arg(ap, int);
+ H5F_libver_t libver_vers = (H5F_libver_t)HDva_arg(ap, int);
switch (libver_vers) {
case H5F_LIBVER_EARLIEST:
@@ -924,12 +922,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5G_obj_t obj_type = (H5G_obj_t)va_arg(ap, int);
+ H5G_obj_t obj_type = (H5G_obj_t)HDva_arg(ap, int);
switch (obj_type) {
case H5G_UNKNOWN:
@@ -972,15 +970,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5G_stat_t *statbuf =
- va_arg(ap, H5G_stat_t *); /*lint !e64 Type mismatch not really occuring */
+ H5G_stat_t *statbuf = HDva_arg(ap, H5G_stat_t *);
- HDfprintf(out, "0x%lx", (unsigned long)statbuf);
+ HDfprintf(out, "0x%p", statbuf);
}
break;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -994,7 +991,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'h':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
hsize_t *p = (hsize_t *)vp;
@@ -1012,7 +1009,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- hsize_t hsize = va_arg(ap, hsize_t); /*lint !e732 Loss of sign not really occuring */
+ hsize_t hsize = HDva_arg(ap, hsize_t);
if (H5S_UNLIMITED == hsize)
HDfprintf(out, "H5S_UNLIMITED");
@@ -1028,7 +1025,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
hssize_t *p = (hssize_t *)vp;
@@ -1042,7 +1039,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- hssize_t hssize = va_arg(ap, hssize_t);
+ hssize_t hssize = HDva_arg(ap, hssize_t);
HDfprintf(out, "%Hd", hssize);
asize[argno] = (hssize_t)hssize;
@@ -1058,12 +1055,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- hid_t obj = va_arg(ap, hid_t);
+ hid_t obj = HDva_arg(ap, hid_t);
if (H5P_DEFAULT == obj)
HDfprintf(out, "H5P_DEFAULT");
@@ -1246,12 +1243,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5_index_t idx_type = (H5_index_t)va_arg(ap, int);
+ H5_index_t idx_type = (H5_index_t)HDva_arg(ap, int);
switch (idx_type) {
case H5_INDEX_UNKNOWN:
@@ -1280,12 +1277,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5_iter_order_t order = (H5_iter_order_t)va_arg(ap, int);
+ H5_iter_order_t order = (H5_iter_order_t)HDva_arg(ap, int);
switch (order) {
case H5_ITER_UNKNOWN:
@@ -1318,7 +1315,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
int *p = (int *)vp;
@@ -1332,7 +1329,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- int is = va_arg(ap, int);
+ int is = HDva_arg(ap, int);
HDfprintf(out, "%d", is);
asize[argno] = is;
@@ -1342,12 +1339,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5I_type_t id_type = (H5I_type_t)va_arg(ap, int);
+ H5I_type_t id_type = (H5I_type_t)HDva_arg(ap, int);
switch (id_type) {
case H5I_UNINIT:
@@ -1424,7 +1421,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'u':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned *p = (unsigned *)vp;
@@ -1438,8 +1435,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- unsigned iu =
- va_arg(ap, unsigned); /*lint !e732 Loss of sign not really occuring */
+ unsigned iu = HDva_arg(ap, unsigned);
HDfprintf(out, "%u", iu);
asize[argno] = iu;
@@ -1457,12 +1453,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5L_type_t link_type = (H5L_type_t)va_arg(ap, int);
+ H5L_type_t link_type = (H5L_type_t)HDva_arg(ap, int);
switch (link_type) {
case H5L_TYPE_ERROR:
@@ -1503,13 +1499,13 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
#ifdef H5_HAVE_PARALLEL
else {
- MPI_Comm comm = va_arg(ap, MPI_Comm);
+ MPI_Comm comm = HDva_arg(ap, MPI_Comm);
HDfprintf(out, "%ld", (long)comm);
} /* end else */
@@ -1519,13 +1515,13 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'i':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
#ifdef H5_HAVE_PARALLEL
else {
- MPI_Info info = va_arg(ap, MPI_Info);
+ MPI_Info info = HDva_arg(ap, MPI_Info);
HDfprintf(out, "%ld", (long)info);
} /* end else */
@@ -1535,12 +1531,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5FD_mem_t mt = (H5FD_mem_t)va_arg(ap, int);
+ H5FD_mem_t mt = (H5FD_mem_t)HDva_arg(ap, int);
switch (mt) {
case H5FD_MEM_NOLIST:
@@ -1594,12 +1590,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- off_t offset = va_arg(ap, off_t);
+ off_t offset = HDva_arg(ap, off_t);
HDfprintf(out, "%ld", (long)offset);
} /* end else */
@@ -1610,12 +1606,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5O_type_t objtype = (H5O_type_t)va_arg(ap, int);
+ H5O_type_t objtype = (H5O_type_t)HDva_arg(ap, int);
switch (objtype) {
case H5O_TYPE_UNKNOWN:
@@ -1635,7 +1631,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
break;
case H5O_TYPE_NTYPES:
- HDfprintf(out, "H5O_TYPE_TYPES");
+ HDfprintf(out, "H5O_TYPE_NTYPES");
break;
default:
@@ -1654,12 +1650,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'p':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- hid_t pclass_id = va_arg(ap, hid_t);
+ hid_t pclass_id = HDva_arg(ap, hid_t);
char * class_name = NULL;
H5P_genclass_t *pclass;
@@ -1678,12 +1674,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'r':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- hobj_ref_t ref = va_arg(ap, hobj_ref_t); /*lint !e732 Loss of sign not really occuring */
+ hobj_ref_t ref = HDva_arg(ap, hobj_ref_t);
HDfprintf(out, "Reference Object=%a", ref);
} /* end else */
@@ -1694,12 +1690,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5R_type_t reftype = (H5R_type_t)va_arg(ap, int);
+ H5R_type_t reftype = (H5R_type_t)HDva_arg(ap, int);
switch (reftype) {
case H5R_BADTYPE:
@@ -1736,12 +1732,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5S_class_t cls = (H5S_class_t)va_arg(ap, int);
+ H5S_class_t cls = (H5S_class_t)HDva_arg(ap, int);
switch (cls) {
case H5S_NO_CLASS:
@@ -1770,12 +1766,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5S_seloper_t so = (H5S_seloper_t)va_arg(ap, int);
+ H5S_seloper_t so = (H5S_seloper_t)HDva_arg(ap, int);
switch (so) {
case H5S_SELECT_NOOP:
@@ -1828,12 +1824,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5S_sel_type st = (H5S_sel_type)va_arg(ap, int);
+ H5S_sel_type st = (H5S_sel_type)HDva_arg(ap, int);
switch (st) {
case H5S_SEL_ERROR:
@@ -1876,13 +1872,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- const char *str =
- va_arg(ap, const char *); /*lint !e64 Type mismatch not really occuring */
+ const char *str = HDva_arg(ap, const char *);
HDfprintf(out, "\"%s\"", str);
} /* end else */
@@ -1893,12 +1888,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'c':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_cset_t cset = (H5T_cset_t)va_arg(ap, int);
+ H5T_cset_t cset = (H5T_cset_t)HDva_arg(ap, int);
switch (cset) {
case H5T_CSET_ERROR:
@@ -1940,12 +1935,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'd':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_direction_t direct = (H5T_direction_t)va_arg(ap, int);
+ H5T_direction_t direct = (H5T_direction_t)HDva_arg(ap, int);
switch (direct) {
case H5T_DIR_DEFAULT:
@@ -1970,12 +1965,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'e':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_pers_t pers = (H5T_pers_t)va_arg(ap, int);
+ H5T_pers_t pers = (H5T_pers_t)HDva_arg(ap, int);
switch (pers) {
case H5T_PERS_DONTCARE:
@@ -2000,12 +1995,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'n':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_norm_t norm = (H5T_norm_t)va_arg(ap, int);
+ H5T_norm_t norm = (H5T_norm_t)HDva_arg(ap, int);
switch (norm) {
case H5T_NORM_ERROR:
@@ -2034,12 +2029,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'o':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_order_t order = (H5T_order_t)va_arg(ap, int);
+ H5T_order_t order = (H5T_order_t)HDva_arg(ap, int);
switch (order) {
case H5T_ORDER_ERROR:
@@ -2076,12 +2071,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'p':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_pad_t pad = (H5T_pad_t)va_arg(ap, int);
+ H5T_pad_t pad = (H5T_pad_t)HDva_arg(ap, int);
switch (pad) {
case H5T_PAD_ERROR:
@@ -2114,12 +2109,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_sign_t sign = (H5T_sign_t)va_arg(ap, int);
+ H5T_sign_t sign = (H5T_sign_t)HDva_arg(ap, int);
switch (sign) {
case H5T_SGN_ERROR:
@@ -2148,12 +2143,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_class_t type_class = (H5T_class_t)va_arg(ap, int);
+ H5T_class_t type_class = (H5T_class_t)HDva_arg(ap, int);
switch (type_class) {
case H5T_NO_CLASS:
@@ -2218,12 +2213,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'z':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5T_str_t str = (H5T_str_t)va_arg(ap, int);
+ H5T_str_t str = (H5T_str_t)HDva_arg(ap, int);
switch (str) {
case H5T_STR_ERROR:
@@ -2274,12 +2269,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- htri_t tri_var = va_arg(ap, htri_t);
+ htri_t tri_var = HDva_arg(ap, htri_t);
if (tri_var > 0)
HDfprintf(out, "TRUE");
@@ -2295,7 +2290,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'l':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned long *p = (unsigned long *)vp;
@@ -2309,18 +2304,17 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- unsigned long iul =
- va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occuring */
+ unsigned long iul = HDva_arg(ap, unsigned long);
HDfprintf(out, "%lu", iul);
- asize[argno] = iul;
+ asize[argno] = (hssize_t)iul;
} /* end else */
break;
case 'L':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
unsigned long long *p = (unsigned long long *)vp;
@@ -2334,11 +2328,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- unsigned long long iull = va_arg(
- ap, unsigned long long); /*lint !e732 Loss of sign not really occuring */
+ unsigned long long iull = HDva_arg(ap, unsigned long long);
HDfprintf(out, "%llu", iull);
- asize[argno] = iull;
+ asize[argno] = (hssize_t)iull;
} /* end else */
break;
@@ -2351,14 +2344,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'x':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
void **p = (void **)vp;
HDfprintf(out, " {");
for (i = 0; i < asize[asize_idx]; i++) {
if (p[i])
- HDfprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i]));
+ HDfprintf(out, "%s0x%p", (i ? ", " : ""), p[i]);
else
HDfprintf(out, "%sNULL", (i ? ", " : ""));
} /* end for */
@@ -2369,10 +2362,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- vp = va_arg(ap, void *); /*lint !e64 Type mismatch not really occuring */
+ vp = HDva_arg(ap, void *);
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end else */
@@ -2381,7 +2374,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'z':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
size_t *p = (size_t *)vp;
@@ -2395,7 +2388,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- size_t size = va_arg(ap, size_t); /*lint !e732 Loss of sign not really occuring */
+ size_t size = HDva_arg(ap, size_t);
HDfprintf(out, "%Zu", size);
asize[argno] = (hssize_t)size;
@@ -2407,12 +2400,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'a':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)va_arg(ap, int);
+ H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)HDva_arg(ap, int);
switch (scale_type) {
case H5Z_SO_FLOAT_DSCALE:
@@ -2442,22 +2435,21 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- H5Z_class2_t *filter =
- va_arg(ap, H5Z_class2_t *); /*lint !e64 Type mismatch not really occuring */
+ H5Z_class2_t *filter = HDva_arg(ap, H5Z_class2_t *);
- HDfprintf(out, "0x%lx", (unsigned long)filter);
+ HDfprintf(out, "0x%p", filter);
} /* end else */
break;
case 'e':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5Z_EDC_t edc = (H5Z_EDC_t)va_arg(ap, int);
+ H5Z_EDC_t edc = (H5Z_EDC_t)HDva_arg(ap, int);
if (H5Z_DISABLE_EDC == edc)
HDfprintf(out, "H5Z_DISABLE_EDC");
@@ -2471,12 +2463,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 'f':
if (ptr) {
if (vp)
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
else
HDfprintf(out, "NULL");
} /* end if */
else {
- H5Z_filter_t id = va_arg(ap, H5Z_filter_t);
+ H5Z_filter_t id = HDva_arg(ap, H5Z_filter_t);
if (H5Z_FILTER_DEFLATE == id)
HDfprintf(out, "H5Z_FILTER_DEFLATE");
@@ -2488,7 +2480,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
if (vp) {
- HDfprintf(out, "0x%lx", (unsigned long)vp);
+ HDfprintf(out, "0x%p", vp);
if (asize_idx >= 0 && asize[asize_idx] >= 0) {
ssize_t *p = (ssize_t *)vp;
@@ -2502,7 +2494,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
HDfprintf(out, "NULL");
} /* end if */
else {
- ssize_t ssize = va_arg(ap, ssize_t);
+ ssize_t ssize = HDva_arg(ap, ssize_t);
HDfprintf(out, "%Zd", ssize);
asize[argno] = (hssize_t)ssize;
@@ -2530,7 +2522,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
(event_time.etime - *returning));
error:
- va_end(ap);
+ HDva_end(ap);
if (returning)
HDfprintf(out, ";\n");
else {
diff --git a/src/hdf5.h b/src/hdf5.h
index 551ff2e..067f4b4 100644
--- a/src/hdf5.h
+++ b/src/hdf5.h
@@ -20,37 +20,37 @@
#define _HDF5_H
#include "H5public.h"
-#include "H5Apublic.h" /* Attributes */
-#include "H5ACpublic.h" /* Metadata cache */
-#include "H5Dpublic.h" /* Datasets */
-#include "H5Epublic.h" /* Errors */
-#include "H5Fpublic.h" /* Files */
-#include "H5FDpublic.h" /* File drivers */
-#include "H5Gpublic.h" /* Groups */
-#include "H5Ipublic.h" /* ID management */
-#include "H5Lpublic.h" /* Links */
-#include "H5MMpublic.h" /* Memory management */
-#include "H5Opublic.h" /* Object headers */
-#include "H5Ppublic.h" /* Property lists */
-#include "H5PLpublic.h" /* Plugins */
-#include "H5Rpublic.h" /* References */
-#include "H5Spublic.h" /* Dataspaces */
-#include "H5Tpublic.h" /* Datatypes */
-#include "H5Zpublic.h" /* Data filters */
+#include "H5Apublic.h" /* Attributes */
+#include "H5ACpublic.h" /* Metadata cache */
+#include "H5Dpublic.h" /* Datasets */
+#include "H5Epublic.h" /* Errors */
+#include "H5Fpublic.h" /* Files */
+#include "H5FDpublic.h" /* File drivers */
+#include "H5Gpublic.h" /* Groups */
+#include "H5Ipublic.h" /* ID management */
+#include "H5Lpublic.h" /* Links */
+#include "H5MMpublic.h" /* Memory management */
+#include "H5Opublic.h" /* Object headers */
+#include "H5Ppublic.h" /* Property lists */
+#include "H5PLpublic.h" /* Plugins */
+#include "H5Rpublic.h" /* References */
+#include "H5Spublic.h" /* Dataspaces */
+#include "H5Tpublic.h" /* Datatypes */
+#include "H5Zpublic.h" /* Data filters */
/* Predefined file drivers */
-#include "H5FDcore.h" /* Files stored entirely in memory */
-#include "H5FDfamily.h" /* File families */
-#include "H5FDhdfs.h" /* Hadoop HDFS */
-#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */
-#include "H5FDmpi.h" /* MPI-based file drivers */
-#include "H5FDmulti.h" /* Usage-partitioned file family */
-#include "H5FDros3.h" /* R/O S3 "file" I/O */
-#include "H5FDsec2.h" /* POSIX unbuffered file I/O */
-#include "H5FDstdio.h" /* Standard C buffered I/O */
+#include "H5FDcore.h" /* Files stored entirely in memory */
+#include "H5FDdirect.h" /* Linux direct I/O */
+#include "H5FDfamily.h" /* File families */
+#include "H5FDhdfs.h" /* Hadoop HDFS */
+#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */
+#include "H5FDmpi.h" /* MPI-based file drivers */
+#include "H5FDmulti.h" /* Usage-partitioned file family */
+#include "H5FDros3.h" /* R/O S3 "file" I/O */
+#include "H5FDsec2.h" /* POSIX unbuffered file I/O */
+#include "H5FDstdio.h" /* Standard C buffered I/O */
#ifdef H5_HAVE_WINDOWS
-#include "H5FDwindows.h" /* Windows buffered I/O */
+#include "H5FDwindows.h" /* Win32 I/O */
#endif
-#include "H5FDdirect.h" /* Linux direct I/O */
#endif
diff --git a/src/hdf5.lnt b/src/hdf5.lnt
index 6b94b8b..cce342b 100644
--- a/src/hdf5.lnt
+++ b/src/hdf5.lnt
@@ -60,7 +60,7 @@
H5FO.c
H5Tcommit.c
- H5Tcompound.c
+ H5Tcompound.c
H5Tcset.c
H5Tenum.c
diff --git a/test/hdfs.c b/test/hdfs.c
index 3e28d5f..0115bfb 100644
--- a/test/hdfs.c
+++ b/test/hdfs.c
@@ -19,7 +19,7 @@
*
* Demonstrates basic use cases and fapl interaction.
*
- * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * Programmer: Jacob Smith
* 2018-04-23
*/
@@ -29,7 +29,6 @@
#ifdef H5_HAVE_LIBHDFS
#define HDFS_TEST_DEBUG 0
#define HDFS_TEST_MAX_BUF_SIZE 256
-#endif /* H5_HAVE_LIBHDFS */
/*****************************************************************************
*
@@ -359,11 +358,8 @@
* OTHER MACROS AND DEFINITIONS *
********************************/
-/* copied from src/hdfs.c
- */
-#ifdef H5_HAVE_LIBHDFS
+/* copied from src/hdfs.c */
#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
-#endif /* H5_HAVE_LIBHDFS */
#define HDFS_NAMENODE_NAME_MAX_SIZE 128
@@ -371,12 +367,10 @@
* FILE-LOCAL GLOBAL VARIABLES *
*******************************/
-#ifdef H5_HAVE_LIBHDFS
static const char filename_missing[] = "/tmp/missing.txt";
static const char filename_bard[] = "/tmp/t8.shakespeare.txt";
static const char filename_raven[] = "/tmp/Poe_Raven.txt";
static const char filename_example_h5[] = "/tmp/t.h5";
-#endif /* H5_HAVE_LIBHDFS */
static H5FD_hdfs_fapl_t default_fa = {
1, /* fa version */
@@ -386,6 +380,7 @@ static H5FD_hdfs_fapl_t default_fa = {
"", /* kerberos path */
1024, /* buffer size */
};
+#endif /* H5_HAVE_LIBHDFS */
/******************
* TEST FUNCTIONS *
@@ -415,6 +410,14 @@ static H5FD_hdfs_fapl_t default_fa = {
static int
test_fapl_config_validation(void)
{
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS fapl configuration validation");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
/*********************
* test-local macros *
*********************/
@@ -587,6 +590,7 @@ error:
H5E_END_TRY;
}
return 1;
+#endif /* H5_HAVE_LIBHDFS */
} /* end test_fapl_config_validation() */
@@ -612,14 +616,22 @@ error:
static int
test_hdfs_fapl(void)
{
+#ifndef H5_HAVE_LIBHDFS
+ TESTING("HDFS fapl ");
+ SKIPPED();
+ puts(" HDFS VFD is not enabled");
+ fflush(stdout);
+ return 0;
+
+#else
/************************
* test-local variables *
************************/
- hid_t fapl_id = -1; /* file access property list ID */
- hid_t driver_id = -1; /* ID for this VFD */
- unsigned long driver_flags = 0; /* VFD feature flags */
- H5FD_hdfs_fapl_t hdfs_fa_0 = {
+ hid_t fapl_id = -1; /* file access property list ID */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ H5FD_hdfs_fapl_t hdfs_fa_0 = {
1, /* version*/
"", /* node name */
9000, /* node port */
@@ -661,6 +673,7 @@ error:
H5E_END_TRY;
return 1;
+#endif /* H5_HAVE_LIBHDFS */
} /* end test_hdfs_fapl() */
@@ -711,10 +724,10 @@ test_vfd_open(void)
struct test_condition {
const char *message;
const char *url;
- unsigned flags;
- int which_fapl;
- haddr_t maxaddr;
- hbool_t might_use_other_driver;
+ unsigned flags;
+ int which_fapl;
+ haddr_t maxaddr;
+ hbool_t might_use_other_driver;
};
/************************
@@ -803,11 +816,11 @@ test_vfd_open(void)
FALSE,
},
};
- unsigned i = 0;
+ unsigned i = 0;
unsigned failing_conditions_count = 10;
- H5FD_t * fd = NULL;
- hid_t fapl_hdfs = -1;
- hid_t fapl_unconfigured = -1;
+ H5FD_t *fd = NULL;
+ hid_t fapl_hdfs = -1;
+ hid_t fapl_unconfigured = -1;
TESTING("HDFS VFD-level open");
@@ -825,8 +838,8 @@ test_vfd_open(void)
/* all the test cases that will _not_ open
*/
for (i = 0; i < failing_conditions_count; i++) {
- struct test_condition T = failing_conditions[i];
- hid_t fapl_id = H5P_DEFAULT;
+ struct test_condition T = failing_conditions[i];
+ hid_t fapl_id = H5P_DEFAULT;
fd = NULL;
@@ -961,7 +974,7 @@ test_eof_eoa(void)
************************/
H5FD_t *fd_shakespeare = NULL;
- hid_t fapl_id = -1;
+ hid_t fapl_id = -1;
TESTING("HDFS eof/eoa gets and sets");
@@ -982,19 +995,21 @@ test_eof_eoa(void)
/* verify as found
*/
- JSVERIFY(5458199, H5FDget_eof(fd_shakespeare), NULL)
+ JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), NULL)
+ JSVERIFY(H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), H5FDget_eof(fd_shakespeare, H5FD_MEM_DRAW),
+ "mismatch between DEFAULT and RAW memory types")
JSVERIFY(0, H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), "EoA should be unset by H5FDopen")
/* set EoA below EoF
*/
JSVERIFY(SUCCEED, H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 44442202), "unable to set EoA (lower)")
- JSVERIFY(5458199, H5FDget_eof(fd_shakespeare), "EoF changed")
+ JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), "EoF changed")
JSVERIFY(44442202, H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), "EoA unchanged")
/* set EoA above EoF
*/
JSVERIFY(SUCCEED, H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 6789012), "unable to set EoA (higher)")
- JSVERIFY(5458199, H5FDget_eof(fd_shakespeare), "EoF changed")
+ JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), "EoF changed")
JSVERIFY(6789012, H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), "EoA unchanged")
/************
@@ -1056,10 +1071,10 @@ test_H5FDread_without_eoa_set_fails(void)
#else
- char buffer[HDFS_TEST_MAX_BUF_SIZE];
- unsigned int i = 0;
- H5FD_t * file_shakespeare = NULL;
- hid_t fapl_id = -1;
+ char buffer[HDFS_TEST_MAX_BUF_SIZE];
+ unsigned int i = 0;
+ H5FD_t *file_shakespeare = NULL;
+ hid_t fapl_id = -1;
TESTING("HDFS VFD read-eoa temporal coupling library limitation");
@@ -1164,10 +1179,10 @@ test_read(void)
*************************/
struct testcase {
const char *message; /* purpose of test case */
- haddr_t eoa_set; /* set file EOA to this prior to read */
- size_t addr; /* offset of read in file */
- size_t len; /* length of read in file */
- herr_t success; /* expected return value of read function */
+ haddr_t eoa_set; /* set file EOA to this prior to read */
+ size_t addr; /* offset of read in file */
+ size_t len; /* length of read in file */
+ herr_t success; /* expected return value of read function */
const char *expected; /* expected contents of buffer; failure ignores */
};
@@ -1224,14 +1239,14 @@ test_read(void)
NULL,
},
};
- unsigned testcase_count = 6;
- unsigned test_i = 0;
+ unsigned testcase_count = 6;
+ unsigned test_i = 0;
struct testcase test;
- herr_t open_return = FAIL;
- char buffer[HDFS_TEST_MAX_BUF_SIZE];
- unsigned int i = 0;
- H5FD_t * file_raven = NULL;
- hid_t fapl_id = -1;
+ herr_t open_return = FAIL;
+ char buffer[HDFS_TEST_MAX_BUF_SIZE];
+ unsigned int i = 0;
+ H5FD_t *file_raven = NULL;
+ hid_t fapl_id = -1;
TESTING("HDFS VFD read/range-gets");
@@ -1256,7 +1271,7 @@ test_read(void)
HADDR_UNDEF); /* Demonstrate success with "automatic" value */
FAIL_IF(NULL == file_raven)
- JSVERIFY(6464, H5FDget_eof(file_raven), NULL)
+ JSVERIFY(6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), NULL)
/*********
* TESTS *
@@ -1268,7 +1283,7 @@ test_read(void)
* per-test setup *
* -------------- */
- test = cases[test_i];
+ test = cases[test_i];
open_return = FAIL;
FAIL_IF(HDFS_TEST_MAX_BUF_SIZE < test.len) /* buffer too small! */
@@ -1378,8 +1393,8 @@ test_noops_and_autofails(void)
* test-local variables *
************************/
- hid_t fapl_id = -1;
- H5FD_t * file = NULL;
+ hid_t fapl_id = -1;
+ H5FD_t *file = NULL;
const char data[36] = "The Force shall be with you, always";
TESTING("HDFS VFD always-fail and no-op routines");
@@ -1521,7 +1536,7 @@ test_H5F_integration(void)
* test-local variables *
************************/
- hid_t file = -1;
+ hid_t file = -1;
hid_t fapl_id = -1;
TESTING("HDFS file access through HD5F library (H5F API)");
@@ -1612,6 +1627,7 @@ main(void)
* commence tests *
******************/
+#ifdef H5_HAVE_LIBHDFS
static char hdfs_namenode_name[HDFS_NAMENODE_NAME_MAX_SIZE] = "";
const char *hdfs_namenode_name_env = NULL;
@@ -1623,6 +1639,7 @@ main(void)
HDstrncpy(/* TODO: error-check? */
default_fa.namenode_name, hdfs_namenode_name_env, HDFS_NAMENODE_NAME_MAX_SIZE);
}
+#endif /* H5_HAVE_LIBHDFS */
h5_reset();
diff --git a/test/ros3.c b/test/ros3.c
index 54965f7..edc774a 100644
--- a/test/ros3.c
+++ b/test/ros3.c
@@ -20,7 +20,7 @@
*
* Demonstrates basic use cases and fapl/dxpl interaction.
*
- * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * Programmer: Jacob Smith
* 2017-10-11
*/
@@ -989,19 +989,21 @@ test_eof_eoa(void)
/* verify as found
*/
- JSVERIFY(5458199, H5FDget_eof(fd_shakespeare), NULL)
+ JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), NULL)
+ JSVERIFY(H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), H5FDget_eof(fd_shakespeare, H5FD_MEM_DRAW),
+ "mismatch between DEFAULT and RAW memory types")
JSVERIFY(0, H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), "EoA should be unset by H5FDopen")
/* set EoA below EoF
*/
JSVERIFY(SUCCEED, H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 44442202), "unable to set EoA (lower)")
- JSVERIFY(5458199, H5FDget_eof(fd_shakespeare), "EoF changed")
+ JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), "EoF changed")
JSVERIFY(44442202, H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), "EoA unchanged")
/* set EoA above EoF
*/
JSVERIFY(SUCCEED, H5FDset_eoa(fd_shakespeare, H5FD_MEM_DEFAULT, 6789012), "unable to set EoA (higher)")
- JSVERIFY(5458199, H5FDget_eof(fd_shakespeare), "EoF changed")
+ JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), "EoF changed")
JSVERIFY(6789012, H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), "EoA unchanged")
/************
@@ -1265,7 +1267,7 @@ test_read(void)
H5F_ACC_RDONLY, fapl_id, HADDR_UNDEF); /* Demonstrate success with "automatic" value */
FAIL_IF(NULL == file_raven)
- JSVERIFY(6464, H5FDget_eof(file_raven), NULL)
+ JSVERIFY(6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), NULL)
/*********
* TESTS *
@@ -1415,15 +1417,9 @@ test_noops_and_autofails(void)
/* no-op calls to `lock()` and `unlock()`
*/
/*
- JSVERIFY( SUCCEED,
- H5FDlock(file, TRUE),
- "lock always succeeds; has no effect" )
- JSVERIFY( SUCCEED,
- H5FDlock(file, FALSE),
- NULL )
- JSVERIFY( SUCCEED,
- H5FDunlock(file),
- NULL )
+ JSVERIFY(SUCCEED, H5FDlock(file, TRUE), "lock always succeeds; has no effect")
+ JSVERIFY(SUCCEED, H5FDlock(file, FALSE), NULL)
+ JSVERIFY(SUCCEED, H5FDunlock(file), NULL)
*/
/* Lock/unlock with null file or similar error crashes tests.
* HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()`
diff --git a/test/s3comms.c b/test/s3comms.c
index a054d41..d0764fd 100644
--- a/test/s3comms.c
+++ b/test/s3comms.c
@@ -15,7 +15,7 @@
*
* Purpose: Unit tests for the S3 Communications (s3comms) module.
*
- * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * Programmer: Jacob Smith
* 2017-10-11
*/