summaryrefslogtreecommitdiffstats
path: root/src/H5HFsection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5HFsection.c')
-rw-r--r--src/H5HFsection.c112
1 files changed, 50 insertions, 62 deletions
diff --git a/src/H5HFsection.c b/src/H5HFsection.c
index eca55c8..152f15a 100644
--- a/src/H5HFsection.c
+++ b/src/H5HFsection.c
@@ -206,6 +206,7 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_SINGLE[1] = {{
H5HF_sect_single_shrink, /* Shrink container w/section */
H5HF_sect_single_free, /* Free section */
H5HF_sect_single_valid, /* Check validity of section */
+ NULL, /* Split section node for alignment */
NULL, /* Dump debugging for section */
}};
@@ -234,6 +235,7 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_FIRST_ROW[1] = {{
H5HF_sect_row_shrink, /* Shrink container w/section */
H5HF_sect_row_free, /* Free section */
H5HF_sect_row_valid, /* Check validity of section */
+ NULL, /* Split section node for alignment */
H5HF_sect_row_debug, /* Dump debugging for section */
}};
@@ -259,6 +261,7 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_NORMAL_ROW[1] = {{
NULL, /* Shrink container w/section */
H5HF_sect_row_free, /* Free section */
H5HF_sect_row_valid, /* Check validity of section */
+ NULL, /* Split section node for alignment */
H5HF_sect_row_debug, /* Dump debugging for section */
}};
@@ -287,6 +290,7 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_INDIRECT[1] = {{
NULL, /* Shrink container w/section */
NULL, /* Free section */
NULL, /* Check validity of section */
+ NULL, /* Split section node for alignment */
NULL, /* Dump debugging for section */
}};
@@ -333,7 +337,7 @@ H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr)
/* Allocate & initialize the class-private (i.e. private shared) information
* for this type of section
*/
- if(NULL == (cls_prvt = H5MM_malloc(sizeof(H5HF_sect_private_t))))
+ if(NULL == (cls_prvt = (H5HF_sect_private_t *)H5MM_malloc(sizeof(H5HF_sect_private_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
cls_prvt->hdr = hdr;
cls->cls_private = cls_prvt;
@@ -372,7 +376,7 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls)
HDassert(cls);
/* Get pointer to class private info */
- cls_prvt = cls->cls_private;
+ cls_prvt = (H5HF_sect_private_t *)cls->cls_private;
/* Decrement reference count on heap header */
if(H5HF_hdr_decr(cls_prvt->hdr) < 0)
@@ -461,7 +465,7 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block")
/* Release the section */
- H5FL_FREE(H5HF_free_section_t, sect);
+ (void)H5FL_FREE(H5HF_free_section_t, sect);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -522,7 +526,7 @@ done:
} /* end if */
/* Release the section */
- H5FL_FREE(H5HF_free_section_t, sect);
+ (void)H5FL_FREE(H5HF_free_section_t, sect);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -1138,7 +1142,7 @@ H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void UNUSED *_udata)
/* Protect the direct block for the section */
/* (should be a root direct block) */
HDassert(dblock_addr == hdr->man_dtable.table_addr);
- if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr,
+ if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr,
dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC_WRITE)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block")
HDassert(H5F_addr_eq(dblock->block_off + dblock_size, (*sect)->sect_info.addr + (*sect)->sect_info.size));
@@ -2051,7 +2055,7 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *
HDassert(sect);
/* Retrieve class private information */
- cls_prvt = cls->cls_private;
+ cls_prvt = (H5HF_sect_private_t *)cls->cls_private;
hdr = cls_prvt->hdr;
/* Sanity checking on the row */
@@ -2306,7 +2310,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size,
/* Set the 'indirect' specific fields */
if(iblock) {
sect->u.indirect.u.iblock = iblock;
- sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width *
+ sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width *
sect->u.indirect.u.iblock->max_rows;
if(H5HF_iblock_incr(sect->u.indirect.u.iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block")
@@ -2340,7 +2344,7 @@ done:
HDONE_ERROR(H5E_HEAP, H5E_CANTDEC, NULL, "can't decrement reference count on shared indirect block")
/* Release the section */
- H5FL_FREE(H5HF_free_section_t, sect);
+ (void)H5FL_FREE(H5HF_free_section_t, sect);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -2361,7 +2365,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5HF_free_section_t *
-H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock,
+H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock,
H5HF_free_section_t *row_sect)
{
H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */
@@ -2378,7 +2382,7 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock,
HDassert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows);
/* Create free space section node */
- if(NULL == (sect = H5HF_sect_indirect_new(hdr, row_sect->sect_info.addr,
+ if(NULL == (sect = H5HF_sect_indirect_new(hdr, row_sect->sect_info.addr,
row_sect->sect_info.size, iblock, iblock->block_off,
row_sect->u.row.row, row_sect->u.row.col, row_sect->u.row.num_entries)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section")
@@ -2387,7 +2391,7 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock,
sect->u.indirect.dir_nrows = 1;
/* Allocate space for the derived row sections */
- if(NULL == (sect->u.indirect.dir_rows = H5MM_malloc(sizeof(H5HF_free_section_t *))))
+ if(NULL == (sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_malloc(sizeof(H5HF_free_section_t *))))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "allocation failed for row section pointer array")
/* Atatch the new row section to indirect section */
@@ -2469,7 +2473,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id,
sect->u.indirect.dir_nrows = 0;
/* Allocate space for the derived row sections */
- if(NULL == (sect->u.indirect.dir_rows = H5MM_malloc(sizeof(H5HF_free_section_t *) * dir_nrows)))
+ if(NULL == (sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_malloc(sizeof(H5HF_free_section_t *) * dir_nrows)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for row section pointer array")
} /* end if */
else {
@@ -2499,14 +2503,13 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id,
+ indirect_start_col;
/* Compute ending indirect entry */
- indirect_end_entry = (end_row * hdr->man_dtable.cparam.width) +
- end_col;
+ indirect_end_entry = (end_row * hdr->man_dtable.cparam.width) + end_col;
/* Compute # of indirect entries covered */
sect->u.indirect.indir_nents = (indirect_end_entry - indirect_start_entry) + 1;
/* Allocate space for the child indirect sections */
- if(NULL == (sect->u.indirect.indir_ents = H5MM_malloc(sizeof(H5HF_free_section_t *) * sect->u.indirect.indir_nents)))
+ if(NULL == (sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_malloc(sizeof(H5HF_free_section_t *) * sect->u.indirect.indir_nents)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for indirect section pointer array")
} /* end if */
else {
@@ -2647,7 +2650,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id,
sect->u.indirect.dir_nrows = dir_nrows;
/* Make certain we've tracked the section's dependents correctly */
- HDassert(sect->u.indirect.rc ==
+ HDassert(sect->u.indirect.rc ==
(sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows));
done:
@@ -2827,7 +2830,7 @@ H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
sect->u.indirect.u.iblock = sec_iblock;
/* Set the number of entries in the indirect block */
- sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width *
+ sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width *
sect->u.indirect.u.iblock->max_rows;
/* Unlock indirect block */
@@ -2890,7 +2893,7 @@ H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id,
sect->u.indirect.u.iblock = sect_iblock;
/* Set the number of entries in the indirect block */
- sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width *
+ sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width *
sect->u.indirect.u.iblock->max_rows;
/* Section is "live" now */
@@ -2938,7 +2941,6 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
unsigned start_col; /* Start column in indirect block */
unsigned end_entry; /* Entry for last block covered */
unsigned end_row; /* End row in indirect block */
- unsigned end_col; /* End column in indirect block */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce_row)
@@ -2960,7 +2962,6 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
start_entry = (start_row * hdr->man_dtable.cparam.width) + start_col;
end_entry = (start_entry + sect->u.indirect.num_entries) - 1;
end_row = end_entry / hdr->man_dtable.cparam.width;
- end_col = end_entry % hdr->man_dtable.cparam.width;
/* Additional sanity check */
HDassert(sect->u.indirect.span_size > 0);
@@ -3038,7 +3039,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
HDassert(sect->u.indirect.indir_ents);
/* Eliminate direct rows for this section */
- sect->u.indirect.dir_rows = H5MM_xfree(sect->u.indirect.dir_rows);
+ sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.dir_rows);
/* Make new "first row" in indirect section */
if(row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW)
@@ -3107,17 +3108,17 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
/* Set up direct row & indirect entry information for peer section */
peer_sect->u.indirect.dir_nrows = peer_dir_nrows;
- if(NULL == (peer_sect->u.indirect.dir_rows = H5MM_malloc(sizeof(H5HF_free_section_t *) * peer_dir_nrows)))
+ if(NULL == (peer_sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_malloc(sizeof(H5HF_free_section_t *) * peer_dir_nrows)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for row section pointer array")
peer_sect->u.indirect.indir_nents = 0;
peer_sect->u.indirect.indir_ents = NULL;
/* Transfer row sections between current & peer sections */
HDmemcpy(&peer_sect->u.indirect.dir_rows[0],
- &sect->u.indirect.dir_rows[0],
+ &sect->u.indirect.dir_rows[0],
(sizeof(H5HF_free_section_t *) * peer_dir_nrows));
- HDmemmove(&sect->u.indirect.dir_rows[0],
- &sect->u.indirect.dir_rows[peer_dir_nrows],
+ HDmemmove(&sect->u.indirect.dir_rows[0],
+ &sect->u.indirect.dir_rows[peer_dir_nrows],
(sizeof(H5HF_free_section_t *) * (sect->u.indirect.dir_nrows - peer_dir_nrows)));
sect->u.indirect.dir_nrows -= peer_dir_nrows;
HDassert(row_sect == sect->u.indirect.dir_rows[0]);
@@ -3149,9 +3150,9 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
sect->u.indirect.num_entries -= (peer_nentries + 1); /* Transferred entries, plus the entry allocated out of the row */
/* Make certain we've tracked the sections' dependents correctly */
- HDassert(sect->u.indirect.rc ==
+ HDassert(sect->u.indirect.rc ==
(sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows));
- HDassert(peer_sect->u.indirect.rc ==
+ HDassert(peer_sect->u.indirect.rc ==
(peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows));
} /* end else */
} /* end if */
@@ -3162,7 +3163,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
HDassert(sect->u.indirect.dir_nrows == 0);
/* Eliminate direct rows for this section */
- sect->u.indirect.dir_rows = H5MM_xfree(sect->u.indirect.dir_rows);
+ sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.dir_rows);
} /* end else */
done:
@@ -3194,7 +3195,6 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s
unsigned start_col; /* Start column in indirect block */
unsigned end_entry; /* Entry for last block covered */
unsigned end_row; /* End row in indirect block */
- unsigned end_col; /* End column in indirect block */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce)
@@ -3213,7 +3213,6 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s
start_entry = (start_row * hdr->man_dtable.cparam.width) + start_col;
end_entry = (start_entry + sect->u.indirect.num_entries) - 1;
end_row = end_entry / hdr->man_dtable.cparam.width;
- end_col = end_entry % hdr->man_dtable.cparam.width;
/* Check how to adjust section for allocated entry */
if(sect->u.indirect.num_entries > 1) {
@@ -3279,7 +3278,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s
/* Adjust indirect entry information */
sect->u.indirect.indir_nents--;
if(sect->u.indirect.indir_nents == 0)
- sect->u.indirect.indir_ents = H5MM_xfree(sect->u.indirect.indir_ents);
+ sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents);
} /* end if */
else {
H5HF_free_section_t *peer_sect; /* Peer indirect section */
@@ -3337,18 +3336,18 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s
peer_sect->u.indirect.dir_nrows = 0;
peer_sect->u.indirect.dir_rows = NULL;
peer_sect->u.indirect.indir_nents = peer_nentries;
- if(NULL == (peer_sect->u.indirect.indir_ents = H5MM_malloc(sizeof(H5HF_free_section_t *) * peer_nentries)))
+ if(NULL == (peer_sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_malloc(sizeof(H5HF_free_section_t *) * peer_nentries)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for indirect section pointer array")
/* Transfer child indirect sections between current & peer sections */
HDmemcpy(&peer_sect->u.indirect.indir_ents[0],
- &sect->u.indirect.indir_ents[sect->u.indirect.indir_nents - peer_nentries],
+ &sect->u.indirect.indir_ents[sect->u.indirect.indir_nents - peer_nentries],
(sizeof(H5HF_free_section_t *) * peer_nentries));
sect->u.indirect.indir_nents -= (peer_nentries + 1); /* Transferred blocks, plus child entry */
/* Eliminate indirect entries for this section, if appropriate */
if(sect->u.indirect.indir_nents == 0)
- sect->u.indirect.indir_ents = H5MM_xfree(sect->u.indirect.indir_ents);
+ sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents);
/* Re-target transferred row sections to point to new underlying indirect section */
for(u = 0; u < peer_nentries; u++)
@@ -3369,9 +3368,9 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s
/* (Note modified on current section's ref. count, since we haven't
* detached the child section yet)
*/
- HDassert((sect->u.indirect.rc - 1) ==
+ HDassert((sect->u.indirect.rc - 1) ==
(sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows));
- HDassert(peer_sect->u.indirect.rc ==
+ HDassert(peer_sect->u.indirect.rc ==
(peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows));
} /* end else */
} /* end if */
@@ -3382,7 +3381,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s
HDassert(sect->u.indirect.indir_nents == 0);
/* Eliminate indirect entries for this section */
- sect->u.indirect.indir_ents = H5MM_xfree(sect->u.indirect.indir_ents);
+ sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents);
} /* end else */
/* Decrement # of sections which depend on this row */
@@ -3535,11 +3534,8 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id,
unsigned start_entry1; /* Start entry for section #1 */
unsigned start_row1, start_col1; /* Starting row & column for section #1 */
unsigned end_entry1; /* End entry for section #1 */
- unsigned end_row1, end_col1; /* Ending row & column for section #1 */
- unsigned start_entry2; /* Start entry for section #2 */
- unsigned start_row2, start_col2; /* Starting row & column for section #2 */
- unsigned end_row2, end_col2; /* Ending row & column for section #2 */
- unsigned end_entry2; /* End entry for section #2 */
+ unsigned end_row1; /* Ending row for section #1 */
+ unsigned start_row2; /* Starting row for section #2 */
hbool_t merged_rows; /* Flag to indicate that rows was merged together */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3577,13 +3573,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id,
start_entry1 = (start_row1 * hdr->man_dtable.cparam.width) + start_col1;
end_entry1 = (start_entry1 + sect1->u.indirect.num_entries) - 1;
end_row1 = end_entry1 / hdr->man_dtable.cparam.width;
- end_col1 = end_entry1 % hdr->man_dtable.cparam.width;
start_row2 = sect2->u.indirect.row;
- start_col2 = sect2->u.indirect.col;
- start_entry2 = (start_row2 * hdr->man_dtable.cparam.width) + start_col2;
- end_entry2 = (start_entry2 + sect2->u.indirect.num_entries) - 1;
- end_row2 = end_entry2 / hdr->man_dtable.cparam.width;
- end_col2 = end_entry2 % hdr->man_dtable.cparam.width;
/* Check for direct sections in second section */
/* (second indirect section can be parent of indirect section for second
@@ -3644,13 +3634,13 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id,
H5HF_free_section_t **new_dir_rows; /* Pointer to new array of direct row pointers */
/* Extend the first section's row array */
- if(NULL == (new_dir_rows = H5MM_realloc(sect1->u.indirect.dir_rows, sizeof(H5HF_free_section_t *) * new_dir_nrows1)))
+ if(NULL == (new_dir_rows = (H5HF_free_section_t **)H5MM_realloc(sect1->u.indirect.dir_rows, sizeof(H5HF_free_section_t *) * new_dir_nrows1)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for row section pointer array")
sect1->u.indirect.dir_rows = new_dir_rows;
/* Transfer the second section's rows to first section */
- HDmemcpy(&sect1->u.indirect.dir_rows[sect1->u.indirect.dir_nrows],
- &sect2->u.indirect.dir_rows[src_row2],
+ HDmemcpy(&sect1->u.indirect.dir_rows[sect1->u.indirect.dir_nrows],
+ &sect2->u.indirect.dir_rows[src_row2],
(sizeof(H5HF_free_section_t *) * nrows_moved2));
/* Re-target the row sections moved from second section */
@@ -3690,13 +3680,13 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id,
H5HF_free_section_t **new_indir_ents; /* Pointer to new array of indirect entries */
/* Extend the first section's entry array */
- if(NULL == (new_indir_ents = H5MM_realloc(sect1->u.indirect.indir_ents, sizeof(H5HF_free_section_t *) * new_indir_nents1)))
+ if(NULL == (new_indir_ents = (H5HF_free_section_t **)H5MM_realloc(sect1->u.indirect.indir_ents, sizeof(H5HF_free_section_t *) * new_indir_nents1)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for row section pointer array")
sect1->u.indirect.indir_ents = new_indir_ents;
/* Transfer the second section's entries to first section */
- HDmemcpy(&sect1->u.indirect.indir_ents[sect1->u.indirect.indir_nents],
- &sect2->u.indirect.indir_ents[0],
+ HDmemcpy(&sect1->u.indirect.indir_ents[sect1->u.indirect.indir_nents],
+ &sect2->u.indirect.indir_ents[0],
(sizeof(H5HF_free_section_t *) * sect2->u.indirect.indir_nents));
} /* end else */
@@ -3717,7 +3707,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id,
sect1->u.indirect.span_size += sect2->u.indirect.span_size;
/* Make certain we've tracked the first section's dependents correctly */
- HDassert(sect1->u.indirect.rc ==
+ HDassert(sect1->u.indirect.rc ==
(sect1->u.indirect.indir_nents + sect1->u.indirect.dir_nrows));
/* Wrap up, freeing or re-inserting second row section */
@@ -3807,7 +3797,7 @@ H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
HDassert(par_iblock);
/* Create parent indirect section */
- if(NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr,
+ if(NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr,
sect->sect_info.size, par_iblock, par_iblock->block_off,
par_row, par_col, 1)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section")
@@ -3818,7 +3808,7 @@ H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
/* Allocate space for the child indirect sections */
par_sect->u.indirect.indir_nents = 1;
- if(NULL == (par_sect->u.indirect.indir_ents = H5MM_malloc(sizeof(H5HF_free_section_t *))))
+ if(NULL == (par_sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_malloc(sizeof(H5HF_free_section_t *))))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for indirect section pointer array")
/* Attach sections together */
@@ -3965,7 +3955,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id,
unsigned *des_flags)
{
H5HF_free_section_t *new_sect; /* New indirect section */
- hsize_t iblock_off; /* Indirect block's offset */
+ hsize_t iblock_off; /* Indirect block's offset */
unsigned start_row; /* Indirect section's start row */
unsigned start_col; /* Indirect section's start column */
unsigned nentries; /* Indirect section's number of entries */
@@ -4050,10 +4040,10 @@ H5HF_sect_indirect_free(H5HF_free_section_t *sect)
HDassert(sect);
/* Release the memory for tracking direct rows */
- sect->u.indirect.dir_rows = H5MM_xfree(sect->u.indirect.dir_rows);
+ sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.dir_rows);
/* Release the memory for tracking indirect entries */
- sect->u.indirect.indir_ents = H5MM_xfree(sect->u.indirect.indir_ents);
+ 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) {
@@ -4091,7 +4081,6 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
unsigned start_col; /* Column for first block covered */
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 */
unsigned u; /* Local index variable */
@@ -4109,7 +4098,6 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
/* Compute ending entry, column & row */
end_entry = (start_entry + sect->u.indirect.num_entries) - 1;
end_row = end_entry / hdr->man_dtable.cparam.width;
- end_col = end_entry % hdr->man_dtable.cparam.width;
/* Sanity check any direct rows */
if(sect->u.indirect.dir_nrows > 0) {