summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-18 04:10:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-18 04:10:09 (GMT)
commit0a29514b9dd967deb64b53b39e12d6b55177b76c (patch)
treea0a2fce3c7a13fcdf1deed6c022a47bfb5a2cbf1 /src
parent432f394cbbc6f77861501f91dc2fc5c209f3811f (diff)
downloadhdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.zip
hdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.tar.gz
hdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.tar.bz2
[svn-r8383] Purpose:
Code cleanup Description: Clean up lots of warnings based on those reported from the SGI compilers as well as gcc. Platforms tested: SGI O3900, IRIX64 6.5 (Cheryl's SGI machine) FreeBSD 4.9 (sleipnir) w/ & w/o parallel h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5Dio.c8
-rw-r--r--src/H5E.c6
-rw-r--r--src/H5FDfamily.c4
-rw-r--r--src/H5FDmpio.c2
-rw-r--r--src/H5Pdcpl.c4
-rw-r--r--src/H5Smpio.c1
-rw-r--r--src/H5Tbit.c2
-rw-r--r--src/H5Tconv.c10
-rw-r--r--src/H5V.c10
-rw-r--r--src/H5Vprivate.h5
-rw-r--r--src/H5Zdeflate.c2
-rw-r--r--src/H5detect.c2
12 files changed, 23 insertions, 33 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 9840bf0..c2239b1 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -2694,7 +2694,7 @@ H5D_create_chunk_file_map_hyper(const fm_map *fm)
} /* end for */
/* Calculate the index of this chunk */
- if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0)
+ if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Iterate through each chunk in the dataset */
@@ -2806,7 +2806,7 @@ H5D_create_chunk_file_map_hyper(const fm_map *fm)
} while(coords[curr_dim]>sel_end[curr_dim]);
/* Re-Calculate the index of this chunk */
- if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0)
+ if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end if */
} /* end while */
@@ -3028,7 +3028,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize
FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_file_cb)
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0)
+ if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Find correct chunk in file & memory TBBTs */
@@ -3140,7 +3140,7 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize_
FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_mem_cb)
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0)
+ if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Find correct chunk in file & memory TBBTs */
diff --git a/src/H5E.c b/src/H5E.c
index 30e1ce9..9678afc 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -110,7 +110,7 @@ static herr_t H5E_set_current_stack(H5E_t *estack);
static herr_t H5E_close_stack(H5E_t *err_stack);
static int H5E_get_num(const H5E_t *err_stack);
static herr_t H5E_pop(H5E_t *err_stack, size_t count);
-static herr_t H5E_clear_entries(H5E_t *estack, unsigned nentries);
+static herr_t H5E_clear_entries(H5E_t *estack, size_t nentries);
static herr_t H5E_print(const H5E_t *estack, FILE *stream);
static herr_t H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func,
void *client_data);
@@ -1685,7 +1685,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5E_clear_entries(H5E_t *estack, unsigned nentries)
+H5E_clear_entries(H5E_t *estack, size_t nentries)
{
H5E_error_t *error; /* Pointer to error stack entry to clear */
unsigned u; /* Local index variable */
@@ -2083,7 +2083,7 @@ H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void
} else {
H5_CHECK_OVERFLOW(estack->nused-1,size_t,int);
for (i=(int)(estack->nused-1); i>=0 && status>=0; i--)
- status = (func)(estack->nused-(size_t)(i+1), estack->slot+i, client_data);
+ status = (func)((unsigned)(estack->nused-(size_t)(i+1)), estack->slot+i, client_data);
}
#endif /* H5_WANT_H5_V1_6_COMPAT */
if(status<0)
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 558b5b9..c902e9b 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -609,7 +609,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
/* Enlarge member array */
if (file->nmembs>=file->amembs) {
- size_t n = MAX(64, 2*file->amembs);
+ int n = MAX(64, 2*file->amembs);
H5FD_t **x = H5MM_realloc(file->memb, n*sizeof(H5FD_t*));
if (!x)
@@ -866,7 +866,7 @@ H5FD_family_set_eoa(H5FD_t *_file, haddr_t eoa)
/* Enlarge member array */
if (u>=file->amembs) {
- size_t n = MAX(64, 2*file->amembs);
+ int n = MAX(64, 2*file->amembs);
H5FD_t **x = H5MM_realloc(file->memb, n*sizeof(H5FD_t*));
if (!x)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block")
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 7d967c9..a27abca 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1484,7 +1484,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */
/* Obtain the data transfer properties */
- xfer_mode = H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME);
+ xfer_mode = (H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME);
/*
* Set up for a fancy xfer using complex types, or single byte block. We
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index a510f85..1ae97b2 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -325,7 +325,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size)
/* Add to the list */
if (efl.nused >= efl.nalloc) {
- int na = efl.nalloc + H5O_EFL_ALLOC;
+ size_t na = efl.nalloc + H5O_EFL_ALLOC;
H5O_efl_entry_t *x = H5MM_realloc (efl.slot, na*sizeof(H5O_efl_entry_t));
if (!x)
@@ -388,7 +388,7 @@ H5Pget_external_count(hid_t plist_id)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list");
/* Set return value */
- ret_value=efl.nused;
+ ret_value=(int)efl.nused;
done:
FUNC_LEAVE_API(ret_value);
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 7c732b1..cc1adb4 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -573,7 +573,6 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
case H5S_COMPLEX:
/* not yet implemented */
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "complex data spaces are not supported yet");
- break;
default:
assert("unknown data space type" && 0);
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index 79bb296..8bcd1a4 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -196,7 +196,7 @@ H5T_bit_shift (uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size)
if(!shift_dist)
goto done;
- if(ABS(shift_dist) >= size) {
+ if((size_t)ABS(shift_dist) >= size) {
H5T_bit_set(buf, offset, size, 0);
goto done;
}
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 0cd615b..83f001c 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -8409,7 +8409,6 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
hssize_t sign; /*source sign bit value */
uint8_t *int_buf; /*buffer for temporary value */
size_t buf_size; /*buffer size for temporary value */
- size_t msize; /*mantissa size after restored implied 1 */
size_t i; /*miscellaneous counters */
size_t first; /*first bit(MSB) in an integer */
ssize_t sfirst; /*a signed version of `first' */
@@ -8590,11 +8589,8 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
* Restore the implicit bit for mantissa if it's implied.
* Equivalent to mantissa |= (hsize_t)1<<src.u.f.msize.
*/
- if (H5T_NORM_IMPLIED==src.u.f.norm) {
+ if (H5T_NORM_IMPLIED==src.u.f.norm)
H5T_bit_inc(int_buf, src.u.f.msize, 8*buf_size-src.u.f.msize);
- msize = src.u.f.msize + 1;
- } else
- msize = src.u.f.msize;
/*
* Shift mantissa part by exponent minus mantissa size(right shift),
@@ -8759,7 +8755,6 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
hsize_t sign = 0; /*source sign bit value */
hsize_t is_max_neg = 0; /*source is maximal negative value*/
hsize_t do_round = 0; /*whether there is roundup */
- hsize_t trailing = 0; /*whether there is trailing after 1st roundup bit*/
uint8_t *int_buf; /*buffer for temporary value */
size_t buf_size; /*buffer size for temporary value */
size_t i; /*miscellaneous counters */
@@ -8832,7 +8827,6 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
sign = 0; /*source sign bit value */
is_max_neg = 0; /*source is maximal negative value*/
do_round = 0; /*whether there is roundup */
- trailing = 0; /*whether there is trailing after 1st roundup bit*/
/*
* If the source and destination buffers overlap then use a
@@ -8912,7 +8906,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
* (create a carry) to help conversion. i.e. a character type number 0x80
* is treated as 0x100.
*/
- sfirst = src.prec-1;
+ sfirst = (ssize_t)(src.prec-1);
is_max_neg = 0;
}
diff --git a/src/H5V.c b/src/H5V.c
index 654a4a9..0af06b1 100644
--- a/src/H5V.c
+++ b/src/H5V.c
@@ -1061,7 +1061,7 @@ done:
*-------------------------------------------------------------------------
*/
hsize_t
-H5V_array_offset_pre(unsigned n, const hsize_t *total_size, const hsize_t *acc, const hssize_t *offset)
+H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hssize_t *offset)
{
hsize_t skip; /*starting point byte offset */
int i; /*counter */
@@ -1070,7 +1070,6 @@ H5V_array_offset_pre(unsigned n, const hsize_t *total_size, const hsize_t *acc,
FUNC_ENTER_NOAPI(H5V_array_offset_pre, (HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */
assert(n <= H5V_HYPER_NDIMS);
- assert(total_size);
assert(acc);
assert(offset);
@@ -1125,7 +1124,7 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hssize_t *offset)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes")
/* Set return value */
- ret_value=H5V_array_offset_pre(n,total_size,acc_arr,offset);
+ ret_value=H5V_array_offset_pre(n,acc_arr,offset);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1231,7 +1230,7 @@ done:
*/
herr_t
H5V_chunk_index(unsigned ndims, const hssize_t *coord, const hsize_t *chunk,
- const hsize_t *nchunks, const hsize_t *down_nchunks, hsize_t *chunk_idx)
+ const hsize_t *down_nchunks, hsize_t *chunk_idx)
{
hssize_t scaled_coord[H5V_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */
unsigned u; /* Local index variable */
@@ -1243,7 +1242,6 @@ H5V_chunk_index(unsigned ndims, const hssize_t *coord, const hsize_t *chunk,
assert(ndims <= H5V_HYPER_NDIMS);
assert(coord);
assert(chunk);
- assert(nchunks);
assert(chunk_idx);
/* Compute the scaled coordinates for actual coordinates */
@@ -1253,7 +1251,7 @@ H5V_chunk_index(unsigned ndims, const hssize_t *coord, const hsize_t *chunk,
} /* end for */
/* Compute the chunk index */
- *chunk_idx=H5V_array_offset_pre(ndims,nchunks,down_nchunks,scaled_coord); /*lint !e772 scaled_coord will always be initialized */
+ *chunk_idx=H5V_array_offset_pre(ndims,down_nchunks,scaled_coord); /*lint !e772 scaled_coord will always be initialized */
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h
index 998b12b..1247912 100644
--- a/src/H5Vprivate.h
+++ b/src/H5Vprivate.h
@@ -75,15 +75,14 @@ H5_DLL herr_t H5V_array_fill(void *_dst, const void *src, size_t size,
size_t count);
H5_DLL herr_t H5V_array_down(unsigned n, const hsize_t *total_size,
hsize_t *down);
-H5_DLL hsize_t H5V_array_offset_pre(unsigned n, const hsize_t *total_size,
+H5_DLL hsize_t H5V_array_offset_pre(unsigned n,
const hsize_t *acc, const hssize_t *offset);
H5_DLL hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size,
const hssize_t *offset);
H5_DLL herr_t H5V_array_calc(hsize_t offset, unsigned n,
const hsize_t *total_size, hssize_t *coords);
H5_DLL herr_t H5V_chunk_index(unsigned ndims, const hssize_t *coord,
- const hsize_t *chunk, const hsize_t *nchunks, const hsize_t *down_nchunks,
- hsize_t *chunk_idx);
+ const hsize_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx);
H5_DLL ssize_t H5V_memcpyvv(void *_dst,
size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[],
const void *_src,
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index ece24ba..250bd3e 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -51,7 +51,7 @@ const H5Z_class_t H5Z_DEFLATE[1] = {{
H5Z_filter_deflate, /* The actual filter function */
}};
-#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil((double)((s)*1.001))+12)
+#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*1.001)+12)
/*-------------------------------------------------------------------------
diff --git a/src/H5detect.c b/src/H5detect.c
index f3a5588..fc6d4a7 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -479,7 +479,7 @@ sigbus_handler(int UNUSED signo)
static void
print_results(int nd, detected_t *d, int na, malign_t *misc_align)
{
- int byte_order;
+ int byte_order=0;
int i, j;
/* Include files */