diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-12-14 15:22:29 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-12-14 15:22:29 (GMT) |
commit | 7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a (patch) | |
tree | 6bd24199653eff3e99f312d748ba4909686bef61 /src/H5HFhdr.c | |
parent | 8e9b142d9cd347432d400b4f9b3b88a3f047c06d (diff) | |
parent | 2cb441c507dfbd4437ccf29e232a9b730e6e1003 (diff) | |
download | hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.zip hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.tar.gz hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.tar.bz2 |
[svn-r28636] merge from trunk.
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; |