summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2022-03-08 02:52:42 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2022-03-08 02:52:42 (GMT)
commite5cec21c8ea8bb5e708d1076dcfeb359ad3969b7 (patch)
treee347a2af7d9a43dd4fee24dc553b1098e2c93489 /hl/test
parent3107fafa2ce858b598617463334d3d6d01dc1e4c (diff)
downloadhdf5-e5cec21c8ea8bb5e708d1076dcfeb359ad3969b7.zip
hdf5-e5cec21c8ea8bb5e708d1076dcfeb359ad3969b7.tar.gz
hdf5-e5cec21c8ea8bb5e708d1076dcfeb359ad3969b7.tar.bz2
Phase one of removing the HD prefix: replace most `HD`-prefixed C99
function names with plain C99 names and poison the `HD`-prefixed versions.
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/gen_test_ds.c16
-rw-r--r--hl/test/gen_test_ld.c6
-rw-r--r--hl/test/h5hltest.h8
-rw-r--r--hl/test/test_ds.c472
-rw-r--r--hl/test/test_dset_append.c14
-rw-r--r--hl/test/test_file_image.c74
-rw-r--r--hl/test/test_h5do_compat.c10
-rw-r--r--hl/test/test_image.c158
-rw-r--r--hl/test/test_ld.c66
-rw-r--r--hl/test/test_lite.c192
-rw-r--r--hl/test/test_packet.c14
-rw-r--r--hl/test/test_packet_vlen.c118
-rw-r--r--hl/test/test_table.c56
13 files changed, 602 insertions, 602 deletions
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index d7a9f44..884c987 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -80,12 +80,12 @@ main(int argc, char **argv)
char filename[65];
if (argc < 2 || !argv[0] || !argv[1]) {
- HDprintf("Usage: gen_test [le | be]\n");
+ printf("Usage: gen_test [le | be]\n");
return 1;
}
if (argv[1] && (strcmp("le", argv[1]) != 0) && (strcmp("be", argv[1]) != 0)) {
- HDprintf("Usage: gen_test [le | be]\n");
+ printf("Usage: gen_test [le | be]\n");
return 1;
}
@@ -105,11 +105,11 @@ main(int argc, char **argv)
if (nerrors)
goto error;
- HDprintf("Dimension scales file generation passed.\n");
+ printf("Dimension scales file generation passed.\n");
return 0;
error:
- HDprintf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n", nerrors);
+ printf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n", nerrors);
return 1;
}
@@ -193,11 +193,11 @@ test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx)
if (H5DSis_attached(did, dsid, idx) == 0) {
if (H5DSattach_scale(did, dsid, idx) >= 0) {
if (H5DSis_attached(did, dsid, idx) > 0) {
- /* HDprintf(" scale attached "); */
+ /* printf(" scale attached "); */
ret_value = SUCCEED;
}
else if (H5DSis_attached(did, dsid, idx) == 0) {
- HDprintf(" scale not attached ");
+ printf(" scale not attached ");
}
}
}
@@ -261,13 +261,13 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if (H5DSis_attached(did, dsid, idx) == 1) {
if ((name_len = H5DSget_scale_name(dsid, NULL, (size_t)0)) > 0) {
- name_out = (char *)HDmalloc((size_t)name_len * sizeof(char));
+ name_out = (char *)malloc((size_t)name_len * sizeof(char));
if (name_out != NULL) {
if (H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) {
if (strcmp(scalename, name_out) == 0) {
ret_value = SUCCEED;
}
- HDfree(name_out);
+ free(name_out);
name_out = NULL;
}
}
diff --git a/hl/test/gen_test_ld.c b/hl/test/gen_test_ld.c
index 8ce699f..9282681 100644
--- a/hl/test/gen_test_ld.c
+++ b/hl/test/gen_test_ld.c
@@ -103,7 +103,7 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m
goto done;
/* Set up dataset's creation properties */
- if (!HDstrcmp(dname, DSET_NONE))
+ if (!strcmp(dname, DSET_NONE))
dcpl = H5P_DEFAULT;
else {
hsize_t chunk_dims[H5S_MAX_RANK]; /* Dimension sizes for chunks */
@@ -116,11 +116,11 @@ generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *m
goto done;
} /* end else */
- if (!HDstrcmp(dname, DSET_ALLOC_LATE)) {
+ if (!strcmp(dname, DSET_ALLOC_LATE)) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0)
goto done;
} /* end if */
- else if (!HDstrcmp(dname, DSET_ALLOC_EARLY)) {
+ else if (!strcmp(dname, DSET_ALLOC_EARLY)) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
goto done;
} /* end if */
diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h
index 14f3e14..7c98fde 100644
--- a/hl/test/h5hltest.h
+++ b/hl/test/h5hltest.h
@@ -30,13 +30,13 @@
/* Macros used in HL tests */
#define HL_TESTING2(WHAT) \
{ \
- HDprintf("Testing %-62s", WHAT); \
- HDfflush(stdout); \
+ printf("Testing %-62s", WHAT); \
+ fflush(stdout); \
}
#define HL_TESTING3(WHAT) \
{ \
- HDprintf("Testing %-62s", WHAT); \
- HDfflush(stdout); \
+ printf("Testing %-62s", WHAT); \
+ fflush(stdout); \
}
/* Implements verbose 'assert' with 'goto error' exit */
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 12b6840..c3b910d 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -215,11 +215,11 @@ main(void)
if (nerrors)
goto error;
- HDprintf("All dimension scales tests passed.\n");
+ printf("All dimension scales tests passed.\n");
return 0;
error:
- HDprintf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -246,7 +246,7 @@ create_test_file(const char *fileext)
{
char filename[65];
- HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
+ snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
}
@@ -256,7 +256,7 @@ open_test_file(const char *fileext)
{
char filename[65];
- HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
+ snprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT);
return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
}
@@ -285,7 +285,7 @@ create_char_dataset(hid_t fid, const char *dsidx, int fulldims)
char s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 120, 120, 120};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_char(fid, name, rank, dims, NULL) >= 0) {
@@ -339,7 +339,7 @@ create_short_dataset(hid_t fid, const char *dsidx, int fulldims)
short s33_wbuf[DIM3_SIZE] = {6, 6, 6, 12, 12, 12, 53, 53, 53, 140, 140, 140};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_short(fid, name, rank, dims, NULL) >= 0) {
@@ -388,7 +388,7 @@ create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
int s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_int(fid, name, rank, dims, NULL) >= 0) {
@@ -498,7 +498,7 @@ create_float_dataset(hid_t fid, const char *dsidx, int fulldims)
float s22_wbuf[DIM2_SIZE] = {5, 10, 50, 300};
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */
if (H5LTmake_dataset_float(fid, name, rank, dims, NULL) >= 0) {
@@ -534,14 +534,14 @@ create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -561,14 +561,14 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -576,7 +576,7 @@ create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -596,14 +596,14 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -611,7 +611,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -619,7 +619,7 @@ create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -639,14 +639,14 @@ create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -666,14 +666,14 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -681,7 +681,7 @@ create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -701,14 +701,14 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -716,7 +716,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -724,7 +724,7 @@ create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -743,14 +743,14 @@ create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -770,14 +770,14 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -785,7 +785,7 @@ create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -805,14 +805,14 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -820,7 +820,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -828,7 +828,7 @@ create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -848,14 +848,14 @@ create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -875,14 +875,14 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -890,7 +890,7 @@ create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -910,14 +910,14 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -925,7 +925,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -933,7 +933,7 @@ create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -953,14 +953,14 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -968,7 +968,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -976,7 +976,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -984,7 +984,7 @@ create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_di
}
if (s4_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0)
@@ -1004,14 +1004,14 @@ create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -1031,14 +1031,14 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx);
/* make a DS dataset for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -1046,7 +1046,7 @@ create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -1066,14 +1066,14 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
{
char name[64];
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx);
/* make a DS dataset for the first dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if (s1_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
@@ -1081,7 +1081,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s2_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0)
@@ -1089,7 +1089,7 @@ create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_d
}
if (s3_wbuf != NULL) {
- HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
+ snprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if (H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0)
@@ -1112,7 +1112,7 @@ test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx)
ret_value = SUCCEED;
}
else if (H5DSis_attached(did, dsid, idx) == 0) {
- HDprintf(" scale not attached ");
+ printf(" scale not attached ");
}
}
}
@@ -1176,13 +1176,13 @@ test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if (H5DSis_attached(did, dsid, idx) == 1) {
if ((name_len = H5DSget_scale_name(dsid, NULL, (size_t)0)) > 0) {
- name_out = (char *)HDmalloc(((size_t)name_len + 1) * sizeof(char));
+ name_out = (char *)malloc(((size_t)name_len + 1) * sizeof(char));
if (name_out != NULL) {
if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) >= 0) {
- if (HDstrncmp(scalename, name_out, (size_t)name_len) == 0) {
+ if (strncmp(scalename, name_out, (size_t)name_len) == 0) {
ret_value = SUCCEED;
}
- HDfree(name_out);
+ free(name_out);
name_out = NULL;
}
}
@@ -1220,14 +1220,14 @@ test_detachscales(void)
/* make datasets; they are three dimensional*/
for (i = 0; i < 2; i++) {
- HDsprintf(dname, "D%d", i);
+ sprintf(dname, "D%d", i);
if (H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
}
/* create datasets and make them dim. scales */
for (i = 0; i < 4; i++) {
- HDsprintf(dname, "DS%d", i);
+ sprintf(dname, "DS%d", i);
if (H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0)
goto out;
}
@@ -1235,7 +1235,7 @@ test_detachscales(void)
two scales attached */
if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i = 0; i < 4; i++) {
- HDsprintf(dname, "DS%d", i);
+ sprintf(dname, "DS%d", i);
if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, (unsigned int)i % 3) < 0)
@@ -1252,7 +1252,7 @@ test_detachscales(void)
/* attach scales to the second dataset */
if ((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) {
for (i = 0; i < 3; i++) {
- HDsprintf(dname, "DS%d", i);
+ sprintf(dname, "DS%d", i);
if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, (unsigned int)i) < 0)
@@ -1273,7 +1273,7 @@ test_detachscales(void)
goto out;
for (i = 0; i < 2; i++) {
- HDsprintf(dname, "D%d", i);
+ sprintf(dname, "D%d", i);
if ((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, (unsigned int)0) < 0)
@@ -1303,7 +1303,7 @@ test_detachscales(void)
sure that attribute "DIMENSION_LIST" doesn't exist anymore */
if ((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i = 1; i < 4; i++) {
- HDsprintf(dname, "DS%d", i);
+ sprintf(dname, "DS%d", i);
if ((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, (unsigned int)i % 3) < 0)
@@ -1347,7 +1347,7 @@ test_char_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
HL_TESTING2("test_char_attachscales");
@@ -1359,15 +1359,15 @@ test_char_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
@@ -1403,7 +1403,7 @@ test_short_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
HL_TESTING2("test_short_attachscales");
@@ -1415,39 +1415,39 @@ test_short_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
@@ -1483,7 +1483,7 @@ test_int_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
HL_TESTING2("test_int_attachscales");
@@ -1495,23 +1495,23 @@ test_int_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
@@ -1547,7 +1547,7 @@ test_long_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
HL_TESTING2("test_long_attachscales");
@@ -1559,19 +1559,19 @@ test_long_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM3) < 0)
goto out;
@@ -1607,7 +1607,7 @@ test_duplicatelong_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
HL_TESTING2("test_duplicatelong_attachscales");
@@ -1619,19 +1619,19 @@ test_duplicatelong_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
if (test_attach_scale(fid, did, scalename, DIM3) < 0)
goto out;
@@ -1667,7 +1667,7 @@ test_float_attachscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
HL_TESTING2("test_float_attachscales");
@@ -1679,23 +1679,23 @@ test_float_attachscales(const char *fileext)
goto out;
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
if (test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
@@ -1732,7 +1732,7 @@ test_numberofscales(const char *fileext)
char dsname[32];
char scalename[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
HL_TESTING2("test_numberofscales");
@@ -1758,7 +1758,7 @@ test_numberofscales(const char *fileext)
else
goto out;
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b");
/* make a dataset */
if (create_int_dataset(fid, "b", 1) < 0)
@@ -1766,7 +1766,7 @@ test_numberofscales(const char *fileext)
/* make a DS dataset for the first dimension */
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b");
if (test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
@@ -1815,31 +1815,31 @@ test_char_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set char scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac");
+ snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
@@ -1879,79 +1879,79 @@ test_short_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set short scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as");
+ snprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
@@ -1991,47 +1991,47 @@ test_int_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set int scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a");
+ snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
@@ -2071,39 +2071,39 @@ test_long_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set long scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM3) < 0)
goto out;
@@ -2143,39 +2143,39 @@ test_samelong_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set same long scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
- HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al");
+ snprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al");
if (test_set_scalename(fid, did, scalename, name, DIM3) < 0)
goto out;
@@ -2215,47 +2215,47 @@ test_float_scalenames(const char *fileext)
char scalename[32];
char name[32];
- HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
+ snprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
if ((fid = open_test_file(fileext)) < 0)
goto out;
HL_TESTING2("set float scale/cmp scale name");
if ((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if (test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
- HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af");
+ snprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af");
+ snprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af");
if (test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
@@ -2372,7 +2372,7 @@ test_simple(void)
char snames[3];
int i, j;
- HDprintf("Testing API functions\n");
+ printf("Testing API functions\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -2984,10 +2984,10 @@ test_simple(void)
if ((sid = H5Screate_simple(rank, dims, NULL)) < 0)
goto out;
for (i = 0; i < 5; i++) {
- HDsprintf(dname, "dset_%d", i);
+ sprintf(dname, "dset_%d", i);
if ((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- HDsprintf(sname, "ds_%d", i);
+ sprintf(sname, "ds_%d", i);
if ((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if (H5DSset_scale(dsid, "scale") < 0)
@@ -3004,11 +3004,11 @@ test_simple(void)
*/
for (i = 0; i < 5; i++) {
- HDsprintf(dname, "dset_%d", i);
+ sprintf(dname, "dset_%d", i);
if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for (j = 0; j < 5; j++) {
- HDsprintf(sname, "ds_%d", j);
+ sprintf(sname, "ds_%d", j);
if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, DIM0) < 0)
@@ -3026,11 +3026,11 @@ test_simple(void)
*/
for (i = 0; i < 5; i++) {
- HDsprintf(dname, "dset_%d", i);
+ sprintf(dname, "dset_%d", i);
if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for (j = 0; j < 5; j++) {
- HDsprintf(sname, "ds_%d", j);
+ sprintf(sname, "ds_%d", j);
if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, DIM0) < 0)
@@ -3048,11 +3048,11 @@ test_simple(void)
*/
for (i = 0; i < 5; i++) {
- HDsprintf(dname, "dset_%d", i);
+ sprintf(dname, "dset_%d", i);
if ((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for (j = 0; j < 5; j++) {
- HDsprintf(sname, "ds_%d", j);
+ sprintf(sname, "ds_%d", j);
if ((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, DIM0) < 0)
@@ -3146,9 +3146,9 @@ test_simple(void)
goto out;
if (H5DSget_label(did, DIM1, dim1_label, sizeof(dim1_label)) < 0)
goto out;
- if (HDstrncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0)
+ if (strncmp(DIM0_LABEL, dim0_label, sizeof(dim0_label)) != 0)
goto out;
- if (HDstrncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0)
+ if (strncmp(DIM1_LABEL, dim1_label, sizeof(dim1_label)) != 0)
goto out;
/*-------------------------------------------------------------------------
@@ -3162,24 +3162,24 @@ test_simple(void)
goto out;
/* allocate */
- dim0_labeld = (char *)HDmalloc((size_t)dim0_label_size * sizeof(char));
- dim1_labeld = (char *)HDmalloc((size_t)dim1_label_size * sizeof(char));
+ dim0_labeld = (char *)malloc((size_t)dim0_label_size * sizeof(char));
+ dim1_labeld = (char *)malloc((size_t)dim1_label_size * sizeof(char));
if (dim0_labeld == NULL || dim1_labeld == NULL)
goto out;
if (H5DSget_label(did, DIM0, dim0_labeld, (size_t)dim0_label_size) < 0)
goto out;
if (H5DSget_label(did, DIM1, dim1_labeld, (size_t)dim1_label_size) < 0)
goto out;
- if (HDstrncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0)
+ if (strncmp(DIM0_LABEL, dim0_labeld, (size_t)(dim0_label_size - 1)) != 0)
goto out;
- if (HDstrncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0)
+ if (strncmp(DIM1_LABEL, dim1_labeld, (size_t)(dim1_label_size - 1)) != 0)
goto out;
if (dim0_labeld) {
- HDfree(dim0_labeld);
+ free(dim0_labeld);
dim0_labeld = NULL;
}
if (dim1_labeld) {
- HDfree(dim1_labeld);
+ free(dim1_labeld);
dim1_labeld = NULL;
}
@@ -3192,9 +3192,9 @@ test_simple(void)
goto out;
if (H5DSget_label(did, DIM1, dim1_labels, sizeof(dim1_labels)) < 0)
goto out;
- if (HDstrncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0)
+ if (strncmp(DIM0_LABEL, dim0_labels, sizeof(dim0_labels) - 1) != 0)
goto out;
- if (HDstrncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0)
+ if (strncmp(DIM1_LABEL, dim1_labels, sizeof(dim1_labels) - 1) != 0)
goto out;
if (H5Dclose(did))
goto out;
@@ -3226,7 +3226,7 @@ test_simple(void)
goto out;
/* allocate a buffer */
- name_out = (char *)HDmalloc(((size_t)name_len + 1) * sizeof(char));
+ name_out = (char *)malloc(((size_t)name_len + 1) * sizeof(char));
if (name_out == NULL)
goto out;
@@ -3234,10 +3234,10 @@ test_simple(void)
if (H5DSget_scale_name(dsid, name_out, (size_t)name_len + 1) < 0)
goto out;
- if (HDstrncmp("Latitude set 0", name_out, (size_t)name_len) != 0)
+ if (strncmp("Latitude set 0", name_out, (size_t)name_len) != 0)
goto out;
if (name_out) {
- HDfree(name_out);
+ free(name_out);
name_out = NULL;
}
@@ -3250,7 +3250,7 @@ test_simple(void)
if (H5DSget_scale_name(dsid, sname, sizeof(sname)) < 0)
goto out;
- if (HDstrncmp("Latitude set 0", sname, sizeof(sname)) != 0)
+ if (strncmp("Latitude set 0", sname, sizeof(sname)) != 0)
goto out;
/*-------------------------------------------------------------------------
@@ -3262,7 +3262,7 @@ test_simple(void)
if (H5DSget_scale_name(dsid, snames, sizeof(snames)) < 0)
goto out;
- if (HDstrncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0)
+ if (strncmp("Latitude set 0", snames, sizeof(snames) - 1) != 0)
goto out;
if (H5Dclose(dsid))
goto out;
@@ -3498,7 +3498,7 @@ test_simple(void)
goto out;
break;
default:
- HDassert(0);
+ assert(0);
break;
} /*switch*/
} /*for*/
@@ -3628,7 +3628,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
goto out;
if (nelmts) {
- buf = (char *)HDmalloc(((size_t)nelmts * size));
+ buf = (char *)malloc(((size_t)nelmts * size));
if (buf == NULL)
goto out;
if (H5Dread(scale_id, mtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
@@ -3636,7 +3636,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
for (i = 0; i < nelmts; i++) {
if (buf[i] != data[i]) {
- HDprintf("read and write buffers differ\n");
+ printf("read and write buffers differ\n");
goto out;
}
}
@@ -3650,7 +3650,7 @@ read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
if (H5Tclose(mtid) < 0)
goto out;
if (buf)
- HDfree(buf);
+ free(buf);
return ret;
@@ -3662,7 +3662,7 @@ out:
H5Tclose(tid);
H5Tclose(mtid);
if (buf) {
- HDfree(buf);
+ free(buf);
}
}
H5E_END_TRY;
@@ -3840,7 +3840,7 @@ test_errors(void)
hid_t sidds = -1; /* space ID */
hsize_t pal_dims[] = {9, 3};
- HDprintf("Testing error conditions\n");
+ printf("Testing error conditions\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -4214,7 +4214,7 @@ test_iterators(void)
char dname[30]; /* dataset name */
int i;
- HDprintf("Testing iterators\n");
+ printf("Testing iterators\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@@ -4292,7 +4292,7 @@ test_iterators(void)
for (i = 0; i < 100; i++) {
/* make a DS */
- HDsprintf(dname, "ds_%d", i);
+ sprintf(dname, "ds_%d", i);
if (H5LTmake_dataset_int(fid, dname, rankds, s1_dim, NULL) < 0)
goto out;
/* open */
@@ -4404,7 +4404,7 @@ test_rank(void)
float buff[1] = {1};
int i;
- HDprintf("Testing ranks\n");
+ printf("Testing ranks\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@@ -4442,7 +4442,7 @@ test_rank(void)
goto out;
for (i = 0; i < 3; i++) {
- HDsprintf(name, "ds_a_%d", i);
+ sprintf(name, "ds_a_%d", i);
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
goto out;
if (H5DSattach_scale(did, dsid, (unsigned)i) < 0)
@@ -4469,7 +4469,7 @@ test_rank(void)
goto out;
for (i = 0; i < 3; i++) {
- HDsprintf(name, "ds_a_%d", i);
+ sprintf(name, "ds_a_%d", i);
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
goto out;
if (H5DSdetach_scale(did, dsid, (unsigned)i) < 0)
@@ -4495,7 +4495,7 @@ test_rank(void)
goto out;
for (i = 0; i < 3; i++) {
- HDsprintf(name, "ds_a_%d", i);
+ sprintf(name, "ds_a_%d", i);
if ((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
goto out;
if (H5DSset_scale(dsid, name) < 0)
@@ -4512,9 +4512,9 @@ test_rank(void)
goto out;
if (H5DSget_label(did, (unsigned)i, namel, sizeof(namel)) < 0)
goto out;
- if (HDstrncmp(name, names, sizeof(names)) != 0)
+ if (strncmp(name, names, sizeof(names)) != 0)
goto out;
- if (HDstrncmp(name, namel, sizeof(namel)) != 0)
+ if (strncmp(name, namel, sizeof(namel)) != 0)
goto out;
}
@@ -4611,7 +4611,7 @@ test_types(void)
const char * s1_str = "ABC";
const char * s2_str = "ABCD";
- HDprintf("Testing scales with several datatypes\n");
+ printf("Testing scales with several datatypes\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -4789,7 +4789,7 @@ test_data(void)
hsize_t londims[1]; /* array to hold dimensions */
float fill = -99; /* fill value */
- HDprintf("Testing reading ASCII data and generate HDF5 data with scales\n");
+ printf("Testing reading ASCII data and generate HDF5 data with scales\n");
/*-------------------------------------------------------------------------
* create a file for the test
@@ -4819,7 +4819,7 @@ test_data(void)
if (H5LTmake_dataset_float(fid, "lat", 1, latdims, latbuf) < 0)
goto out;
- HDfree(latbuf);
+ free(latbuf);
latbuf = NULL;
/* read the longitude */
@@ -4830,7 +4830,7 @@ test_data(void)
if (H5LTmake_dataset_float(fid, "lon", 1, londims, lonbuf) < 0)
goto out;
- HDfree(lonbuf);
+ free(lonbuf);
lonbuf = NULL;
/* make a dataset for the data. a fill value is set */
@@ -4850,7 +4850,7 @@ test_data(void)
if (H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, vals) < 0)
goto out;
- HDfree(vals);
+ free(vals);
vals = NULL;
if (H5Dclose(did) < 0)
@@ -4925,11 +4925,11 @@ out:
H5_FAILED();
if (latbuf)
- HDfree(latbuf);
+ free(latbuf);
if (lonbuf)
- HDfree(lonbuf);
+ free(lonbuf);
if (vals)
- HDfree(vals);
+ free(vals);
return FAIL;
}
@@ -4958,44 +4958,44 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf)
const char *data_file = H5_get_srcdir_filename(fname);
/* read first data file */
- f = HDfopen(data_file, "r");
+ f = fopen(data_file, "r");
if (f == NULL) {
- HDprintf("Could not open file %s\n", data_file);
+ printf("Could not open file %s\n", data_file);
return -1;
}
for (i = 0, nelms = 1; i < ndims; i++) {
- if (HDfscanf(f, "%s %u", str, &j) && HDferror(f)) {
- HDprintf("fscanf error in file %s\n", data_file);
- HDfclose(f);
+ if (fscanf(f, "%s %u", str, &j) && ferror(f)) {
+ printf("fscanf error in file %s\n", data_file);
+ fclose(f);
return -1;
} /* end if */
- if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s\n", data_file);
- HDfclose(f);
+ if (fscanf(f, "%d", &n) < 0 && ferror(f)) {
+ printf("fscanf error in file %s\n", data_file);
+ fclose(f);
return -1;
} /* end if */
dims[i] = (hsize_t)n;
nelms *= (size_t)n;
}
- *buf = (float *)HDmalloc(nelms * sizeof(float));
+ *buf = (float *)malloc(nelms * sizeof(float));
if (*buf == NULL) {
- HDprintf("memory allocation failed\n");
- HDfclose(f);
+ printf("memory allocation failed\n");
+ fclose(f);
return -1;
}
for (j = 0; j < nelms; j++) {
- if (HDfscanf(f, "%f", &val) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s\n", data_file);
- HDfclose(f);
+ if (fscanf(f, "%f", &val) < 0 && ferror(f)) {
+ printf("fscanf error in file %s\n", data_file);
+ fclose(f);
return -1;
} /* end if */
(*buf)[j] = val;
}
- HDfclose(f);
+ fclose(f);
return 1;
}
@@ -5019,7 +5019,7 @@ test_errors2(void)
int nscales; /* number of scales in DIM */
int count; /* visitor data */
- HDprintf("Testing parameter errors\n");
+ printf("Testing parameter errors\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@@ -5101,7 +5101,7 @@ test_errors2(void)
goto out;
if ((label_len = H5DSget_label(did, 0, NULL, 0)) < 0)
goto out;
- if (label_len != HDstrlen("label"))
+ if (label_len != strlen("label"))
goto out;
if (H5DSget_label(did, 0, lbuf, sizeof(lbuf)) < 0)
goto out;
diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c
index 3b11c2b..e7d1139 100644
--- a/hl/test/test_dset_append.c
+++ b/hl/test/test_dset_append.c
@@ -252,7 +252,7 @@ test_dataset_append_rows_columns(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -388,7 +388,7 @@ test_dataset_append_rows(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -525,7 +525,7 @@ test_dataset_append_columns(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -688,7 +688,7 @@ test_dataset_append_BUG1(hid_t fid)
if (buf[i][j] != rbuf[i][j])
TEST_ERROR;
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -851,7 +851,7 @@ test_dataset_append_BUG2(hid_t fid)
if (buf[i][j] != rbuf[i][j])
TEST_ERROR;
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -1010,7 +1010,7 @@ test_dataset_append_less(hid_t fid)
TEST_ERROR;
/* Clear the buffer */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
@@ -1167,7 +1167,7 @@ test_dataset_append_vary(hid_t fid)
TEST_ERROR;
/* Clear the dataset */
- HDmemset(rbuf, 0, sizeof(rbuf));
+ memset(rbuf, 0, sizeof(rbuf));
/* Close the dataset */
if (H5Dclose(did) < 0)
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index 4448e41..f605aff 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -77,27 +77,27 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
VERIFY(nflags > 0, "The number of flag combinations must be greater than 0");
/* allocate array of flags for open images */
- if (NULL == (input_flags = (unsigned *)HDmalloc(sizeof(unsigned) * open_images)))
+ if (NULL == (input_flags = (unsigned *)malloc(sizeof(unsigned) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array of pointers for each of the open images */
- if (NULL == (buf_ptr = (void **)HDmalloc(sizeof(void *) * open_images)))
+ if (NULL == (buf_ptr = (void **)malloc(sizeof(void *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the name of each of the open images */
- if (NULL == (filename = (char **)HDcalloc(1, sizeof(char *) * open_images)))
+ if (NULL == (filename = (char **)calloc(1, sizeof(char *) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array to store the size of each of the open images */
- if (NULL == (buf_size = (ssize_t *)HDmalloc(sizeof(ssize_t) * open_images)))
+ if (NULL == (buf_size = (ssize_t *)malloc(sizeof(ssize_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the file identifiers */
- if (NULL == (file_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
+ if (NULL == (file_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
/* allocate array for each of the dataset identifiers */
- if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
+ if (NULL == (dset_id = (hid_t *)malloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
HL_TESTING2("get file images");
@@ -110,12 +110,12 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
/* allocate name buffer for image i */
size_t filenamelength = sizeof(char) * 32;
- filename[i] = (char *)HDmalloc(filenamelength);
+ filename[i] = (char *)malloc(filenamelength);
if (!filename[i])
- FAIL_PUTS_ERROR("HDmalloc() failed");
+ FAIL_PUTS_ERROR("malloc() failed");
/* create file name */
- HDsnprintf(filename[i], filenamelength, "image_file%d.h5", (int)i);
+ snprintf(filename[i], filenamelength, "image_file%d.h5", (int)i);
/* create file */
if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -170,7 +170,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
FAIL_PUTS_ERROR("H5Fget_file_image() failed");
/* allocate buffer for the file image i */
- if (NULL == (buf_ptr[i] = (void *)HDmalloc((size_t)buf_size[i])))
+ if (NULL == (buf_ptr[i] = (void *)malloc((size_t)buf_size[i])))
FAIL_PUTS_ERROR("malloc() failed");
/* buffer for file image 2 is filled with counter data (non-valid image) */
@@ -234,28 +234,28 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
*/
if (input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW && !(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY)) {
- void *tmp_ptr = HDmalloc((size_t)buf_size[i]);
+ void *tmp_ptr = malloc((size_t)buf_size[i]);
if (!tmp_ptr)
FAIL_PUTS_ERROR("buffer allocation failed");
/* Copy vfd buffer to a temporary buffer */
- HDmemcpy(tmp_ptr, (void *)*core_buf_ptr_ptr, (size_t)buf_size[i]);
+ memcpy(tmp_ptr, (void *)*core_buf_ptr_ptr, (size_t)buf_size[i]);
/* Clear status_flags in the superblock for the vfd buffer: file locking is using status_flags
*/
- HDmemset((uint8_t *)tmp_ptr + SUPER_STATUS_FLAGS_OFF_V0_V1, (int)0,
+ memset((uint8_t *)tmp_ptr + SUPER_STATUS_FLAGS_OFF_V0_V1, (int)0,
(size_t)SUPER_STATUS_FLAGS_SIZE_V0_V1);
/* Does the comparison */
- if (HDmemcmp(tmp_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
+ if (memcmp(tmp_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
FAIL_PUTS_ERROR("comparison of TMP vfd and user buffer failed");
/* Free the temporary buffer */
if (tmp_ptr)
- HDfree(tmp_ptr);
+ free(tmp_ptr);
}
else {
/* test whether the contents of the user buffer and driver buffer */
/* are equal. */
- if (HDmemcmp(*core_buf_ptr_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
+ if (memcmp(*core_buf_ptr_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0)
FAIL_PUTS_ERROR("comparison of vfd and user buffer failed");
}
} /* end else */
@@ -269,7 +269,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
for (i = 0; i < open_images; i++) {
/* if opening the file image failed, continue next iteration */
if (file_id[i] < 0) {
- HDassert(i == 2);
+ assert(i == 2);
continue;
} /* end if */
@@ -325,7 +325,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
for (i = 0; i < open_images; i++) {
/* if opening the file image failed, continue next iteration */
if (file_id[i] < 0) {
- HDassert(i == 2);
+ assert(i == 2);
continue;
} /* end if */
@@ -502,27 +502,27 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
} /* end if */
/* delete test data files */
- if (HDremove(filename[i]) < 0)
- FAIL_PUTS_ERROR("HDremove() failed");
+ if (remove(filename[i]) < 0)
+ FAIL_PUTS_ERROR("remove() failed");
/* free shared buffer if appropriate */
if (!(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY) ||
(input_flags[i] & H5LT_FILE_IMAGE_DONT_RELEASE)) {
VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL");
- HDfree(buf_ptr[i]);
+ free(buf_ptr[i]);
} /* end if */
} /* end for */
/* release temporary working buffers */
for (i = 0; i < open_images; i++)
- HDfree(filename[i]);
- HDfree(filename);
- HDfree(file_id);
- HDfree(dset_id);
- HDfree(buf_ptr);
- HDfree(buf_size);
- HDfree(input_flags);
+ free(filename[i]);
+ free(filename);
+ free(file_id);
+ free(dset_id);
+ free(buf_ptr);
+ free(buf_size);
+ free(input_flags);
PASSED();
@@ -533,14 +533,14 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags)
error:
if (filename) {
for (i = 0; i < open_images; i++)
- HDfree(filename[i]);
- HDfree(filename);
+ free(filename[i]);
+ free(filename);
}
- HDfree(file_id);
- HDfree(dset_id);
- HDfree(buf_ptr);
- HDfree(buf_size);
- HDfree(input_flags);
+ free(file_id);
+ free(dset_id);
+ free(buf_ptr);
+ free(buf_size);
+ free(input_flags);
H5_FAILED();
return -1;
@@ -573,10 +573,10 @@ main(void)
if (nerrors)
goto error;
- HDprintf("File image tests passed.\n");
+ printf("File image tests passed.\n");
return 0;
error:
- HDprintf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ printf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
return 1;
}
diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c
index 6f19d4b..93231bf 100644
--- a/hl/test/test_h5do_compat.c
+++ b/hl/test/test_h5do_compat.c
@@ -193,7 +193,7 @@ test_direct_chunk_read(hid_t did)
TEST_ERROR
/* Read the raw chunk back */
- HDmemset(chunk_data, 0, CHUNK_NX * sizeof(int));
+ memset(chunk_data, 0, CHUNK_NX * sizeof(int));
filter_mask = UINT_MAX;
offset[0] = (hsize_t)i * CHUNK_NX;
if (H5DOread_chunk(did, H5P_DEFAULT, offset, &filter_mask, chunk_data) < 0)
@@ -248,8 +248,8 @@ main(void)
{
#ifdef H5_NO_DEPRECATED_SYMBOLS
- HDputs("Direct chunk read/write wrapper tests SKIPPED.");
- HDputs("(Backward compatibility not configured)");
+ puts("Direct chunk read/write wrapper tests SKIPPED.");
+ puts("(Backward compatibility not configured)");
return EXIT_SUCCESS;
#else
@@ -276,11 +276,11 @@ main(void)
if (nerrors)
goto error;
- HDputs("All direct chunk read/write wrapper tests passed.");
+ puts("All direct chunk read/write wrapper tests passed.");
return EXIT_SUCCESS;
error:
- HDputs("*** TESTS FAILED ***");
+ puts("*** TESTS FAILED ***");
return EXIT_FAILURE;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* end main() */
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index 4997df6..d48a291 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -72,11 +72,11 @@ main(void)
if (nerrors)
goto error;
- HDprintf("All image tests passed.\n");
+ printf("All image tests passed.\n");
return 0;
error:
- HDprintf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ printf("***** %d IMAGE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -112,14 +112,14 @@ test_simple(void)
hsize_t pal_dims_out[2]; /* palette dimensions */
/* Allocate image buffers */
- buf1 = (unsigned char *)HDmalloc(WIDTH * HEIGHT);
- HDassert(buf1);
- buf2 = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3);
- HDassert(buf2);
- buf1_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT);
- HDassert(buf1_out);
- buf2_out = (unsigned char *)HDmalloc(WIDTH * HEIGHT * 3);
- HDassert(buf2_out);
+ buf1 = (unsigned char *)malloc(WIDTH * HEIGHT);
+ assert(buf1);
+ buf2 = (unsigned char *)malloc(WIDTH * HEIGHT * 3);
+ assert(buf2);
+ buf1_out = (unsigned char *)malloc(WIDTH * HEIGHT);
+ assert(buf1_out);
+ buf2_out = (unsigned char *)malloc(WIDTH * HEIGHT * 3);
+ assert(buf2_out);
/* create an image */
space = WIDTH * HEIGHT / PAL_ENTRIES;
@@ -275,13 +275,13 @@ test_simple(void)
*/
if (buf1)
- HDfree(buf1);
+ free(buf1);
if (buf2)
- HDfree(buf2);
+ free(buf2);
if (buf1_out)
- HDfree(buf1_out);
+ free(buf1_out);
if (buf2_out)
- HDfree(buf2_out);
+ free(buf2_out);
/* Close the file. */
if (H5Fclose(fid) < 0)
@@ -294,13 +294,13 @@ test_simple(void)
/* error zone, gracefully close */
out:
if (buf1)
- HDfree(buf1);
+ free(buf1);
if (buf2)
- HDfree(buf2);
+ free(buf2);
if (buf1_out)
- HDfree(buf1_out);
+ free(buf1_out);
if (buf2_out)
- HDfree(buf2_out);
+ free(buf2_out);
H5E_BEGIN_TRY
{
H5Fclose(fid);
@@ -330,7 +330,7 @@ test_data(void)
if ((fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- HDprintf("Testing read ascii image data and generate images\n");
+ printf("Testing read ascii image data and generate images\n");
/*-------------------------------------------------------------------------
* read 8bit image data
@@ -481,7 +481,7 @@ test_data(void)
goto out;
/* Release memory buffer */
- HDfree(image_data);
+ free(image_data);
return 0;
@@ -489,7 +489,7 @@ test_data(void)
out:
/* Release memory buffer */
if (image_data)
- HDfree(image_data);
+ free(image_data);
H5E_BEGIN_TRY
{
@@ -532,16 +532,16 @@ test_generate(void)
if ((fid = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- HDprintf("Testing read and process data and make indexed images\n");
+ printf("Testing read and process data and make indexed images\n");
/*-------------------------------------------------------------------------
* read data; the file data format is described below
*-------------------------------------------------------------------------
*/
- f = HDfopen(data_file, "r");
+ f = fopen(data_file, "r");
if (f == NULL) {
- HDprintf("Could not find file %s. Try set $srcdir \n", data_file);
+ printf("Could not find file %s. Try set $srcdir \n", data_file);
goto out;
}
@@ -580,12 +580,12 @@ test_generate(void)
!
*/
- if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -607,21 +607,21 @@ test_generate(void)
if (n_elements > INT_MAX / (int)sizeof(float))
goto out;
- data = (float *)HDmalloc((size_t)n_elements * sizeof(float));
+ data = (float *)malloc((size_t)n_elements * sizeof(float));
if (NULL == data)
goto out;
- image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char));
+ image_data = (unsigned char *)malloc((size_t)n_elements * sizeof(unsigned char));
if (NULL == image_data)
goto out;
for (i = 0; i < n_elements; i++) {
- if (HDfscanf(f, "%f ", &value) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%f ", &value) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
data[i] = value;
}
- HDfclose(f);
+ fclose(f);
f = NULL;
/*-------------------------------------------------------------------------
@@ -713,8 +713,8 @@ test_generate(void)
goto out;
/* Release memory buffers */
- HDfree(data);
- HDfree(image_data);
+ free(data);
+ free(image_data);
/* Indicate success */
return 0;
@@ -723,9 +723,9 @@ test_generate(void)
out:
/* Release memory buffers */
if (data)
- HDfree(data);
+ free(data);
if (image_data)
- HDfree(image_data);
+ free(image_data);
H5E_BEGIN_TRY
{
@@ -733,7 +733,7 @@ out:
}
H5E_END_TRY;
if (f)
- HDfclose(f);
+ fclose(f);
H5_FAILED();
return retval;
}
@@ -774,38 +774,38 @@ read_data(const char *fname, /*IN*/
*-------------------------------------------------------------------------
*/
- if (NULL == (f = HDfopen(data_file, "r"))) {
- HDprintf("Could not open file %s. Try set $srcdir \n", data_file);
+ if (NULL == (f = fopen(data_file, "r"))) {
+ printf("Could not open file %s. Try set $srcdir \n", data_file);
goto out;
}
- if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%s", str) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &color_planes) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%s", str) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%d", &h) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &h) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%s", str) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
- if (HDfscanf(f, "%d", &w) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &w) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
@@ -826,10 +826,10 @@ read_data(const char *fname, /*IN*/
/* Release the buffer, if it was previously allocated */
if (image_data)
- HDfree(image_data);
+ free(image_data);
/* Allocate the image data buffer */
- image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char));
+ image_data = (unsigned char *)malloc((size_t)n_elements * sizeof(unsigned char));
if (NULL == image_data)
goto out;
@@ -838,8 +838,8 @@ read_data(const char *fname, /*IN*/
/* Read data elements */
for (i = 0; i < n_elements; i++) {
- if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) {
- HDprintf("fscanf error in file %s.\n", data_file);
+ if (fscanf(f, "%d", &n) < 0 && ferror(f)) {
+ printf("fscanf error in file %s.\n", data_file);
goto out;
} /* end if */
image_data[i] = (unsigned char)n;
@@ -850,7 +850,7 @@ read_data(const char *fname, /*IN*/
out:
if (f)
- HDfclose(f);
+ fclose(f);
return ret_val;
} /* end read_data() */
@@ -890,40 +890,40 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
return -1;
/* open the input file */
- if (!(file = HDfopen(data_file, "r"))) {
- HDprintf("Could not open file %s. Try set $srcdir \n", data_file);
+ if (!(file = fopen(data_file, "r"))) {
+ printf("Could not open file %s. Try set $srcdir \n", data_file);
return -1;
}
/* read the file ident string */
- if (HDfgets(buffer, sizeof(buffer), file) == NULL) {
- HDfclose(file);
+ if (fgets(buffer, sizeof(buffer), file) == NULL) {
+ fclose(file);
return -1;
}
/* ensure it matches the palette file ident string */
- if (HDstrncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
- HDstrncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) {
- HDfclose(file);
+ if (strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
+ strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0) {
+ fclose(file);
return -1;
}
/* read the version string */
- if (HDfgets(buffer, sizeof(buffer), file) == NULL) {
- HDfclose(file);
+ if (fgets(buffer, sizeof(buffer), file) == NULL) {
+ fclose(file);
return -1;
}
/* ensure it matches the palette file version string */
- if (HDstrncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
- HDstrncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) {
- HDfclose(file);
+ if (strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
+ strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0) {
+ fclose(file);
return -1;
}
/* read the number of colors */
- if (HDfgets(buffer, sizeof(buffer), file) == NULL) {
- HDfclose(file);
+ if (fgets(buffer, sizeof(buffer), file) == NULL) {
+ fclose(file);
return -1;
}
@@ -931,27 +931,27 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
check for missing version or number of colors
in this case it reads the first entry
*/
- if (HDstrlen(buffer) > 4) {
- HDfclose(file);
+ if (strlen(buffer) > 4) {
+ fclose(file);
return -1;
}
- if (HDsscanf(buffer, "%u", &nentries) != 1) {
- HDfclose(file);
+ if (sscanf(buffer, "%u", &nentries) != 1) {
+ fclose(file);
return -1;
}
/* ensure there are a sensible number of colors in the palette */
if ((nentries > 256) || (nentries > palette_size)) {
- HDfclose(file);
+ fclose(file);
return (-1);
}
/* read the palette entries */
for (u = 0; u < nentries; u++) {
/* extract the red, green and blue color components. */
- if (HDfscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
- HDfclose(file);
+ if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) {
+ fclose(file);
return -1;
}
/* store this palette entry */
@@ -961,7 +961,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size)
}
/* close file */
- HDfclose(file);
+ fclose(file);
return (int)nentries;
}
diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c
index 150d04c..c330a13 100644
--- a/hl/test/test_ld.c
+++ b/hl/test/test_ld.c
@@ -471,7 +471,7 @@ test_LD_dims(const char *file)
FAIL_STACK_ERROR
/* Remove the copied file */
- HDremove(COPY_FILENAME);
+ remove(COPY_FILENAME);
PASSED();
return 0;
@@ -1037,10 +1037,10 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
/* Loop through different variations of extending the dataset */
for (i = 0; i < ONE_NTESTS; i++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ memset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ memset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
ext_dims[0] = (hsize_t)((int)prev_dims[0] + one_tests[i]);
@@ -1049,27 +1049,27 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
FAIL_STACK_ERROR
/* Initialize data */
- if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
FAIL_STACK_ERROR
} /* end if */
- else if (!HDstrcmp(dname, DSET_ONE)) {
+ else if (!strcmp(dname, DSET_ONE)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
FAIL_STACK_ERROR
} /* end if */
/* There are changes in dimension sizes */
if (one_tests[i] > 0) {
- if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) {
+ if (!strcmp(dname, DSET_CMPD) || !strcmp(dname, DSET_CMPD_ESC)) {
if (fields) {
- if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
+ if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
TEST_ERROR
for (j = 0; j < one_tests[i]; j++)
VERIFY_ELMTS_VALID1(vbuf1[j], cbuf[prev_dims[0] + (hsize_t)j])
} /* end if */
- else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) {
+ else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0)
TEST_ERROR
@@ -1111,7 +1111,7 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields)
FAIL_STACK_ERROR
/* Remove the copied file */
- HDremove(COPY_FILENAME);
+ remove(COPY_FILENAME);
PASSED();
return 0;
@@ -1248,10 +1248,10 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
/* Loop through different variations of extending the dataset */
for (i = 0; i < TWO_NTESTS; i++) {
- HDmemset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
- HDmemset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
- HDmemset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
- HDmemset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
+ memset(vbuf1, 0, TEST_BUF_SIZE * sizeof(test_valid_fields1));
+ memset(vbuf2, 0, TEST_BUF_SIZE * sizeof(test_valid_fields2));
+ memset(ccbuf, 0, TEST_BUF_SIZE * sizeof(set_t));
+ memset(iibuf, 0, TEST_BUF_SIZE * sizeof(int));
ext_dims[0] = (hsize_t)((int)prev_dims[0] + two_tests[i][0]);
ext_dims[1] = (hsize_t)((int)prev_dims[1] + two_tests[i][1]);
@@ -1261,11 +1261,11 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
FAIL_STACK_ERROR
/* Initialize data */
- if (!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if (!strcmp(dname, DSET_CMPD_TWO)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0)
FAIL_STACK_ERROR
} /* end if */
- else if (!HDstrcmp(dname, DSET_TWO)) {
+ else if (!strcmp(dname, DSET_TWO)) {
if (H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0)
FAIL_STACK_ERROR
} /* end else-if */
@@ -1274,16 +1274,16 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
/* There are changes in dimension sizes */
if (two_tests[i][0] > 0 || two_tests[i][1] > 0) {
- if (!HDstrcmp(dname, DSET_CMPD_TWO)) {
+ if (!strcmp(dname, DSET_CMPD_TWO)) {
if (fields) {
- if (!HDstrcmp(fields, VALID_FIELDS1) || !HDstrcmp(fields, VALID_ESC_FIELDS1)) {
+ if (!strcmp(fields, VALID_FIELDS1) || !strcmp(fields, VALID_ESC_FIELDS1)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf1) < 0)
TEST_ERROR
if (verify_elmts_two(TWO_CMPD_VALID1, ext_dims, prev_dims, vbuf1, cbuf) < 0)
TEST_ERROR
} /* end if */
- else if (!HDstrcmp(fields, VALID_FIELDS2) || !HDstrcmp(fields, VALID_ESC_FIELDS2)) {
+ else if (!strcmp(fields, VALID_FIELDS2) || !strcmp(fields, VALID_ESC_FIELDS2)) {
/* Retrieve the elmemts in BUF */
if (H5LDget_dset_elmts(did, prev_dims, ext_dims, fields, vbuf2) < 0)
TEST_ERROR
@@ -1325,7 +1325,7 @@ test_LD_elmts_two(const char *file, const char *dname, const char *fields)
FAIL_STACK_ERROR;
/* Remove the copied file */
- HDremove(COPY_FILENAME);
+ remove(COPY_FILENAME);
PASSED();
return 0;
@@ -1351,19 +1351,19 @@ main(void)
int nerrors = 0;
/* Set up temporary buffers for tests: test_LD_elmts_one() & test_LD_elmts_two() */
- if (NULL == (ibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
+ if (NULL == (ibuf = (int *)malloc(sizeof(int) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (iibuf = (int *)HDmalloc(sizeof(int) * TEST_BUF_SIZE)))
+ if (NULL == (iibuf = (int *)malloc(sizeof(int) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (cbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
+ if (NULL == (cbuf = (set_t *)malloc(sizeof(set_t) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (ccbuf = (set_t *)HDmalloc(sizeof(set_t) * TEST_BUF_SIZE)))
+ if (NULL == (ccbuf = (set_t *)malloc(sizeof(set_t) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (vbuf1 = (test_valid_fields1 *)HDmalloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE)))
+ if (NULL == (vbuf1 = (test_valid_fields1 *)malloc(sizeof(test_valid_fields1) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
- if (NULL == (vbuf2 = (test_valid_fields2 *)HDmalloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE)))
+ if (NULL == (vbuf2 = (test_valid_fields2 *)malloc(sizeof(test_valid_fields2) * TEST_BUF_SIZE)))
FAIL_STACK_ERROR;
/*
@@ -1415,17 +1415,17 @@ main(void)
/* Free temporary buffers */
if (ibuf)
- HDfree(ibuf);
+ free(ibuf);
if (iibuf)
- HDfree(iibuf);
+ free(iibuf);
if (cbuf)
- HDfree(cbuf);
+ free(cbuf);
if (ccbuf)
- HDfree(ccbuf);
+ free(ccbuf);
if (vbuf1)
- HDfree(vbuf1);
+ free(vbuf1);
if (vbuf2)
- HDfree(vbuf2);
+ free(vbuf2);
/* check for errors */
if (nerrors)
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 53f834a..1b6cf5f 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -346,7 +346,7 @@ test_dsets(void)
if (H5LTread_dataset_string(file_id, DSET7_NAME, data_string_out) < 0)
goto out;
- if (HDstrcmp(data_string_in, data_string_out) != 0)
+ if (strcmp(data_string_in, data_string_out) != 0)
goto out;
/*-------------------------------------------------------------------------
@@ -522,7 +522,7 @@ make_attributes(hid_t loc_id, const char *obj_name)
if (H5LTget_attribute_string(loc_id, obj_name, ATTR1_NAME, attr_str_out) < 0)
return -1;
- if (HDstrcmp(attr_str_in, attr_str_out) != 0) {
+ if (strcmp(attr_str_in, attr_str_out) != 0) {
return -1;
}
@@ -1039,26 +1039,26 @@ make_attributes(hid_t loc_id, const char *obj_name)
HL_TESTING2("H5LTget_attribute_info");
- if (NULL == (dims_out = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)rank_out)))
+ if (NULL == (dims_out = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)rank_out)))
return -1;
if (H5LTget_attribute_info(loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0) {
- HDfree(dims_out);
+ free(dims_out);
return -1;
}
for (i = 0; i < rank_out; i++) {
if (dims_out[i] != 5) {
- HDfree(dims_out);
+ free(dims_out);
return -1;
}
}
if (type_class != H5T_INTEGER) {
- HDfree(dims_out);
+ free(dims_out);
return -1;
}
- HDfree(dims_out);
+ free(dims_out);
PASSED();
@@ -1093,17 +1093,17 @@ test_integers(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) {
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_STD_I8BE") != 0) {
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1151,17 +1151,17 @@ test_fps(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) {
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_IEEE_F32BE") != 0) {
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1222,19 +1222,19 @@ test_strings(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET "
+ if (strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET "
"H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1257,62 +1257,62 @@ test_strings(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n "
+ if (strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n "
"CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
/* Length of the character buffer is larger then needed */
str_len = str_len + 10;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrncmp(dt_str,
+ if (strncmp(dt_str,
"H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
"H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
str_len - 1) != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
/* Length of the character buffer is smaller then needed */
str_len = 21;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
/* check the truncated string */
- if (HDstrlen(dt_str) != str_len - 1)
+ if (strlen(dt_str) != str_len - 1)
goto out;
- str_len = HDstrlen(dt_str);
- if (HDstrncmp(dt_str,
+ str_len = strlen(dt_str);
+ if (strncmp(dt_str,
"H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET "
"H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }",
str_len) != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1322,7 +1322,7 @@ test_strings(void)
out:
if (dt_str)
- HDfree(dt_str);
+ free(dt_str);
H5_FAILED();
return -1;
@@ -1359,21 +1359,21 @@ test_opaques(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(
+ if (strcmp(
dt_str,
"H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") !=
0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1422,7 +1422,7 @@ test_enums(void)
if (H5Tenum_nameof(dtype, &value1, name1, size) < 0)
goto out;
- if (HDstrcmp(name1, "BLUE") != 0)
+ if (strcmp(name1, "BLUE") != 0)
goto out;
if (H5Tenum_valueof(dtype, name2, &value2) < 0)
@@ -1439,22 +1439,22 @@ test_enums(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str,
+ if (strcmp(dt_str,
"H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" "
" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1503,18 +1503,18 @@ test_variables(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ if (strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) {
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1565,21 +1565,21 @@ test_arrays(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n "
+ if (strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n "
" H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE "
"\"arr_compound_2\" : 1;\n }\n }\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1626,19 +1626,19 @@ test_compounds(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE "
+ if (strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE "
"\"two_field\" : 6;\n }") != 0) {
- HDprintf("dt=\n%s\n", dt_str);
- HDfree(dt_str);
+ printf("dt=\n%s\n", dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1652,7 +1652,7 @@ test_compounds(void)
if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "i16_field") != 0) {
+ if (strcmp(memb_name, "i16_field") != 0) {
H5free_memory(memb_name);
goto out;
}
@@ -1730,7 +1730,7 @@ test_compound_bug(void)
if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "sub") != 0) {
+ if (strcmp(memb_name, "sub") != 0) {
H5free_memory(memb_name);
goto out;
}
@@ -1739,13 +1739,13 @@ test_compound_bug(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1766,7 +1766,7 @@ test_compound_bug(void)
if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
- if (HDstrcmp(memb_name, "desc____________________________________________________________________________"
+ if (strcmp(memb_name, "desc____________________________________________________________________________"
"_____________") != 0) {
H5free_memory(memb_name);
goto out;
@@ -1776,14 +1776,14 @@ test_compound_bug(void)
if (H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len) < 0)
goto out;
- if (NULL == (dt_str = (char *)HDcalloc(str_len, sizeof(char))))
+ if (NULL == (dt_str = (char *)calloc(str_len, sizeof(char))))
goto out;
if (H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len) < 0) {
- HDfree(dt_str);
+ free(dt_str);
goto out;
}
- HDfree(dt_str);
+ free(dt_str);
if (H5Tclose(dtype) < 0)
goto out;
@@ -1814,9 +1814,9 @@ test_complicated_compound(void)
HL_TESTING3(" text for complicated compound types");
/* Open input file */
- fp = HDfopen(filename, "r");
+ fp = fopen(filename, "r");
if (fp == NULL) {
- HDprintf("Could not find file %s. Try set $srcdir \n", filename);
+ printf("Could not find file %s. Try set $srcdir \n", filename);
goto out;
}
@@ -1824,23 +1824,23 @@ test_complicated_compound(void)
* Library has convenient function getline() but isn't available on
* all machines.
*/
- if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL)
+ if ((line = (char *)calloc(size, sizeof(char))) == NULL)
goto out;
- if (HDfgets(line, (int)size, fp) == NULL)
+ if (fgets(line, (int)size, fp) == NULL)
goto out;
- while (HDstrlen(line) == size - 1) {
+ while (strlen(line) == size - 1) {
size *= 2;
if (line)
- HDfree(line);
- if ((line = (char *)HDcalloc(size, sizeof(char))) == NULL)
+ free(line);
+ if ((line = (char *)calloc(size, sizeof(char))) == NULL)
goto out;
if (HDfseek(fp, 0L, SEEK_SET) != 0)
goto out;
- if (HDfgets(line, (int)size, fp) == NULL)
+ if (fgets(line, (int)size, fp) == NULL)
goto out;
}
- HDfclose(fp);
+ fclose(fp);
fp = NULL;
if ((dtype = H5LTtext_to_dtype(line, H5LT_DDL)) < 0)
@@ -1858,7 +1858,7 @@ test_complicated_compound(void)
goto out;
if (line)
- HDfree(line);
+ free(line);
PASSED();
return 0;
@@ -1866,9 +1866,9 @@ test_complicated_compound(void)
out:
if (line)
- HDfree(line);
+ free(line);
if (fp)
- HDfclose(fp);
+ fclose(fp);
H5_FAILED();
return -1;
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index e8b90f7..6cf6ade 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -59,7 +59,7 @@ static particle_t testPart[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10
static int
cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf)
{
- if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
+ if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) {
return FAIL;
@@ -169,7 +169,7 @@ test_create_close(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
@@ -446,7 +446,7 @@ test_big_table(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Create a new table */
table = H5PTcreate_fl(fid, "Packet Test Dataset2", part_t, (hsize_t)33, -1);
@@ -520,7 +520,7 @@ test_opaque(hid_t fid)
if ((part_t = H5Tcreate(H5T_OPAQUE, sizeof(particle_t))) < 0)
return FAIL;
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Tag the opaque datatype */
if (H5Tset_tag(part_t, "Opaque Particle") < 0)
@@ -596,7 +596,7 @@ test_compress(void)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- HDassert(part_t != -1);
+ assert(part_t != -1);
/* Create a new table with compression level 8 */
table = H5PTcreate_fl(fid1, "Compressed Test Dataset", part_t, (hsize_t)80, 8);
@@ -621,7 +621,7 @@ test_compress(void)
TEST_ERROR;
/* Read particles to ensure that all of them were written correctly */
- HDmemset(readPart, 0, sizeof(readPart));
+ memset(readPart, 0, sizeof(readPart));
for (c = 0; c < BIG_TABLE_SIZE; c++) {
err = H5PTget_next(table, (size_t)1, readPart);
if (err < 0)
@@ -983,7 +983,7 @@ main(void)
/* create a file using default properties */
fid = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- HDputs("Testing packet table");
+ puts("Testing packet table");
/* Test packet table with fixed length */
if (test_packet_table(fid) < 0)
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index aa88a6c..6c6afaa 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -68,9 +68,9 @@ test_VLof_atomic(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -109,7 +109,7 @@ test_VLof_atomic(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -120,8 +120,8 @@ test_VLof_atomic(void)
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- HDprintf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- HDprintf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -188,9 +188,9 @@ test_VLof_comptype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(VLcomp_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -246,7 +246,7 @@ test_VLof_comptype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -257,14 +257,14 @@ test_VLof_comptype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
- HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n",
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n",
__LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
continue;
} /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv]) {
- HDfprintf(
+ fprintf(
stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv,
(int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]);
continue;
@@ -344,16 +344,16 @@ test_compound_VL_VLtype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].u = uu * 10;
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
- writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ writeBuf[uu].v.p = malloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++) {
- t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
+ t1->p = malloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + L2_INCM;
@@ -418,7 +418,7 @@ test_compound_VL_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -429,18 +429,18 @@ test_compound_VL_VLtype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
- HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
- HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
(double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
- HDfprintf(stderr,
+ fprintf(stderr,
"%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n",
__LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
@@ -449,13 +449,13 @@ test_compound_VL_VLtype(void)
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0;
(size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
__LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww]) {
- HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
@@ -527,16 +527,16 @@ test_VLof_VLtype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++) {
- t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
+ t1->p = malloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + 1;
@@ -582,7 +582,7 @@ test_VLof_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -652,10 +652,10 @@ verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value)
ret = SUCCEED;
else {
char lenthtype[20];
- HDstrcpy(lenthtype, "fixed-length");
+ strcpy(lenthtype, "fixed-length");
if (expected_value == 1)
- HDstrcpy(lenthtype, "variable-length");
- HDfprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
+ strcpy(lenthtype, "variable-length");
+ fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
ret = FAIL;
}
@@ -990,7 +990,7 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type)
*buf = '\0';
if ((name_size = H5Iget_name(dset_id, (char *)buf, NAME_BUF_SIZE)) < 0)
goto error;
- VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match");
+ VERIFY(strcmp(buf, table_name), "Names of dataset and packet table don't match");
/* Get the packet table's datatype ID */
if ((dtype_id = H5PTget_type(ptable)) < 0)
@@ -1007,10 +1007,10 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type)
*/
char lenthtype[20];
if (uses_vlen_type == TRUE)
- HDstrcpy(lenthtype, "variable-length");
+ strcpy(lenthtype, "variable-length");
else
- HDstrcpy(lenthtype, "fixed-length");
- HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype);
+ strcpy(lenthtype, "fixed-length");
+ fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype);
goto error;
}
@@ -1103,9 +1103,9 @@ testfl_VLof_atomic(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -1144,7 +1144,7 @@ testfl_VLof_atomic(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1155,8 +1155,8 @@ testfl_VLof_atomic(void)
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- HDprintf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- HDprintf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@@ -1223,9 +1223,9 @@ testfl_VLof_comptype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(VLcomp_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@@ -1281,7 +1281,7 @@ testfl_VLof_comptype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1292,14 +1292,14 @@ testfl_VLof_comptype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
- HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",
+ fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",
__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
continue;
} /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv]) {
- HDfprintf(stderr,
+ fprintf(stderr,
"VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv,
((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
continue;
@@ -1379,16 +1379,16 @@ testfl_compound_VL_VLtype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].u = uu * 10;
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
- writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
+ writeBuf[uu].v.p = malloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++) {
- t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
+ t1->p = malloc((vv + L2_INCM) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + L2_INCM;
@@ -1453,7 +1453,7 @@ testfl_compound_VL_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1464,18 +1464,18 @@ testfl_compound_VL_VLtype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
- HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
+ fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu,
writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
- HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
+ fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu,
(double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
- HDfprintf(stderr,
+ fprintf(stderr,
"%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n",
__LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
@@ -1484,13 +1484,13 @@ testfl_compound_VL_VLtype(void)
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0;
(size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
- HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
+ fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n",
__LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww]) {
- HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
+ fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww,
((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
@@ -1562,16 +1562,16 @@ testfl_VLof_VLtype(void)
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
- writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
+ writeBuf[uu].p = malloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++) {
- t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
+ t1->p = malloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
- HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + 1;
@@ -1617,7 +1617,7 @@ testfl_VLof_VLtype(void)
if (ret < 0)
goto error;
- HDsnprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
+ snprintf(msg, sizeof(msg), "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@@ -1683,7 +1683,7 @@ test_packet_table_with_varlen(void)
if (H5Fclose(fid) < 0)
return FAIL;
- HDputs("Testing packet table with various variable-length datatypes");
+ puts("Testing packet table with various variable-length datatypes");
/* If any test fails, move on to subsequent test, but status will indicate
there is a failure. */
@@ -1731,7 +1731,7 @@ test_packet_table_with_varlen(void)
if (H5Fclose(fid) < 0)
return FAIL;
- HDputs("Testing packet table with various variable-length datatypes - H5PTcreate_fl");
+ puts("Testing packet table with various variable-length datatypes - H5PTcreate_fl");
/* If any test fails, move on to subsequent test, but status will indicate
there is a failure. */
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 90a930c..66718e2 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -137,8 +137,8 @@ h5file_open(const char *fname, unsigned flags)
/* open */
if ((fid = H5Fopen(data_file, flags, H5P_DEFAULT)) < 0) {
- HDfprintf(stderr, "Error: Cannot open file <%s>\n", data_file);
- HDexit(1);
+ fprintf(stderr, "Error: Cannot open file <%s>\n", data_file);
+ exit(1);
}
return fid;
@@ -151,13 +151,13 @@ h5file_open(const char *fname, unsigned flags)
static int
cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf)
{
- if ((HDstrcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
+ if ((strcmp(rbuf[i].name, wbuf[j].name) != 0) || rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi || !H5_FLT_ABS_EQUAL(rbuf[i].pressure, wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature, wbuf[j].temperature)) {
- HDfprintf(stderr, "read and write buffers have differences\n");
- HDfprintf(stderr, "%s %ld %f %f %d\n", rbuf[i].name, rbuf[i].longi, (double)rbuf[i].pressure,
+ fprintf(stderr, "read and write buffers have differences\n");
+ fprintf(stderr, "%s %ld %f %f %d\n", rbuf[i].name, rbuf[i].longi, (double)rbuf[i].pressure,
rbuf[i].temperature, rbuf[i].lati);
- HDfprintf(stderr, "%s %ld %f %f %d\n", wbuf[j].name, wbuf[j].longi, (double)wbuf[j].pressure,
+ fprintf(stderr, "%s %ld %f %f %d\n", wbuf[j].name, wbuf[j].longi, (double)wbuf[j].pressure,
wbuf[j].temperature, wbuf[j].lati);
return -1;
}
@@ -478,9 +478,9 @@ test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
if (do_write)
- HDstrcpy(tname, "table2");
+ strcpy(tname, "table2");
else
- HDstrcpy(tname, "table1");
+ strcpy(tname, "table1");
rstart = 0;
rrecords = 8;
@@ -618,7 +618,7 @@ test_table(hid_t fid, int do_write)
wbufd[i].longi = wbuf[i].longi;
wbufd[i].pressure = wbuf[i].pressure;
wbufd[i].temperature = wbuf[i].temperature;
- HDstrcpy(wbufd[i].name, wbuf[i].name);
+ strcpy(wbufd[i].name, wbuf[i].name);
}
if (H5TBmake_table(TITLE, fid, "table3", FIELDS, RECORDS, type_size_mem, field_names, field_offset,
@@ -1024,9 +1024,9 @@ test_table(hid_t fid, int do_write)
if (rbuf[i].lati != position_in[i - NRECORDS_ADD + 1].lati ||
rbuf[i].longi != position_in[i - NRECORDS_ADD + 1].longi ||
!H5_FLT_ABS_EQUAL(rbuf[i].pressure, pressure_in[i - NRECORDS_ADD + 1])) {
- HDfprintf(stderr, "%ld %f %d\n", rbuf[i].longi, (double)rbuf[i].pressure,
+ fprintf(stderr, "%ld %f %d\n", rbuf[i].longi, (double)rbuf[i].pressure,
rbuf[i].lati);
- HDfprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i],
+ fprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i],
position_in[i].lati);
goto out;
}
@@ -1132,7 +1132,7 @@ test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) {
goto out;
}
@@ -1140,7 +1140,7 @@ test_table(hid_t fid, int do_write)
/* reset buffer */
for (i = 0; i < NRECORDS; i++) {
- HDstrcpy(namepre_out[i].name, "\0");
+ strcpy(namepre_out[i].name, "\0");
namepre_out[i].pressure = -1;
}
@@ -1157,7 +1157,7 @@ test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for (i = 0; i < 3; i++) {
hsize_t iistart = start;
- if ((HDstrcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, namepre_in[iistart + i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart + i].pressure)) {
goto out;
}
@@ -1320,7 +1320,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, namepre_in[i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[i].pressure)) {
goto out;
}
@@ -1328,7 +1328,7 @@ test_table(hid_t fid, int do_write)
/* reset buffer */
for (i = 0; i < NRECORDS; i++) {
- HDstrcpy(namepre_out[i].name, "\0");
+ strcpy(namepre_out[i].name, "\0");
namepre_out[i].pressure = -1;
}
@@ -1349,7 +1349,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for (i = 0; i < 3; i++) {
int iistart = (int)start;
- if ((HDstrcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) ||
+ if ((strcmp(namepre_out[i].name, wbuf[iistart + (int)i].name) != 0) ||
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart + (int)i].pressure)) {
goto out;
}
@@ -1385,7 +1385,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati ||
+ if ((strcmp(rbuf2[i].name, wbuf[i].name) != 0) || rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi || !H5_FLT_ABS_EQUAL(rbuf2[i].pressure, wbuf[i].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf2[i].temperature, wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i]) {
@@ -1421,7 +1421,7 @@ test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for (i = 0; i < NRECORDS; i++) {
- if ((HDstrcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati ||
+ if ((strcmp(rbuf3[i].name, wbuf[i].name) != 0) || rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
!H5_DBL_ABS_EQUAL(rbuf3[i].temperature, wbuf[i].temperature)) {
goto out;
@@ -1465,9 +1465,9 @@ test_table(hid_t fid, int do_write)
HL_TESTING2("getting field info");
/* allocate */
- names_out = (char **)HDmalloc(sizeof(char *) * (size_t)NFIELDS);
+ names_out = (char **)malloc(sizeof(char *) * (size_t)NFIELDS);
for (i = 0; i < NFIELDS; i++) {
- names_out[i] = (char *)HDmalloc(sizeof(char) * 255);
+ names_out[i] = (char *)malloc(sizeof(char) * 255);
}
/* Get field info */
@@ -1475,16 +1475,16 @@ test_table(hid_t fid, int do_write)
goto out;
for (i = 0; i < NFIELDS; i++) {
- if ((HDstrcmp(field_names[i], names_out[i]) != 0)) {
+ if ((strcmp(field_names[i], names_out[i]) != 0)) {
goto out;
}
}
/* release */
for (i = 0; i < NFIELDS; i++) {
- HDfree(names_out[i]);
+ free(names_out[i]);
}
- HDfree(names_out);
+ free(names_out);
PASSED();
@@ -1517,7 +1517,7 @@ main(void)
/* create a file using default properties */
fid = H5Fcreate("test_table.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- HDputs("Testing table with file creation mode (read/write in native architecture):");
+ puts("Testing table with file creation mode (read/write in native architecture):");
/* test, do write */
if (test_table(fid, 1) < 0)
@@ -1530,7 +1530,7 @@ main(void)
* test2: open a file written in test1 on a big-endian machine
*-------------------------------------------------------------------------
*/
- HDputs("Testing table with file open mode (read big-endian data):");
+ puts("Testing table with file open mode (read big-endian data):");
fid = h5file_open(TEST_FILE_BE, flags);
@@ -1545,7 +1545,7 @@ main(void)
* test3: open a file written in test1 on a little-endian machine
*-------------------------------------------------------------------------
*/
- HDputs("Testing table with file open mode (read little-endian data):");
+ puts("Testing table with file open mode (read little-endian data):");
fid = h5file_open(TEST_FILE_LE, flags);
@@ -1560,7 +1560,7 @@ main(void)
* test4: open a file written in test1 on the Cray T3 machine
*-------------------------------------------------------------------------
*/
- HDputs("Testing table with file open mode (read Cray data):");
+ puts("Testing table with file open mode (read Cray data):");
fid = h5file_open(TEST_FILE_CRAY, flags);