summaryrefslogtreecommitdiffstats
path: root/src/H5Olayout.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-01-08 16:54:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-01-08 16:54:49 (GMT)
commit596f9b43271b088bf4f13783024f0a75ac05011c (patch)
treed1c30cb9aa9a74cda2ab95e3a94e954375398197 /src/H5Olayout.c
parentde5e1d93e44fdab49ab2d6b3bad4042219ad5236 (diff)
downloadhdf5-596f9b43271b088bf4f13783024f0a75ac05011c.zip
hdf5-596f9b43271b088bf4f13783024f0a75ac05011c.tar.gz
hdf5-596f9b43271b088bf4f13783024f0a75ac05011c.tar.bz2
[svn-r16278] Description:
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 FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
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")