summaryrefslogtreecommitdiffstats
path: root/src/H5Gnode.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-09-25 14:50:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-09-25 14:50:49 (GMT)
commit12e30dc9b284cae8dd821ffec93c344b7fb0d96b (patch)
treeca1e34bd719276349c4f75a7c38d79d361ce2025 /src/H5Gnode.c
parentf9c3920d286b9d18156d1b7d85f14852345b5e74 (diff)
downloadhdf5-12e30dc9b284cae8dd821ffec93c344b7fb0d96b.zip
hdf5-12e30dc9b284cae8dd821ffec93c344b7fb0d96b.tar.gz
hdf5-12e30dc9b284cae8dd821ffec93c344b7fb0d96b.tar.bz2
[svn-r5947] Purpose:
Code cleanup Description: Clean up ID->name code: - Reformat to better match library coding standard - Changed several algorithms to be more efficient - Integrated into library more smoothly Platforms tested: eirene w/FORTRAN & C++ arabica w/FORTRAN modi4 w/FORTRAN & parallel sleipnir
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r--src/H5Gnode.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 7ad68e3..ff76674 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -324,9 +324,9 @@ done:
* Added dxpl parameter to allow more control over I/O from metadata
* cache.
*
- * Pedro Vicente, <pvn@ncsa.uiuc.edu> 18 Sep 2002
- * Added `id to name' support.
- *
+ * Pedro Vicente, <pvn@ncsa.uiuc.edu> 18 Sep 2002
+ * Added `id to name' support.
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -401,11 +401,9 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_
* preempted from the cache.
*/
if (destroy) {
-
- /*Free the ID to name buffer */
- for (i=0; i<sym->nsyms; i++) {
- H5G_free_ent_name(&(sym->entry[i]));
- }
+ /* Free the ID to name buffer */
+ for (i=0; i<sym->nsyms; i++)
+ H5G_free_ent_name(&(sym->entry[i]));
sym->entry = H5FL_ARR_FREE(H5G_entry_t,sym->entry);
H5FL_FREE(H5G_node_t,sym);
@@ -858,7 +856,7 @@ H5G_node_insert(H5F_t *f, haddr_t addr, void UNUSED *_lt_key,
HDmemmove(insert_into->entry + idx + 1,
insert_into->entry + idx,
(insert_into->nsyms - idx) * sizeof(H5G_entry_t));
- insert_into->entry[idx] = bt_udata->ent;
+ H5G_ent_copy(&(bt_udata->ent), &(insert_into->entry[idx])); /* Deep copy the entry */
insert_into->entry[idx].dirty = TRUE;
insert_into->nsyms += 1;
@@ -889,12 +887,12 @@ done:
* Thursday, September 24, 1998
*
* Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
+ * Robb Matzke, 1999-07-28
+ * The ADDR argument is passed by value.
+ *
+ * Pedro Vicente, <pvn@ncsa.uiuc.edu> 18 Sep 2002
+ * Added `id to name' support.
*
- * Pedro Vicente, <pvn@ncsa.uiuc.edu> 18 Sep 2002
- * Added `id to name' support.
- *
*-------------------------------------------------------------------------
*/
static H5B_ins_t
@@ -959,8 +957,8 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/,
H5HL_remove(f, bt_udata->heap_addr, sn->entry[idx].name_off, HDstrlen(s)+1);
H5E_clear(); /*no big deal*/
- /*Free the ID to name buffer */
- H5G_free_ent_name(sn->entry+idx);
+ /* Free the ID to name buffer for the entry being squeezed out */
+ H5G_free_ent_name(sn->entry+idx);
/* Remove the entry from the symbol table node */
if (1==sn->nsyms) {