From 54f7af58851b777e61ecad5e7f5c6e0b468cd665 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 15 Dec 2016 17:01:20 -0600 Subject: Fix bugs in h5dsm_dset_r1m.c --- examples/h5dsm_dset_r1m.c | 10 +++++----- examples/h5dsm_dset_w1m.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/h5dsm_dset_r1m.c b/examples/h5dsm_dset_r1m.c index b6da505..89d8b38 100644 --- a/examples/h5dsm_dset_r1m.c +++ b/examples/h5dsm_dset_r1m.c @@ -7,7 +7,7 @@ int main(int argc, char *argv[]) { hid_t file = -1, dset = -1, trans = -1, fapl = -1; hid_t nfile = -1, ndset = -1; hsize_t dims[1] = {256 * 1024}; - int *buf = NULL, nbuf = NULL; + int *buf = NULL, *nbuf = NULL; int i; (void)MPI_Init(&argc, &argv); @@ -33,8 +33,8 @@ int main(int argc, char *argv[]) { if((file = H5Fopen_ff(argv[2], H5F_ACC_RDWR, fapl, &trans)) < 0) ERROR; - /* Create native file */ - if((file = H5Fopen(argv[2], H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + /* Open native file */ + if((nfile = H5Fopen(argv[2], H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERROR; /* Create dataset */ @@ -56,9 +56,9 @@ int main(int argc, char *argv[]) { if(H5Dread_ff(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf, trans) < 0) ERROR; - /* Write native data */ + /* Read native data */ printf("Reading native dataset\n"); - if(H5Dread(ndset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if(H5Dread(ndset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, nbuf) < 0) ERROR; /* Compare data */ diff --git a/examples/h5dsm_dset_w1m.c b/examples/h5dsm_dset_w1m.c index dbd568b..3ee1e11 100644 --- a/examples/h5dsm_dset_w1m.c +++ b/examples/h5dsm_dset_w1m.c @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) { ERROR; /* Create native file */ - if((file = H5Fcreate(argv[2], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((nfile = H5Fcreate(argv[2], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERROR; /* Set up dataspace */ -- cgit v0.12