summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-03-22 18:11:24 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-03-22 18:11:24 (GMT)
commit3424f9f5d1c45e739480e16ab3faa272ca1569f8 (patch)
tree9137c6377285d8576d35205f9e390dbcff40fa57 /src
parentbd73819e2682bebcde6e9c3f1183acdb9608e6ce (diff)
downloadhdf5-3424f9f5d1c45e739480e16ab3faa272ca1569f8.zip
hdf5-3424f9f5d1c45e739480e16ab3faa272ca1569f8.tar.gz
hdf5-3424f9f5d1c45e739480e16ab3faa272ca1569f8.tar.bz2
[svn-r12128] Purpose:
Code cleanup Description: Clean up some compiler warnings (esp. those flagged on Windows builds) Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5Dio.c4
-rw-r--r--src/H5Distore.c34
-rw-r--r--src/H5Dpkg.h6
-rw-r--r--src/H5Dselect.c4
-rw-r--r--src/H5HLdbg.c3
-rw-r--r--src/H5Vprivate.h14
-rw-r--r--src/H5Zscaleoffset.c4
-rw-r--r--src/H5Zszip.c2
8 files changed, 26 insertions, 45 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index f5513f0..dec068e 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -2191,8 +2191,8 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f
for(u=0; u<fm->f_ndims; u++)
fm->total_chunks= fm->total_chunks*fm->chunks[u];
if(IS_H5FD_MPI(dataset->oloc.file)) {
-
- if(NULL == (fm->select_chunk = (hbool_t *) H5MM_calloc(fm->total_chunks*sizeof(hbool_t))))
+ H5_CHECK_OVERFLOW(fm->total_chunks, hsize_t, size_t);
+ if(NULL == (fm->select_chunk = (hbool_t *) H5MM_calloc((size_t)fm->total_chunks * sizeof(hbool_t))))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info")
}
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 570cf81..8ab2527 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -904,9 +904,8 @@ H5D_istore_iter_chunkmap (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt
H5D_istore_it_ud5_t *udata = (H5D_istore_it_ud5_t *)_udata;
const H5D_istore_key_t *lt_key = (const H5D_istore_key_t *)_lt_key;
unsigned rank;
- hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /*logical location of the chunks */
hsize_t chunk_index;
- int ret_value = H5B_ITER_CONT; /* Return value */
+ int ret_value = H5B_ITER_CONT; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5D_istore_iter_chunkmap);
@@ -915,20 +914,12 @@ H5D_istore_iter_chunkmap (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt
if(H5V_chunk_index(rank,lt_key->offset,udata->common.mesg->u.chunk.dim,udata->down_chunks,&chunk_index)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
-#if 0
- HDfprintf(stdout,"chunk index is %Hu\n",chunk_index);
-#endif
udata->chunk_addr[chunk_index] = addr;
-#if 0
- HDfprintf(stdout,"chunk address is %Hu\n",addr);
-#endif
- done:
+done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_istore_iter_allocated() */
-
-
/*-------------------------------------------------------------------------
* Function: H5D_istore_iter_dump
@@ -2463,30 +2454,24 @@ herr_t
H5D_istore_chunkmap(const H5D_io_info_t *io_info, hsize_t total_chunks,haddr_t chunk_addr[],hsize_t down_chunks[])
{
H5D_t *dset=io_info->dset; /* Local pointer to dataset info */
+#if 0
const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
H5D_rdcc_ent_t *ent; /*cache entry */
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */
+#endif
H5D_istore_it_ud5_t udata;
-
- hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /*current dataspace dimensions */
- hsize_t chunks[H5O_LAYOUT_NDIMS]; /*current number of chunks in each dimension */
-
- int srank; /*current # of dimensions (signed) */
- unsigned rank; /*current # of dimensions */
- unsigned u;
-
hid_t dxpl_id = io_info->dxpl_id;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_chunkmap, 0)
+ FUNC_ENTER_NOAPI(H5D_istore_chunkmap, FAIL)
HDassert(dset);
#if 0
/* Fill the DXPL cache values for later use */
if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't fill dxpl cache")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache")
/* Construct dataset I/O info */
H5D_BUILD_IO_INFO(&io_info,dset,dxpl_cache,dxpl_id,NULL);
@@ -2495,7 +2480,7 @@ H5D_istore_chunkmap(const H5D_io_info_t *io_info, hsize_t total_chunks,haddr_t c
for(ent = rdcc->head; ent; ent = ent->next) {
/* Flush the chunk out to disk, to make certain the size is correct later */
if (H5D_istore_flush_entry(&io_info, ent, FALSE)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, 0, "cannot flush indexed storage buffer")
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer")
} /* end for */
#endif
@@ -2503,11 +2488,10 @@ H5D_istore_chunkmap(const H5D_io_info_t *io_info, hsize_t total_chunks,haddr_t c
udata.common.mesg = &dset->shared->layout;
udata.down_chunks = down_chunks;
udata.chunk_addr = chunk_addr;
-
+
if (H5B_iterate(dset->oloc.file, dxpl_id, H5B_ISTORE, H5D_istore_iter_chunkmap, dset->shared->layout.u.chunk.addr, &udata)<0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to iterate over chunk B-tree")
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to iterate over chunk B-tree")
-
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_chunkmap() */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 615f728..4c1c663 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -249,13 +249,11 @@ H5_DLL size_t H5D_select_mgath (const void *_buf,
H5_DLL herr_t H5D_select_read(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- haddr_t addr,
- void *buf/*out*/);
+ haddr_t addr, void *buf/*out*/);
H5_DLL herr_t H5D_select_write(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- haddr_t addr,
- const void *buf/*out*/);
+ haddr_t addr, const void *buf/*out*/);
/* Functions that operate on contiguous storage */
H5_DLL herr_t H5D_contig_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout);
diff --git a/src/H5Dselect.c b/src/H5Dselect.c
index df9d32f..928f90d 100644
--- a/src/H5Dselect.c
+++ b/src/H5Dselect.c
@@ -432,7 +432,7 @@ herr_t
H5D_select_read(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- const haddr_t UNUSED addr,
+ haddr_t UNUSED addr,
void *buf/*out*/)
{
H5S_sel_iter_t mem_iter; /* Memory selection iteration info */
@@ -576,7 +576,7 @@ herr_t
H5D_select_write(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- const haddr_t UNUSED addr,
+ haddr_t UNUSED addr,
const void *buf/*out*/)
{
H5S_sel_iter_t mem_iter; /* Memory selection iteration info */
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index 1dedaa5..bee7182 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -54,8 +54,7 @@ herr_t
H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth)
{
H5HL_t *h = NULL;
- int i, j, overlap, free_block;
- uint8_t c;
+ int i, overlap, free_block;
H5HL_free_t *freelist = NULL;
uint8_t *marker = NULL;
size_t amount_free = 0;
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h
index 71f62b0..942381d 100644
--- a/src/H5Vprivate.h
+++ b/src/H5Vprivate.h
@@ -347,16 +347,16 @@ H5V_log2_gen(hsize_t n)
unsigned r = 0; /* r will be log2(n) */
register unsigned int t, tt, ttt; /* temporaries */
- if((ttt = n >> 32))
- if((tt = n >> 48))
- r = (t = n >> 56) ? 56 + LogTable256[t] : 48 + LogTable256[tt & 0xFF];
+ if((ttt = (unsigned)(n >> 32)))
+ if((tt = (unsigned)(n >> 48)))
+ r = (t = (unsigned)(n >> 56)) ? 56 + LogTable256[t] : 48 + LogTable256[tt & 0xFF];
else
- r = (t = n >> 40) ? 40 + LogTable256[t] : 32 + LogTable256[ttt & 0xFF];
+ r = (t = (unsigned)(n >> 40)) ? 40 + LogTable256[t] : 32 + LogTable256[ttt & 0xFF];
else
- if((tt = n >> 16))
- r = (t = n >> 24) ? 24 + LogTable256[t] : 16 + LogTable256[tt & 0xFF];
+ if((tt = (unsigned)(n >> 16)))
+ r = (t = (unsigned)(n >> 24)) ? 24 + LogTable256[t] : 16 + LogTable256[tt & 0xFF];
else
- r = (t = n >> 8) ? 8 + LogTable256[t] : LogTable256[n];
+ r = (t = (unsigned)(n >> 8)) ? 8 + LogTable256[t] : LogTable256[n];
return(r);
} /* H5V_log2_gen() */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 8326516..20f0c6e 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -991,11 +991,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu
if(scale_type==H5Z_SO_FLOAT_DSCALE) { /* floating-point type, variable-minimum-bits */
D_val = (double)scale_factor;
} else { /* integer type, or floating-point type with fixed-minimum-bits method */
- if(scale_factor>cd_values[H5Z_SCALEOFFSET_PARM_SIZE]*8)
+ if(scale_factor > (int)(cd_values[H5Z_SCALEOFFSET_PARM_SIZE] * 8))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "minimum number of bits exceeds maximum")
/* no need to process data */
- if(scale_factor==cd_values[H5Z_SCALEOFFSET_PARM_SIZE]*8) {
+ if(scale_factor == (int)(cd_values[H5Z_SCALEOFFSET_PARM_SIZE] * 8)) {
ret_value = *buf_size;
goto done;
}
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 1da1b39..e393ebd 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -141,7 +141,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
hsize_t dims[H5O_LAYOUT_NDIMS]; /* Dataspace (i.e. chunk) dimensions */
int ndims; /* Number of (chunk) dimensions */
H5T_order_t dtype_order; /* Datatype's endianness order */
- int dtype_size; /* Datatype's size (in bits) */
+ size_t dtype_size; /* Datatype's size (in bits) */
size_t dtype_precision; /* Datatype's precision (in bits) */
size_t dtype_offset; /* Datatype's offset (in bits) */
hsize_t scanline; /* Size of dataspace's fastest changing dimension */