summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
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