summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 70d512c..28a3d2e 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -742,7 +742,6 @@ H5D_create(H5F_t *f, const char *name, const H5T_t *type, const H5P_t *space,
{
H5D_t *new_dset = NULL;
H5D_t *ret_value = NULL;
- size_t nbytes;
intn i;
FUNC_ENTER(H5D_create, NULL);
@@ -776,7 +775,6 @@ H5D_create(H5F_t *f, const char *name, const H5T_t *type, const H5P_t *space,
}
/* Total raw data size */
- nbytes = H5T_get_size(type) * H5P_get_npoints(space);
new_dset->layout.type = new_dset->create_parms.layout;
new_dset->layout.ndims = H5P_get_ndims(space) + 1;
assert(new_dset->layout.ndims <= NELMTS(new_dset->layout.dim));
@@ -1037,7 +1035,6 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
assert(buf);
if (!file_space) file_space = dataset->space;
if (!mem_space) mem_space = file_space;
- assert (H5P_get_npoints (mem_space)==H5P_get_npoints (file_space));
/*
* Convert data types to atoms because the conversion functions are
@@ -1069,6 +1066,10 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
} else {
HDmemset (&numbering, 0, sizeof numbering);
}
+ if (H5P_get_npoints (mem_space)!=H5P_get_npoints (file_space)) {
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,
+ "src and dest data spaces have different sizes");
+ }
/*
* Compute the size of the request and allocate scratch buffers.
@@ -1177,7 +1178,6 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
assert(buf);
if (!file_space) file_space = dataset->space;
if (!mem_space) mem_space = file_space;
- assert (H5P_get_npoints (mem_space)==H5P_get_npoints (file_space));
/*
* Convert data types to atoms because the conversion functions are
@@ -1209,6 +1209,10 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
} else {
HDmemset (&numbering, 0, sizeof numbering);
}
+ if (H5P_get_npoints (mem_space)!=H5P_get_npoints (file_space)) {
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,
+ "src and dest data spaces have different sizes");
+ }
/*
* Compute the size of the request and allocate scratch buffers.