summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-12-16 21:08:26 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-12-16 21:08:26 (GMT)
commite615fc7a982c1817cf7d4c24adf9323604692310 (patch)
tree5dab77c6c1a4476ab5b5953c45f1ea6a1b5d994e /src/H5P.c
parentfaca6fbaa8c557b18d6b264841fc8717d1e73816 (diff)
downloadhdf5-e615fc7a982c1817cf7d4c24adf9323604692310.zip
hdf5-e615fc7a982c1817cf7d4c24adf9323604692310.tar.gz
hdf5-e615fc7a982c1817cf7d4c24adf9323604692310.tar.bz2
[svn-r146] ./src/H5.c
Changes to error handling. ./src/H5B.c Increased size of internal static buffers. ./src/H5C.c Fixed syntax error when NDEBUG is defined. ./src/H5E.c ./src/H5Eprivate.h ./src/H5Epublic.h Errors can now be printed with H5Eprint(). Other minor changes to names and arg types. ./src/H5F.c The base address is now stored in the boot block. The user block size and the base address are synonyms. ./src/H5Fstdio.c Fixed a bug with a return value from fseek(). ./src/H5H.c Added alignment constraints to get rid of unaligned access errors on the DEC alpha having to do with the heap free list. ./src/H5P.c ./src/H5Ppublic.h Changed some size arguments from int to size_t and fixed memory allocation calls. ./src/H5T.c ./src/H5Tpublic.h Changed the order of functions so all the public ones are at the top of the file. Other minor changes. ./src/H5detect.c Added a newline to a string constant.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/H5P.c b/src/H5P.c
index 5171c01..8e3651e 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -268,19 +268,22 @@ H5P_copy (const H5P_t *src)
case H5P_SIMPLE:
if (dst->u.simple.size) {
- dst->u.simple.size = H5MM_xmalloc (dst->u.simple.rank * sizeof(intn));
+ dst->u.simple.size = H5MM_xmalloc (dst->u.simple.rank *
+ sizeof(dst->u.simple.size[0]));
for (i=0; i<dst->u.simple.rank; i++) {
dst->u.simple.size[i] = src->u.simple.size[i];
}
}
if (dst->u.simple.max) {
- dst->u.simple.max = H5MM_xmalloc (dst->u.simple.rank * sizeof(intn));
+ dst->u.simple.max = H5MM_xmalloc (dst->u.simple.rank *
+ sizeof(dst->u.simple.max[0]));
for (i=0; i<dst->u.simple.rank; i++) {
dst->u.simple.max[i] = src->u.simple.max[i];
}
}
if (dst->u.simple.perm) {
- dst->u.simple.perm = H5MM_xmalloc (dst->u.simple.rank * sizeof(intn));
+ dst->u.simple.perm = H5MM_xmalloc (dst->u.simple.rank *
+ sizeof(dst->u.simple.perm[0]));
for (i=0; i<dst->u.simple.rank; i++) {
dst->u.simple.perm[i] = src->u.simple.perm[i];
}
@@ -811,7 +814,7 @@ done:
herr_t H5Pset_space(sid, rank, dims)
hid_t sid; IN: Dataspace object to query
intn rank; IN: # of dimensions for the dataspace
- const intn *dims; IN: Size of each dimension for the dataspace
+ const size_t *dims; IN: Size of each dimension for the dataspace
RETURNS
SUCCEED/FAIL
DESCRIPTION
@@ -823,7 +826,8 @@ done:
expand. Currently, only the first dimension in the array (the slowest) may
be unlimited in size.
--------------------------------------------------------------------------*/
-herr_t H5Pset_space(hid_t sid, intn rank, const intn *dims)
+herr_t
+H5Pset_space (hid_t sid, intn rank, const size_t *dims)
{
H5P_t *space=NULL; /* dataspace to modify */
intn u; /* local counting variable */
@@ -886,8 +890,8 @@ herr_t H5Pset_space(hid_t sid, intn rank, const intn *dims)
/* Set the rank and copy the dims */
space->u.simple.rank=rank;
- space->u.simple.size = H5MM_xcalloc (sizeof(intn), rank);
- HDmemcpy(space->u.simple.size,dims,sizeof(intn)*rank);
+ space->u.simple.size = H5MM_xcalloc (rank, sizeof(size_t));
+ HDmemcpy(space->u.simple.size,dims,sizeof(size_t)*rank);
/* check if there are unlimited dimensions and create the maximum dims array */
for(u=0; u<rank; u++)
@@ -897,8 +901,8 @@ herr_t H5Pset_space(hid_t sid, intn rank, const intn *dims)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL,
"unlimited dimensions not in the lowest "
"dimensionality");
- space->u.simple.max = H5MM_xcalloc (sizeof(intn),rank);
- HDmemcpy(space->u.simple.max,dims,sizeof(intn)*rank);
+ space->u.simple.max = H5MM_xcalloc (rank, sizeof(size_t));
+ HDmemcpy(space->u.simple.max,dims,sizeof(size_t)*rank);
space->u.simple.dim_flags|=H5P_VALID_MAX;
break;
} /* end if */