summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-27 20:26:32 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-27 20:26:32 (GMT)
commit6e6760216bd2dc64bba0976cdf1a1fed5a8fa114 (patch)
tree13235c92a1c3d9be4a8dc988788cb2e383e264eb /src/H5Oattr.c
parent66be6f05d417671d1ef202931d769743ad8a83d9 (diff)
downloadhdf5-6e6760216bd2dc64bba0976cdf1a1fed5a8fa114.zip
hdf5-6e6760216bd2dc64bba0976cdf1a1fed5a8fa114.tar.gz
hdf5-6e6760216bd2dc64bba0976cdf1a1fed5a8fa114.tar.bz2
[svn-r8592] Purpose:
Code optimization & bug fix Description: When dimension information is being stored in the storage layout message on disk, it is stored as 32-bit quantities, possibly truncating the dimension information, if a dimension is greater than 32-bits in size. Solution: Fix the storage layout message problem by revising file format to not store dimension information, since it is already available in the dataspace. Also revise the storage layout data structures to be more compartmentalized for the information for contiguous, chunked and compact storage. Platforms tested: FreeBSD 4.9 (sleipnir) w/parallel Solaris 2.7 (arabica) h5committest
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index f5bd52b..2ae0278 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -16,6 +16,10 @@
#define H5O_PACKAGE /*suppress error about including H5Opkg */
#define H5S_PACKAGE /*suppress error about including H5Spkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5O_attr_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Apkg.h" /* Attributes */
#include "H5Eprivate.h" /* Error handling */
@@ -25,8 +29,6 @@
#include "H5Opkg.h" /* Object headers */
#include "H5Spkg.h" /* Dataspaces */
-#define PABLO_MASK H5O_attr_mask
-
/* PRIVATE PROTOTYPES */
static herr_t H5O_attr_encode (H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_attr_decode (H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
@@ -201,13 +203,14 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *
/* Default to entire dataspace being selected */
if(H5S_select_all(attr->ds,0)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection");
+
if(version < H5O_ATTR_VERSION_NEW)
p += H5O_ALIGN(attr->ds_size);
else
p += attr->ds_size;
/* Compute the size of the data */
- H5_ASSIGN_OVERFLOW(attr->data_size,H5S_get_simple_extent_npoints(attr->ds)*H5T_get_size(attr->dt),hsize_t,size_t);
+ H5_ASSIGN_OVERFLOW(attr->data_size,H5S_GET_SIMPLE_EXTENT_NPOINTS(attr->ds)*H5T_get_size(attr->dt),hsize_t,size_t);
/* Go get the data */
if (NULL==(attr->data = H5MM_malloc(attr->data_size)))
@@ -262,7 +265,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
size_t name_len; /* Attribute name length */
unsigned version; /* Attribute version */
hbool_t type_shared; /* Flag to indicate that a shared datatype is used for this attribute */
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5O_attr_encode, FAIL);