summaryrefslogtreecommitdiffstats
path: root/hl/test/test_ds.c
diff options
context:
space:
mode:
authorQuincey Koziol <quincey@koziol.cc>2016-09-27 17:29:16 (GMT)
committerQuincey Koziol <quincey@koziol.cc>2016-09-27 17:29:16 (GMT)
commitfa66428a6dd3e9250497618afa6402008c7ed409 (patch)
tree33d2e0c499f90fbd137607a01ae35d9058d058a3 /hl/test/test_ds.c
parent6d5ee49ff3a33b30b9a7baf0af4f1929ad8d3b72 (diff)
downloadhdf5-fa66428a6dd3e9250497618afa6402008c7ed409.zip
hdf5-fa66428a6dd3e9250497618afa6402008c7ed409.tar.gz
hdf5-fa66428a6dd3e9250497618afa6402008c7ed409.tar.bz2
Description:
Further warning cleanups: from 667 warnings to 503.
Diffstat (limited to 'hl/test/test_ds.c')
-rw-r--r--hl/test/test_ds.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 47929e6..3ca1e4d 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -389,7 +389,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
int rank = 4;
int rankds = 1;
hsize_t dims[4] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE,DIM4_SIZE};
- long buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE*DIM4_SIZE];
+ long *buf;
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE};
@@ -409,6 +409,10 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
long s43_wbuf[DIM4_SIZE] = {180,180};
long s44_wbuf[DIM4_SIZE] = {280,280};
+ /* Allocate buffer */
+ buf = (long *)HDmalloc(sizeof(long) * DIM1_SIZE * DIM2_SIZE * DIM3_SIZE * DIM4_SIZE);
+ HDassert(buf);
+
/* make a dataset */
if(H5LTmake_dataset_long(fid, dsname, rank, dims, buf) >= 0) {
if(fulldims==0) {
@@ -444,6 +448,9 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
}
else
return FAIL;
+
+ HDfree(buf);
+
return SUCCEED;
}