summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /src/H5S.c
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 6c3b353..4c5daa1 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -69,9 +69,6 @@ H5FL_DEFINE(H5S_t);
/* Declare a free list to manage the array's of hsize_t's */
H5FL_ARR_DEFINE(hsize_t,H5S_MAX_RANK);
-/* Declare a free list to manage the array's of hssize_t's */
-H5FL_ARR_DEFINE(hssize_t,H5S_MAX_RANK);
-
/*--------------------------------------------------------------------------
NAME
@@ -1737,7 +1734,6 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc)
{
size_t extent_size;
hssize_t select_size;
- H5S_class_t space_type;
H5F_t f; /* fake file structure*/
herr_t ret_value = SUCCEED;
@@ -1751,9 +1747,6 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc)
if((extent_size=H5O_raw_size(H5O_SDSPACE_ID, &f, obj))==0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace size");
- /* Get space type */
- space_type = H5S_GET_EXTENT_TYPE(obj);
-
if((select_size=H5S_SELECT_SERIAL_SIZE(obj))<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace selection size");
@@ -1771,7 +1764,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc)
*buf++ = H5S_ENCODE_VERSION;
/* Encode the "size of size" information */
- *buf++ = f.shared->sizeof_size;
+ *buf++ = (unsigned char)f.shared->sizeof_size;
/* Encode size of extent information. Pointer is actually moved in this macro. */
UINT32ENCODE(buf, extent_size);
@@ -1917,6 +1910,37 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5S_raw_size
+ *
+ * Purpose: Compute the 'raw' size of the extent, as stored on disk.
+ *
+ * Return: Success: non-zero
+ * Failure: zero
+ *
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * October 14, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+size_t
+H5S_raw_size(const H5F_t *f, const H5S_t *space)
+{
+ size_t ret_value;
+
+ FUNC_ENTER_NOAPI(H5S_raw_size, 0);
+
+ /* Find out the size of buffer needed for extent */
+ ret_value=H5O_raw_size(H5O_SDSPACE_ID, f, &(space->extent));
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5S_raw_size() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5S_get_simple_extent_type
*
* Purpose: Internal function for retrieving the type of extent for a dataspace object