summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-08-12 13:33:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-08-12 13:33:49 (GMT)
commit367f2125d956e1c38c99f59603df95f6f31b940e (patch)
tree13d975fd64da87abc8944861d297585a3acdb5dc
parentf040f990a065db070a83e3217c209a83e204d6ca (diff)
downloadhdf5-367f2125d956e1c38c99f59603df95f6f31b940e.zip
hdf5-367f2125d956e1c38c99f59603df95f6f31b940e.tar.gz
hdf5-367f2125d956e1c38c99f59603df95f6f31b940e.tar.bz2
[svn-r15463] Description:
Bring revision 15462 (compiler warnings) back from trunk. Tested on: Mac OS X/32 10.5.4 (amazon) w/FORTRAN & C++ (Too minor to require h5committest)
-rw-r--r--c++/src/H5Attribute.cpp2
-rw-r--r--c++/src/H5CommonFG.cpp4
-rw-r--r--c++/test/dsets.cpp4
-rw-r--r--c++/test/tfilter.cpp5
-rw-r--r--fortran/src/H5Pf.c4
-rw-r--r--hl/c++/test/ptableTest.cpp6
-rw-r--r--hl/src/H5DS.c6
-rw-r--r--src/H5Dchunk.c3
-rw-r--r--src/H5Dscatgath.c3
-rw-r--r--tools/h5dump/h5dumpgentest.c2
-rw-r--r--tools/h5repack/testh5repack_detect_szip.c1
11 files changed, 21 insertions, 19 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index ed2e7f3..fe2527b 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -162,7 +162,7 @@ void Attribute::read( const DataType& mem_type, H5std_string& strg ) const
void *ptr;
if (!is_variable_len) // only allocate for fixed-len string
{
- strg_C = new char [attr_size+1];
+ strg_C = new char [(size_t)attr_size+1];
ptr = strg_C;
}
else
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp
index 0217df2..f70e0d1 100644
--- a/c++/src/H5CommonFG.cpp
+++ b/c++/src/H5CommonFG.cpp
@@ -541,11 +541,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 4e7d306..b91ced6 100644
--- a/hl/c++/test/ptableTest.cpp
+++ b/hl/c++/test/ptableTest.cpp
@@ -79,7 +79,7 @@ int BasicTest()
{
herr_t err;
int myRecord;
- int count;
+ hsize_t count;
int error;
TESTING("basic funtionality")
@@ -134,7 +134,7 @@ out:
int TestCompoundDatatype()
{
hid_t dtypeID;
- int count;
+ hsize_t count;
int error;
TESTING("compound datatypes")
@@ -440,7 +440,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"