summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /src/H5D.c
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 149c021..a18c805 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -45,7 +45,7 @@ static hsize_t H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id);
static haddr_t H5D_get_offset(const H5D_t *dset);
static herr_t H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
static herr_t H5D_set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
-static herr_t H5D_init_type(H5F_t *file, H5D_t *dset, hid_t type_id, const H5T_t *type);
+static herr_t H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type);
static int H5D_crt_fill_value_cmp(const void *value1, const void *value2, size_t size);
static int H5D_crt_ext_file_list_cmp(const void *value1, const void *value2, size_t size);
static int H5D_crt_data_pipeline_cmp(const void *value1, const void *value2, size_t size);
@@ -201,7 +201,7 @@ H5D_init_interface(void)
FUNC_ENTER_NOAPI_NOINIT(H5D_init_interface)
/* Initialize the atom group for the dataset IDs */
- if (H5I_register_type(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)<0)
+ if (H5I_register_type(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)<H5I_FILE)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize interface")
/* =========Dataset Transfer Property Class Initialization========= */
@@ -420,7 +420,7 @@ H5D_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_term_interface)
if (H5_interface_initialize_g) {
- if ((n=H5I_nmembers(H5I_DATASET))) {
+ if ((n=H5I_nmembers(H5I_DATASET))>0) {
/* The dataset API uses the "force" flag set to true because it
* is using the "file objects" (H5FO) API functions to track open
* objects in the file. Using the H5FO code means that dataset
@@ -471,6 +471,7 @@ H5D_term_interface(void)
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5D_xfer_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value)
{
@@ -479,9 +480,6 @@ H5D_xfer_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED
FUNC_ENTER_NOAPI(H5D_xfer_xform_del, FAIL)
assert(value);
-#ifdef H5Z_XFORM_DEBUG
- fprintf(stderr, "Freeing memory b/c of delete\n");
-#endif
if(H5Z_xform_destroy(*(H5Z_data_xform_t **)value)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing the parse tree")
@@ -510,6 +508,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5D_xfer_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value)
{
@@ -543,6 +542,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5D_xfer_xform_close(const char UNUSED *name, size_t UNUSED size, void *value)
{
@@ -551,9 +551,6 @@ H5D_xfer_xform_close(const char UNUSED *name, size_t UNUSED size, void *value)
FUNC_ENTER_NOAPI(H5D_xfer_xform_close, FAIL)
assert(value);
-#ifdef H5Z_XFORM_DEBUG
- fprintf(stderr, "Freeing memory b/c of close\n");
-#endif
if(H5Z_xform_destroy(*(H5Z_data_xform_t **)value)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing the parse tree")
@@ -1748,7 +1745,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_init_type(H5F_t *file, H5D_t *dset, hid_t type_id, const H5T_t *type)
+H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type)
{
htri_t relocatable; /* Flag whether the type is relocatable */
htri_t immutable; /* Flag whether the type is immutable */
@@ -2359,7 +2356,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space
default:
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet")
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Update the dataset's entry info. */
if (H5D_update_entry_info(file, dxpl_id, new_dset, dc_plist) != SUCCEED)
@@ -2492,7 +2489,7 @@ done:
*-------------------------------------------------------------------------
*/
H5D_t*
-H5D_open(H5G_entry_t *ent, hid_t dxpl_id)
+H5D_open(const H5G_entry_t *ent, hid_t dxpl_id)
{
H5D_shared_t *shared_fo=NULL;
H5D_t *dataset=NULL;
@@ -2534,16 +2531,15 @@ H5D_open(H5G_entry_t *ent, hid_t dxpl_id)
ret_value = dataset;
done:
- if(ret_value==NULL) {
+ if(ret_value==NULL) {
if(dataset) {
- if(shared_fo==NULL) { /* Need to free shared fo */
+ if(shared_fo==NULL) /* Need to free shared fo */
H5FL_FREE(H5D_shared_t, dataset->shared);
- }
H5FL_FREE(H5D_t, dataset);
}
if(shared_fo)
shared_fo->fo_count--;
- }
+ } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -2693,7 +2689,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id)
default:
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet")
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Point at dataset's copy, to cache it for later */
fill_prop=&dataset->shared->fill;
@@ -2725,7 +2721,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id)
default:
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet")
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Set the default fill time */
fill.fill_time=H5D_CRT_FILL_TIME_DEF;
@@ -2900,7 +2896,7 @@ H5D_close(H5D_t *dataset)
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/*
* Release datatype, dataspace and creation property list -- there isn't
@@ -3224,7 +3220,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Check if we need to initialize the space */
if(init_space) {
@@ -3349,7 +3345,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id)
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -3443,7 +3439,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id)
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset type")
- }
+ } /*lint !e788 All appropriate cases are covered */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -3539,7 +3535,7 @@ H5D_get_offset(const H5D_t *dset)
#ifdef NDEBUG
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "unknown dataset layout type")
#endif /* NDEBUG */
- }
+ } /*lint !e788 All appropriate cases are covered */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -3574,14 +3570,14 @@ done:
* Operation information:
* H5D_operator_t is defined as:
* typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id,
- * hsize_t ndim, hssize_t *point, void *operator_data);
+ * unsigned ndim, const hsize_t *point, void *operator_data);
*
* H5D_operator_t parameters:
* void *elem; IN/OUT: Pointer to the element in memory containing
* the current point.
* hid_t type_id; IN: Datatype ID for the elements stored in ELEM.
- * hsize_t ndim; IN: Number of dimensions for POINT array
- * hssize_t *point; IN: Array containing the location of the element
+ * unsigned ndim; IN: Number of dimensions for POINT array
+ * const hsize_t *point; IN: Array containing the location of the element
* within the original dataspace.
* void *operator_data; IN/OUT: Pointer to any user-defined data
* associated with the operation.
@@ -3753,7 +3749,7 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t *point, void *op_data)
+H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data)
{
H5D_vlen_bufsize_t *vlen_bufsize=(H5D_vlen_bufsize_t *)op_data;
H5T_t *dt = NULL;
@@ -3773,7 +3769,7 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, hsize_t UNUSED ndim, hss
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't resize tbuf")
/* Select point to read in */
- if (H5Sselect_elements(vlen_bufsize->fspace_id,H5S_SELECT_SET,1,(const hssize_t **)point)<0)
+ if (H5Sselect_elements(vlen_bufsize->fspace_id,H5S_SELECT_SET,1,(const hsize_t **)point)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't select point")
/* Read in the point (with the custom VL memory allocator) */
@@ -4075,7 +4071,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_flush(H5F_t *f, hid_t dxpl_id, unsigned flags)
+H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags)
{
int num_dsets; /* Number of datasets in file */
hid_t *id_list=NULL; /* list of dataset IDs */
@@ -4140,7 +4136,7 @@ H5D_flush(H5F_t *f, hid_t dxpl_id, unsigned flags)
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
}
} /* end if */