summaryrefslogtreecommitdiffstats
path: root/tools/h5jam
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-08-19 21:16:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-08-19 21:16:28 (GMT)
commit525caddd9e0460b2f39d043f04dabc7ab6a1bf3a (patch)
tree176f2be3724d8160e67de97df457988a27aa2257 /tools/h5jam
parentd221d97f992d66540d39b0dfdca80b37849a7dd6 (diff)
downloadhdf5-525caddd9e0460b2f39d043f04dabc7ab6a1bf3a.zip
hdf5-525caddd9e0460b2f39d043f04dabc7ab6a1bf3a.tar.gz
hdf5-525caddd9e0460b2f39d043f04dabc7ab6a1bf3a.tar.bz2
[svn-r19254] Description:
Bring r19252 & 19253 from trunk to 1.8 branch: Bring Coverity changes from branch to trunk: r19161: Fixed the part for matching the subset info with dataset r19189: BZ1646: h5dump does not check number of dimensions for subsetting parameters against the dataset Changed subset_t structure from holding hsize_t pointers to holding new subset_d pointers, which hold the original hsize_t pointer + len. this len is then checked against dataset ndims in the handle_dataset function of h5dump. Changed all references to use new data structure. Added tests for each subset parameter. r19190: Added new h5dump ddl files Tested on: Mac OS X/32 10.6.4 (amazon) w/debug & production (h5committested on Coverity branch)
Diffstat (limited to 'tools/h5jam')
-rw-r--r--tools/h5jam/getub.c10
-rw-r--r--tools/h5jam/h5jam.c28
-rw-r--r--tools/h5jam/h5unjam.c28
-rw-r--r--tools/h5jam/tellub.c12
4 files changed, 39 insertions, 39 deletions
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index 7468db2..293aa17 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -97,7 +97,7 @@ parse_command_line (int argc, const char *argv[])
if (argc <= opt_ind)
{
- error_msg (h5tools_getprogname(), "missing file name\n");
+ error_msg("missing file name\n");
usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
@@ -120,13 +120,13 @@ main (int argc, const char *argv[])
if (nbytes == NULL)
{
/* missing arg */
- error_msg (h5tools_getprogname(), "missing size\n");
+ error_msg("missing size\n");
usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
if (argc <= (opt_ind))
{
- error_msg (h5tools_getprogname(), "missing file name\n");
+ error_msg("missing file name\n");
usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
@@ -137,7 +137,7 @@ main (int argc, const char *argv[])
if (res == EOF)
{
/* fail */
- error_msg (h5tools_getprogname(), "missing file name\n");
+ error_msg("missing file name\n");
usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
@@ -145,7 +145,7 @@ main (int argc, const char *argv[])
fd = HDopen (filename, O_RDONLY, 0);
if (fd < 0)
{
- error_msg (h5tools_getprogname(), "can't open file %s\n", filename);
+ error_msg("can't open file %s\n", filename);
exit (EXIT_FAILURE);
}
diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c
index 6fdd744..17b1384 100644
--- a/tools/h5jam/h5jam.c
+++ b/tools/h5jam/h5jam.c
@@ -193,7 +193,7 @@ main (int argc, const char *argv[])
if (ub_file == NULL)
{
/* no user block */
- error_msg (h5tools_getprogname(), "no user block file name\n");
+ error_msg("no user block file name\n");
usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
@@ -201,7 +201,7 @@ main (int argc, const char *argv[])
if (input_file == NULL)
{
/* no user block */
- error_msg (h5tools_getprogname(), "no HDF5 file\n");
+ error_msg("no HDF5 file\n");
usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
@@ -210,7 +210,7 @@ main (int argc, const char *argv[])
if (testval <= 0)
{
- error_msg (h5tools_getprogname(), "Input HDF5 file is not HDF \"%s\"\n", input_file);
+ error_msg("Input HDF5 file is not HDF \"%s\"\n", input_file);
exit (EXIT_FAILURE);
}
@@ -218,14 +218,14 @@ main (int argc, const char *argv[])
if (ifile < 0)
{
- error_msg (h5tools_getprogname(), "Can't open input HDF5 file \"%s\"\n", input_file);
+ error_msg("Can't open input HDF5 file \"%s\"\n", input_file);
exit (EXIT_FAILURE);
}
plist = H5Fget_create_plist (ifile);
if (plist < 0)
{
- error_msg (h5tools_getprogname(), "Can't get file creation plist for file \"%s\"\n",
+ error_msg("Can't get file creation plist for file \"%s\"\n",
input_file);
exit (EXIT_FAILURE);
}
@@ -233,7 +233,7 @@ main (int argc, const char *argv[])
status = H5Pget_userblock (plist, &usize);
if (status < 0)
{
- error_msg (h5tools_getprogname(), "Can't get user block for file \"%s\"\n",
+ error_msg("Can't get user block for file \"%s\"\n",
input_file);
exit (EXIT_FAILURE);
}
@@ -245,7 +245,7 @@ main (int argc, const char *argv[])
if (ufid < 0)
{
- error_msg (h5tools_getprogname(), "unable to open user block file \"%s\"\n",
+ error_msg("unable to open user block file \"%s\"\n",
ub_file);
exit (EXIT_FAILURE);
}
@@ -254,7 +254,7 @@ main (int argc, const char *argv[])
if (res < 0)
{
- error_msg (h5tools_getprogname(), "Can't stat file \"%s\"\n", ub_file);
+ error_msg("Can't stat file \"%s\"\n", ub_file);
exit (EXIT_FAILURE);
}
@@ -264,7 +264,7 @@ main (int argc, const char *argv[])
if (h5fid < 0)
{
- error_msg (h5tools_getprogname(), "unable to open HDF5 file for read \"%s\"\n",
+ error_msg("unable to open HDF5 file for read \"%s\"\n",
input_file);
exit (EXIT_FAILURE);
}
@@ -273,7 +273,7 @@ main (int argc, const char *argv[])
if (res < 0)
{
- error_msg (h5tools_getprogname(), "Can't stat file \"%s\"\n", input_file);
+ error_msg("Can't stat file \"%s\"\n", input_file);
exit (EXIT_FAILURE);
}
@@ -285,7 +285,7 @@ main (int argc, const char *argv[])
if (ofid < 0)
{
- error_msg (h5tools_getprogname(), "unable to open output file \"%s\"\n",
+ error_msg("unable to open output file \"%s\"\n",
output_file);
exit (EXIT_FAILURE);
}
@@ -296,7 +296,7 @@ main (int argc, const char *argv[])
if (ofid < 0)
{
- error_msg (h5tools_getprogname(), "unable to create output file \"%s\"\n",
+ error_msg("unable to create output file \"%s\"\n",
output_file);
exit (EXIT_FAILURE);
}
@@ -399,7 +399,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout,
if (startin > startout)
{
/* this case is prohibited */
- error_msg (h5tools_getprogname(), "copy_some_to_file: panic: startin > startout?\n");
+ error_msg("copy_some_to_file: panic: startin > startout?\n");
exit (EXIT_FAILURE);
}
@@ -409,7 +409,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout,
if (res < 0)
{
- error_msg (h5tools_getprogname(), "Can't stat file \n");
+ error_msg("Can't stat file \n");
exit (EXIT_FAILURE);
}
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c
index a69fd45..8e31ce1 100644
--- a/tools/h5jam/h5unjam.c
+++ b/tools/h5jam/h5unjam.c
@@ -141,7 +141,7 @@ parse_command_line(int argc, const char *argv[])
/* check for file name to be processed */
/*
if (argc <= opt_ind+2) {
- error_msg(h5tools_getprogname(), "missing file name\n");
+ error_msg("missing file name\n");
usage(h5tools_getprogname());
exit(EXIT_FAILURE);
}
@@ -191,32 +191,32 @@ main(int argc, const char *argv[])
testval = H5Fis_hdf5(input_file);
if (testval <= 0) {
- error_msg(h5tools_getprogname(), "Input HDF5 file is not HDF \"%s\"\n", input_file);
+ error_msg("Input HDF5 file is not HDF \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
ifile = H5Fopen(input_file, H5F_ACC_RDONLY , H5P_DEFAULT);
if (ifile < 0) {
- error_msg(h5tools_getprogname(), "Can't open input HDF5 file \"%s\"\n", input_file);
+ error_msg("Can't open input HDF5 file \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
plist = H5Fget_create_plist(ifile);
if (plist < 0) {
- error_msg(h5tools_getprogname(), "Can't get file creation plist for file \"%s\"\n", input_file);
+ error_msg("Can't get file creation plist for file \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
status = H5Pget_userblock(plist, & usize );
if (status < 0) {
- error_msg(h5tools_getprogname(), "Can't get user block for file \"%s\"\n", input_file);
+ error_msg("Can't get user block for file \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
if (usize == 0) {
/* no user block to remove: message? */
- error_msg(h5tools_getprogname(), "\"%s\" has no user block: no change to file\n", input_file);
+ error_msg("\"%s\" has no user block: no change to file\n", input_file);
exit(EXIT_SUCCESS);
}
@@ -224,7 +224,7 @@ main(int argc, const char *argv[])
res = stat(input_file, &sbuf);
if (res < 0) {
- error_msg(h5tools_getprogname(), "Can't stat file \"%s\"\n", input_file);
+ error_msg("Can't stat file \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
@@ -233,12 +233,12 @@ main(int argc, const char *argv[])
ifid = HDopen(input_file,O_RDONLY,0);
if (ifid < 0) {
- error_msg(h5tools_getprogname(), "unable to open input HDF5 file \"%s\"\n", input_file);
+ error_msg("unable to open input HDF5 file \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
if (do_delete && (ub_file != NULL)) {
- error_msg(h5tools_getprogname(), "??\"%s\"\n", ub_file);
+ error_msg("??\"%s\"\n", ub_file);
exit(EXIT_FAILURE);
}
@@ -249,7 +249,7 @@ main(int argc, const char *argv[])
ufid = HDopen(ub_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 );
if (ufid < 0) {
- error_msg(h5tools_getprogname(), "unable to open user block file for output\"%s\"\n", ub_file);
+ error_msg("unable to open user block file for output\"%s\"\n", ub_file);
exit(EXIT_FAILURE);
}
}
@@ -258,14 +258,14 @@ main(int argc, const char *argv[])
h5fid = HDopen(input_file,O_WRONLY, 0);
if (h5fid < 0) {
- error_msg(h5tools_getprogname(), "unable to open output HDF5 file \"%s\"\n", input_file);
+ error_msg("unable to open output HDF5 file \"%s\"\n", input_file);
exit(EXIT_FAILURE);
}
} else {
h5fid = HDopen(output_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 );
if (h5fid < 0) {
- error_msg(h5tools_getprogname(), "unable to open output HDF5 file \"%s\"\n", output_file);
+ error_msg("unable to open output HDF5 file \"%s\"\n", output_file);
exit(EXIT_FAILURE);
}
}
@@ -274,7 +274,7 @@ main(int argc, const char *argv[])
/* copy from 0 to 'usize - 1' into ufid */
if (!do_delete) {
if(copy_to_file(ifid, ufid, 0, (ssize_t) usize) < 0) {
- error_msg(h5tools_getprogname(), "unable to copy user block to output file \"%s\"\n", ub_file);
+ error_msg("unable to copy user block to output file \"%s\"\n", ub_file);
exit(EXIT_FAILURE);
}
}
@@ -283,7 +283,7 @@ main(int argc, const char *argv[])
* starting at end of user block if present
*/
if(copy_to_file(ifid, h5fid, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize)) < 0) {
- error_msg(h5tools_getprogname(), "unable to copy hdf5 data to output file \"%s\"\n", output_file);
+ error_msg("unable to copy hdf5 data to output file \"%s\"\n", output_file);
exit(EXIT_FAILURE);
}
diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c
index 450759f..f1b6756 100644
--- a/tools/h5jam/tellub.c
+++ b/tools/h5jam/tellub.c
@@ -104,7 +104,7 @@ parse_command_line (int argc, const char *argv[])
/* check for file name to be processed */
if (argc <= opt_ind)
{
- error_msg (h5tools_getprogname(), "missing file name\n");
+ error_msg("missing file name\n");
usage (h5tools_getprogname());
exit (EXIT_FAILURE);
}
@@ -147,7 +147,7 @@ main (int argc, const char *argv[])
if (argc <= (opt_ind))
{
- error_msg (h5tools_getprogname(), "missing file name\n");
+ error_msg("missing file name\n");
usage (h5tools_getprogname());
return (EXIT_FAILURE);
}
@@ -158,7 +158,7 @@ main (int argc, const char *argv[])
if (testval <= 0)
{
- error_msg (h5tools_getprogname(), "Input HDF5 file is not HDF \"%s\"\n", ifname);
+ error_msg("Input HDF5 file is not HDF \"%s\"\n", ifname);
return (EXIT_FAILURE);
}
@@ -166,14 +166,14 @@ main (int argc, const char *argv[])
if (ifile < 0)
{
- error_msg (h5tools_getprogname(), "Can't open input HDF5 file \"%s\"\n", ifname);
+ error_msg("Can't open input HDF5 file \"%s\"\n", ifname);
return (EXIT_FAILURE);
}
plist = H5Fget_create_plist (ifile);
if (plist < 0)
{
- error_msg (h5tools_getprogname(), "Can't get file creation plist for file \"%s\"\n",
+ error_msg("Can't get file creation plist for file \"%s\"\n",
ifname);
return (EXIT_FAILURE);
}
@@ -181,7 +181,7 @@ main (int argc, const char *argv[])
status = H5Pget_userblock (plist, &usize);
if (status < 0)
{
- error_msg (h5tools_getprogname(), "Can't get user block for file \"%s\"\n", ifname);
+ error_msg("Can't get user block for file \"%s\"\n", ifname);
return (EXIT_FAILURE);
}