diff options
-rw-r--r-- | c++/src/H5Attribute.cpp | 2 | ||||
-rw-r--r-- | c++/src/H5CommonFG.cpp | 4 | ||||
-rw-r--r-- | c++/test/dsets.cpp | 4 | ||||
-rw-r--r-- | c++/test/tfilter.cpp | 5 | ||||
-rw-r--r-- | fortran/src/H5Pf.c | 4 | ||||
-rw-r--r-- | hl/c++/test/ptableTest.cpp | 6 | ||||
-rw-r--r-- | hl/src/H5DS.c | 6 | ||||
-rw-r--r-- | src/H5Dchunk.c | 3 | ||||
-rw-r--r-- | src/H5Dscatgath.c | 3 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 2 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_detect_szip.c | 1 |
11 files changed, 21 insertions, 19 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 64993a2..404aec9 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -153,7 +153,7 @@ void Attribute::read( const DataType& mem_type, H5std_string& strg ) const { throw AttributeIException("Attribute::read", "Unable to get attribute size before reading"); } - char* strg_C = new char [attr_size+1]; + char* strg_C = new char [(size_t)attr_size+1]; if (strg_C == NULL) { throw AttributeIException("Attribute::read", "Unable to allocate buffer to read the attribute"); diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 364f639..71658df 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -546,11 +546,11 @@ H5std_string CommonFG::getComment (const H5std_string& name) const // temporary C-string for the object's comment char* comment_C = new char[bufsize+1]; - herr_t ret_value = H5Oget_comment_by_name(loc_id, name.c_str(), comment_C, bufsize, H5P_DEFAULT); + ssize_t ret_value = H5Oget_comment_by_name(loc_id, name.c_str(), comment_C, bufsize, H5P_DEFAULT); // if the actual length of the comment is longer than the anticipated // value, then call H5Oget_comment_by_name again with the correct value - if (ret_value > bufsize) + if ((size_t)ret_value > bufsize) { bufsize = ret_value; delete []comment_C; diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 652149e..603a0aa 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -423,7 +423,7 @@ test_compression(H5File& file) for (i = n = 0; i < 100; i++) { for (j = 0; j < 200; j++) { - points[i][j] = n++; + points[i][j] = (int)n++; } } char* tconv_buf = new char [1000]; @@ -487,7 +487,7 @@ test_compression(H5File& file) { for (j=0; j<size[1]; j++) { - points[i][j] = n++; + points[i][j] = (int)n++; } } diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 1774cf2..db7e358 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -118,7 +118,7 @@ static void test_null_filter() // Output message about test being performed SUBTEST("'Null' filter"); try { - hsize_t null_size; // Size of dataset with null filter + //hsize_t null_size; // Size of dataset with null filter // Prepare dataset create property list DSetCreatPropList dsplist; @@ -168,7 +168,6 @@ void test_szip_filter(H5File& file1) { #ifdef H5_HAVE_FILTER_SZIP int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; - hsize_t szip_size; /* Size of dataset with szip filter */ unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK; unsigned szip_pixels_per_block=4; @@ -203,7 +202,7 @@ void test_szip_filter(H5File& file1) { for (j=0; j<size[1]; j++) { - points[i][j] = n++; + points[i][j] = (int)n++; } } diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 02da4f2..e466152 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -4199,12 +4199,12 @@ int_f nh5pset_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ) { int ret_value = -1; +#ifdef H5_HAVE_DIRECT herr_t ret; /* * Call H5Pset_link_phase_change function. */ -#ifdef H5_HAVE_DIRECT ret = H5Pset_fapl_direct((hid_t)*fapl_id, (size_t)*alignment, (size_t)*block_size, (size_t)*cbuf_size ); if (ret < 0) return ret_value; @@ -4233,6 +4233,7 @@ int_f nh5pget_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ) { int ret_value = -1; +#ifdef H5_HAVE_DIRECT herr_t ret; size_t c_alignment; size_t c_block_size; @@ -4241,7 +4242,6 @@ nh5pget_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_siz /* * Call H5Pget_link_phase_change function. */ -#ifdef H5_HAVE_DIRECT ret = H5Pget_fapl_direct((hid_t)*fapl_id, &c_alignment, &c_block_size, &c_cbuf_size ); if (ret < 0) return ret_value; diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 77edce4..da84006 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -78,7 +78,7 @@ int BasicTest() { herr_t err; int myRecord; - int count; + hsize_t count; int error; TESTING("basic funtionality") @@ -133,7 +133,7 @@ out: int TestCompoundDatatype() { hid_t dtypeID; - int count; + hsize_t count; int error; TESTING("compound datatypes") @@ -439,7 +439,7 @@ int SystemTest() TESTING("multiple datatypes") hid_t dtypeID1, dtypeID2; - unsigned int count; + hsize_t count; int error; /* Creating two inter-related datatypes. Create two datasets and put diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 08345c6..46eedc4 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1478,7 +1478,7 @@ herr_t H5DSset_label(hid_t did, if(H5Aclose(aid) < 0) goto out; if(buf) - free(buf); + free((void *)buf); } /*------------------------------------------------------------------------- @@ -1501,7 +1501,7 @@ herr_t H5DSset_label(hid_t did, goto out; /* read */ - if(H5Aread(aid, tid, buf) < 0) + if(H5Aread(aid, tid, (void *)buf) < 0) goto out; /* store the label information in the required index */ @@ -1517,7 +1517,7 @@ herr_t H5DSset_label(hid_t did, if (H5Aclose(aid) < 0) goto out; if (buf) - free(buf); + free((void *)buf); } return SUCCEED; diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 711b91b..d15715b 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -3266,7 +3266,8 @@ H5D_chunk_prune_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* The number of bytes accessed in the chunk */ /* (i.e. the bytes replaced with fill values) */ - bytes_accessed = sel_nelmts * layout->u.chunk.dim[rank]; + H5_CHECK_OVERFLOW(sel_nelmts, hssize_t, uint32_t); + bytes_accessed = (uint32_t)sel_nelmts * layout->u.chunk.dim[rank]; /* Release lock on chunk */ if(H5D_chunk_unlock(io_info, TRUE, idx_hint, chunk, bytes_accessed) < 0) diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 3ea4c69..9f98622 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -802,7 +802,8 @@ H5D_compound_opt_read(size_t nelmts, const H5S_t *space, /* Get the number of bytes and offset in sequence */ curr_len = len[curr_seq]; - curr_off = off[curr_seq]; + H5_CHECK_OVERFLOW(off[curr_seq], hsize_t, size_t); + curr_off = (size_t)off[curr_seq]; /* Decide the number of elements and position in the buffer. */ curr_nelmts = curr_len / dst_stride; diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 0646536..2123bb3 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -1813,7 +1813,7 @@ static void gent_datareg(void) coord1[7][0]=9; coord1[7][1]=0; coord1[8][0]=7; coord1[8][1]=1; coord1[9][0]=3; coord1[9][1]=3; - H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,coord1); + H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(hsize_t *)coord1); H5Sget_select_npoints(sid2); diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c index 9e6d74e..906996a 100644 --- a/tools/h5repack/testh5repack_detect_szip.c +++ b/tools/h5repack/testh5repack_detect_szip.c @@ -15,6 +15,7 @@ #include <stdio.h> #include "h5repack.h" +#include "h5tools.h" #include "h5test.h" |