summaryrefslogtreecommitdiffstats
path: root/src/debug.c
diff options
context:
space:
mode:
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);
}