summaryrefslogtreecommitdiffstats
path: root/tools/h5ls
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /tools/h5ls
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'tools/h5ls')
-rw-r--r--tools/h5ls/h5ls.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 1514ca6..9ddabab 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -80,7 +80,7 @@ static char *fix_name(const char *path, const char *base);
hid_t thefile;
char *prefix;
-char *progname;
+const char *progname="h5ls";
int d_status;
@@ -99,7 +99,7 @@ int d_status;
*-------------------------------------------------------------------------
*/
static void
-usage (const char *progname)
+usage (void)
{
fprintf(stderr, "\
usage: %s [OPTIONS] [OBJECTS...]\n\
@@ -1356,6 +1356,10 @@ list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data)
/* null dataspace */
puts(" null");
break;
+ default:
+ /* Unknown dataspace type */
+ puts(" unknown");
+ break;
}
/* Data type */
@@ -2022,7 +2026,6 @@ main (int argc, const char *argv[])
{
hid_t file=-1, root=-1;
char *fname=NULL, *oname=NULL, *x;
- const char *progname="h5ls";
const char *s = NULL;
char *rest, *container=NULL;
int argno;
@@ -2061,7 +2064,7 @@ main (int argc, const char *argv[])
argno++;
break;
} else if (!strcmp(argv[argno], "--help")) {
- usage(progname);
+ usage();
leave(0);
} else if (!strcmp(argv[argno], "--address")) {
address_g = TRUE;
@@ -2087,19 +2090,19 @@ main (int argc, const char *argv[])
} else if (!strncmp(argv[argno], "--width=", 8)) {
width_g = (int)strtol(argv[argno]+8, &rest, 0);
if (width_g<=0 || *rest) {
- usage(progname);
+ usage();
leave(1);
}
} else if (!strcmp(argv[argno], "--width")) {
if (argno+1>=argc) {
- usage(progname);
+ usage();
leave(1);
} else {
s = argv[++argno];
}
width_g = (int)strtol(s, &rest, 0);
if (width_g<=0 || *rest) {
- usage(progname);
+ usage();
leave(1);
}
} else if (!strcmp(argv[argno], "--verbose")) {
@@ -2113,14 +2116,14 @@ main (int argc, const char *argv[])
if (argv[argno][2]) {
s = argv[argno]+2;
} else if (argno+1>=argc) {
- usage(progname);
+ usage();
leave(1);
} else {
s = argv[++argno];
}
width_g = (int)strtol(s, &rest, 0);
if (width_g<=0 || *rest) {
- usage(progname);
+ usage();
leave(1);
}
} else if ('-'!=argv[argno][1]) {
@@ -2129,7 +2132,7 @@ main (int argc, const char *argv[])
switch (*s) {
case '?':
case 'h': /* --help */
- usage(progname);
+ usage();
leave(0);
case 'a': /* --address */
address_g = TRUE;
@@ -2169,12 +2172,12 @@ main (int argc, const char *argv[])
hexdump_g = TRUE;
break;
default:
- usage(progname);
+ usage();
leave(1);
}
}
} else {
- usage(progname);
+ usage();
leave(1);
}
}
@@ -2182,7 +2185,7 @@ main (int argc, const char *argv[])
/* If no arguments remain then print a usage message (instead of doing
* absolutely nothing ;-) */
if (argno>=argc) {
- usage(progname);
+ usage();
leave(1);
}