summaryrefslogtreecommitdiffstats
path: root/src/H5Olayout.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-01-08 17:27:15 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-01-08 17:27:15 (GMT)
commit634c7c5a93abb49a56336eec9e842a0bd694f828 (patch)
treed30f170a49ca3186bc8beddac7bf3523dfdb1ad3 /src/H5Olayout.c
parent9b1f93283c32f81658cf40d0caeb5333c4db6ae9 (diff)
downloadhdf5-634c7c5a93abb49a56336eec9e842a0bd694f828.zip
hdf5-634c7c5a93abb49a56336eec9e842a0bd694f828.tar.gz
hdf5-634c7c5a93abb49a56336eec9e842a0bd694f828.tar.bz2
[svn-r16279] Description:
Bring revision 16278 back from revise_chunks branch: Update layout information in DCPL to unify all information in one underlying property and switch to using H5O_layout_t for storing it, which simplifies things considerably. Also, fix many compiler warnings. Tested on: FreeBSD/32 6.3 (duty) in debug mode (Original patch tested on many machines)
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r--src/H5Olayout.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index f2b6b30..59cd7db 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -72,12 +72,6 @@ const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{
H5O_layout_debug /*debug the message */
}};
-/* For forward and backward compatibility. Version is 1 when space is
- * allocated; 2 when space is delayed for allocation; 3 is default now and
- * is revised to just store information needed for each storage type. */
-#define H5O_LAYOUT_VERSION_1 1
-#define H5O_LAYOUT_VERSION_2 2
-#define H5O_LAYOUT_VERSION_3 3
/* Declare a free list to manage the H5O_layout_t struct */
H5FL_DEFINE(H5O_layout_t);
@@ -334,7 +328,7 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi
case H5D_CHUNKED:
/* Number of dimensions */
HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS);
- *p++ = mesg->u.chunk.ndims;
+ *p++ = (uint8_t)mesg->u.chunk.ndims;
/* B-tree address */
H5F_addr_encode(f, &p, mesg->u.chunk.addr);
@@ -386,7 +380,7 @@ H5O_layout_copy(const void *_mesg, void *_dest)
*dest = *mesg;
/* Deep copy the buffer for compact datasets also */
- if(mesg->type == H5D_COMPACT) {
+ if(mesg->type == H5D_COMPACT && mesg->u.compact.size > 0) {
/* Allocate memory for the raw data */
if(NULL == (dest->u.compact.buf = H5MM_malloc(dest->u.compact.size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset")