diff options
author | Albert Cheng <acheng@hdfgroup.org> | 1998-02-09 19:37:40 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 1998-02-09 19:37:40 (GMT) |
commit | 7e8e3eec42254a6988b2739b621b1412963d590c (patch) | |
tree | cc7d01adda3675d67d35c8cb2edaf7a1dc469f40 /src/H5P.c | |
parent | 35e7a062e26c1a65e571202a6fda0b475e42da00 (diff) | |
download | hdf5-7e8e3eec42254a6988b2739b621b1412963d590c.zip hdf5-7e8e3eec42254a6988b2739b621b1412963d590c.tar.gz hdf5-7e8e3eec42254a6988b2739b621b1412963d590c.tar.bz2 |
[svn-r230] Changes were actually made by Robb. I am commiting them for him
while he is visiting LLNL. I changed the default creation template
offset and length to 4. Will fix the problem later.
Changes since 19980205
----------------------
./src/H5H.c
./src/H5Hprivate.h
./src/H5O.c
./src/H5Ocont.c
./src/H5Odtype.c
./src/H5Oefl.c
./src/H5Olayout.c
./src/H5Oname.c
./src/H5Onull.c
./src/H5Oprivate.h
./src/H5Odspace.c
./src/H5Ostab.c
./src/debug.c
./html/H5.format.html
Added an extra 4-byte field after the heap magic number for
alignment on the DEC alpha. Changed object header message
alignment to 8-bytes.
./src/H5F.c
./src/H5Farray.c
./src/H5Ffamily.c
./src/H5Fistore.c
./src/H5Flow.c
./src/H5Fprivate.h
./src/H5Fsec2.c
./src/H5Fstdio.c
./src/H5Gnode.c
./src/H5O.c
./src/H5Odtype.c
./src/H5P.c
./src/H5Pprivate.h
./src/H5T.c
./src/H5Tconv.c
./src/H5Tpkg.h
./src/H5Tpublic.h
./src/H5V.c
./src/H5detect.c
./test/cmpd_dset.c
./test/dsets.c
./test/dtypes.c
./test/extend.c
./test/hyperslab.c
./test/istore.c
./test/th5p.c
./test/theap.c
Fixed a few irix64 warnings regarding size_t vs. int,
variables set but not used, printf formats
./config/irix64
Added `-woff 1196' to get rid of errors about __vfork() being
implicitly defined in a system header file.
./src/H5B.c
Fixed a stack alignment problem.
Diffstat (limited to 'src/H5P.c')
-rw-r--r-- | src/H5P.c | 35 |
1 files changed, 17 insertions, 18 deletions
@@ -491,7 +491,7 @@ int H5Pget_ndims(hid_t space_id) { H5P_t *ds = NULL; - size_t ret_value = 0; + intn ret_value = 0; FUNC_ENTER(H5Pget_ndims, FAIL); @@ -577,7 +577,7 @@ H5Pget_dims(hid_t space_id, size_t dims[]/*out*/) { H5P_t *ds = NULL; - size_t ret_value = 0; + intn ret_value = 0; FUNC_ENTER(H5Pget_dims, FAIL); @@ -1020,7 +1020,7 @@ herr_t H5Pset_hyperslab(hid_t sid, const int *start, const size_t *count, const size_t *stride) { H5P_t *space = NULL; /* dataspace to modify */ - intn *tmp_stride=NULL; /* temp. copy of stride */ + size_t *tmp_stride=NULL; /* temp. copy of stride */ intn u; /* local counting variable */ herr_t ret_value = SUCCEED; @@ -1039,39 +1039,38 @@ H5Pset_hyperslab(hid_t sid, const int *start, const size_t *count, const size_t "unknown dataspace type"); /* Set up stride values for later use */ - tmp_stride= H5MM_xmalloc(space->u.simple.rank*sizeof(intn)); + tmp_stride= H5MM_xmalloc(space->u.simple.rank*sizeof(tmp_stride[0])); for (u=0; u<space->u.simple.rank; u++) { tmp_stride[u] = stride ? stride[u] : 1; } /* Range check arguments */ for (u=0; u<space->u.simple.rank; u++) { - if (start[u]<0 || start[u]>=space->u.simple.size[u]) + if (start[u]<0 || start[u]>=space->u.simple.size[u]) { HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "hyperslab bounds out of range"); - if (start[u]+(SIGN(count[u])*(ABS(count[u])-1)*tmp_stride[u])<0 || - (start[u]+(SIGN(count[u])*(ABS(count[u])-1)*tmp_stride[u])>= - space->u.simple.size[u])) + } + if (start[u]<0 || + start[u]+(count[u]*tmp_stride[u])>space->u.simple.size[u]) { HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "hyperslab bounds out of range"); - } /* end for */ + } + } /* Allocate space for the hyperslab information */ if (NULL==space->h.start) { - space->h.start= H5MM_xcalloc(space->u.simple.rank,sizeof(size_t)); + space->h.start= H5MM_xcalloc(space->u.simple.rank,sizeof(intn)); space->h.count= H5MM_xcalloc(space->u.simple.rank,sizeof(size_t)); space->h.stride= H5MM_xcalloc(space->u.simple.rank,sizeof(size_t)); } /* Build hyperslab */ - for(u=0; u<space->u.simple.rank; u++) - { - /* copy "normalized" (i.e. strictly increasing) values for hyperslab parameters */ - space->h.start[u]=MIN(start[u],start[u]+((ABS(count[u])-1)*tmp_stride[u])); - space->h.count[u]=ABS(count[u]); - space->h.stride[u]=ABS(tmp_stride[u]); - } /* end for */ - space->hslab_def=TRUE; + for(u=0; u<space->u.simple.rank; u++) { + space->h.start[u] = start[u]; + space->h.count[u] = count[u]; + space->h.stride[u] = tmp_stride[u]; + } + space->hslab_def=TRUE; done: if (ret_value == FAIL) { /* Error condition cleanup */ |