summaryrefslogtreecommitdiffstats
path: root/src/debug.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-09-02 15:38:26 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-09-02 15:38:26 (GMT)
commit9d41d3679e1b5d0bb430a7374bb458656e127f15 (patch)
tree2b2a22546f93a839e5b1c9b63e7d36251bb0bb24 /src/debug.c
parent07dacb9486230fe2522efca266ab06f4558527c3 (diff)
downloadhdf5-9d41d3679e1b5d0bb430a7374bb458656e127f15.zip
hdf5-9d41d3679e1b5d0bb430a7374bb458656e127f15.tar.gz
hdf5-9d41d3679e1b5d0bb430a7374bb458656e127f15.tar.bz2
[svn-r61] ./src/H5.c
Changed atexit() to HDatexit(). ./src/H5AC.c Changed qsort() to HDqsort(). ./src/H5B.c Changed memcmp() to HDmemcmp(). ./src/H5E.c ./src/H5M.c Added parentheses around indirect function calls so that checkposix doesn't complain and to advertise that it's an indirect function call. ./src/H5F.c ./src/H5G.c Added errors field to each function prologue to test the script mentioned above. ./src/H5H.c Changed fputc() to HDfputc(). ./src/H5MM.c ./src/H5MMprivate.h The argument for H5MM_xfree() is a pointer to a constant even though the argument to free() isn't. This reduces the number of warnings in other parts of the code but creates a new warning in this file. ./src/H5O.c Plugged a few memory leaks that happen during error handling. ./src/H5Oname.c ./src/debug.c Added `HD' to the beginning of some posix functions.
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/debug.c b/src/debug.c
index b21a0c8..e6a0740 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -58,10 +58,10 @@ main (int argc, char *argv[])
*/
if (argc>2) {
printf ("New address: %s\n", argv[2]);
- addr = strtol (argv[2], NULL, 0);
+ addr = HDstrtol (argv[2], NULL, 0);
}
if (argc>3) {
- extra = strtol (argv[3], NULL, 0);
+ extra = HDstrtol (argv[3], NULL, 0);
}
/*
@@ -69,11 +69,11 @@ main (int argc, char *argv[])
*/
if ((fid = H5Fopen (argv[1], 0, 0))<0) {
fprintf (stderr, "cannot open file\n");
- exit (1);
+ HDexit (1);
}
if (NULL==(f=H5Aatom_object (fid))) {
fprintf (stderr, "cannot obtain hdf5_file_t pointer\n");
- exit (2);
+ HDexit (2);
}
/*
@@ -82,28 +82,28 @@ main (int argc, char *argv[])
printf ("Reading signature at byte %lu\n", (unsigned long)addr);
if (H5F_block_read (f, addr, sizeof(sig), sig)<0) {
fprintf (stderr, "cannot read signature\n");
- exit (3);
+ HDexit (3);
}
- if (!memcmp (sig, H5F_SIGNATURE, H5F_SIGNATURE_LEN)) {
+ if (!HDmemcmp (sig, H5F_SIGNATURE, H5F_SIGNATURE_LEN)) {
/*
* Debug the boot block.
*/
status = H5F_debug (f, 0, stdout, 0, VCOL);
- } else if (!memcmp (sig, H5H_MAGIC, H5H_SIZEOF_MAGIC)) {
+ } else if (!HDmemcmp (sig, H5H_MAGIC, H5H_SIZEOF_MAGIC)) {
/*
* Debug a heap.
*/
status = H5H_debug (f, addr, stdout, 0, VCOL);
- } else if (!memcmp (sig, H5G_NODE_MAGIC, H5G_NODE_SIZEOF_MAGIC)) {
+ } else if (!HDmemcmp (sig, H5G_NODE_MAGIC, H5G_NODE_SIZEOF_MAGIC)) {
/*
* Debug a symbol table node.
*/
status = H5G_node_debug (f, addr, stdout, 0, VCOL, extra);
- } else if (!memcmp (sig, H5B_MAGIC, H5B_SIZEOF_MAGIC)) {
+ } else if (!HDmemcmp (sig, H5B_MAGIC, H5B_SIZEOF_MAGIC)) {
/*
* Debug a B-tree. B-trees are debugged through the B-tree
* subclass. The subclass identifier is the byte immediately
@@ -117,7 +117,7 @@ main (int argc, char *argv[])
default:
fprintf (stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
- exit (4);
+ HDexit (4);
}
} else if (sig[0]==H5O_VERSION && sig[1]==H5O_ALIGNMENT) {
@@ -134,25 +134,25 @@ main (int argc, char *argv[])
printf ("%-*s ", VCOL, "Signature:");
for (i=0; i<8; i++) {
if (sig[i]>' ' && sig[i]<='~' && '\\'!=sig[i]) {
- putchar (sig[i]);
+ HDputchar (sig[i]);
} else if ('\\'==sig[i]) {
- putchar ('\\');
- putchar ('\\');
+ HDputchar ('\\');
+ HDputchar ('\\');
} else {
printf ("\\%03o", sig[i]);
}
}
- putchar ('\n');
+ HDputchar ('\n');
fprintf (stderr, "unknown signature\n");
- exit (4);
+ HDexit (4);
}
if (status<0) {
fprintf (stderr, "An error occurred\n");
- exit (5);
+ HDexit (5);
}
H5Fclose (fid);
- exit (0);
+ HDexit (0);
}