From 507a21125783ea03d75e8c6460212cd22f8466ee Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 12 Aug 2008 07:46:40 -0500 Subject: [svn-r15462] Description: Correct compiler warnings from Visual Studio. Tested on: Mac OS X/32 10.5.4 (amazon) w/FORTRAN & C++ (Too minor to require full h5committest) --- c++/src/H5Attribute.cpp | 2 +- c++/src/H5CommonFG.cpp | 4 ++-- c++/test/dsets.cpp | 4 ++-- c++/test/tfilter.cpp | 5 ++--- fortran/src/H5Pf.c | 4 ++-- hl/c++/test/ptableTest.cpp | 6 +++--- hl/src/H5DS.c | 6 +++--- src/H5Dchunk.c | 3 ++- src/H5Dscatgath.c | 3 ++- tools/h5dump/h5dumpgentest.c | 2 +- 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; ju.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 #include "h5repack.h" +#include "h5tools.h" #include "h5test.h" -- cgit v0.12