diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-02 04:54:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-02 04:54:19 (GMT) |
commit | 19c9657f7c4029df52a804c7ed8b4d3b30cc6196 (patch) | |
tree | 6601816880f90040ae67df5bd27558c0f0670e86 /src/H5T.c | |
parent | 0f84d2fb15813c10fca48f95772626c34039619d (diff) | |
download | hdf5-19c9657f7c4029df52a804c7ed8b4d3b30cc6196.zip hdf5-19c9657f7c4029df52a804c7ed8b4d3b30cc6196.tar.gz hdf5-19c9657f7c4029df52a804c7ed8b4d3b30cc6196.tar.bz2 |
[svn-r12842] Description:
Refactor generic property list initialization code to put property list
specific routines in property list modules, instead of scattered to the four
winds. Also, introduce property list class initialization objects, to make
adding new property list classes in the library easier.
Fix daily test failure by using H5Pget_elink_prefix() API routine instead
of looking at the "raw" generic property list information.
Tested on:
Mac OS X/32 10.4.8 (amazon)
FreeBSD/32 4.11 (sleipnir) w/threadsafe
Linux/32 2.4 (heping) w/C++ & FORTRAN
Linux/64 2.4 (mir) w/build-all & 1.6 compat
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 97 |
1 files changed, 41 insertions, 56 deletions
@@ -419,7 +419,7 @@ static H5T_t *H5T_decode(const unsigned char *buf); #define H5T_INIT_TYPE_STRING_COMMON { \ H5T_INIT_TYPE_ALLOC_COMMON(H5T_STRING) \ H5T_INIT_TYPE_NUM_COMMON(H5T_ORDER_NONE) \ - dt->shared->u.atomic.u.s.cset = H5F_CRT_DEFAULT_CSET; \ + dt->shared->u.atomic.u.s.cset = H5F_DEFAULT_CSET; \ } #define H5T_INIT_TYPE_CSTRING_CORE { \ @@ -732,58 +732,57 @@ H5T_init_interface(void) herr_t status; unsigned copied_dtype=1; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ H5P_genclass_t *crt_pclass; /* Property list class for datatype creation properties */ - H5P_genclass_t *acc_pclass; /* Property list class for datatype access properties */ herr_t ret_value=SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5T_init_interface); + FUNC_ENTER_NOAPI_NOINIT(H5T_init_interface) /* Initialize the atom group for the file IDs */ - if (H5I_register_type(H5I_DATATYPE, (size_t)H5I_DATATYPEID_HASHSIZE, H5T_RESERVED_ATOMS, (H5I_free_t)H5T_close)<0) - HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface"); + if(H5I_register_type(H5I_DATATYPE, (size_t)H5I_DATATYPEID_HASHSIZE, H5T_RESERVED_ATOMS, (H5I_free_t)H5T_close)<0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Make certain there aren't too many classes of datatypes defined */ /* Only 16 (numbered 0-15) are supported in the current file format */ - assert(H5T_NCLASSES<16); + HDassert(H5T_NCLASSES < 16); /* Perform any necessary hardware initializations */ if(H5T_init_hw()<0) - HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* * Initialize pre-defined native data types from code generated during * the library configuration by H5detect. */ - if (H5TN_init_interface()<0) - HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface"); + if(H5TN_init_interface()<0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Get the atomic datatype structures needed by the initialization code below */ - if (NULL==(native_schar=H5I_object(H5T_NATIVE_SCHAR_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_uchar=H5I_object(H5T_NATIVE_UCHAR_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_short=H5I_object(H5T_NATIVE_SHORT_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_ushort=H5I_object(H5T_NATIVE_USHORT_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_int=H5I_object(H5T_NATIVE_INT_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_uint=H5I_object(H5T_NATIVE_UINT_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_long=H5I_object(H5T_NATIVE_LONG_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_ulong=H5I_object(H5T_NATIVE_ULONG_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_llong=H5I_object(H5T_NATIVE_LLONG_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_ullong=H5I_object(H5T_NATIVE_ULLONG_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_float=H5I_object(H5T_NATIVE_FLOAT_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); - if (NULL==(native_double=H5I_object(H5T_NATIVE_DOUBLE_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); + if(NULL==(native_schar=H5I_object(H5T_NATIVE_SCHAR_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_uchar=H5I_object(H5T_NATIVE_UCHAR_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_short=H5I_object(H5T_NATIVE_SHORT_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_ushort=H5I_object(H5T_NATIVE_USHORT_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_int=H5I_object(H5T_NATIVE_INT_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_uint=H5I_object(H5T_NATIVE_UINT_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_long=H5I_object(H5T_NATIVE_LONG_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_ulong=H5I_object(H5T_NATIVE_ULONG_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_llong=H5I_object(H5T_NATIVE_LLONG_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_ullong=H5I_object(H5T_NATIVE_ULLONG_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_float=H5I_object(H5T_NATIVE_FLOAT_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") + if(NULL==(native_double=H5I_object(H5T_NATIVE_DOUBLE_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") #if H5_SIZEOF_LONG_DOUBLE !=0 - if (NULL==(native_ldouble=H5I_object(H5T_NATIVE_LDOUBLE_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); + if(NULL==(native_ldouble=H5I_object(H5T_NATIVE_LDOUBLE_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object") #endif /*------------------------------------------------------------ @@ -1001,13 +1000,13 @@ H5T_init_interface(void) fixedpt = native_int; floatpt = native_float; if (NULL == (compound = H5T_create(H5T_COMPOUND, (size_t)1))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (enum_type = H5T_create(H5T_ENUM, (size_t)1))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (vlen = H5T_vlen_create(native_int))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (NULL == (array = H5T_array_create(native_int, 1, dim))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") status = 0; status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T_conv_i_i, H5AC_dxpl_id, FALSE); @@ -1305,7 +1304,7 @@ H5T_init_interface(void) status |= H5T_init_inf(); if (status<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)") /* ========== Datatype Creation Property Class Initialization ============*/ assert(H5P_CLS_DATATYPE_CREATE_g!=-1); @@ -1325,20 +1324,6 @@ H5T_init_interface(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't insert property into class") } /* end if */ - /* ========== Datatype Access Property Class Initialization ============*/ - assert(H5P_CLS_DATATYPE_ACCESS_g!=-1); - - /* Get the pointer to dataset access class */ - if(NULL == (acc_pclass = H5I_object(H5P_CLS_DATATYPE_ACCESS_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") - - /* Only register the default property list if it hasn't been created yet */ - if(H5P_LST_DATATYPE_ACCESS_g == (-1)) { - /* Register the default dataset access property list */ - if((H5P_LST_DATATYPE_ACCESS_g = H5P_create_id(acc_pclass))<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't insert property into class") - } /* end if */ - done: /* General cleanup */ if (compound!=NULL) @@ -1364,8 +1349,8 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_init_interface() */ /*------------------------------------------------------------------------- |