diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5BP.c | 4 | ||||
-rw-r--r-- | src/H5Dcontig.c | 3 | ||||
-rw-r--r-- | src/H5Distore.c | 15 | ||||
-rw-r--r-- | src/H5Glink.c | 3 | ||||
-rw-r--r-- | src/H5Gobj.c | 3 | ||||
-rw-r--r-- | src/H5O.c | 6 | ||||
-rw-r--r-- | src/H5Zscaleoffset.c | 10 |
7 files changed, 24 insertions, 20 deletions
@@ -280,7 +280,7 @@ H5BP_create_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bpt_shared, H5BP_node_ptr_t *n /* Create record pool for leaf node */ if((leaf->rec_pool = H5MP_create(H5BP_LEAF_POOL_PAGE, H5MP_FLG_DEFAULT)) == NULL) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't allocate memory pool") + HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "can't allocate memory pool") /* Set number of records */ leaf->nrec=0; @@ -323,8 +323,10 @@ H5BP_insert_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bpt_shared, { H5BP_leaf_t *leaf; /* Pointer to leaf node */ H5BP_shared_t *shared; /* Pointer to B+ tree's shared information */ +#ifdef LATER int cmp; /* Comparison value of records */ unsigned idx; /* Location of record which matches key */ +#endif /* LATER */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT(H5BP_insert_leaf) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index bed70d7..21b2e56 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -1031,7 +1031,8 @@ H5D_contig_copy(H5F_t *f_src, H5O_layout_t *layout_src, /* Set up number of bytes to copy, and initial buffer size */ total_nbytes = layout_src->u.contig.size; - buf_size = MIN(H5D_XFER_MAX_TEMP_BUF_DEF, total_nbytes); + H5_CHECK_OVERFLOW(total_nbytes,hsize_t,size_t); + buf_size = MIN(H5D_XFER_MAX_TEMP_BUF_DEF, (size_t)total_nbytes); /* If there's a source datatype, set up type conversion information */ if(dt_src) { diff --git a/src/H5Distore.c b/src/H5Distore.c index f0ec78a..c450293 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -875,8 +875,8 @@ H5D_istore_iter_allocated (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_l * * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, April 21, 1999 + * Programmer: Kent Yang + * Tuesday, November 15, 2005 * *------------------------------------------------------------------------- */ @@ -2356,27 +2356,25 @@ H5D_istore_allocated(H5D_t *dset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_istore_allocated() */ + /*------------------------------------------------------------------------- * Function: H5D_istore_chunkmap * * Purpose: obtain the chunk address and corresponding chunk index * - * - * * Return: Success: Non-negative on succeed. * * Failure: negative value * - * Programmer: - * + * Programmer: Kent Yang + * November 15, 2005 * *------------------------------------------------------------------------- */ herr_t H5D_istore_chunkmap(const H5D_io_info_t *io_info, hsize_t total_chunks,haddr_t chunk_addr[],hsize_t down_chunks[]) { - H5D_t *dset=io_info->dset; /* Local pointer to dataset info */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ H5D_rdcc_ent_t *ent; /*cache entry */ @@ -2425,8 +2423,7 @@ H5D_istore_chunkmap(const H5D_io_info_t *io_info, hsize_t total_chunks,haddr_t c done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_istore_allocated() */ - +} /* end H5D_istore_chunkmap() */ /*------------------------------------------------------------------------- diff --git a/src/H5Glink.c b/src/H5Glink.c index 74361ca..0213422 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -195,7 +195,8 @@ H5G_link_build_table(H5O_loc_t *oloc, hid_t dxpl_id, H5G_link_table_t *ltable) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Set size of table */ - ltable->nlinks = linfo.nlinks; + H5_CHECK_OVERFLOW(linfo.nlinks, hsize_t, size_t); + ltable->nlinks = (size_t)linfo.nlinks; /* Allocate space for the table entries */ if(ltable->nlinks > 0) { diff --git a/src/H5Gobj.c b/src/H5Gobj.c index a178e93..903e7a0 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -675,7 +675,8 @@ H5G_obj_remove(H5O_loc_t *oloc, const char *name, H5G_obj_t *obj_type, hid_t dxp udata.heap_addr = stab.heap_addr; udata.lnk_table = lnk_table; udata.nlinks = 0; - udata.max_links = linfo.nlinks; + H5_CHECK_OVERFLOW(linfo.nlinks, hsize_t, size_t); + udata.max_links = (size_t)linfo.nlinks; /* Iterate over the group members, building a table of equivalent link messages */ if((ret_value = H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, @@ -4303,8 +4303,10 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, addr_map->is_locked = FALSE; /* Increment object header's reference count, if any descendents have created links to link to this object */ - if(addr_map->inc_ref_count) - oh_dst->nlink += addr_map->inc_ref_count; + if(addr_map->inc_ref_count) { + H5_CHECK_OVERFLOW(addr_map->inc_ref_count, hsize_t, int); + oh_dst->nlink += (int)addr_map->inc_ref_count; + } /* end if */ /* Insert destination object header in cache */ if(H5AC_set(oloc_dst->file, dxpl_id, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__DIRTIED_FLAG) < 0) diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index c8e7177..8326516 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -472,9 +472,9 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ \ H5Z_scaleoffset_get_filval_1(i, type, filval_buf, filval) \ for(i = 0; i < d_nelmts; i++) \ - buf[i] = (buf[i] == (((type)1 << minbits) - 1))?filval:(buf[i] + minval);\ + buf[i] = (type)((buf[i] == (((type)1 << minbits) - 1))?filval:(buf[i] + minval));\ } else /* fill value undefined */ \ - for(i = 0; i < d_nelmts; i++) buf[i] += minval; \ + for(i = 0; i < d_nelmts; i++) buf[i] += (type)(minval); \ } /* Postdecompress for signed integer type */ @@ -485,9 +485,9 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ \ H5Z_scaleoffset_get_filval_1(i, type, filval_buf, filval) \ for(i = 0; i < d_nelmts; i++) \ - buf[i] = ((unsigned type)buf[i] == (((unsigned type)1 << minbits) - 1)) ? filval : (buf[i] + minval);\ + buf[i] = (type)(((unsigned type)buf[i] == (((unsigned type)1 << minbits) - 1)) ? filval : (buf[i] + minval));\ } else /* fill value undefined */ \ - for(i = 0; i < d_nelmts; i++) buf[i] += minval; \ + for(i = 0; i < d_nelmts; i++) buf[i] += (type)(minval); \ } /* Retrive minimum value of floating-point type */ @@ -1135,7 +1135,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu ((unsigned char *)outbuf)[4] = sizeof(unsigned long_long); for(i = 0; i < sizeof(unsigned long_long); i++) - ((unsigned char *)outbuf)[5+i] = (minval & ((unsigned long_long)0xff << i*8)) >> i*8; + ((unsigned char *)outbuf)[5+i] = (unsigned char)((minval & ((unsigned long_long)0xff << i*8)) >> i*8); /* special case: minbits equal to full precision */ if(minbits == p.size * 8) { |