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");
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "H5Eprivate.h" /*error handling */
|
||||
#include "H5Fpkg.h" /* File */
|
||||
#include "H5FLprivate.h" /* Free Lists */
|
||||
#include "H5FOprivate.h" /* File objects */
|
||||
#include "H5FOprivate.h" /* File objects */
|
||||
#include "H5Gprivate.h" /*groups */
|
||||
#include "H5Iprivate.h" /*ID functions */
|
||||
#include "H5MMprivate.h" /*memory management */
|
||||
@ -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)
|
||||
|
@ -27,9 +27,9 @@
|
||||
#define PABLO_MASK H5T_array_mask
|
||||
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5FLprivate.h" /* Free Lists */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5FLprivate.h" /* Free Lists */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
#include "H5Tpkg.h" /* Datatypes */
|
||||
|
||||
/* Declare extern the free list for H5T_t's */
|
||||
|
@ -27,10 +27,10 @@
|
||||
#define PABLO_MASK H5T_commit_mask
|
||||
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5FOprivate.h" /* File objects */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
#include "H5Oprivate.h" /* Object headers */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5FOprivate.h" /* File objects */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
#include "H5Oprivate.h" /* Object headers */
|
||||
#include "H5Tpkg.h" /* Datatypes */
|
||||
|
||||
/* Static local functions */
|
||||
|
@ -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;
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "H5private.h" /*generic functions */
|
||||
#include "H5Eprivate.h" /*error handling */
|
||||
#include "H5FLprivate.h" /*Free Lists */
|
||||
#include "H5FLprivate.h" /*Free Lists */
|
||||
#include "H5Iprivate.h" /*ID functions */
|
||||
#include "H5MMprivate.h" /*memory management */
|
||||
#include "H5Tpkg.h" /*data-type functions */
|
||||
@ -592,4 +592,3 @@ H5T_enum_valueof(H5T_t *dt, const char *name, void *value/*out*/)
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ typedef enum {
|
||||
/* A VL datatype */
|
||||
typedef struct H5T_vlen_t {
|
||||
H5T_vlen_type_t type; /* Type of VL data in buffer */
|
||||
H5T_loc_t loc; /* Location of VL data in buffer */
|
||||
H5T_loc_t loc; /* Location of VL data in buffer */
|
||||
H5T_cset_t cset; /* For VL string. character set */
|
||||
H5T_str_t pad; /* For VL string. space or null padding of
|
||||
* extra bytes */
|
||||
@ -197,7 +197,7 @@ typedef enum H5T_state_t {
|
||||
|
||||
/* This struct is shared between all occurances of an open named type */
|
||||
typedef struct H5T_shared_t {
|
||||
hsize_t fo_count; /* number of references to this file object */
|
||||
hsize_t fo_count; /* number of references to this file object */
|
||||
H5T_state_t state; /*current state of the type */
|
||||
H5F_t *sh_file;/*file pointer if this is a shared type */
|
||||
H5T_class_t type; /*which class of type is this? */
|
||||
@ -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