diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dio.c | 16 | ||||
-rw-r--r-- | src/H5FDstdio.c | 2 | ||||
-rw-r--r-- | src/H5HG.c | 2 | ||||
-rw-r--r-- | src/H5I.c | 6 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 2 | ||||
-rw-r--r-- | src/H5Shyper.c | 10 | ||||
-rw-r--r-- | src/H5Spoint.c | 2 | ||||
-rw-r--r-- | src/H5Sprivate.h | 2 | ||||
-rw-r--r-- | src/H5Sselect.c | 2 | ||||
-rw-r--r-- | src/H5TB.c | 11 | ||||
-rw-r--r-- | src/H5Zszip.c | 3 |
11 files changed, 34 insertions, 24 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 1e6edf7..2fd4a65 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1151,7 +1151,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; @@ -1202,7 +1202,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 @@ -1389,7 +1389,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; @@ -1444,7 +1444,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 @@ -1658,7 +1658,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; @@ -1724,7 +1724,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 @@ -2004,7 +2004,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; @@ -2074,7 +2074,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/H5FDstdio.c b/src/H5FDstdio.c index 958ae97..c15fe35 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -841,7 +841,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, #ifdef WIN32 tempos = ftell(file->fp); - fseek(file->fp,tempos,SEEK_SET); + fseek(file->fp,(long)tempos,SEEK_SET); #endif /* Update EOF if necessary */ if (file->pos>file->eof) @@ -794,7 +794,7 @@ H5HG_extend (H5F_t *f, H5HG_heap_t *heap, size_t size) /* Re-allocate the heap information in memory */ if (NULL==(new_chunk = H5FL_BLK_REALLOC (heap_chunk, heap->chunk, heap->size+need))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "new heap allocation failed"); + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "new heap allocation failed"); /* Adjust the size of the heap */ old_size=heap->size; @@ -959,7 +959,7 @@ H5I_dec_ref(hid_t id) /* Check arguments */ grp = H5I_GROUP(id); if (grp <= H5I_BADID || grp >= H5I_NGROUPS) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid group number"); + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); grp_ptr = H5I_id_group_list_g[grp]; if (grp_ptr == NULL || grp_ptr->count <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); @@ -1062,7 +1062,7 @@ H5I_inc_ref(hid_t id) /* Check arguments */ grp = H5I_GROUP(id); if (grp <= H5I_BADID || grp >= H5I_NGROUPS) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid group number"); + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); grp_ptr = H5I_id_group_list_g[grp]; if (!grp_ptr || grp_ptr->count<=0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid group"); @@ -1147,7 +1147,7 @@ H5I_get_ref(hid_t id) /* Check arguments */ grp = H5I_GROUP(id); if (grp <= H5I_BADID || grp >= H5I_NGROUPS) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid group number"); + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); grp_ptr = H5I_id_group_list_g[grp]; if (!grp_ptr || grp_ptr->count<=0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid group"); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index e7c1152..62e12e6 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -178,7 +178,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 269b030..f468db0 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -660,13 +660,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; @@ -731,13 +731,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; @@ -1590,7 +1590,7 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) /* Allocate space for the hyperslab selection information */ if((dst->select.sel_info.hslab=H5FL_MALLOC(H5S_hyper_sel_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab info"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info"); /* Set temporary pointers */ dst_hslab=dst->select.sel_info.hslab; diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 2f0989b..d34b8a8 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -1329,7 +1329,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 634b5df..659489e 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 bdd9c37..1dacbf5 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -234,7 +234,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +hssize_t H5S_select_serial_size(const H5S_t *space) { hssize_t ret_value; /* Return value */ @@ -204,12 +204,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/H5Zszip.c b/src/H5Zszip.c index 7df0be2..449d832 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -184,7 +184,8 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Set "local" parameter for this dataset's "pixels-per-scanline" */ /* (Use the chunk's fastest changing dimension size) */ - cd_values[H5Z_SZIP_PARM_PPS]=dims[ndims-1]; + assert(ndims>0); + H5_ASSIGN_OVERFLOW(cd_values[H5Z_SZIP_PARM_PPS],dims[ndims-1],hsize_t,unsigned); /* Get datatype's endianness order */ if((dtype_order=H5Tget_order(type_id))==H5T_ORDER_ERROR) |