mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-24 17:51:25 +08:00
[svn-r9469] Purpose:
Code cleanup Description: Clear up some inconsistencies, inefficiencies and possible errors between the release and development branch. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Solaris 2.7 (arabica) Linux 2.4 (heping) w/C++ & FORTRAN
This commit is contained in:
parent
c274ffe1c9
commit
0db364390b
@ -382,10 +382,6 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
|
||||
/* Decode base type of VL information */
|
||||
if (NULL==(dt->shared->parent = H5FL_CALLOC(H5T_t)))
|
||||
HGOTO_ERROR (H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed");
|
||||
if(NULL== (dt->shared->parent->shared = H5FL_CALLOC (H5T_shared_t))) {
|
||||
H5FL_FREE(H5T_t, dt->shared->parent);
|
||||
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
|
||||
}
|
||||
if (NULL==(dt->shared->parent->shared = H5FL_CALLOC(H5T_shared_t)))
|
||||
{
|
||||
H5FL_FREE(H5T_t, dt->shared->parent);
|
||||
@ -863,8 +859,6 @@ H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p,
|
||||
if (NULL==(dt->shared=H5FL_CALLOC(H5T_shared_t)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
|
||||
dt->ent.header = HADDR_UNDEF;
|
||||
dt->shared->fo_count=1;
|
||||
|
||||
|
||||
if (H5O_dtype_decode_helper(f, &p, dt) < 0)
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode type");
|
||||
|
@ -443,7 +443,6 @@ static H5T_t *H5T_decode(const unsigned char *buf);
|
||||
H5FL_FREE(H5T_t, dt); \
|
||||
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") \
|
||||
} \
|
||||
dt->shared->fo_count=1; \
|
||||
}
|
||||
|
||||
|
||||
@ -2855,7 +2854,6 @@ H5T_create(H5T_class_t type, size_t size)
|
||||
}
|
||||
|
||||
dt->ent.header = HADDR_UNDEF;
|
||||
dt->shared->fo_count = 1;
|
||||
dt->shared->size = size;
|
||||
|
||||
/* Set return value */
|
||||
@ -2974,9 +2972,8 @@ H5T_open (H5G_entry_t *ent, hid_t dxpl_id)
|
||||
done:
|
||||
if(ret_value==NULL) {
|
||||
if(dt) {
|
||||
if(shared_fo==NULL) { /* Need to free shared fo */
|
||||
if(shared_fo==NULL) /* Need to free shared fo */
|
||||
H5FL_FREE(H5T_shared_t, dt->shared);
|
||||
}
|
||||
H5FL_FREE(H5T_t, dt);
|
||||
}
|
||||
if(shared_fo)
|
||||
@ -3095,7 +3092,6 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method)
|
||||
/* Copy actual information */
|
||||
new_dt->ent = old_dt->ent;
|
||||
*(new_dt->shared) = *(old_dt->shared);
|
||||
new_dt->shared->fo_count = 1;
|
||||
|
||||
/* Copy parent information */
|
||||
if (new_dt->shared->parent)
|
||||
|
@ -316,14 +316,14 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
size_t
|
||||
H5T_get_member_size(H5T_t *dt, int membno)
|
||||
H5T_get_member_size(H5T_t *dt, unsigned membno)
|
||||
{
|
||||
size_t ret_value = 0;
|
||||
|
||||
FUNC_ENTER_NOAPI(H5T_get_member_size, 0);
|
||||
|
||||
assert(dt);
|
||||
assert(membno >=0 && membno < dt->shared->u.compnd.nmembs);
|
||||
assert(membno < dt->shared->u.compnd.nmembs);
|
||||
|
||||
/* Value */
|
||||
ret_value = dt->shared->u.compnd.memb[membno].type->shared->size;
|
||||
|
@ -592,4 +592,3 @@ H5T_enum_valueof(H5T_t *dt, const char *name, void *value/*out*/)
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
}
|
||||
|
||||
|
@ -1091,7 +1091,7 @@ H5_DLL H5T_t * H5T_array_create(H5T_t *base, int ndims,
|
||||
/* Compound functions */
|
||||
H5_DLL H5T_t *H5T_get_member_type(const H5T_t *dt, unsigned membno);
|
||||
H5_DLL size_t H5T_get_member_offset(const H5T_t *dt, unsigned membno);
|
||||
H5_DLL size_t H5T_get_member_size(H5T_t *dt, int membno);
|
||||
H5_DLL size_t H5T_get_member_size(H5T_t *dt, unsigned membno);
|
||||
H5_DLL htri_t H5T_is_packed(const H5T_t *dt);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user