summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-01 20:02:47 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-01 20:02:47 (GMT)
commite5e786f589896da6f6414da51b56ccc119df8adb (patch)
tree69c21934ad23b0b71326a8fb8b40c384aca92f24
parenteab58732d86e9219fa9f41f9ab2e30fae94e4a7d (diff)
downloadhdf5-e5e786f589896da6f6414da51b56ccc119df8adb.zip
hdf5-e5e786f589896da6f6414da51b56ccc119df8adb.tar.gz
hdf5-e5e786f589896da6f6414da51b56ccc119df8adb.tar.bz2
[svn-r8782] Purpose:
Code cleanup Description: Clean up almost all warnings from Windows builds. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest
-rw-r--r--c++/test/th5s.cpp2
-rw-r--r--src/H5Dio.c16
-rw-r--r--src/H5Pdcpl.c2
-rw-r--r--src/H5Shyper.c8
-rw-r--r--src/H5Spoint.c2
-rw-r--r--src/H5Sprivate.h2
-rw-r--r--src/H5Sselect.c2
-rw-r--r--src/H5TB.c11
-rw-r--r--src/H5Tconv.c2
-rw-r--r--src/H5Ztrans.c545
-rw-r--r--test/bittests.c12
-rw-r--r--test/dsets.c7
-rw-r--r--test/dtransform.c68
-rw-r--r--test/dtypes.c8
-rw-r--r--test/h5test.c2
-rw-r--r--test/ntypes.c2
-rw-r--r--test/th5s.c4
-rw-r--r--tools/h5dump/h5dump.c4
-rw-r--r--tools/h5ls/h5ls.c5
19 files changed, 318 insertions, 386 deletions
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index 8ea38ad..eac6703 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -77,7 +77,7 @@ struct space4_struct {
unsigned u;
float f;
char c2;
- } space4_data={'v',987123,-3.14,'g'}; /* Test data for 4th dataspace */
+ } space4_data={'v',987123,(float)-3.14,'g'}; /* Test data for 4th dataspace */
/* Null dataspace */
int space5_data = 7;
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 9585cd8..8996431 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -1152,7 +1152,7 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset,
target_size = max_type_size;
/* If the buffer is too large to hold all the elements, make it smaller */
else if(target_size>(nelmts*max_type_size))
- target_size=(nelmts*max_type_size);
+ target_size=(size_t)(nelmts*max_type_size);
} /* end if */
request_nelmts = target_size / max_type_size;
@@ -1203,7 +1203,7 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset,
for (smine_start=0; smine_start<nelmts; smine_start+=smine_nelmts) {
/* Go figure out how many elements to read from the file */
assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start));
- smine_nelmts = MIN(request_nelmts, (nelmts-smine_start));
+ smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start));
/*
* Gather the data from disk into the data type conversion
@@ -1397,7 +1397,7 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset,
target_size = max_type_size;
/* If the buffer is too large to hold all the elements, make it smaller */
else if(target_size>(nelmts*max_type_size))
- target_size=(nelmts*max_type_size);
+ target_size=(size_t)(nelmts*max_type_size);
} /* end if */
request_nelmts = target_size / max_type_size;
@@ -1452,7 +1452,7 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset,
for (smine_start=0; smine_start<nelmts; smine_start+=smine_nelmts) {
/* Go figure out how many elements to read from the file */
assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start));
- smine_nelmts = MIN(request_nelmts, (nelmts-smine_start));
+ smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start));
/*
* Gather data from application buffer into the data type conversion
@@ -1673,7 +1673,7 @@ H5D_chunk_read(hsize_t nelmts, H5D_t *dataset,
target_size = max_type_size;
/* If the buffer is too large to hold all the elements, make it smaller */
else if(target_size>(nelmts*max_type_size))
- target_size=(nelmts*max_type_size);
+ target_size=(size_t)(nelmts*max_type_size);
} /* end if */
request_nelmts = target_size / max_type_size;
@@ -1739,7 +1739,7 @@ H5D_chunk_read(hsize_t nelmts, H5D_t *dataset,
for (smine_start=0; smine_start<chunk_info->chunk_points; smine_start+=smine_nelmts) {
/* Go figure out how many elements to read from the file */
assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(chunk_info->chunk_points-smine_start));
- smine_nelmts = MIN(request_nelmts, (chunk_info->chunk_points-smine_start));
+ smine_nelmts = (size_t)MIN(request_nelmts, (chunk_info->chunk_points-smine_start));
/*
* Gather the data from disk into the data type conversion
@@ -2026,7 +2026,7 @@ H5D_chunk_write(hsize_t nelmts, H5D_t *dataset,
target_size = max_type_size;
/* If the buffer is too large to hold all the elements, make it smaller */
else if(target_size>(nelmts*max_type_size))
- target_size=(nelmts*max_type_size);
+ target_size=(size_t)(nelmts*max_type_size);
} /* end if */
request_nelmts = target_size / max_type_size;
@@ -2096,7 +2096,7 @@ H5D_chunk_write(hsize_t nelmts, H5D_t *dataset,
for (smine_start=0; smine_start<chunk_info->chunk_points; smine_start+=smine_nelmts) {
/* Go figure out how many elements to read from the file */
assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(chunk_info->chunk_points-smine_start));
- smine_nelmts = MIN(request_nelmts, (chunk_info->chunk_points-smine_start));
+ smine_nelmts = (size_t)MIN(request_nelmts, (chunk_info->chunk_points-smine_start));
/*
* Gather the data from disk into the data type conversion
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 48abd21..99f3e30 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -175,7 +175,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/])
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "all chunk dimensions must be positive");
if (dim[i] != (dim[i]&0xffffffff))
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "all chunk dimensions must be less than 2^32");
- real_dims[i]=dim[i]; /* Store user's chunk dimensions */
+ real_dims[i]=(size_t)dim[i]; /* Store user's chunk dimensions */
} /* end for */
layout = H5D_CHUNKED;
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 0425d76..2ee7356 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -658,13 +658,13 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
while(temp_dim>=0) {
if(temp_dim==fast_dim) {
size_t actual_elem; /* Actual # of elements advanced on each iteration through loop */
- size_t block_elem; /* Number of elements left in a block */
+ hsize_t block_elem; /* Number of elements left in a block */
/* Compute the number of elements left in block */
block_elem=tdiminfo[temp_dim].block-iter_offset[temp_dim];
/* Compute the number of actual elements to advance */
- actual_elem=MIN(nelem,block_elem);
+ actual_elem=(size_t)MIN(nelem,block_elem);
/* Move the iterator over as many elements as possible */
iter_offset[temp_dim]+=actual_elem;
@@ -729,13 +729,13 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
/* Increment absolute position */
if(curr_dim==fast_dim) {
size_t actual_elem; /* Actual # of elements advanced on each iteration through loop */
- size_t span_elem; /* Number of elements left in a span */
+ hsize_t span_elem; /* Number of elements left in a span */
/* Compute the number of elements left in block */
span_elem=(curr_span->high-abs_arr[curr_dim])+1;
/* Compute the number of actual elements to advance */
- actual_elem=MIN(nelem,span_elem);
+ actual_elem=(size_t)MIN(nelem,span_elem);
/* Move the iterator over as many elements as possible */
abs_arr[curr_dim]+=actual_elem;
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index 11802e5..4970321 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -1312,7 +1312,7 @@ H5S_point_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter,
/* Choose the minimum number of bytes to sequence through */
H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t);
- start_io_left=io_left=MIN(iter->elmt_left,maxelem);
+ start_io_left=io_left=(size_t)MIN(iter->elmt_left,maxelem);
/* Get the dataspace dimensions */
if ((ndims=H5S_get_simple_extent_dims (space, dims, NULL))<0)
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 89215cd..1c0c4d0 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -267,7 +267,7 @@ H5_DLL herr_t H5S_select_release(H5S_t *ds);
H5_DLL herr_t H5S_select_get_seq_list(const H5S_t *space, unsigned flags,
H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
-H5_DLL herr_t H5S_select_serial_size(const H5S_t *space);
+H5_DLL hssize_t H5S_select_serial_size(const H5S_t *space);
H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t *buf);
H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space);
H5_DLL htri_t H5S_select_is_single(const H5S_t *space);
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 61a1f5d..e9fc5a3 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -225,7 +225,7 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags,
*
*-------------------------------------------------------------------------
*/
-herr_t
+hssize_t
H5S_select_serial_size(const H5S_t *space)
{
hssize_t ret_value; /* Return value */
diff --git a/src/H5TB.c b/src/H5TB.c
index 164380f..526acaf 100644
--- a/src/H5TB.c
+++ b/src/H5TB.c
@@ -215,12 +215,21 @@ H5TB_int_cmp(const void *k1, const void *k2, int UNUSED cmparg)
static int
H5TB_hsize_cmp(const void *k1, const void *k2, int UNUSED cmparg)
{
+ int ret_value;
+
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_hsize_cmp);
assert(k1);
assert(k2);
- FUNC_LEAVE_NOAPI(*(const hsize_t *)k1 - *(const hsize_t *)k2);
+ if(*(const hsize_t *)k1 < *(const hsize_t *)k2)
+ ret_value=-1;
+ else if(*(const hsize_t *)k1 > *(const hsize_t *)k2)
+ ret_value=1;
+ else
+ ret_value=0;
+
+ FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_hsize_cmp() */
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 389de12..82c7084 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -9293,7 +9293,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* Find the sign bit value of the source.
*/
if (H5T_SGN_2 == src.u.i.sign)
- sign = H5T_bit_get_d(int_buf, src.prec-1, 1);
+ sign = (size_t)H5T_bit_get_d(int_buf, src.prec-1, 1);
/*
* What is the bit position(starting from 0 as first one) for the most significant
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 3a0931a..c53a758 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -724,7 +724,8 @@ H5Z_new_node(H5Z_token_type type)
*-------------------------------------------------------------------------
*/
-herr_t H5Z_xform_eval(const H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size, const H5T_t *buf_type)
+herr_t
+H5Z_xform_eval(const H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size, const H5T_t *buf_type)
{
H5Z_node *tree;
hid_t array_type;
@@ -736,7 +737,7 @@ herr_t H5Z_xform_eval(const H5Z_data_xform_t *data_xform_prop, void* array, size
FUNC_ENTER_NOAPI(H5Z_xform_eval, FAIL)
- assert(data_xform_prop);
+ assert(data_xform_prop);
tree=data_xform_prop->parse_root;
@@ -776,7 +777,7 @@ herr_t H5Z_xform_eval(const H5Z_data_xform_t *data_xform_prop, void* array, size
}
else if(array_type == H5T_NATIVE_FLOAT)
{
- f = tree->value.float_val;
+ f = (float)tree->value.float_val;
for(i=0; i<array_size; i++)
*((float*)array + i) = f;
}
@@ -820,7 +821,7 @@ H5Z_eval_full(H5Z_node *tree, void* array, size_t array_size, hid_t array_type)
error.type = H5Z_XFORM_ERROR;
- FUNC_ENTER_NOAPI(H5Z_eval_full, ret_value);
+ FUNC_ENTER_NOAPI(H5Z_eval_full, error);
/* check args */
assert(tree);
@@ -828,359 +829,269 @@ H5Z_eval_full(H5Z_node *tree, void* array, size_t array_size, hid_t array_type)
if (tree->type == H5Z_XFORM_INTEGER)
{
res.type = H5Z_XFORM_INTEGER;
- res.value = tree->value;
- HGOTO_DONE(res)
+ res.value.int_val = tree->value.int_val;
}
else if (tree->type == H5Z_XFORM_FLOAT)
{
res.type = H5Z_XFORM_FLOAT;
- res.value = tree->value;
- HGOTO_DONE(res)
+ res.value.float_val = tree->value.float_val;
}
else if (tree->type == H5Z_XFORM_SYMBOL)
{
res.type = H5Z_XFORM_SYMBOL;
- res.value = tree->value;
+ res.value.sym_val = tree->value.sym_val;
res.ar_type = array_type;
- HGOTO_DONE(res)
}
else
{
resl = H5Z_eval_full(tree->lchild, array, array_size, array_type);
resr = H5Z_eval_full(tree->rchild, array, array_size, array_type);
- switch (tree->type)
- {
- case H5Z_XFORM_PLUS:
- if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
+ res.type = H5Z_XFORM_SYMBOL;
+
+ /* Check for un-handled datatype */
+ if(array_type!= H5T_NATIVE_INT && array_type!= H5T_NATIVE_FLOAT)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
+
+ switch (tree->type) {
+ case H5Z_XFORM_PLUS:
+ if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
+ {
if(array_type == H5T_NATIVE_INT)
{
- for(i=0; i<array_size; i++)
- *((int*)array + i) = resr.value.int_val + *((int*)array + i);
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) += resr.value.int_val;
}
- else if(array_type == H5T_NATIVE_FLOAT)
+ else
{
- for(i=0; i<array_size; i++)
- *((float*)array + i) = resr.value.int_val + *((float*)array + i);
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) += resr.value.int_val;
}
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
- HGOTO_DONE(res)
- }
- else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT))
- {
- res.type = H5Z_XFORM_SYMBOL;
+ }
+ else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT))
+ {
if(array_type == H5T_NATIVE_INT)
{
- for(i=0; i<array_size; i++)
- *((int*)array + i) += resr.value.float_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) += resr.value.float_val;
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) += resr.value.float_val;
}
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) += (float)resr.value.float_val;
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
+ {
if(array_type == H5T_NATIVE_INT)
{
- for(i=0; i<array_size; i++)
- *((int*)array + i) += resl.value.int_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) += resl.value.int_val ;
- }
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
- HGOTO_DONE(res)
-
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
- {
-
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) += resl.value.float_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) += resl.value.float_val ;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type conversion operation")
-
- HGOTO_DONE(res)
- break;
- case H5Z_XFORM_MINUS:
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) += resl.value.int_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) += resl.value.int_val ;
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) += resl.value.float_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) += (float)resl.value.float_val ;
+ }
+ }
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type conversion operation")
+ break;
- if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) -= resr.value.int_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) -= resr.value.int_val;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT)) /*we can't upgrade an array w/o allocating more memory, so we downgrade the float_val to an int.*/
- {
- res.type = H5Z_XFORM_SYMBOL;
+ case H5Z_XFORM_MINUS:
+ if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
+ {
if(array_type == H5T_NATIVE_INT)
{
- for(i=0; i<array_size; i++)
- *((int*)array + i) -= resr.value.float_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) -= resr.value.float_val;
- }
- else
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
- }
- HGOTO_DONE(res)
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) = resl.value.int_val - *((int*)array + i);
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) = resl.value.int_val - *((float*)array + i);
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
-
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
- {
-
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) = resl.value.float_val - *((int*)array + i);
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) = resl.value.float_val - *((float*)array + i);
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type conversion operation")
-
-
- HGOTO_DONE(res)
- break;
-
-
- case H5Z_XFORM_MULT:
-
- if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) *= resr.value.int_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) *= resr.value.int_val;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT))
- {
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) *= resr.value.float_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) *= resr.value.float_val;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) *= resl.value.int_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) *= resl.value.int_val;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
-
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
- {
-
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) *= resl.value.float_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) *= resl.value.float_val;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type operation")
-
- HGOTO_DONE(res)
- break;
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) -= resr.value.int_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) -= resr.value.int_val;
+ }
+ }
+ else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT)) /*we can't upgrade an array w/o allocating more memory, so we downgrade the float_val to an int.*/
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) -= resr.value.float_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) -= (float)resr.value.float_val;
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) = resl.value.int_val - *((int*)array + i);
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) = resl.value.int_val - *((float*)array + i);
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) = resl.value.float_val - *((int*)array + i);
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) = (float)resl.value.float_val - *((float*)array + i);
+ }
+ }
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type conversion operation")
+ break;
- case H5Z_XFORM_DIVIDE:
+ case H5Z_XFORM_MULT:
- if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) /= resr.value.int_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) /= resr.value.int_val;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT))
- {
- res.type = H5Z_XFORM_SYMBOL;
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) /= resr.value.float_val;
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) /= resr.value.float_val;
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- HGOTO_DONE(res)
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
- {
- res.type = H5Z_XFORM_SYMBOL;
+ if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
{
if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) = resl.value.int_val / *((int*)array + i);
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) = resl.value.int_val / *((float*)array + i);
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
- }
- HGOTO_DONE(res)
-
- }
- else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
- {
-
- res.type = H5Z_XFORM_SYMBOL;
- {
- if(array_type == H5T_NATIVE_INT)
- {
- for(i=0; i<array_size; i++)
- *((int*)array + i) = resl.value.float_val / *((int*)array + i);
- }
- else if(array_type == H5T_NATIVE_FLOAT)
- {
- for(i=0; i<array_size; i++)
- *((float*)array + i) = resl.value.float_val / *((float*)array + i);
- }else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Cannot perform a data transform on this type")
-
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) *= resr.value.int_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) *= resr.value.int_val;
+ }
}
- HGOTO_DONE(res)
- }
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type operation")
-
- HGOTO_DONE(res)
- break;
-
+ else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) *= resr.value.float_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) *= (float)resr.value.float_val;
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) *= resl.value.int_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) *= resl.value.int_val;
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) *= resl.value.float_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) *= (float)resl.value.float_val;
+ }
+ }
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type operation")
+ break;
+ case H5Z_XFORM_DIVIDE:
+ if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_INTEGER))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) /= resr.value.int_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) /= resr.value.int_val;
+ }
+ }
+ else if( (resl.type == H5Z_XFORM_SYMBOL) && (resr.type==H5Z_XFORM_FLOAT))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) /= resr.value.float_val;
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) /= (float)resr.value.float_val;
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_INTEGER))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) = resl.value.int_val / *((int*)array + i);
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) = resl.value.int_val / *((float*)array + i);
+ }
+ }
+ else if( (resr.type == H5Z_XFORM_SYMBOL) && (resl.type==H5Z_XFORM_FLOAT))
+ {
+ if(array_type == H5T_NATIVE_INT)
+ {
+ for(i=0; i<array_size; i++)
+ *((int*)array + i) = resl.value.float_val / *((int*)array + i);
+ }
+ else
+ {
+ for(i=0; i<array_size; i++)
+ *((float*)array + i) = (float)resl.value.float_val / *((float*)array + i);
+ }
+ }
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Unexpected type operation")
+ break;
- default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Invalid expression tree")
+ default:
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, error, "Invalid expression tree")
}
}
+ ret_value=res;
+
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
}
diff --git a/test/bittests.c b/test/bittests.c
index 2823a56..cb038f7 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -310,7 +310,7 @@ test_shift (void)
/* Look for the ones */
n = H5T_bit_find (vector, 0, 8*sizeof(vector), H5T_BIT_LSB, 1);
- if (n!=offset+shift_dist) {
+ if ((size_t)n!=offset+shift_dist) {
H5_FAILED();
printf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
@@ -337,7 +337,7 @@ test_shift (void)
/* Look for the ones */
n = H5T_bit_find (vector, 0, 8*sizeof(vector), H5T_BIT_LSB, 1);
- if (n!=offset) {
+ if ((size_t)n!=offset) {
H5_FAILED();
printf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
@@ -363,7 +363,7 @@ test_shift (void)
if(size % 2 == 0)
shift_dist = size;
else
- shift_dist = -size;
+ shift_dist = -((ssize_t)size);
memset (vector, 0x00, sizeof vector);
H5T_bit_set (vector, offset, size, 1);
@@ -445,7 +445,7 @@ test_increment (void)
/* Look for the one */
n = H5T_bit_find (vector, 0, 8*sizeof(vector), H5T_BIT_LSB, 1);
- if (size!=1 && n!=offset+size-1) {
+ if (size!=1 && (size_t)n!=offset+size-1) {
H5_FAILED();
printf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
@@ -529,7 +529,7 @@ test_decrement (void)
/* Look for the ones */
n = H5T_bit_find (vector, 0, 8*sizeof(vector), H5T_BIT_LSB, 1);
- if (n!=offset) {
+ if ((size_t)n!=offset) {
H5_FAILED();
printf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
@@ -601,7 +601,7 @@ test_negate (void)
/* Look for the ones */
n = H5T_bit_find (vector, 0, 8*sizeof(vector), H5T_BIT_LSB, 1);
- if (n!=offset) {
+ if ((size_t)n!=offset) {
H5_FAILED();
printf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
diff --git a/test/dsets.c b/test/dsets.c
index 152dc97..8cdb5bf 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -791,7 +791,7 @@ test_conv_buffer(hid_t fid)
cf->a[j][k][l] = 10*(j+1) + l + k;
for (j = 0; j < DIM2; j++)
- cf->b[j] = 100.*(j+1) + 0.01*j;
+ cf->b[j] = (float)(100.*(j+1) + 0.01*j);
for (j = 0; j < DIM3; j++)
cf->c[j] = 100.*(j+1) + 0.02*j;
@@ -2964,9 +2964,10 @@ test_set_local(hid_t fapl)
h5_fixname(FILENAME[5], fapl, filename, sizeof filename);
/* Initialize the integer & floating-point dataset */
- for (i = n = 0; i < DSET_DIM1; i++)
+ n=0.0;
+ for (i = 0; i < DSET_DIM1; i++)
for (j = 0; j < DSET_DIM2; j++) {
- points[i][j] = n++;
+ points[i][j] = (int)n++;
points_dbl[i][j] = (double)1.5*n++;
}
diff --git a/test/dtransform.c b/test/dtransform.c
index 5e67986..9d1665b 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -47,42 +47,52 @@ int main()
herr_t err;
int row, col;
+ TESTING("data transform, setting up")
+
for(row = 0; row<ROWS; row++)
{
for(col = 0; col<COLS; col++)
windchillCint[row][col] = (5/9.0)*(windchillFint[row][col] - 32);
}
- dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER);
- dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER);
- dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER);
+ if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
+ if((dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
+ if((dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
- err= H5Pset_data_transform(dxpl_id_f_to_c, f_to_c);
- err= H5Pset_data_transform(dxpl_id_c_to_f, c_to_f);
- err = H5Pset_data_transform(dxpl_id_simple, simple);
+ if((err= H5Pset_data_transform(dxpl_id_f_to_c, f_to_c))<0) TEST_ERROR;
+ if((err= H5Pset_data_transform(dxpl_id_c_to_f, c_to_f))<0) TEST_ERROR;
+ if((err = H5Pset_data_transform(dxpl_id_simple, simple))<0) TEST_ERROR;
+
+ if((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) TEST_ERROR;
- file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR;
+
+ PASSED();
- dataspace = H5Screate_simple(2, dim, NULL);
+ TESTING("data transform, writing integer data")
/* Write out the integer dataset to the file, converting it to c */
- datatype = H5Tcopy(H5T_NATIVE_INT);
- dset_id_int = H5Dcreate(file_id, "/transformtest_int", datatype, dataspace, H5P_DEFAULT);
- err = H5Dwrite(dset_id_int, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFint);
- H5Tclose(datatype);
+ if((datatype = H5Tcopy(H5T_NATIVE_INT))<0) TEST_ERROR;
+ if((dset_id_int = H5Dcreate(file_id, "/transformtest_int", datatype, dataspace, H5P_DEFAULT))<0) TEST_ERROR;
+ if((err = H5Dwrite(dset_id_int, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFint))<0) TEST_ERROR;
+ if((err = H5Tclose(datatype))<0) TEST_ERROR;
+
+ PASSED();
+
+ TESTING("data transform, writing float data")
/* Write out a floating point version to the file, converting it to c */
- datatype = H5Tcopy(H5T_NATIVE_FLOAT);
- dset_id_float = H5Dcreate(file_id, "/transformtest_float", datatype, dataspace, H5P_DEFAULT);
- err = H5Dwrite(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFint);
- H5Tclose(datatype);
+ if((datatype = H5Tcopy(H5T_NATIVE_FLOAT))<0) TEST_ERROR;
+ if((dset_id_float = H5Dcreate(file_id, "/transformtest_float", datatype, dataspace, H5P_DEFAULT))<0) TEST_ERROR;
+ if((err = H5Dwrite(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFint))<0) TEST_ERROR;
+ if((err = H5Tclose(datatype))<0) TEST_ERROR;
-
+ PASSED();
TESTING("data transform, no data type conversion (int->int)")
/* Read in the integer data with a data transform. */
- err = H5Dread(dset_id_int, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFintread);
+ if((err = H5Dread(dset_id_int, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFintread))<0) TEST_ERROR;
if( (compare_int(*windchillFintread, *windchillFint, 2)) == 0)
{
@@ -93,7 +103,7 @@ int main()
PASSED();
TESTING("data transform, no data type conversion (float->float)")
- err = H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread);
+ if((err = H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread))<0) TEST_ERROR;
if( (compare_float(*windchillFfloat, *windchillFfloatread, 2.0)) == 0)
{
fprintf(stderr, "ERROR: Conversion failed to match computed data\n");
@@ -103,7 +113,7 @@ int main()
PASSED();
TESTING("data transform, with data type conversion (int->float)")
- err = H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread);
+ if((err = H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread))<0) TEST_ERROR;
if( (compare_float(*windchillFfloat, *windchillFfloatread, 2.0)) == 0)
{
fprintf(stderr, "ERROR: Conversion failed to match computed data\n");
@@ -113,7 +123,7 @@ int main()
PASSED();
TESTING("data transform, with data type conversion (float->int)")
- err = H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFintread);
+ if((err = H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFintread))<0) TEST_ERROR;
if( (compare_int(*windchillFint, *windchillFintread, 2)) == 0)
{
fprintf(stderr, "ERROR: Conversion failed to match computed data\n");
@@ -123,7 +133,7 @@ int main()
PASSED();
TESTING("data transform, trivial transform, without type conversion")
- err = H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread);
+ if((err = H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread))<0) TEST_ERROR;
for(row = 0; row<ROWS; row++)
{
for(col = 0; col<COLS; col++)
@@ -138,7 +148,7 @@ int main()
PASSED();
TESTING("data transform, trivial transform, with type conversion")
- err = H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread);
+ if((err = H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread))<0) TEST_ERROR;
for(row = 0; row<ROWS; row++)
{
for(col = 0; col<COLS; col++)
@@ -153,12 +163,12 @@ int main()
/* Close the objects we opened/created */
- err = H5Sclose(dataspace);
- err = H5Dclose(dset_id_int);
- err = H5Dclose(dset_id_float);
- err = H5Fclose(file_id);
- err = H5Pclose(dxpl_id_f_to_c);
- err = H5Pclose(dxpl_id_c_to_f);
+ if((err = H5Sclose(dataspace))<0) TEST_ERROR;
+ if((err = H5Dclose(dset_id_int))<0) TEST_ERROR;
+ if((err = H5Dclose(dset_id_float))<0) TEST_ERROR;
+ if((err = H5Fclose(file_id))<0) TEST_ERROR;
+ if((err = H5Pclose(dxpl_id_f_to_c))<0) TEST_ERROR;
+ if((err = H5Pclose(dxpl_id_c_to_f))<0) TEST_ERROR;
PASSED();
diff --git a/test/dtypes.c b/test/dtypes.c
index 5d2297d..fc85ad3 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1488,9 +1488,9 @@ static int
test_compound_9(void)
{
typedef struct cmpd_struct {
- int i1;
- const char* str;
- int i2;
+ int i1;
+ char* str;
+ int i2;
} cmpd_struct;
cmpd_struct wdata = {11, "variable-length string", 22};
@@ -1593,7 +1593,7 @@ test_compound_9(void)
goto error;
} /* end if */
- if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || strcmp(rdata.str, wdata.str)) {
+ if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
H5_FAILED(); AT();
printf("incorrect read data\n");
goto error;
diff --git a/test/h5test.c b/test/h5test.c
index 5c21181..1338b5b 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -793,7 +793,7 @@ h5_get_file_size(const char *filename)
/* Get the file's statistics */
if (HDstat(filename, &sb)>=0)
- return(sb.st_size);
+ return((off_t)sb.st_size);
return(0);
} /* end get_file_size() */
diff --git a/test/ntypes.c b/test/ntypes.c
index 9772bb6..952c90c 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -1577,7 +1577,7 @@ test_vl_dtype(hid_t file)
tmp=malloc(t2->len*sizeof(unsigned int));
memcpy(tmp, t2->p, t2->len*H5Tget_size(nat_super_type));
- if (H5Tconvert(nat_super_type, H5T_NATIVE_UINT, (hsize_t)t2->len, tmp, NULL, H5P_DEFAULT))
+ if (H5Tconvert(nat_super_type, H5T_NATIVE_UINT, t2->len, tmp, NULL, H5P_DEFAULT))
TEST_ERROR;
for(k=0; k<t2->len; k++) {
diff --git a/test/th5s.c b/test/th5s.c
index deb2dae..f77f0cd 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -362,7 +362,7 @@ test_h5s_null(void)
VERIFY(stype, H5S_NULL, "H5Sget_simple_extent_type");
/* Verify there is zero element in the dataspace */
- ret = H5Sget_simple_extent_npoints(dset_sid2);
+ ret = (herr_t)H5Sget_simple_extent_npoints(dset_sid2);
VERIFY(ret, 0, "H5Sget_simple_extent_npoints");
/* Try reading from the dataset (make certain our buffer is unmodified) */
@@ -390,7 +390,7 @@ test_h5s_null(void)
VERIFY(stype, H5S_NULL, "H5Sget_simple_extent_type");
/* Verify there is zero element in the dataspace */
- ret = H5Sget_simple_extent_npoints(attr_sid);
+ ret = (herr_t)H5Sget_simple_extent_npoints(attr_sid);
VERIFY(ret, 0, "H5Sget_simple_extent_npoints");
/* Close the dataspace */
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index ed41369..cfc4955 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -3712,7 +3712,7 @@ print_enum(hid_t type)
/* Convert values to native data type */
if (native > 0)
- H5Tconvert(super, native, (hsize_t)nmembs, value, NULL, H5P_DEFAULT);
+ H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT);
/*
* Sort members by increasing value
@@ -6156,7 +6156,7 @@ xml_print_enum(hid_t type)
/* Convert values to native data type */
if (native > 0)
- H5Tconvert(super, native, (hsize_t)nmembs, value, NULL, H5P_DEFAULT);
+ H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT);
/* Sort members by increasing value */
/*not implemented yet */
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index ed73af4..7107162 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -801,7 +801,7 @@ display_enum_type(hid_t type, int ind)
}
/* Convert values to native data type */
- if (native>0) H5Tconvert(super, native, (hsize_t)nmembs, value, NULL, H5P_DEFAULT);
+ if (native>0) H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT);
/* Sort members by increasing value */
/*not implemented yet*/
@@ -2216,7 +2216,7 @@ main (int argc, const char *argv[])
* doesn't exist). */
show_file_name_g = (argc-argno > 1); /*show file names if more than one*/
while (argno<argc) {
- fname = argv[argno++];
+ fname = HDstrdup(argv[argno++]);
oname = NULL;
file = -1;
@@ -2266,6 +2266,7 @@ main (int argc, const char *argv[])
if (H5Gclose(root)<0) leave(1);
}
H5Fclose(file);
+ free(fname);
}
leave(0);
}