summaryrefslogtreecommitdiffstats
path: root/tools/h5jam/h5unjam.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
commitb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (patch)
treec3429ee577e454526c8704d66a84f0c45b7959a1 /tools/h5jam/h5unjam.c
parent23a702e7bad93fc4f14eab07678c75d276e2d0ad (diff)
parent60f76980aab92f0e0730170b99a2363acd3c97fa (diff)
downloadhdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.zip
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.gz
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.bz2
Merge pull request #811 in HDFFV/hdf5 from hdf5_1_8_20 to 1.8/masterhdf5-1_8_20
* commit '60f76980aab92f0e0730170b99a2363acd3c97fa': (108 commits) Update version numbers and remove empty sections in RELEASE.txt. Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES. Update version for 1.8.20 release. Fixed documentation warnings HDFFV-10329 Correct LINK INTERFACE and VS20013 compile Switch default build mode from development to production. Increment version string to pre2. Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797) Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0) Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af) Fix linking of libs Changed file path to relative. iAdd NAG to supported compilers in RELEASE.txt. Add description to RELEASE.txt for HDFFV-10323 Correct issue number Set version to 1.8.20-pre1 Update supported and tested platforms in RELEASE.txt. HDFFV-10321 Merge from 1.8 Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. updated issues related to Fortran Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. ...
Diffstat (limited to 'tools/h5jam/h5unjam.c')
-rw-r--r--tools/h5jam/h5unjam.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c
index 8f6b686..9c83740 100644
--- a/tools/h5jam/h5unjam.c
+++ b/tools/h5jam/h5unjam.c
@@ -135,28 +135,28 @@ static int
parse_command_line(int argc, const char *argv[])
{
int opt = FALSE;
-
+
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch((char)opt) {
case 'o':
output_file = HDstrdup(opt_arg);
- if (output_file)
- h5tools_set_data_output_file(output_file, 1);
- break;
+ if (output_file)
+ h5tools_set_data_output_file(output_file, 1);
+ break;
case 'i':
input_file = HDstrdup(opt_arg);
- if (input_file)
- h5tools_set_input_file(input_file, 1);
- break;;
+ if (input_file)
+ h5tools_set_input_file(input_file, 1);
+ break;;
case 'u':
ub_file = HDstrdup(opt_arg);
- if (ub_file)
- h5tools_set_output_file(ub_file, 1);
- else
- rawoutstream = stdout;
+ if (ub_file)
+ h5tools_set_output_file(ub_file, 1);
+ else
+ rawoutstream = stdout;
break;
case 'd':
@@ -182,7 +182,7 @@ parse_command_line(int argc, const char *argv[])
}
return EXIT_SUCCESS;
-
+
done:
if(input_file)
HDfree(input_file);
@@ -242,7 +242,7 @@ main(int argc, const char *argv[])
h5tools_setstatus(EXIT_FAILURE);
goto done;
}
-
+
testval = H5Fis_hdf5(input_file);
if (testval <= 0) {
@@ -274,10 +274,8 @@ main(int argc, const char *argv[])
goto done;
}
- status = H5Pclose(plist);
- HDassert(status >= 0);
- status = H5Fclose(ifile);
- HDassert(status >= 0);
+ H5Pclose(plist);
+ H5Fclose(ifile);
if (usize == 0) {
/* no user block to remove: message? */
@@ -305,7 +303,7 @@ main(int argc, const char *argv[])
error_msg("unable to open output HDF5 file \"%s\"\n", input_file);
h5tools_setstatus(EXIT_FAILURE);
goto done;
- }
+ }
/* copy from 0 to 'usize - 1' into ufid */
if (!do_delete) {
@@ -323,18 +321,18 @@ main(int argc, const char *argv[])
h5tools_setstatus(EXIT_FAILURE);
goto done;
}
-
+
done:
if(input_file)
HDfree(input_file);
-
+
if(output_file)
HDfree(output_file);
-
+
if(ub_file) {
HDfree(ub_file);
}
-
+
h5tools_close();
return h5tools_getstatus();
@@ -374,7 +372,7 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much )
else
bytes_in = how_much;
- /* Seek to correct position in input file */
+ /* Seek to correct position in input file */
HDfseek(infid, from, SEEK_SET);
/* Read data to buffer */
@@ -396,11 +394,11 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much )
to += bytes_read;
/* Write nchars bytes to output file */
- bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid);
- if(bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */
- ret_value = -1;
- goto done;
- } /* end if */
+ bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid);
+ if(bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */
+ ret_value = -1;
+ goto done;
+ } /* end if */
} /* end while */
done: