mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-24 17:51:25 +08:00
[svn-r6780] Purpose: Backward compatibility change
Description: 1.4 compatibility for H5G_obj_t type and H5Zregister test. Solution: use macro H5_WANT_H5_V1_4_COMPAT Platforms tested: h5committest
This commit is contained in:
parent
b58192dfe7
commit
11fe5b0657
18
src/H5R.c
18
src/H5R.c
@ -40,7 +40,7 @@ static herr_t H5R_create(void *ref, H5G_entry_t *loc, const char *name,
|
|||||||
H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id);
|
H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id);
|
||||||
static hid_t H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref);
|
static hid_t H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref);
|
||||||
static H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref);
|
static H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref);
|
||||||
static int H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref);
|
static H5G_obj_t H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref);
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
@ -337,7 +337,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
|
|||||||
H5T_t *datatype; /* Pointer to datatype to open */
|
H5T_t *datatype; /* Pointer to datatype to open */
|
||||||
H5G_entry_t ent; /* Symbol table entry */
|
H5G_entry_t ent; /* Symbol table entry */
|
||||||
uint8_t *p; /* Pointer to OID to store */
|
uint8_t *p; /* Pointer to OID to store */
|
||||||
int oid_type; /* type of object being dereferenced */
|
H5G_obj_t oid_type; /* type of object being dereferenced */
|
||||||
hid_t ret_value;
|
hid_t ret_value;
|
||||||
|
|
||||||
FUNC_ENTER_NOINIT(H5R_dereference);
|
FUNC_ENTER_NOINIT(H5R_dereference);
|
||||||
@ -647,13 +647,13 @@ done:
|
|||||||
EXAMPLES
|
EXAMPLES
|
||||||
REVISION LOG
|
REVISION LOG
|
||||||
--------------------------------------------------------------------------*/
|
--------------------------------------------------------------------------*/
|
||||||
static int
|
static H5G_obj_t
|
||||||
H5R_get_object_type(H5F_t *file, hid_t dxpl_id, void *_ref)
|
H5R_get_object_type(H5F_t *file, void *_ref)
|
||||||
{
|
{
|
||||||
H5G_entry_t ent; /* Symbol table entry */
|
H5G_entry_t ent; /* Symbol table entry */
|
||||||
hobj_ref_t *ref=(hobj_ref_t *)_ref; /* Only object references currently supported */
|
hobj_ref_t *ref=(hobj_ref_t *)_ref; /* Only object references currently supported */
|
||||||
uint8_t *p; /* Pointer to OID to store */
|
uint8_t *p; /* Pointer to OID to store */
|
||||||
int ret_value;
|
H5G_obj_t ret_value;
|
||||||
|
|
||||||
FUNC_ENTER_NOINIT(H5R_get_object_type);
|
FUNC_ENTER_NOINIT(H5R_get_object_type);
|
||||||
|
|
||||||
@ -670,7 +670,7 @@ H5R_get_object_type(H5F_t *file, hid_t dxpl_id, void *_ref)
|
|||||||
H5F_addr_decode(ent.file,(const uint8_t **)&p,&(ent.header));
|
H5F_addr_decode(ent.file,(const uint8_t **)&p,&(ent.header));
|
||||||
|
|
||||||
/* Get the OID type */
|
/* Get the OID type */
|
||||||
ret_value=H5G_get_type(&ent, dxpl_id);
|
ret_value=H5G_get_type(&ent, H5P_DEFAULT);
|
||||||
|
|
||||||
#ifdef LATER
|
#ifdef LATER
|
||||||
done:
|
done:
|
||||||
@ -721,7 +721,7 @@ H5Rget_object_type(hid_t id, void *_ref)
|
|||||||
file=loc->file;
|
file=loc->file;
|
||||||
|
|
||||||
/* Get the object information */
|
/* Get the object information */
|
||||||
if ((ret_value=H5R_get_object_type(file,H5AC_ind_dxpl_id,_ref))<0)
|
if ((ret_value=H5R_get_object_type(file,_ref))<0)
|
||||||
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type");
|
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type");
|
||||||
|
|
||||||
done:
|
done:
|
||||||
@ -752,12 +752,12 @@ done:
|
|||||||
EXAMPLES
|
EXAMPLES
|
||||||
REVISION LOG
|
REVISION LOG
|
||||||
--------------------------------------------------------------------------*/
|
--------------------------------------------------------------------------*/
|
||||||
static int
|
static H5G_obj_t
|
||||||
H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
|
H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
|
||||||
{
|
{
|
||||||
H5G_entry_t ent; /* Symbol table entry */
|
H5G_entry_t ent; /* Symbol table entry */
|
||||||
uint8_t *p; /* Pointer to OID to store */
|
uint8_t *p; /* Pointer to OID to store */
|
||||||
int ret_value;
|
H5G_obj_t ret_value;
|
||||||
|
|
||||||
FUNC_ENTER_NOINIT(H5R_get_obj_type);
|
FUNC_ENTER_NOINIT(H5R_get_obj_type);
|
||||||
|
|
||||||
|
18
test/dsets.c
18
test/dsets.c
@ -2253,11 +2253,8 @@ test_can_apply(hid_t file)
|
|||||||
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
|
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
|
||||||
goto error;
|
goto error;
|
||||||
} /* end if */
|
} /* end if */
|
||||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
#ifndef H5_WANT_H5_V1_4_COMPAT
|
||||||
if(H5Zregister (H5Z_FILTER_BOGUS, "bogus", filter_bogus)<0) {
|
|
||||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
|
||||||
if(H5Zregister (H5Z_CAN_APPLY)<0) {
|
if(H5Zregister (H5Z_CAN_APPLY)<0) {
|
||||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
|
||||||
H5_FAILED();
|
H5_FAILED();
|
||||||
printf(" Line %d: Can't register 'can apply' filter\n",__LINE__);
|
printf(" Line %d: Can't register 'can apply' filter\n",__LINE__);
|
||||||
goto error;
|
goto error;
|
||||||
@ -2267,6 +2264,7 @@ test_can_apply(hid_t file)
|
|||||||
printf(" Line %d: Can't set bogus filter\n",__LINE__);
|
printf(" Line %d: Can't set bogus filter\n",__LINE__);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||||
|
|
||||||
/* Create the data space */
|
/* Create the data space */
|
||||||
if ((sid = H5Screate_simple(2, dims, NULL))<0) {
|
if ((sid = H5Screate_simple(2, dims, NULL))<0) {
|
||||||
@ -2559,11 +2557,8 @@ test_set_local(const char *filename, hid_t fapl)
|
|||||||
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
|
printf(" Line %d: Can't set chunk sizes\n",__LINE__);
|
||||||
goto error;
|
goto error;
|
||||||
} /* end if */
|
} /* end if */
|
||||||
#ifdef H5_WANT_H5_V1_4_COMPAT
|
#ifndef H5_WANT_H5_V1_4_COMPAT
|
||||||
if(H5Zregister (H5Z_FILTER_BOGUS2, "bogus2", filter_bogus2)<0) {
|
|
||||||
#else /* H5_WANT_H5_V1_4_COMPAT */
|
|
||||||
if(H5Zregister (H5Z_SET_LOCAL)<0) {
|
if(H5Zregister (H5Z_SET_LOCAL)<0) {
|
||||||
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
|
||||||
H5_FAILED();
|
H5_FAILED();
|
||||||
printf(" Line %d: Can't register 'set local' filter\n",__LINE__);
|
printf(" Line %d: Can't register 'set local' filter\n",__LINE__);
|
||||||
goto error;
|
goto error;
|
||||||
@ -2573,6 +2568,7 @@ test_set_local(const char *filename, hid_t fapl)
|
|||||||
printf(" Line %d: Can't set bogus2 filter\n",__LINE__);
|
printf(" Line %d: Can't set bogus2 filter\n",__LINE__);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||||
|
|
||||||
/* Create the data space */
|
/* Create the data space */
|
||||||
if ((sid = H5Screate_simple(2, dims, NULL))<0) {
|
if ((sid = H5Screate_simple(2, dims, NULL))<0) {
|
||||||
@ -2827,10 +2823,12 @@ main(void)
|
|||||||
nerrors += test_multiopen (file)<0 ?1:0;
|
nerrors += test_multiopen (file)<0 ?1:0;
|
||||||
nerrors += test_types(file)<0 ?1:0;
|
nerrors += test_types(file)<0 ?1:0;
|
||||||
nerrors += test_userblock_offset(fapl)<0 ?1:0;
|
nerrors += test_userblock_offset(fapl)<0 ?1:0;
|
||||||
nerrors += test_missing_filter(file)<0 ?1:0;
|
nerrors += test_missing_filter(file)<0 ?1:0;
|
||||||
|
#ifndef H5_WANT_H5_V1_4_COMPAT
|
||||||
nerrors += test_can_apply(file)<0 ?1:0;
|
nerrors += test_can_apply(file)<0 ?1:0;
|
||||||
nerrors += test_can_apply_szip(file)<0 ?1:0;
|
|
||||||
nerrors += test_set_local(filename,fapl)<0 ?1:0;
|
nerrors += test_set_local(filename,fapl)<0 ?1:0;
|
||||||
|
#endif /* H5_WANT_H5_V1_4_COMPAT */
|
||||||
|
nerrors += test_can_apply_szip(file)<0 ?1:0;
|
||||||
|
|
||||||
if (H5Fclose(file)<0) goto error;
|
if (H5Fclose(file)<0) goto error;
|
||||||
if (nerrors) goto error;
|
if (nerrors) goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user