diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-11-20 20:24:23 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-11-20 20:24:23 (GMT) |
commit | 8830acb2cbc9384978c22a3e01f4dd15276290e5 (patch) | |
tree | 3ff95fe7a8885ade286b1caeb350e57ef25b63e2 /src/H5HFhdr.c | |
parent | 5c6f1819d5033b2443a165b12b81b0343bec6456 (diff) | |
download | hdf5-8830acb2cbc9384978c22a3e01f4dd15276290e5.zip hdf5-8830acb2cbc9384978c22a3e01f4dd15276290e5.tar.gz hdf5-8830acb2cbc9384978c22a3e01f4dd15276290e5.tar.bz2 |
[svn-r28422] Description:
Revert most of r27549, since revise_chunks code requires debugging contexts
for v2 B-trees. Also, misc. warning cleanups and alignments w/changes on
revise_chunks branch.
Tested on:
MacOSX/64 10.11.1 (amazon) w/serial & parallel
(h5committest forthcoming)
Diffstat (limited to 'src/H5HFhdr.c')
-rw-r--r-- | src/H5HFhdr.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 6560756..19ea14a 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -224,7 +224,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info") /* Set the size of heap IDs */ - hdr->heap_len_size = MIN(hdr->man_dtable.max_dir_blk_off_size, + hdr->heap_len_size = (uint8_t)MIN(hdr->man_dtable.max_dir_blk_off_size, H5VM_limit_enc_size((uint64_t)hdr->max_man_size)); done: @@ -382,7 +382,7 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info") #ifndef NDEBUG - if(cparam->managed.max_index > (8 * hdr->sizeof_size)) + if(cparam->managed.max_index > (unsigned)(8 * hdr->sizeof_size)) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size too large for file") #endif /* NDEBUG */ @@ -433,7 +433,7 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, HADDR_UNDEF, "can't set latest version of I/O filter pipeline") /* Compute the I/O filters' encoded size */ - if(0 == (hdr->filter_len = H5O_msg_raw_size(hdr->f, H5O_PLINE_ID, FALSE, &(hdr->pline)))) + if(0 == (hdr->filter_len = (unsigned)H5O_msg_raw_size(hdr->f, H5O_PLINE_ID, FALSE, &(hdr->pline)))) HGOTO_ERROR(H5E_HEAP, H5E_CANTGETSIZE, HADDR_UNDEF, "can't get I/O filter pipeline size") /* Compute size of header on disk */ @@ -462,13 +462,13 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) case 1: /* Set the length of heap IDs to just enough to hold the information needed to directly access 'huge' objects in the heap */ if(hdr->filter_len > 0) - hdr->id_len = 1 /* ID flags */ + hdr->id_len = (unsigned)1 /* ID flags */ + hdr->sizeof_addr /* Address of filtered object */ + hdr->sizeof_size /* Length of filtered object */ + 4 /* Filter mask for filtered object */ + hdr->sizeof_size; /* Size of de-filtered object in memory */ else - hdr->id_len = 1 /* ID flags */ + hdr->id_len = (unsigned)1 /* ID flags */ + hdr->sizeof_addr /* Address of object */ + hdr->sizeof_size; /* Length of object */ break; @@ -764,7 +764,7 @@ H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) /* Update heap header */ HDassert(amt > 0 || hdr->total_man_free >= (hsize_t)-amt); - hdr->total_man_free += amt; + hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + amt); /* Mark heap header as modified */ if(H5HF_hdr_dirty(hdr) < 0) @@ -804,7 +804,8 @@ H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) hdr->man_size = new_size; /* Adjust the free space in direct blocks */ - hdr->total_man_free += extra_free; + HDassert(extra_free > 0 || hdr->total_man_free >= (hsize_t)-extra_free); + hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + extra_free); /* Mark heap header as modified */ if(H5HF_hdr_dirty(hdr) < 0) @@ -1246,7 +1247,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) /* Walk backwards through entries, until we find one that has a child */ /* (Skip direct block that will be deleted, if we find it) */ - tmp_entry = curr_entry; + tmp_entry = (int)curr_entry; while(tmp_entry >= 0 && (H5F_addr_eq(iblock->ents[tmp_entry].addr, dblock_addr) || !H5F_addr_defined(iblock->ents[tmp_entry].addr))) @@ -1281,7 +1282,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) else { unsigned row; /* Row for entry */ - curr_entry = tmp_entry; + curr_entry = (unsigned)tmp_entry; /* Check if entry is for a direct block */ row = curr_entry / hdr->man_dtable.cparam.width; |