summaryrefslogtreecommitdiffstats
path: root/hl/tools/h5watch/extend_dset.c
diff options
context:
space:
mode:
Diffstat (limited to 'hl/tools/h5watch/extend_dset.c')
-rw-r--r--hl/tools/h5watch/extend_dset.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c
index 97abbc6..59c5eb7 100644
--- a/hl/tools/h5watch/extend_dset.c
+++ b/hl/tools/h5watch/extend_dset.c
@@ -85,9 +85,9 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
set_t *cbuf = NULL; /* buffer for storing retrieved elements (compound) */
/* Allocate memory */
- if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int))))
+ if (NULL == (ibuf = (int *)calloc(TEST_BUF_SIZE, sizeof(int))))
goto error;
- if (NULL == (cbuf = (set_t *)HDcalloc(TEST_BUF_SIZE, sizeof(set_t))))
+ if (NULL == (cbuf = (set_t *)calloc(TEST_BUF_SIZE, sizeof(set_t))))
goto error;
/* Create a copy of file access property list */
@@ -148,7 +148,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
/* Compound type */
if (!HDstrcmp(dname, DSET_CMPD_TWO)) {
- HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
for (i = 0; i < num_elmts; i++) {
cbuf[i].field1 = action1;
cbuf[i].field2.a = action1;
@@ -166,7 +166,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
goto error;
}
else { /* Integer type */
- HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
for (i = 0; i < num_elmts; i++)
ibuf[i] = action1;
@@ -189,9 +189,9 @@ extend_dset_two(const char *file, char *dname, int action1, int action2)
goto error;
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return SUCCEED;
@@ -204,9 +204,9 @@ error:
H5E_END_TRY
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return FAIL;
@@ -239,9 +239,9 @@ extend_dset_one(const char *file, char *dname, int action)
set_t *cbuf = NULL; /* buffer for storing retrieved elements (compound) */
/* Allocate memory */
- if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int))))
+ if (NULL == (ibuf = (int *)calloc(TEST_BUF_SIZE, sizeof(int))))
goto error;
- if (NULL == (cbuf = (set_t *)HDcalloc(TEST_BUF_SIZE, sizeof(set_t))))
+ if (NULL == (cbuf = (set_t *)calloc(TEST_BUF_SIZE, sizeof(set_t))))
goto error;
/* Create a copy of file access property list */
@@ -307,7 +307,7 @@ extend_dset_one(const char *file, char *dname, int action)
/* Compound type */
if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
- HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
for (i = 0; i < action; i++) {
cbuf[i].field1 = i + 1;
cbuf[i].field2.a = i + 2;
@@ -328,7 +328,7 @@ extend_dset_one(const char *file, char *dname, int action)
}
else { /* Integer type */
- HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(ibuf, 0, TEST_BUF_SIZE * sizeof(int));
for (i = 0; i < action; i++)
ibuf[i] = (int)i;
@@ -358,9 +358,9 @@ extend_dset_one(const char *file, char *dname, int action)
goto error;
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return SUCCEED;
@@ -375,9 +375,9 @@ error:
H5E_END_TRY
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
return FAIL;
} /* end extend_dset_one() */
@@ -398,15 +398,15 @@ main(int argc, char *argv[])
int action1, action2;
if (argc != 5) {
- HDfprintf(stderr, "Should have file name, dataset name, and the extended amount...\n");
+ fprintf(stderr, "Should have file name, dataset name, and the extended amount...\n");
goto error;
} /* end if */
/* Get the dataset name to be extended */
fname = HDstrdup(argv[1]);
dname = HDstrdup(argv[2]);
- action1 = HDatoi(argv[3]);
- action2 = HDatoi(argv[4]);
+ action1 = atoi(argv[3]);
+ action2 = atoi(argv[4]);
if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
if (extend_dset_one(fname, dname, action1) < 0)
@@ -422,16 +422,16 @@ main(int argc, char *argv[])
goto error;
}
else {
- HDfprintf(stdout, "Dataset cannot be extended...\n");
+ fprintf(stdout, "Dataset cannot be extended...\n");
goto error;
} /* end if-else */
- HDexit(EXIT_SUCCESS);
+ exit(EXIT_SUCCESS);
error:
if (dname)
- HDfree(dname);
+ free(dname);
if (fname)
- HDfree(fname);
- HDexit(EXIT_FAILURE);
+ free(fname);
+ exit(EXIT_FAILURE);
} /* end main() */