diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-03 20:05:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-03 20:05:19 (GMT) |
commit | 22d442825b2a57d24e03dfe13d1515a9d09e2cc3 (patch) | |
tree | fff9c136647d21f5000c481365a8bd24b84f7de0 /src/H5T.c | |
parent | 513012e673fa2e6feb98ab564c7524298927bbb7 (diff) | |
download | hdf5-22d442825b2a57d24e03dfe13d1515a9d09e2cc3.zip hdf5-22d442825b2a57d24e03dfe13d1515a9d09e2cc3.tar.gz hdf5-22d442825b2a57d24e03dfe13d1515a9d09e2cc3.tar.bz2 |
[svn-r8802] Purpose:
Code optimization
Description:
Set up datatype ID for dataset's datatype on disk. This allows us to avoid
repeatedly copying the datatype when an ID is needed.
Also, clean up a few warnings in various other places.
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.10 (sleipnir) w/parallel
Too minor to require h5committest
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 47 |
1 files changed, 44 insertions, 3 deletions
@@ -2891,12 +2891,14 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) case H5T_COPY_REOPEN: /* * Return a transient type (locked or unlocked) or an opened named - * type. + * type. Immutable transient types are degraded to read-only. */ if (H5F_addr_defined(new_dt->ent.header)) { if (H5O_open (&(new_dt->ent))<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to reopen named data type"); new_dt->state = H5T_STATE_OPEN; + } else if (H5T_STATE_IMMUTABLE==new_dt->state) { + new_dt->state = H5T_STATE_RDONLY; } break; } /* end switch */ @@ -4249,7 +4251,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5T_is_immutable(H5T_t *dt) +H5T_is_immutable(const H5T_t *dt) { htri_t ret_value = FALSE; @@ -4282,7 +4284,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5T_is_named(H5T_t *dt) +H5T_is_named(const H5T_t *dt) { htri_t ret_value = FALSE; @@ -4390,6 +4392,45 @@ done: /*------------------------------------------------------------------------- + * Function: H5T_is_relocatable + * + * Purpose: Check if a datatype will change between disk and memory. + * + * Notes: Currently, only variable-length and object references change + * between disk & memory (see cases where things are changed in + * the H5T_set_loc() code above). + * + * Return: + * One of two values on success: + * TRUE - If the location of any vlen types changed + * FALSE - If the location of any vlen types is the same + * <0 is returned on failure + * + * Programmer: Quincey Koziol + * Thursday, June 24, 2004 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +htri_t +H5T_is_relocatable(const H5T_t *dt) +{ + htri_t ret_value = FALSE; + + FUNC_ENTER_NOAPI(H5T_is_relocatable, FAIL); + + assert(dt); + + if(H5T_detect_class(dt, H5T_VLEN)) + ret_value = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value); +} /* end H5T_is_relocatable() */ + + +/*------------------------------------------------------------------------- * Function: H5T_print_stats * * Purpose: Print statistics about a conversion path. Statistics are |