summaryrefslogtreecommitdiffstats
path: root/src/H5Gent.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-08-20 19:28:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-08-20 19:28:40 (GMT)
commitb7d43b0cf0c750031b60937b7dc2eaf0d8a803eb (patch)
treea451641fa5cb4965b40103576ec53beef49e66e4 /src/H5Gent.c
parent96b3c145b7b8e033fff6504a5dbb88c78c42219b (diff)
downloadhdf5-b7d43b0cf0c750031b60937b7dc2eaf0d8a803eb.zip
hdf5-b7d43b0cf0c750031b60937b7dc2eaf0d8a803eb.tar.gz
hdf5-b7d43b0cf0c750031b60937b7dc2eaf0d8a803eb.tar.bz2
[svn-r11283] Purpose:
Code cleanup Description: Clean up code somewhat: - Move from HDmemset() -> H5G_ent_reset() to clear out group entry info - Simplify H5G_unlink() call - Use portability macros instead of direct system calls in more places - Improve readbility by neatening whitespace, etc. - Move some macros into source code module instead of header files Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4
Diffstat (limited to 'src/H5Gent.c')
-rw-r--r--src/H5Gent.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/H5Gent.c b/src/H5Gent.c
index fa58ca7..ffc7a52 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -417,7 +417,7 @@ H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5G_ent_copy_depth_t dept
dst->canon_path_r=NULL;
} else if(depth==H5G_COPY_SHALLOW) {
/* Discarding 'const' qualifier OK - QAK */
- HDmemset(src, 0, sizeof(H5G_entry_t));
+ H5G_ent_reset(src);
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED);
@@ -425,6 +425,39 @@ H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5G_ent_copy_depth_t dept
/*-------------------------------------------------------------------------
+ * Function: H5G_ent_reset
+ *
+ * Purpose: Reset a symbol table entry to an empty state
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Quincey Koziol, koziol@ncsa.uiuc.edu
+ *
+ * Date: August 2005
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G_ent_reset(H5G_entry_t *ent)
+{
+ FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_reset);
+
+ /* Check arguments */
+ HDassert(ent);
+
+ /* Clear the symbol table entry to an empty state */
+ HDmemset(ent, 0, sizeof(H5G_entry_t));
+ ent->header = HADDR_UNDEF;
+
+ FUNC_LEAVE_NOAPI(SUCCEED);
+} /* end H5G_ent_reset() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5G_ent_debug
*
* Purpose: Prints debugging information about a symbol table entry.