summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5jam/h5jam.c46
-rw-r--r--tools/h5jam/h5unjam.c16
-rw-r--r--tools/lib/h5diff.c5
-rw-r--r--tools/lib/h5diff_array.c12
-rw-r--r--tools/lib/h5diff_attr.c4
-rw-r--r--tools/lib/h5diff_dset.c5
-rw-r--r--tools/lib/h5diff_util.c5
7 files changed, 40 insertions, 53 deletions
diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c
index 17b1384..d6d3d8f 100644
--- a/tools/h5jam/h5jam.c
+++ b/tools/h5jam/h5jam.c
@@ -238,41 +238,33 @@ main (int argc, const char *argv[])
exit (EXIT_FAILURE);
}
- H5Pclose (plist);
- H5Fclose (ifile);
+ H5Pclose(plist);
+ H5Fclose(ifile);
- ufid = HDopen (ub_file, O_RDONLY, 0);
-
- if (ufid < 0)
- {
+ ufid = HDopen(ub_file, O_RDONLY, 0);
+ if(ufid < 0) {
error_msg("unable to open user block file \"%s\"\n",
ub_file);
exit (EXIT_FAILURE);
}
- res = stat (ub_file, &sbuf);
-
- if (res < 0)
- {
+ res = HDfstat(ufid, &sbuf);
+ if(res < 0) {
error_msg("Can't stat file \"%s\"\n", ub_file);
exit (EXIT_FAILURE);
}
fsize = sbuf.st_size;
- h5fid = HDopen (input_file, O_RDONLY, 0);
-
- if (h5fid < 0)
- {
+ h5fid = HDopen(input_file, O_RDONLY, 0);
+ if(h5fid < 0) {
error_msg("unable to open HDF5 file for read \"%s\"\n",
input_file);
exit (EXIT_FAILURE);
}
- res = stat (input_file, &sbuf2);
-
- if (res < 0)
- {
+ res = HDfstat(h5fid, &sbuf2);
+ if(res < 0) {
error_msg("Can't stat file \"%s\"\n", input_file);
exit (EXIT_FAILURE);
}
@@ -396,19 +388,15 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout,
ssize_t toend;
ssize_t fromend;
- if (startin > startout)
- {
+ if(startin > startout) {
/* this case is prohibited */
error_msg("copy_some_to_file: panic: startin > startout?\n");
exit (EXIT_FAILURE);
}
- if (limit < 0)
- {
- res = fstat (infid, &sbuf);
-
- if (res < 0)
- {
+ if(limit < 0) {
+ res = HDfstat(infid, &sbuf);
+ if(res < 0) {
error_msg("Can't stat file \n");
exit (EXIT_FAILURE);
}
@@ -416,14 +404,10 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout,
howmuch = sbuf.st_size;
}
else
- {
howmuch = limit;
- }
- if (howmuch == 0)
- {
+ if(howmuch == 0)
return 0;
- }
/* assert (howmuch > 0) */
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c
index 8e31ce1..fd79e1a 100644
--- a/tools/h5jam/h5unjam.c
+++ b/tools/h5jam/h5unjam.c
@@ -221,22 +221,20 @@ main(int argc, const char *argv[])
}
- res = stat(input_file, &sbuf);
+ ifid = HDopen(input_file,O_RDONLY,0);
+ if(ifid < 0) {
+ error_msg("unable to open input HDF5 file \"%s\"\n", input_file);
+ exit(EXIT_FAILURE);
+ }
- if (res < 0) {
+ res = HDfstat(ifid, &sbuf);
+ if(res < 0) {
error_msg("Can't stat file \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
fsize = sbuf.st_size;
- ifid = HDopen(input_file,O_RDONLY,0);
-
- if (ifid < 0) {
- error_msg("unable to open input HDF5 file \"%s\"\n", input_file);
- exit(EXIT_FAILURE);
- }
-
if (do_delete && (ub_file != NULL)) {
error_msg("??\"%s\"\n", ub_file);
exit(EXIT_FAILURE);
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 640a20a..5f406cf 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -14,11 +14,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <stdlib.h>
+
#include "H5private.h"
-#include "h5diff.h"
-#include "ph5diff.h"
#include "h5tools.h"
#include "h5tools_utils.h"
+#include "h5diff.h"
+#include "ph5diff.h"
/*
* Debug printf macros. The prefix allows output filtering by test scripts.
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 105462f..c889282 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -14,15 +14,15 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <math.h>
-#include "h5diff.h"
-#include "ph5diff.h"
-#include "H5private.h"
-#include "h5tools.h"
-
-
#include <sys/timeb.h>
#include <time.h>
+#include "H5private.h"
+#include "h5tools.h"
+#include "h5tools_utils.h"
+#include "h5diff.h"
+#include "ph5diff.h"
+
/*-------------------------------------------------------------------------
* printf formatting
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index ad6f45b..7e5fb04 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -13,9 +13,11 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include "H5private.h"
#include "h5tools.h"
+#include "h5tools_utils.h"
#include "h5diff.h"
-#include "H5private.h"
+
/*-------------------------------------------------------------------------
* Function: diff_attr
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index 0f482b6..f8fc493 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -13,10 +13,11 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include "h5diff.h"
-#include "ph5diff.h"
#include "H5private.h"
#include "h5tools.h"
+#include "h5tools_utils.h"
+#include "h5diff.h"
+#include "ph5diff.h"
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 5df94fa..6d340d9 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -13,10 +13,11 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include "h5diff.h"
-#include "ph5diff.h"
#include "H5private.h"
#include "h5tools.h"
+#include "h5tools_utils.h"
+#include "h5diff.h"
+#include "ph5diff.h"
/* global variables */