diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-23 20:30:33 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-23 20:30:33 (GMT) |
commit | d89c2c43f37795f906152dbc66a70b232dfb90bb (patch) | |
tree | 43d42fa633c96a337569d567a7af162e88c2c4c4 | |
parent | dc02b5bd22b61c52a6947f338691bc801baf1b91 (diff) | |
download | hdf5-d89c2c43f37795f906152dbc66a70b232dfb90bb.zip hdf5-d89c2c43f37795f906152dbc66a70b232dfb90bb.tar.gz hdf5-d89c2c43f37795f906152dbc66a70b232dfb90bb.tar.bz2 |
[svn-r13183] Description:
Checkpoint work toward getting the fill value message into the shared
message interface regime.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
-rw-r--r-- | src/H5Ofill.c | 27 | ||||
-rw-r--r-- | src/H5P.c | 18 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 2 |
3 files changed, 24 insertions, 23 deletions
diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 7b300bf..27ee7b4 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -96,13 +96,13 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ H5O_FILL_ID, /*message id number */ "fill", /*message name for debugging */ sizeof(H5O_fill_t), /*native message size */ - H5O_fill_decode, /*decode message */ - H5O_fill_encode, /*encode message */ + H5O_fill_decode, /*decode message */ + H5O_fill_encode, /*encode message */ H5O_fill_new_copy, /*copy the native value */ - H5O_fill_size, /*raw message size */ + H5O_fill_size, /*raw message size */ H5O_fill_new_reset, /*free internal memory */ H5O_fill_new_free, /* free method */ - NULL, /* file delete method */ + NULL, /* file delete method */ NULL, /* link method */ H5O_fill_new_get_share, /* get share method */ H5O_fill_new_set_share, /* set share method */ @@ -124,17 +124,17 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_fill_new_decode, /*decode message */ H5O_fill_new_encode, /*encode message */ H5O_fill_new_copy, /*copy the native value */ - H5O_fill_new_size, /*raw message size */ + H5O_fill_new_size, /*raw message size */ H5O_fill_new_reset, /*free internal memory */ H5O_fill_new_free, /* free method */ - NULL, /* file delete method */ - NULL, /* link method */ + NULL, /* file delete method */ + NULL, /* link method */ H5O_fill_new_get_share, /* get share method */ H5O_fill_new_set_share, /* set share method */ NULL, /*can share method */ H5O_fill_new_is_shared, /* is shared method */ NULL, /* pre copy native value to file */ - NULL, /* copy native value to file */ + NULL, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -264,7 +264,10 @@ H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flag if(NULL == (mesg->buf = H5MM_malloc((size_t)mesg->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value") HDmemcpy(mesg->buf, p, (size_t)mesg->size); + mesg->fill_defined = TRUE; } /* end if */ + else + mesg->size = (-1); /* Set return value */ ret_value = (void*)mesg; @@ -397,13 +400,9 @@ H5O_fill_new_copy(const void *_mesg, void *_dest) if(!dest && NULL == (dest = H5FL_MALLOC(H5O_fill_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill message") - /* Copy fill value attributes */ + /* Shallow copy basic fields */ *dest = *mesg; - /* Copy shared message information */ - if(NULL == H5O_msg_copy(H5O_SHARED_ID, &(mesg->sh_loc), &(dest->sh_loc))) - HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, NULL, "unable to copy fill value shared info"); - /* Copy data type of fill value */ if(mesg->type) { if(NULL == (dest->type = H5T_copy(mesg->type, H5T_COPY_TRANSIENT))) @@ -530,7 +529,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) if(fill->buf) fill->buf = H5MM_xfree(fill->buf); - fill->size = -1; + fill->size = 0; if(fill->type) { H5T_close(fill->type); fill->type = NULL; @@ -3846,33 +3846,33 @@ htri_t H5Pequal(hid_t id1, hid_t id2) { void *obj1, *obj2; /* Property objects to compare */ - htri_t ret_value=FALSE; /* return value */ + htri_t ret_value = FALSE; /* return value */ - FUNC_ENTER_API(H5Pequal, FAIL); + FUNC_ENTER_API(H5Pequal, FAIL) H5TRACE2("t", "ii", id1, id2); /* Check arguments. */ if ((H5I_GENPROP_LST != H5I_get_type(id1) && H5I_GENPROP_CLS != H5I_get_type(id1)) || (H5I_GENPROP_LST != H5I_get_type(id2) && H5I_GENPROP_CLS != H5I_get_type(id2))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property objects"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property objects") if (H5I_get_type(id1) != H5I_get_type(id2)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not the same kind of property objects"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not the same kind of property objects") if(NULL == (obj1 = H5I_object(id1)) || NULL == (obj2 = H5I_object(id2))) - HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); + HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist") /* Compare property lists */ if(H5I_GENPROP_LST == H5I_get_type(id1)) { - if(H5P_cmp_plist(obj1,obj2)==0) - ret_value=TRUE; + if(H5P_cmp_plist(obj1, obj2) == 0) + ret_value = TRUE; } /* end if */ /* Must be property classes */ else { - if(H5P_cmp_class(obj1,obj2)==0) + if(H5P_cmp_class(obj1, obj2) == 0) ret_value=TRUE; } /* end else */ done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pequal() */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 97983ec..9c94a67 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -2018,6 +2018,8 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "memory allocation failed for fill value") HDmemcpy(fill.buf, value, (size_t)fill.size); } /* end if */ + else + fill.size = (-1); /* Update fill value in property list */ if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) |