diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-04-08 21:43:02 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-04-08 21:43:02 (GMT) |
commit | c01750fa740943c0083711b353278143c79d50a3 (patch) | |
tree | fd475b7c7a3639c05b30625b43547850d687b948 /src/H5Ssimp.c | |
parent | 68fa66bf8130d6a6e607e233da8cc61a154bf172 (diff) | |
download | hdf5-c01750fa740943c0083711b353278143c79d50a3.zip hdf5-c01750fa740943c0083711b353278143c79d50a3.tar.gz hdf5-c01750fa740943c0083711b353278143c79d50a3.tar.bz2 |
[svn-r338] Changes since 19980407
----------------------
./src/H5B.c
./src/H5D.c
./src/H5Dprivate.h
./src/H5Dpublic.h
./src/H5F.c
./src/H5Farray.c
./src/H5Fcore.c
./src/H5Ffamily.c
./src/H5Fistore.c
./src/H5Flow.c
./src/H5Fprivate.h
./src/H5Fpublic.h
./src/H5Fsec2.c
./src/H5Fsplit.c
./src/H5Fstdio.c
./src/H5G.c
./src/H5Gent.c
./src/H5Gnode.c
./src/H5HG.c
./src/H5HL.c
./src/H5MF.c
./src/H5MFprivate.h
./src/H5O.c
./src/H5Ocont.c
./src/H5Odtype.c
./src/H5Oefl.c
./src/H5Olayout.c
./src/H5Oname.c
./src/H5Oprivate.h
./src/H5Osdspace.c
./src/H5Oshared.c
./src/H5Ostab.c
./src/H5P.c
./src/H5Ppublic.h
./src/H5S.c
./src/H5Sprivate.h
./src/H5Spublic.h
./src/H5Ssimp.c
./src/H5Tconv.c
./src/H5Tpkg.h
./src/H5V.c
./src/H5Vprivate.h
./src/H5private.h
./src/H5public.h
./src/h5ls.c
./test/cmpd_dset.c
./test/dsets.c
./test/extend.c
./test/external.c
./test/hyperslab.c
./test/iopipe.c
./test/istore.c
./test/shtype.c
./test/tfile.c
./test/th5s.c
Anything having to do with the size of a dataset now uses the
types `hsize_t' and `hssize_t' which must be the same size and
at least as large as `size_t'. This isn't fully tested yet,
so hsize_t and hssize_t are defined as size_t and ssize_t in
H5public.h. Setting them to larger values will trip up gcc
versions less than 2.8.1 on x86 platforms.
Documented unused function formals with `__unused__' before
the formal name. This also has the effect of supressing
warning messages for gcc since it's defined to be
`__attribute__((unused))' in the H5private.h file.
./src/debug.c
./src/h5ls.c
If the file name contains a `%' then the file is opened as a
file family with H5P_DEFAULT for the file member access
property list.
./src/h5ls.c
The group name is optional, defaulting to `/'.
./src/hdf5.h
Added some missing public header files.
Diffstat (limited to 'src/H5Ssimp.c')
-rw-r--r-- | src/H5Ssimp.c | 161 |
1 files changed, 50 insertions, 111 deletions
diff --git a/src/H5Ssimp.c b/src/H5Ssimp.c index a7580c3..976840f 100644 --- a/src/H5Ssimp.c +++ b/src/H5Ssimp.c @@ -36,14 +36,14 @@ static intn interface_initialize_g = FALSE; *------------------------------------------------------------------------- */ size_t -H5S_simp_init (const struct H5O_layout_t *layout, const H5S_t *mem_space, - const H5S_t *file_space, size_t desired_nelmts, - H5S_number_t *numbering/*out*/) +H5S_simp_init (const struct H5O_layout_t __unused__ *layout, + const H5S_t *mem_space, const H5S_t *file_space, + size_t desired_nelmts, H5S_number_t *numbering/*out*/) { - size_t nelmts; + hsize_t nelmts; int m_ndims, f_ndims; /*mem, file dimensionality */ - size_t size[H5O_LAYOUT_NDIMS]; /*size of selected hyperslab */ - size_t acc; + hsize_t size[H5O_LAYOUT_NDIMS]; /*size of selected hyperslab */ + hsize_t acc; int i; FUNC_ENTER (H5S_simp_init, 0); @@ -92,7 +92,8 @@ H5S_simp_init (const struct H5O_layout_t *layout, const H5S_t *mem_space, } } - FUNC_LEAVE (nelmts); + assert (nelmts < MAX_SIZET); + FUNC_LEAVE ((size_t)nelmts); } /*------------------------------------------------------------------------- @@ -125,17 +126,14 @@ size_t H5S_simp_fgath (H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, - const H5S_number_t *numbering, size_t start, size_t nelmts, - void *buf/*out*/) + const H5S_number_t __unused__ *numbering, + size_t start, size_t nelmts, void *buf/*out*/) { - size_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of slab in file*/ - size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ - size_t zero[H5O_LAYOUT_NDIMS]; /*zero */ - size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ - size_t acc; /*accumulator */ -#ifndef LATER - intn file_offset_signed[H5O_LAYOUT_NDIMS]; -#endif + hssize_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of slab in file*/ + hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ + hssize_t zero[H5O_LAYOUT_NDIMS]; /*zero */ + hsize_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ + hsize_t acc; /*accumulator */ intn space_ndims; /*dimensionality of space*/ intn i; /*counters */ @@ -157,24 +155,11 @@ H5S_simp_fgath (H5F_t *f, const struct H5O_layout_t *layout, * currently pass sample information into H5F_arr_read() much less * H5F_istore_read(). */ -#ifdef LATER if ((space_ndims=H5S_get_hyperslab (file_space, file_offset, hsize, sample))<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0, "unable to retrieve hyperslab parameters"); } -#else - /* Argument type problems to be fixed later..... -RPM */ - if ((space_ndims=H5S_get_hyperslab (file_space, file_offset_signed, - hsize, sample))<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0, - "unable to retrieve hyperslab parameters"); - } - for (i=0; i<space_ndims; i++) { - assert (file_offset_signed[i]>=0); - file_offset[i] = file_offset_signed[i]; - } -#endif /* Check that there is no subsampling of the hyperslab */ for (i=0; i<space_ndims; i++) { @@ -194,7 +179,7 @@ H5S_simp_fgath (H5F_t *f, const struct H5O_layout_t *layout, /* The fastest varying dimension is for the data point itself */ file_offset[space_ndims] = 0; hsize[space_ndims] = elmt_size; - HDmemset (zero, 0, layout->ndims*sizeof(size_t)); + HDmemset (zero, 0, layout->ndims*sizeof(*zero)); /* * Gather from file. @@ -230,18 +215,16 @@ H5S_simp_fgath (H5F_t *f, const struct H5O_layout_t *layout, */ herr_t H5S_simp_mscat (const void *tconv_buf, size_t elmt_size, - const H5S_t *mem_space, const H5S_number_t *numbering, + const H5S_t *mem_space, + const H5S_number_t __unused__ *numbering, size_t start, size_t nelmts, void *buf/*out*/) { - size_t mem_offset[H5O_LAYOUT_NDIMS]; /*slab offset in app buf*/ - size_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ - size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ - size_t zero[H5O_LAYOUT_NDIMS]; /*zero */ - size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ - size_t acc; /*accumulator */ -#ifndef LATER - intn mem_offset_signed[H5O_LAYOUT_NDIMS]; -#endif + hssize_t mem_offset[H5O_LAYOUT_NDIMS]; /*slab offset in app buf*/ + hsize_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ + hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ + hssize_t zero[H5O_LAYOUT_NDIMS]; /*zero */ + hsize_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ + hsize_t acc; /*accumulator */ intn space_ndims; /*dimensionality of space*/ intn i; /*counters */ @@ -261,24 +244,11 @@ H5S_simp_mscat (const void *tconv_buf, size_t elmt_size, * only handle hyperslabs with unit sample because there's currently no * way to pass sample information to H5V_hyper_copy(). */ -#ifdef LATER if ((space_ndims=H5S_get_hyperslab (mem_space, mem_offset, hsize, sample))<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to retrieve hyperslab parameters"); } -#else - /* Argument type problems to be fixed later..... -RPM */ - if ((space_ndims=H5S_get_hyperslab (mem_space, mem_offset_signed, - hsize, sample))<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, - "unable to retrieve hyperslab parameters"); - } - for (i=0; i<space_ndims; i++) { - assert (mem_offset_signed[i]>=0); - mem_offset[i] = mem_offset_signed[i]; - } -#endif /* Check that there is no subsampling of the hyperslab */ for (i=0; i<space_ndims; i++) { @@ -303,7 +273,7 @@ H5S_simp_mscat (const void *tconv_buf, size_t elmt_size, mem_offset[space_ndims] = 0; mem_size[space_ndims] = elmt_size; hsize[space_ndims] = elmt_size; - HDmemset (zero, 0, (space_ndims+1)*sizeof(size_t)); + HDmemset (zero, 0, (space_ndims+1)*sizeof(*zero)); /* * Scatter from conversion buffer to application memory. @@ -342,18 +312,16 @@ H5S_simp_mscat (const void *tconv_buf, size_t elmt_size, */ size_t H5S_simp_mgath (const void *buf, size_t elmt_size, - const H5S_t *mem_space, const H5S_number_t *numbering, + const H5S_t *mem_space, + const H5S_number_t __unused__ *numbering, size_t start, size_t nelmts, void *tconv_buf/*out*/) { - size_t mem_offset[H5O_LAYOUT_NDIMS]; /*slab offset in app buf*/ - size_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ - size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ - size_t zero[H5O_LAYOUT_NDIMS]; /*zero */ - size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ - size_t acc; /*accumulator */ -#ifndef LATER - intn mem_offset_signed[H5O_LAYOUT_NDIMS]; -#endif + hssize_t mem_offset[H5O_LAYOUT_NDIMS]; /*slab offset in app buf*/ + hsize_t mem_size[H5O_LAYOUT_NDIMS]; /*total size of app buf */ + hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ + hssize_t zero[H5O_LAYOUT_NDIMS]; /*zero */ + hsize_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ + hsize_t acc; /*accumulator */ intn space_ndims; /*dimensionality of space*/ intn i; /*counters */ @@ -373,24 +341,11 @@ H5S_simp_mgath (const void *buf, size_t elmt_size, * only handle hyperslabs with unit sample because there's currently no * way to pass sample information to H5V_hyper_copy(). */ -#ifdef LATER if ((space_ndims=H5S_get_hyperslab (mem_space, mem_offset, hsize, sample))<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0, "unable to retrieve hyperslab parameters"); } -#else - /* Argument type problems to be fixed later..... -RPM */ - if ((space_ndims=H5S_get_hyperslab (mem_space, mem_offset_signed, - hsize, sample))<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, 0, - "unable to retrieve hyperslab parameters"); - } - for (i=0; i<space_ndims; i++) { - assert (mem_offset_signed[i]>=0); - mem_offset[i] = mem_offset_signed[i]; - } -#endif /* Check that there is no subsampling of the hyperslab */ for (i=0; i<space_ndims; i++) { @@ -415,7 +370,7 @@ H5S_simp_mgath (const void *buf, size_t elmt_size, mem_offset[space_ndims] = 0; mem_size[space_ndims] = elmt_size; hsize[space_ndims] = elmt_size; - HDmemset (zero, 0, (space_ndims+1)*sizeof(size_t)); + HDmemset (zero, 0, (space_ndims+1)*sizeof(*zero)); /* * Scatter from conversion buffer to application memory. @@ -455,17 +410,14 @@ herr_t H5S_simp_fscat (H5F_t *f, const struct H5O_layout_t *layout, const struct H5O_efl_t *efl, size_t elmt_size, const H5S_t *file_space, - const H5S_number_t *numbering, size_t start, size_t nelmts, - const void *buf) + const H5S_number_t __unused__ *numbering, + size_t start, size_t nelmts, const void *buf) { - size_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of hyperslab */ - size_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ - size_t zero[H5O_LAYOUT_NDIMS]; /*zero vector */ - size_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ - size_t acc; /*accumulator */ -#ifndef LATER - intn file_offset_signed[H5O_LAYOUT_NDIMS]; -#endif + hssize_t file_offset[H5O_LAYOUT_NDIMS]; /*offset of hyperslab */ + hsize_t hsize[H5O_LAYOUT_NDIMS]; /*size of hyperslab */ + hssize_t zero[H5O_LAYOUT_NDIMS]; /*zero vector */ + hsize_t sample[H5O_LAYOUT_NDIMS]; /*hyperslab sampling */ + hsize_t acc; /*accumulator */ intn space_ndims; /*space dimensionality */ intn i; /*counters */ @@ -487,24 +439,11 @@ H5S_simp_fscat (H5F_t *f, const struct H5O_layout_t *layout, * currently pass sample information into H5F_arr_read() much less * H5F_istore_read(). */ -#ifdef LATER if ((space_ndims=H5S_get_hyperslab (file_space, file_offset, hsize, sample))<0) { HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to retrieve hyperslab parameters"); } -#else - /* Argument type problems to be fixed later..... -RPM */ - if ((space_ndims=H5S_get_hyperslab (file_space, file_offset_signed, - hsize, sample))<0) { - HRETURN_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, - "unable to retrieve hyperslab parameters"); - } - for (i=0; i<space_ndims; i++) { - assert (file_offset_signed[i]>=0); - file_offset[i] = file_offset_signed[i]; - } -#endif /* Check that there is no subsampling of the hyperslab */ for (i=0; i<space_ndims; i++) { @@ -524,7 +463,7 @@ H5S_simp_fscat (H5F_t *f, const struct H5O_layout_t *layout, /* The fastest varying dimension is for the data point itself */ file_offset[space_ndims] = 0; hsize[space_ndims] = elmt_size; - HDmemset (zero, 0, layout->ndims*sizeof(size_t)); + HDmemset (zero, 0, layout->ndims*sizeof(*zero)); /* * Scatter to file. @@ -564,10 +503,10 @@ H5S_simp_read (H5F_t *f, const struct H5O_layout_t *layout, const H5S_t *file_space, const H5S_t *mem_space, void *buf/*out*/) { - size_t hslab_size[H5O_LAYOUT_NDIMS]; - size_t file_offset[H5O_LAYOUT_NDIMS]; - size_t mem_size[H5O_LAYOUT_NDIMS]; - size_t mem_offset[H5O_LAYOUT_NDIMS]; + hssize_t file_offset[H5O_LAYOUT_NDIMS]; + hsize_t hslab_size[H5O_LAYOUT_NDIMS]; + hssize_t mem_offset[H5O_LAYOUT_NDIMS]; + hsize_t mem_size[H5O_LAYOUT_NDIMS]; int i; FUNC_ENTER (H5S_simp_read, FAIL); @@ -669,10 +608,10 @@ H5S_simp_write (H5F_t *f, const struct H5O_layout_t *layout, const H5S_t *file_space, const H5S_t *mem_space, const void *buf) { - size_t hslab_size[H5O_LAYOUT_NDIMS]; - size_t file_offset[H5O_LAYOUT_NDIMS]; - size_t mem_size[H5O_LAYOUT_NDIMS]; - size_t mem_offset[H5O_LAYOUT_NDIMS]; + hssize_t file_offset[H5O_LAYOUT_NDIMS]; + hsize_t hslab_size[H5O_LAYOUT_NDIMS]; + hssize_t mem_offset[H5O_LAYOUT_NDIMS]; + hsize_t mem_size[H5O_LAYOUT_NDIMS]; int i; FUNC_ENTER (H5S_simp_write, FAIL); |