diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-09-06 17:36:26 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-09-06 17:36:26 (GMT) |
commit | 0b070ae114172588756d2c8732ccb7c89eb08ab6 (patch) | |
tree | bc63dbf62358e0f49460c59bf77e32a031045d3c /tools/h5jam | |
parent | a57f039a6aae04b8f91955e92ddbaa74cc78fc2b (diff) | |
download | hdf5-0b070ae114172588756d2c8732ccb7c89eb08ab6.zip hdf5-0b070ae114172588756d2c8732ccb7c89eb08ab6.tar.gz hdf5-0b070ae114172588756d2c8732ccb7c89eb08ab6.tar.bz2 |
HDFFV-10282 refactor out assert calls in tools
Diffstat (limited to 'tools/h5jam')
-rw-r--r-- | tools/h5jam/h5jam.c | 10 | ||||
-rw-r--r-- | tools/h5jam/h5unjam.c | 48 |
2 files changed, 29 insertions, 29 deletions
diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index b15a18f..269ca89 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -76,13 +76,13 @@ usage (const char *prog) HDfprintf (stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n"); HDfprintf (stdout, "\n"); - HDfprintf (stdout, + HDfprintf (stdout, "OPTIONS\n"); - HDfprintf (stdout, + HDfprintf (stdout, " -i in_file.h5 Specifies the input HDF5 file.\n"); - HDfprintf (stdout, + HDfprintf (stdout, " -u in_user_file Specifies the file to be inserted into the user block.\n"); - HDfprintf (stdout, + HDfprintf (stdout, " Can be any file format except an HDF5 format.\n"); HDfprintf (stdout, " -o out_file.h5 Specifies the output HDF5 file.\n"); @@ -389,7 +389,7 @@ main (int argc, const char *argv[]) HDfree (input_file); if(output_file) HDfree (output_file); - + if(ufid >= 0) HDclose (ufid); if(h5fid >= 0) diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 8f6b686..4cc0c70 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) { @@ -305,7 +305,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 +323,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 +374,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 +396,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: |