summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2016-12-15 23:01:20 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2016-12-15 23:01:20 (GMT)
commit54f7af58851b777e61ecad5e7f5c6e0b468cd665 (patch)
treebee95cff0edf88d0b38c0e7ce42accf172afa5fd
parent6258b7082da7bbc6bad891a886c478bb5b14e049 (diff)
downloadhdf5-54f7af58851b777e61ecad5e7f5c6e0b468cd665.zip
hdf5-54f7af58851b777e61ecad5e7f5c6e0b468cd665.tar.gz
hdf5-54f7af58851b777e61ecad5e7f5c6e0b468cd665.tar.bz2
Fix bugs in h5dsm_dset_r1m.c
-rw-r--r--examples/h5dsm_dset_r1m.c10
-rw-r--r--examples/h5dsm_dset_w1m.c2
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 */