mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
Purged the unused H5I_REFERENCE from the library.
This commit is contained in:
parent
b6944aeb2a
commit
0d6930d3c2
@ -174,7 +174,6 @@ H5I_type_t IdComponent::getHDFObjType() const
|
||||
/// \li \c H5I_DATASPACE
|
||||
/// \li \c H5I_DATASET
|
||||
/// \li \c H5I_ATTR
|
||||
/// \li \c H5I_REFERENCE
|
||||
/// \li \c H5I_VFL
|
||||
/// \li \c H5I_GENPROP_CLS
|
||||
/// \li \c H5I_GENPROP_LST
|
||||
@ -227,7 +226,6 @@ bool IdComponent::isValid(hid_t an_id)
|
||||
/// \li \c H5I_DATASPACE
|
||||
/// \li \c H5I_DATASET
|
||||
/// \li \c H5I_ATTR
|
||||
/// \li \c H5I_REFERENCE
|
||||
/// \li \c H5I_VFL
|
||||
/// \li \c H5I_GENPROP_CLS
|
||||
/// \li \c H5I_GENPROP_LST
|
||||
|
@ -309,7 +309,6 @@ public class HDF5Constants {
|
||||
public static final int H5I_GROUP = H5I_GROUP();
|
||||
public static final int H5I_INVALID_HID = H5I_INVALID_HID();
|
||||
public static final int H5I_NTYPES = H5I_NTYPES();
|
||||
public static final int H5I_REFERENCE = H5I_REFERENCE();
|
||||
public static final int H5I_UNINIT = H5I_UNINIT();
|
||||
public static final int H5I_VFL = H5I_VFL();
|
||||
|
||||
@ -1196,8 +1195,6 @@ public class HDF5Constants {
|
||||
|
||||
private static native final int H5I_NTYPES();
|
||||
|
||||
private static native final int H5I_REFERENCE();
|
||||
|
||||
private static native final int H5I_UNINIT();
|
||||
|
||||
private static native final int H5I_VFL();
|
||||
|
@ -590,8 +590,6 @@ Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASET(JNIEnv *env, jclass cls) { return H5
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5I_1ATTR(JNIEnv *env, jclass cls) { return H5I_ATTR; }
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5I_1REFERENCE(JNIEnv *env, jclass cls) { return H5I_REFERENCE; }
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5I_1VFL(JNIEnv *env, jclass cls) { return H5I_VFL; }
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5I_1INVALID_1HID(JNIEnv *env, jclass cls) { return H5I_INVALID_HID; }
|
||||
|
1
src/H5.c
1
src/H5.c
@ -306,7 +306,6 @@ H5_term_library(void)
|
||||
pending += DOWN(A_top);
|
||||
pending += DOWN(D_top);
|
||||
pending += DOWN(G_top);
|
||||
pending += DOWN(R_top);
|
||||
pending += DOWN(S_top);
|
||||
pending += DOWN(T_top);
|
||||
|
||||
|
@ -318,7 +318,6 @@ H5Aget_num_attrs(hid_t loc_id)
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -679,7 +679,6 @@ H5Fflush(hid_t object_id, H5F_scope_t scope)
|
||||
case H5I_UNINIT:
|
||||
case H5I_BADID:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -452,7 +452,6 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key)
|
||||
case H5I_BADID:
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -240,9 +240,6 @@ H5G_loc(hid_t loc_id, H5G_loc_t *loc)
|
||||
} /* end case */
|
||||
break;
|
||||
|
||||
case H5I_REFERENCE:
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of reference")
|
||||
|
||||
case H5I_UNINIT:
|
||||
case H5I_BADID:
|
||||
case H5I_VFL:
|
||||
|
@ -835,7 +835,6 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key)
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -553,7 +553,6 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -40,7 +40,6 @@ typedef enum H5I_type_t {
|
||||
H5I_DATASPACE, /* type ID for Dataspace objects */
|
||||
H5I_DATASET, /* type ID for Dataset objects */
|
||||
H5I_ATTR, /* type ID for Attribute objects */
|
||||
H5I_REFERENCE, /* type ID for Reference objects */
|
||||
H5I_VFL, /* type ID for virtual file layer */
|
||||
H5I_GENPROP_CLS, /* type ID for generic property list classes */
|
||||
H5I_GENPROP_LST, /* type ID for generic property lists */
|
||||
|
@ -1081,7 +1081,6 @@ H5Oclose(hid_t object_id)
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
@ -2628,7 +2627,6 @@ H5O_get_loc(hid_t object_id)
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -370,40 +370,39 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_
|
||||
type = H5I_get_type(oid);
|
||||
|
||||
switch(type) {
|
||||
case(H5I_GROUP):
|
||||
case H5I_GROUP:
|
||||
/* Re-open the group */
|
||||
if(NULL == (object = H5G_open(obj_loc, dxpl_id)))
|
||||
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group")
|
||||
break;
|
||||
|
||||
case(H5I_DATATYPE):
|
||||
case H5I_DATATYPE:
|
||||
/* Re-open the named datatype */
|
||||
if(NULL == (object = H5T_open(obj_loc, dxpl_id)))
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype")
|
||||
break;
|
||||
|
||||
case(H5I_DATASET):
|
||||
case H5I_DATASET:
|
||||
/* Re-open the dataset */
|
||||
if(NULL == (object = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT, dxpl_id)))
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset")
|
||||
if(!start_swmr) /* No need to handle multiple opens when H5Fstart_swmr_write() */
|
||||
if(H5D_mult_refresh_reopen((H5D_t *)object, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset")
|
||||
if(!start_swmr) /* No need to handle multiple opens when H5Fstart_swmr_write() */
|
||||
if(H5D_mult_refresh_reopen((H5D_t *)object, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset")
|
||||
break;
|
||||
|
||||
case(H5I_UNINIT):
|
||||
case(H5I_BADID):
|
||||
case(H5I_FILE):
|
||||
case(H5I_DATASPACE):
|
||||
case(H5I_ATTR):
|
||||
case(H5I_REFERENCE):
|
||||
case(H5I_VFL):
|
||||
case(H5I_GENPROP_CLS):
|
||||
case(H5I_GENPROP_LST):
|
||||
case(H5I_ERROR_CLASS):
|
||||
case(H5I_ERROR_MSG):
|
||||
case(H5I_ERROR_STACK):
|
||||
case(H5I_NTYPES):
|
||||
case H5I_UNINIT:
|
||||
case H5I_BADID:
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
case H5I_ERROR_CLASS:
|
||||
case H5I_ERROR_MSG:
|
||||
case H5I_ERROR_STACK:
|
||||
case H5I_NTYPES:
|
||||
default:
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_CANTRELEASE, FAIL, "not a valid file object ID (dataset, group, or datatype)")
|
||||
break;
|
||||
|
78
src/H5R.c
78
src/H5R.c
@ -71,17 +71,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
/* Reference ID class */
|
||||
static const H5I_class_t H5I_REFERENCE_CLS[1] = {{
|
||||
H5I_REFERENCE, /* ID class value */
|
||||
0, /* Class flags */
|
||||
0, /* # of reserved IDs for class */
|
||||
NULL /* Callback routine for closing objects of this class */
|
||||
}};
|
||||
|
||||
/* Flag indicating "top" of interface has been initialized */
|
||||
static hbool_t H5R_top_package_initialize_s = FALSE;
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
@ -103,57 +92,10 @@ H5R__init_package(void)
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
/* Initialize the atom group for the file IDs */
|
||||
if(H5I_register_type(H5I_REFERENCE_CLS) < 0)
|
||||
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface")
|
||||
|
||||
/* Mark "top" of interface as initialized, too */
|
||||
H5R_top_package_initialize_s = TRUE;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5R__init_package() */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
NAME
|
||||
H5R_top_term_package
|
||||
PURPOSE
|
||||
Terminate various H5R objects
|
||||
USAGE
|
||||
void H5R_top_term_package()
|
||||
RETURNS
|
||||
void
|
||||
DESCRIPTION
|
||||
Release IDs for the atom group, deferring full interface shutdown
|
||||
until later (in H5R_term_package).
|
||||
GLOBAL VARIABLES
|
||||
COMMENTS, BUGS, ASSUMPTIONS
|
||||
Can't report errors...
|
||||
EXAMPLES
|
||||
REVISION LOG
|
||||
--------------------------------------------------------------------------*/
|
||||
int
|
||||
H5R_top_term_package(void)
|
||||
{
|
||||
int n = 0;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
if(H5R_top_package_initialize_s) {
|
||||
if(H5I_nmembers(H5I_REFERENCE) > 0) {
|
||||
(void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE);
|
||||
n++; /*H5I*/
|
||||
} /* end if */
|
||||
|
||||
/* Mark closed */
|
||||
if(0 == n)
|
||||
H5R_top_package_initialize_s = FALSE;
|
||||
} /* end if */
|
||||
|
||||
FUNC_LEAVE_NOAPI(n)
|
||||
} /* end H5R_top_term_package() */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
NAME
|
||||
@ -178,24 +120,12 @@ H5R_top_term_package(void)
|
||||
int
|
||||
H5R_term_package(void)
|
||||
{
|
||||
int n = 0;
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
|
||||
if(H5_PKG_INIT_VAR) {
|
||||
/* Sanity checks */
|
||||
HDassert(0 == H5I_nmembers(H5I_REFERENCE));
|
||||
HDassert(FALSE == H5R_top_package_initialize_s);
|
||||
if(H5_PKG_INIT_VAR)
|
||||
H5_PKG_INIT_VAR = FALSE;
|
||||
|
||||
/* Destroy the reference id group */
|
||||
n += (H5I_dec_type_ref(H5I_REFERENCE) > 0);
|
||||
|
||||
/* Mark closed */
|
||||
if(0 == n)
|
||||
H5_PKG_INIT_VAR = FALSE;
|
||||
} /* end if */
|
||||
|
||||
FUNC_LEAVE_NOAPI(n)
|
||||
FUNC_LEAVE_NOAPI(0)
|
||||
} /* end H5R_term_package() */
|
||||
|
||||
|
||||
@ -741,7 +671,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
|
||||
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace")
|
||||
|
||||
/* Atomize */
|
||||
if((ret_value = H5I_register (H5I_DATASPACE, space, TRUE)) < 0)
|
||||
if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
|
||||
|
||||
done:
|
||||
|
@ -1673,7 +1673,6 @@ H5Tcopy(hid_t type_id)
|
||||
case H5I_GROUP:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -2593,7 +2593,6 @@ H5_DLL int H5L_term_package(void);
|
||||
H5_DLL int H5P_term_package(void);
|
||||
H5_DLL int H5PL_term_package(void);
|
||||
H5_DLL int H5R_term_package(void);
|
||||
H5_DLL int H5R_top_term_package(void);
|
||||
H5_DLL int H5S_term_package(void);
|
||||
H5_DLL int H5S_top_term_package(void);
|
||||
H5_DLL int H5SL_term_package(void);
|
||||
|
@ -1320,10 +1320,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
|
||||
fprintf(out, "%ld (attr)", (long)obj);
|
||||
break;
|
||||
|
||||
case H5I_REFERENCE:
|
||||
fprintf(out, "%ld (reference)", (long)obj);
|
||||
break;
|
||||
|
||||
case H5I_VFL:
|
||||
fprintf(out, "%ld (file driver)", (long)obj);
|
||||
break;
|
||||
@ -1501,10 +1497,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
|
||||
fprintf(out, "H5I_ATTR");
|
||||
break;
|
||||
|
||||
case H5I_REFERENCE:
|
||||
fprintf(out, "H5I_REFERENCE");
|
||||
break;
|
||||
|
||||
case H5I_VFL:
|
||||
fprintf(out, "H5I_VFL");
|
||||
break;
|
||||
|
@ -7743,7 +7743,6 @@ done:
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
@ -7830,7 +7829,6 @@ done:
|
||||
case H5I_FILE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -1393,7 +1393,6 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
|
||||
case H5I_DATATYPE:
|
||||
case H5I_DATASPACE:
|
||||
case H5I_ATTR:
|
||||
case H5I_REFERENCE:
|
||||
case H5I_VFL:
|
||||
case H5I_GENPROP_CLS:
|
||||
case H5I_GENPROP_LST:
|
||||
|
@ -3445,8 +3445,6 @@ test_misc19(void)
|
||||
} H5E_END_TRY;
|
||||
VERIFY(ret, FAIL, "H5FDunregister");
|
||||
|
||||
/* Check H5I operations on references */
|
||||
|
||||
} /* end test_misc19() */
|
||||
|
||||
/****************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user