diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 20:43:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 20:43:30 (GMT) |
commit | 1e91d96fa02466ffe451319bdac1005f84dc7993 (patch) | |
tree | 4de04ef502c313dfd766497b20235188761146c0 /hl | |
parent | 95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff) | |
download | hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2 |
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'hl')
-rw-r--r-- | hl/fortran/src/H5DSfc.c | 12 | ||||
-rw-r--r-- | hl/fortran/src/H5IMcc.c | 4 | ||||
-rw-r--r-- | hl/fortran/src/H5IMfc.c | 34 | ||||
-rw-r--r-- | hl/fortran/src/H5LTfc.c | 48 | ||||
-rw-r--r-- | hl/fortran/src/H5TBfc.c | 106 | ||||
-rw-r--r-- | hl/src/H5DO.c | 4 | ||||
-rw-r--r-- | hl/src/H5DS.c | 156 | ||||
-rw-r--r-- | hl/src/H5IM.c | 20 | ||||
-rw-r--r-- | hl/src/H5LD.c | 44 | ||||
-rw-r--r-- | hl/src/H5LT.c | 84 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.c | 8 | ||||
-rw-r--r-- | hl/src/H5LTparse.c | 10 | ||||
-rw-r--r-- | hl/src/H5PT.c | 18 | ||||
-rw-r--r-- | hl/src/H5TB.c | 78 | ||||
-rw-r--r-- | hl/test/gen_test_ds.c | 16 | ||||
-rw-r--r-- | hl/test/test_ds.c | 72 | ||||
-rw-r--r-- | hl/test/test_dset_append.c | 14 | ||||
-rw-r--r-- | hl/test/test_file_image.c | 70 | ||||
-rw-r--r-- | hl/test/test_h5do_compat.c | 2 | ||||
-rw-r--r-- | hl/test/test_image.c | 92 | ||||
-rw-r--r-- | hl/test/test_ld.c | 40 | ||||
-rw-r--r-- | hl/test/test_lite.c | 144 | ||||
-rw-r--r-- | hl/test/test_packet.c | 10 | ||||
-rw-r--r-- | hl/test/test_packet_vlen.c | 123 | ||||
-rw-r--r-- | hl/test/test_table.c | 29 | ||||
-rw-r--r-- | hl/tools/gif2h5/hdf2gif.c | 2 | ||||
-rw-r--r-- | hl/tools/h5watch/extend_dset.c | 48 | ||||
-rw-r--r-- | hl/tools/h5watch/h5watch.c | 129 | ||||
-rw-r--r-- | hl/tools/h5watch/h5watchgentest.c | 10 |
29 files changed, 712 insertions, 715 deletions
diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index 9ebd322..8029d34 100644 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.c @@ -54,7 +54,7 @@ h5dsset_scale_c(hid_t_f *dsid, _fcd dimname, size_t_f *dimnamelen) done: if (c_dimname) - HDfree(c_dimname); + free(c_dimname); return ret_value; @@ -231,7 +231,7 @@ h5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *labellen) done: if (c_label) - HDfree(c_label); + free(c_label); return ret_value; @@ -262,7 +262,7 @@ h5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) /* * Allocate buffer to hold label */ - if ((c_label = (char *)HDmalloc((size_t)*size + 1)) == NULL) + if ((c_label = (char *)malloc((size_t)*size + 1)) == NULL) HGOTO_DONE(FAIL); /* @@ -282,7 +282,7 @@ done: *size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the * trailing NULL in the length calculation, Ref. HDFFV-7596 */ if (c_label) - HDfree(c_label); + free(c_label); return ret_value; } /* end h5dsget_label_c() */ @@ -312,7 +312,7 @@ h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) /* * Allocate buffer to hold name */ - if ((c_scale_name = (char *)HDmalloc((size_t)*size + 1)) == NULL) + if ((c_scale_name = (char *)malloc((size_t)*size + 1)) == NULL) HGOTO_DONE(FAIL); /* @@ -330,7 +330,7 @@ h5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) done: if (c_scale_name) - HDfree(c_scale_name); + free(c_scale_name); return ret_value; } /* end h5dsget_scale_name_c() */ diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index 2084826..53c1f69 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -469,7 +469,7 @@ H5IM_get_palette(hid_t loc_id, const char *image_name, int pal_number, hid_t tid dim_ref = (size_t)n_refs; - refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * dim_ref); + refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * dim_ref); if (H5Aread(attr_id, attr_type, refbuf) < 0) goto out; @@ -489,7 +489,7 @@ H5IM_get_palette(hid_t loc_id, const char *image_name, int pal_number, hid_t tid if (H5Dclose(pal_id) < 0) goto out; - HDfree(refbuf); + free(refbuf); } /* H5T_REFERENCE */ diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index cead871..1e060ad 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -63,7 +63,7 @@ h5immake_image_8bit_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f * done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -110,7 +110,7 @@ h5imread_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *buf) done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -168,9 +168,9 @@ h5immake_image_24bit_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f * done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_il != NULL) - HDfree(c_il); + free(c_il); return ret_value; } @@ -215,7 +215,7 @@ h5imget_image_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *w /* * allocate buffer to hold name of an attribute */ - if ((c_buf = (char *)HDmalloc((size_t)*ilen + 1)) == NULL) + if ((c_buf = (char *)malloc((size_t)*ilen + 1)) == NULL) goto done; /* @@ -242,9 +242,9 @@ h5imget_image_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *w done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_buf != NULL) - HDfree(c_buf); + free(c_buf); return ret_value; } @@ -287,7 +287,7 @@ h5imis_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) ret = H5IMis_image(c_loc_id, c_name); if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret; } @@ -334,7 +334,7 @@ h5immake_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *dim done: if (c_name) - HDfree(c_name); + free(c_name); return ret_value; } @@ -389,9 +389,9 @@ h5imlink_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *ilen done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_namepal != NULL) - HDfree(c_namepal); + free(c_namepal); return ret_value; } @@ -446,9 +446,9 @@ h5imunlink_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *il done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_namepal != NULL) - HDfree(c_namepal); + free(c_namepal); return ret_value; } @@ -501,7 +501,7 @@ h5imget_npalettes_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *np done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -557,7 +557,7 @@ h5imget_palette_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -607,7 +607,7 @@ h5imget_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *pal_numb done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -650,7 +650,7 @@ h5imis_palette_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) ret = H5IMis_palette(c_loc_id, c_name); if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret; } diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index c888eec..9555e9f 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -49,7 +49,7 @@ h5ltmake_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank, h if (c_name == NULL) goto done; - c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * ((size_t)*rank)); + c_dims = (hsize_t *)malloc(sizeof(hsize_t) * ((size_t)*rank)); if (c_dims == NULL) goto done; /* @@ -71,9 +71,9 @@ h5ltmake_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *rank, h done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_dims != NULL) - HDfree(c_dims); + free(c_dims); return ret_value; } @@ -124,7 +124,7 @@ h5ltread_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hid_t_f *type_ done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -179,9 +179,9 @@ h5ltmake_dataset_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_ done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_buf != NULL) - HDfree(c_buf); + free(c_buf); return ret_value; } @@ -231,7 +231,7 @@ h5ltread_dataset_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, char *b done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -324,11 +324,11 @@ h5ltset_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_attrname != NULL) - HDfree(c_attrname); + free(c_attrname); if (c_buf != NULL) - HDfree(c_buf); + free(c_buf); return ret_value; } @@ -405,9 +405,9 @@ h5ltget_attribute_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, size_t_f done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_attrname != NULL) - HDfree(c_attrname); + free(c_attrname); return ret_value; } @@ -451,7 +451,7 @@ h5ltget_attribute_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, si /* * Allocate buffer to hold C attribute string */ - if ((c_buf = (char *)HDmalloc((size_t)*buf_size + 1)) == NULL) + if ((c_buf = (char *)malloc((size_t)*buf_size + 1)) == NULL) goto done; /* @@ -470,11 +470,11 @@ h5ltget_attribute_string_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, si done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_attrname != NULL) - HDfree(c_attrname); + free(c_attrname); if (c_buf != NULL) - HDfree(c_buf); + free(c_buf); return ret_value; } @@ -526,7 +526,7 @@ h5ltget_dataset_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *ra done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -569,7 +569,7 @@ h5ltfind_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) ret = H5LTfind_dataset(c_loc_id, c_name); if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret; } @@ -639,7 +639,7 @@ h5ltget_dataset_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f done: if (c_name != NULL) - HDfree(c_name); + free(c_name); return ret_value; } @@ -697,9 +697,9 @@ h5ltget_attribute_ndims_c(hid_t_f *loc_id, size_t_f *namelen, _fcd dsetname, siz done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_attrname != NULL) - HDfree(c_attrname); + free(c_attrname); return ret_value; } @@ -774,9 +774,9 @@ h5ltget_attribute_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f done: if (c_name != NULL) - HDfree(c_name); + free(c_name); if (c_attrname != NULL) - HDfree(c_attrname); + free(c_attrname); return ret_value; } @@ -821,7 +821,7 @@ h5ltpath_valid_c(hid_t_f *loc_id, _fcd path, size_t_f *pathlen, int_f *check_obj done: if (c_path != NULL) - HDfree(c_path); + free(c_path); return (int_f)ret; } diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 588638c..5bbc326 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -61,9 +61,9 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name HGOTO_DONE(FAIL) if (NULL == (c_name1 = (char *)HD5f2cstring(name1, (size_t)*namelen1))) HGOTO_DONE(FAIL) - if (NULL == (c_field_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) + if (NULL == (c_field_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) - if (NULL == (c_field_types = (hid_t *)HDmalloc(sizeof(hid_t) * (size_t)c_nfields))) + if (NULL == (c_field_types = (hid_t *)malloc(sizeof(hid_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) for (i = 0; i < num_elem; i++) { @@ -74,7 +74,7 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name /* * allocate array of character pointers */ - if (NULL == (c_field_names = (char **)HDcalloc((size_t)num_elem, sizeof(char *)))) + if (NULL == (c_field_names = (char **)calloc((size_t)num_elem, sizeof(char *)))) HGOTO_DONE(FAIL) /* copy data to long C string */ @@ -86,9 +86,9 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name */ tmp_p = tmp; for (i = 0; i < num_elem; i++) { - if (NULL == (c_field_names[i] = (char *)HDmalloc((size_t)char_len_field_names[i] + 1))) + if (NULL == (c_field_names[i] = (char *)malloc((size_t)char_len_field_names[i] + 1))) HGOTO_DONE(FAIL) - HDmemcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]); + memcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]); c_field_names[i][char_len_field_names[i]] = '\0'; tmp_p = tmp_p + *max_char_size_field_names; } /* end for */ @@ -103,22 +103,22 @@ h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *name done: if (c_name) - HDfree(c_name); + free(c_name); if (c_name1) - HDfree(c_name1); + free(c_name1); if (c_field_names) { for (i = 0; i < num_elem; i++) { if (c_field_names[i]) - HDfree(c_field_names[i]); + free(c_field_names[i]); } /* end for */ - HDfree(c_field_names); + free(c_field_names); } /* end if */ if (tmp) - HDfree(tmp); + free(tmp); if (c_field_offset) - HDfree(c_field_offset); + free(c_field_offset); if (c_field_types) - HDfree(c_field_types); + free(c_field_types); return ret_value; } /* end h5tbmake_table_c() */ @@ -166,9 +166,9 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * HGOTO_DONE(FAIL) if (NULL == (c_name1 = (char *)HD5f2cstring(name1, (size_t)*namelen1))) HGOTO_DONE(FAIL) - if (NULL == (c_field_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) + if (NULL == (c_field_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) - if (NULL == (c_field_types = (hid_t *)HDmalloc(sizeof(hid_t) * (size_t)c_nfields))) + if (NULL == (c_field_types = (hid_t *)malloc(sizeof(hid_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) for (i = 0; i < num_elem; i++) { @@ -179,7 +179,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * /* * allocate array of character pointers */ - if (NULL == (c_field_names = (char **)HDcalloc((size_t)num_elem, sizeof(char *)))) + if (NULL == (c_field_names = (char **)calloc((size_t)num_elem, sizeof(char *)))) HGOTO_DONE(FAIL) /* copy data to long C string */ @@ -191,9 +191,9 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * */ tmp_p = tmp; for (i = 0; i < num_elem; i++) { - if (NULL == (c_field_names[i] = (char *)HDmalloc((size_t)char_len_field_names[i] + 1))) + if (NULL == (c_field_names[i] = (char *)malloc((size_t)char_len_field_names[i] + 1))) HGOTO_DONE(FAIL) - HDmemcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]); + memcpy(c_field_names[i], tmp_p, (size_t)char_len_field_names[i]); c_field_names[i][char_len_field_names[i]] = '\0'; tmp_p = tmp_p + *max_char_size_field_names; } /* end for */ @@ -208,22 +208,22 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * done: if (c_name) - HDfree(c_name); + free(c_name); if (c_name1) - HDfree(c_name1); + free(c_name1); if (c_field_names) { for (i = 0; i < num_elem; i++) { if (c_field_names[i]) - HDfree(c_field_names[i]); + free(c_field_names[i]); } /* end for */ - HDfree(c_field_names); + free(c_field_names); } /* end if */ if (tmp) - HDfree(tmp); + free(tmp); if (c_field_offset) - HDfree(c_field_offset); + free(c_field_offset); if (c_field_types) - HDfree(c_field_types); + free(c_field_types); return ret_value; } /* end h5tbmake_table_c() */ @@ -260,9 +260,9 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) HGOTO_DONE(FAIL) - if (NULL == (c_dst_offset = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) + if (NULL == (c_dst_offset = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) - if (NULL == (c_dst_sizes = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) + if (NULL == (c_dst_sizes = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) for (i = 0; i < c_nfields; i++) { @@ -278,12 +278,12 @@ h5tbread_table_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hsize_t_f *nfiel done: if (c_name) - HDfree(c_name); + free(c_name); if (c_dst_offset) - HDfree(c_dst_offset); + free(c_dst_offset); if (c_dst_sizes) - HDfree(c_dst_sizes); + free(c_dst_sizes); return ret_value; } /* end h5tbmake_table_c() */ @@ -329,9 +329,9 @@ h5tbwrite_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f * done: if (c_name) - HDfree(c_name); + free(c_name); if (c_name1) - HDfree(c_name1); + free(c_name1); return ret_value; } @@ -377,9 +377,9 @@ h5tbread_field_name_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *n done: if (c_name) - HDfree(c_name); + free(c_name); if (c_name1) - HDfree(c_name1); + free(c_name1); return ret_value; } @@ -423,7 +423,7 @@ h5tbwrite_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *fi done: if (c_name) - HDfree(c_name); + free(c_name); return ret_value; } @@ -467,7 +467,7 @@ h5tbread_field_index_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, int_f *fie done: if (c_name) - HDfree(c_name); + free(c_name); return ret_value; } @@ -512,9 +512,9 @@ h5tbinsert_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name done: if (c_name) - HDfree(c_name); + free(c_name); if (c_name1) - HDfree(c_name1); + free(c_name1); return ret_value; } @@ -557,9 +557,9 @@ h5tbdelete_field_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, size_t_f *name done: if (c_name) - HDfree(c_name); + free(c_name); if (c_name1) - HDfree(c_name1); + free(c_name1); return ret_value; } @@ -604,7 +604,7 @@ h5tbget_table_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n done: if (c_name) - HDfree(c_name); + free(c_name); return ret_value; } @@ -655,15 +655,15 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n */ if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) HGOTO_DONE(FAIL) - if (NULL == (c_field_offsets = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) + if (NULL == (c_field_offsets = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) - if (NULL == (c_field_sizes = (size_t *)HDmalloc(sizeof(size_t) * (size_t)c_nfields))) + if (NULL == (c_field_sizes = (size_t *)malloc(sizeof(size_t) * (size_t)c_nfields))) HGOTO_DONE(FAIL) - if (NULL == (c_field_names = (char **)HDcalloc((size_t)c_nfields, sizeof(char *)))) + if (NULL == (c_field_names = (char **)calloc((size_t)c_nfields, sizeof(char *)))) HGOTO_DONE(FAIL) for (i = 0; i < c_nfields; i++) - if (NULL == (c_field_names[i] = (char *)HDmalloc(sizeof(char) * HLTB_MAX_FIELD_LEN))) + if (NULL == (c_field_names[i] = (char *)malloc(sizeof(char) * HLTB_MAX_FIELD_LEN))) HGOTO_DONE(FAIL) /* @@ -676,15 +676,15 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n /* return values */ /* names array */ - if (NULL == (tmp = (char *)HDmalloc((c_lenmax * (size_t)c_nfields) + 1))) + if (NULL == (tmp = (char *)malloc((c_lenmax * (size_t)c_nfields) + 1))) HGOTO_DONE(FAIL) tmp_p = tmp; - HDmemset(tmp, ' ', c_lenmax * (size_t)c_nfields); + memset(tmp, ' ', c_lenmax * (size_t)c_nfields); tmp[c_lenmax * c_nfields] = '\0'; for (i = 0; i < c_nfields; i++) { size_t field_name_len = HDstrlen(c_field_names[i]); - HDmemcpy(tmp_p, c_field_names[i], field_name_len); + memcpy(tmp_p, c_field_names[i], field_name_len); namelen2[i] = (size_t_f)field_name_len; length = MAX(length, strlen((c_field_names[i]))); tmp_p = tmp_p + c_lenmax; @@ -702,19 +702,19 @@ h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *n done: if (c_name) - HDfree(c_name); + free(c_name); if (c_field_names) { for (i = 0; i < num_elem; i++) if (c_field_names[i]) - HDfree(c_field_names[i]); - HDfree(c_field_names); + free(c_field_names[i]); + free(c_field_names); } /* end if */ if (tmp) - HDfree(tmp); + free(tmp); if (c_field_offsets) - HDfree(c_field_offsets); + free(c_field_offsets); if (c_field_sizes) - HDfree(c_field_sizes); + free(c_field_sizes); return ret_value; } diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 580c6a1..28fe494 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -199,7 +199,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t goto done; /* Allocate the boundary array */ - boundary = (hsize_t *)HDmalloc(ndims * sizeof(hsize_t)); + boundary = (hsize_t *)malloc(ndims * sizeof(hsize_t)); /* Retrieve the append flush property */ if (H5Pget_append_flush(dapl, ndims, boundary, &append_cb, &udata) < 0) @@ -247,7 +247,7 @@ done: ret_value = FAIL; if (boundary) - HDfree(boundary); + free(boundary); return ret_value; } /* H5DOappend() */ diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 34de473..6656f5e 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -310,7 +310,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) goto out; /* allocate and initialize the VL */ - buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t)); + buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; @@ -322,11 +322,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) /* store the REF information in the index of the dataset that has the DS */ buf[idx].len = 1; if (is_new_ref) { - buf[idx].p = HDmalloc(1 * sizeof(H5R_ref_t)); + buf[idx].p = malloc(1 * sizeof(H5R_ref_t)); ((H5R_ref_t *)buf[idx].p)[0] = nref_to_ds; } else { - buf[idx].p = HDmalloc(1 * sizeof(hobj_ref_t)); + buf[idx].p = malloc(1 * sizeof(hobj_ref_t)); ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds; } /* write the attribute with the reference */ @@ -344,9 +344,9 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) goto out; if (H5Aclose(aid) < 0) goto out; - HDfree(buf[idx].p); + free(buf[idx].p); buf[idx].p = NULL; - HDfree(buf); + free(buf); buf = NULL; } @@ -366,7 +366,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) goto out; /* allocate and initialize the VL */ - buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t)); + buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; @@ -421,11 +421,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) buf[idx].len++; len = buf[idx].len; if (is_new_ref) { - buf[idx].p = HDrealloc(buf[idx].p, len * sizeof(H5R_ref_t)); + buf[idx].p = realloc(buf[idx].p, len * sizeof(H5R_ref_t)); ((H5R_ref_t *)buf[idx].p)[len - 1] = nref_to_ds; } else { - buf[idx].p = HDrealloc(buf[idx].p, len * sizeof(hobj_ref_t)); + buf[idx].p = realloc(buf[idx].p, len * sizeof(hobj_ref_t)); ((hobj_ref_t *)buf[idx].p)[len - 1] = ref_to_ds; } } /* end if */ @@ -433,11 +433,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) /* store the REF information in the index of the dataset that has the DS */ buf[idx].len = 1; if (is_new_ref) { - buf[idx].p = HDmalloc(sizeof(H5R_ref_t)); + buf[idx].p = malloc(sizeof(H5R_ref_t)); ((H5R_ref_t *)buf[idx].p)[0] = nref_to_ds; } else { - buf[idx].p = HDmalloc(sizeof(hobj_ref_t)); + buf[idx].p = malloc(sizeof(hobj_ref_t)); ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds; } } /* end else */ @@ -460,7 +460,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) goto out; if (H5Aclose(aid) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; } /* has_dimlist */ @@ -554,14 +554,14 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) nelmts++; if (is_new_ref) { - ndsbuf = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t)); + ndsbuf = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t)); if (ndsbuf == NULL) goto out; if (H5Aread(aid, ntid, ndsbuf) < 0) goto out; } else { - dsbuf = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t)); + dsbuf = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; if (H5Aread(aid, ntid, dsbuf) < 0) @@ -580,12 +580,12 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) /* Allocate new buffer to copy old references and add new one */ if (is_new_ref) { - ndsbuf_w = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t)); + ndsbuf_w = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t)); if (ndsbuf_w == NULL) goto out; } else { - dsbuf_w = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t)); + dsbuf_w = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf_w == NULL) goto out; } @@ -653,15 +653,15 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) if (H5Tclose(ntid) < 0) goto out; if (is_new_ref) { - HDfree(ndsbuf); + free(ndsbuf); dsbuf = NULL; - HDfree(ndsbuf_w); + free(ndsbuf_w); dsbuf = NULL; } else { - HDfree(dsbuf); + free(dsbuf); dsbuf = NULL; - HDfree(dsbuf_w); + free(dsbuf_w); dsbuf = NULL; } } /* has_reflist */ @@ -684,11 +684,11 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) /* error zone */ out: if (buf) - HDfree(buf); + free(buf); if (dsbuf) - HDfree(dsbuf); + free(dsbuf); if (dsbuf_w) - HDfree(dsbuf_w); + free(dsbuf_w); H5E_BEGIN_TRY { @@ -853,7 +853,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) goto out; /* allocate and initialize the VL */ - buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t)); + buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; @@ -915,7 +915,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) } len = --buf[idx].len; if (len == 0) { - HDfree(buf[idx].p); + free(buf[idx].p); buf[idx].p = NULL; } /* Since a reference to a dim. scale can be inserted only once, @@ -958,7 +958,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) if (H5Aclose(aid) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; /*------------------------------------------------------------------------- @@ -984,22 +984,22 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) goto out; if (is_new_ref) { - ndsbuf = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t)); + ndsbuf = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t)); if (ndsbuf == NULL) goto out; if (H5Aread(aid, ntid, ndsbuf) < 0) goto out; - ndsbuf_w = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t)); + ndsbuf_w = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t)); if (ndsbuf_w == NULL) goto out; } else { - dsbuf = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t)); + dsbuf = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; if (H5Aread(aid, ntid, dsbuf) < 0) goto out; - dsbuf_w = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t)); + dsbuf_w = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf_w == NULL) goto out; } @@ -1152,14 +1152,14 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) if (H5Tclose(ntid) < 0) goto out; if (is_new_ref) { - HDfree(ndsbuf); - HDfree(ndsbuf_w); + free(ndsbuf); + free(ndsbuf_w); ndsbuf = NULL; ndsbuf_w = NULL; } else { - HDfree(dsbuf); - HDfree(dsbuf_w); + free(dsbuf); + free(dsbuf_w); dsbuf = NULL; dsbuf_w = NULL; } @@ -1176,15 +1176,15 @@ out: H5Tclose(tid); if (ndsbuf) { - HDfree(ndsbuf); + free(ndsbuf); ndsbuf = NULL; } if (ndsbuf_w) { - HDfree(ndsbuf_w); + free(ndsbuf_w); ndsbuf_w = NULL; } if (dsbuf) { - HDfree(dsbuf); + free(dsbuf); dsbuf = NULL; } if (buf) { @@ -1192,9 +1192,9 @@ out: free the pointers allocated when we read data in */ for (i = 0; i < rank; i++) { if (buf[i].p) - HDfree(buf[i].p); + free(buf[i].p); } - HDfree(buf); + free(buf); buf = NULL; } } @@ -1337,7 +1337,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx) goto out; /* allocate and initialize the VL */ - buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t)); + buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; @@ -1396,7 +1396,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx) goto out; if (H5Aclose(aid) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; } /* has_dimlist */ @@ -1433,14 +1433,14 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx) goto out; if (is_new_ref) { - ndsbuf = (nds_list_t *)HDmalloc((size_t)nelmts * sizeof(nds_list_t)); + ndsbuf = (nds_list_t *)malloc((size_t)nelmts * sizeof(nds_list_t)); if (ndsbuf == NULL) goto out; if (H5Aread(aid, ntid, ndsbuf) < 0) goto out; } else { - dsbuf = (ds_list_t *)HDmalloc((size_t)nelmts * sizeof(ds_list_t)); + dsbuf = (ds_list_t *)malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; if (H5Aread(aid, ntid, dsbuf) < 0) @@ -1515,11 +1515,11 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx) goto out; if (ndsbuf) { - HDfree(ndsbuf); + free(ndsbuf); ndsbuf = NULL; } if (dsbuf) { - HDfree(dsbuf); + free(dsbuf); dsbuf = NULL; } } /* has_reflist */ @@ -1541,15 +1541,15 @@ out: H5E_END_TRY; if (buf) { - HDfree(buf); + free(buf); buf = NULL; } if (ndsbuf) { - HDfree(ndsbuf); + free(ndsbuf); ndsbuf = NULL; } if (dsbuf) { - HDfree(dsbuf); + free(dsbuf); dsbuf = NULL; } return FAIL; @@ -1672,7 +1672,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi goto out; /* allocate and initialize the VL */ - buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t)); + buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; @@ -1748,7 +1748,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi if (H5Aclose(aid) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; } /* if has_dimlist */ @@ -1759,7 +1759,7 @@ out: { if (buf) { H5Treclaim(tid, sid, H5P_DEFAULT, buf); - HDfree(buf); + free(buf); } H5Sclose(sid); H5Aclose(aid); @@ -1799,7 +1799,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) char const **const_buf; /* buf calls */ } u; - HDmemset(&u, 0, sizeof(u)); + memset(&u, 0, sizeof(u)); /*------------------------------------------------------------------------- * parameter checking @@ -1862,7 +1862,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; /* allocate and initialize */ - u.const_buf = (char const **)HDmalloc((size_t)rank * sizeof(char *)); + u.const_buf = (char const **)malloc((size_t)rank * sizeof(char *)); if (u.const_buf == NULL) goto out; @@ -1885,7 +1885,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) if (H5Aclose(aid) < 0) goto out; if (u.const_buf) { - HDfree(u.const_buf); + free(u.const_buf); u.const_buf = NULL; } } @@ -1904,7 +1904,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; /* allocate and initialize */ - u.buf = (char **)HDmalloc((size_t)rank * sizeof(char *)); + u.buf = (char **)malloc((size_t)rank * sizeof(char *)); if (u.buf == NULL) goto out; @@ -1915,7 +1915,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) /* free the ptr that will be replaced by label */ if (u.buf[idx]) - HDfree(u.buf[idx]); + free(u.buf[idx]); /* store the label information in the required index */ u.const_buf[idx] = label; @@ -1930,7 +1930,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) /* free all the ptr's from the H5Aread() */ for (i = 0; i < (unsigned int)rank; i++) { if (u.buf[i]) - HDfree(u.buf[i]); + free(u.buf[i]); } /* close */ @@ -1939,7 +1939,7 @@ H5DSset_label(hid_t did, unsigned int idx, const char *label) if (H5Aclose(aid) < 0) goto out; if (u.buf) { - HDfree(u.buf); + free(u.buf); u.buf = NULL; } } @@ -1955,9 +1955,9 @@ out: /* free all the ptr's from the H5Aread() */ for (i = 0; i < (unsigned int)rank; i++) { if (u.buf[i]) - HDfree(u.buf[i]); + free(u.buf[i]); } - HDfree(u.buf); + free(u.buf); } H5E_BEGIN_TRY { @@ -2054,7 +2054,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) goto out; /* allocate and initialize */ - buf = (char **)HDmalloc((size_t)rank * sizeof(char *)); + buf = (char **)malloc((size_t)rank * sizeof(char *)); if (buf == NULL) goto out; @@ -2073,7 +2073,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) /* copy all/some of the name */ if (label) { - HDmemcpy(label, buf[idx], copy_len); + memcpy(label, buf[idx], copy_len); /* terminate the string */ label[copy_len] = '\0'; @@ -2082,7 +2082,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) /* free all the ptr's from the H5Aread() */ for (i = 0; i < rank; i++) { if (buf[i]) - HDfree(buf[i]); + free(buf[i]); } /* close */ @@ -2091,7 +2091,7 @@ H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) if (H5Aclose(aid) < 0) goto out; if (buf) { - HDfree(buf); + free(buf); buf = NULL; } @@ -2103,9 +2103,9 @@ out: /* free all the ptr's from the H5Aread() */ for (i = 0; i < rank; i++) { if (buf[i]) - HDfree(buf[i]); + free(buf[i]); } - HDfree(buf); + free(buf); } H5E_BEGIN_TRY { @@ -2192,7 +2192,7 @@ H5DSget_scale_name(hid_t did, char *name, size_t size) goto out; /* allocate a temporary buffer */ - buf = (char *)HDmalloc(nbytes * sizeof(char)); + buf = (char *)malloc(nbytes * sizeof(char)); if (buf == NULL) goto out; @@ -2205,7 +2205,7 @@ H5DSget_scale_name(hid_t did, char *name, size_t size) /* copy all/some of the name */ if (name) { - HDmemcpy(name, buf, copy_len); + memcpy(name, buf, copy_len); /* terminate the string */ name[copy_len] = '\0'; @@ -2219,7 +2219,7 @@ H5DSget_scale_name(hid_t did, char *name, size_t size) if (H5Sclose(sid) < 0) goto out; if (buf) - HDfree(buf); + free(buf); return (ssize_t)(nbytes - 1); @@ -2233,7 +2233,7 @@ out: } H5E_END_TRY; if (buf) - HDfree(buf); + free(buf); return FAIL; } @@ -2315,7 +2315,7 @@ H5DSis_scale(hid_t did) goto out; } - buf = (char *)HDmalloc((size_t)string_size * sizeof(char)); + buf = (char *)malloc((size_t)string_size * sizeof(char)); if (buf == NULL) goto out; @@ -2327,7 +2327,7 @@ H5DSis_scale(hid_t did) if (HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS), HDstrlen(buf))) == 0) is_ds = 1; - HDfree(buf); + free(buf); if (H5Tclose(tid) < 0) goto out; @@ -2337,7 +2337,7 @@ H5DSis_scale(hid_t did) } out: if (is_ds < 0) { - HDfree(buf); + free(buf); H5E_BEGIN_TRY { H5Aclose(aid); @@ -2427,7 +2427,7 @@ H5DSget_num_scales(hid_t did, unsigned int idx) goto out; /* allocate and initialize the VL */ - buf = (hvl_t *)HDmalloc((size_t)rank * sizeof(hvl_t)); + buf = (hvl_t *)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; @@ -2446,7 +2446,7 @@ H5DSget_num_scales(hid_t did, unsigned int idx) goto out; if (H5Aclose(aid) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; } /* has_dimlist */ @@ -2463,7 +2463,7 @@ out: H5E_END_TRY; if (buf) - HDfree(buf); + free(buf); return FAIL; } @@ -2510,7 +2510,7 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved) /* Allocate buffer large enough to hold string */ if ((string_size = H5Tget_size(tid)) == 0) goto error; - if (NULL == (buf = HDmalloc(string_size * sizeof(char)))) + if (NULL == (buf = malloc(string_size * sizeof(char)))) goto error; /* Read the attribute */ @@ -2524,7 +2524,7 @@ H5DS_is_reserved(hid_t did, hbool_t *is_reserved) else *is_reserved = FALSE; - HDfree(buf); + free(buf); if (H5Tclose(tid) < 0) goto error; @@ -2541,7 +2541,7 @@ error: } H5E_END_TRY; - HDfree(buf); + free(buf); return FAIL; } diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 25381fd..e38f096 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -570,7 +570,7 @@ H5IMlink_palette(hid_t loc_id, const char *image_name, const char *pal_name) dim_ref = (hsize_t)n_refs + 1; - refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * (size_t)dim_ref); + refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * (size_t)dim_ref); if (H5Aread(aid, atid, refbuf) < 0) goto out; @@ -611,7 +611,7 @@ H5IMlink_palette(hid_t loc_id, const char *image_name, const char *pal_name) if (H5Aclose(aid) < 0) goto out; - HDfree(refbuf); + free(refbuf); } /* ok_pal > 0 */ @@ -868,7 +868,7 @@ H5IMget_palette_info(hid_t loc_id, const char *image_name, int pal_number, hsize dim_ref = (hsize_t)n_refs; - refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * (size_t)dim_ref); + refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * (size_t)dim_ref); if (H5Aread(aid, atid, refbuf) < 0) goto out; @@ -897,7 +897,7 @@ H5IMget_palette_info(hid_t loc_id, const char *image_name, int pal_number, hsize goto out; if (H5Aclose(aid) < 0) goto out; - HDfree(refbuf); + free(refbuf); } /* Close the image dataset. */ @@ -975,7 +975,7 @@ H5IMget_palette(hid_t loc_id, const char *image_name, int pal_number, unsigned c dim_ref = (hsize_t)n_refs; - refbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * (size_t)dim_ref); + refbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * (size_t)dim_ref); if (H5Aread(aid, atid, refbuf) < 0) goto out; @@ -997,7 +997,7 @@ H5IMget_palette(hid_t loc_id, const char *image_name, int pal_number, unsigned c goto out; if (H5Aclose(aid) < 0) goto out; - HDfree(refbuf); + free(refbuf); } /* Close the image dataset. */ @@ -1081,7 +1081,7 @@ H5IMis_image(hid_t loc_id, const char *dset_name) if ((storage_size = H5Aget_storage_size(aid)) == 0) goto out; - attr_data = (char *)HDmalloc((size_t)storage_size * sizeof(char) + 1); + attr_data = (char *)malloc((size_t)storage_size * sizeof(char) + 1); if (attr_data == NULL) goto out; @@ -1093,7 +1093,7 @@ H5IMis_image(hid_t loc_id, const char *dset_name) else ret = 0; - HDfree(attr_data); + free(attr_data); if (H5Tclose(atid) < 0) goto out; @@ -1180,7 +1180,7 @@ H5IMis_palette(hid_t loc_id, const char *dset_name) if ((storage_size = H5Aget_storage_size(aid)) == 0) goto out; - attr_data = (char *)HDmalloc((size_t)storage_size * sizeof(char) + 1); + attr_data = (char *)malloc((size_t)storage_size * sizeof(char) + 1); if (attr_data == NULL) goto out; @@ -1192,7 +1192,7 @@ H5IMis_palette(hid_t loc_id, const char *dset_name) else ret = 0; - HDfree(attr_data); + free(attr_data); if (H5Tclose(atid) < 0) goto out; diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 30257f6..5e39c08 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -43,12 +43,12 @@ H5LD_clean_vector(H5LD_memb_t *listv[]) { unsigned n; /* Local index variable */ - HDassert(listv); + assert(listv); /* Go through info for each field stored in listv[] */ for (n = 0; listv[n] != NULL; n++) { if (listv[n]->names) { - HDfree(listv[n]->names); + free(listv[n]->names); listv[n]->names = NULL; } /* end if */ @@ -59,7 +59,7 @@ H5LD_clean_vector(H5LD_memb_t *listv[]) } /* end if */ /* Free the H5LD_memb_t structure for the field */ - HDfree(listv[n]); + free(listv[n]); listv[n] = NULL; } /* end for */ } /* H5LD_clean_vector() */ @@ -159,8 +159,8 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid) char *fields_ptr; /* Pointer to "fields" */ int ret_value = FAIL; /* Return value */ - HDassert(listv); - HDassert(fields); + assert(listv); + assert(fields); fields_ptr = fields; nfields = 0; @@ -178,11 +178,11 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid) len = (HDstrlen(fields_ptr) / 2) + 2; /* Allocate memory for an H5LD_memb_t for storing a field's info */ - if (NULL == (memb = (H5LD_memb_t *)HDcalloc((size_t)1, sizeof(H5LD_memb_t)))) + if (NULL == (memb = (H5LD_memb_t *)calloc((size_t)1, sizeof(H5LD_memb_t)))) goto done; /* Allocate memory for an array of pointers to member names */ - if (NULL == (memb->names = (char **)HDcalloc(len, sizeof(char *)))) + if (NULL == (memb->names = (char **)calloc(len, sizeof(char *)))) goto done; memb->names[j] = fields_ptr; @@ -251,8 +251,8 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid) } /* end if */ else { if (memb) { - HDfree(memb->names); - HDfree(memb); + free(memb->names); + free(memb); } goto done; } /* end else */ @@ -350,7 +350,7 @@ H5LD_get_dset_type_size(hid_t did, const char *fields) size_t tot = 0; /* Data type size of all the fields in "fields" */ int n = 0, num = 0; /* Local index variables */ - HDassert(fields && *fields); + assert(fields && *fields); /* Should be a compound datatype if "fields" exists */ if (H5Tget_class(dset_tid) != H5T_COMPOUND) @@ -362,7 +362,7 @@ H5LD_get_dset_type_size(hid_t did, const char *fields) /* Allocate memory for a list of H5LD_memb_t pointers to store "fields" info */ len = (HDstrlen(fields) / 2) + 2; - if (NULL == (listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *)))) + if (NULL == (listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *)))) goto done; /* Process and store info for "fields" */ @@ -388,11 +388,11 @@ done: /* Free the array of H5LD_memb_t pointers */ if (listv) - HDfree(listv); + free(listv); /* Free memory */ if (dup_fields) - HDfree(dup_fields); + free(dup_fields); return (ret_value); } /* H5LD_get_dset_type_size() */ @@ -440,8 +440,8 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims goto done; /* Verify that cur_dims must have one dimension whose size is greater than prev_dims */ - HDmemset(start, 0, sizeof start); - HDmemset(count, 0, sizeof count); + memset(start, 0, sizeof start); + memset(count, 0, sizeof count); ctr = 0; for (i = 0; i < ndims; i++) if (cur_dims[i] > prev_dims[i]) { @@ -462,7 +462,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims goto done; } /* end if */ else { /* changes for more than one dimensions */ - HDmemset(start, 0, sizeof start); + memset(start, 0, sizeof start); /* Make the selection in the dataset based on "cur_dims" and "prev_dims" */ if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, cur_dims, NULL) < 0) @@ -506,7 +506,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims goto done; /* Allocate memory for reading in the elements in the dataset selection */ - if (NULL == (sav_buf = tmp_buf = (char *)HDcalloc((size_t)num_elmts, tot_tsize))) + if (NULL == (sav_buf = tmp_buf = (char *)calloc((size_t)num_elmts, tot_tsize))) goto done; /* Read the dataset elements in the selection */ @@ -519,7 +519,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims /* Allocate memory for the vector of H5LD_memb_t pointers */ len = (HDstrlen(fields) / 2) + 2; - if (NULL == (listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *)))) + if (NULL == (listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *)))) goto done; /* Process and store information for "fields" */ @@ -532,7 +532,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims /* Copy data for "fields" to the input buffer */ for (j = 0; listv[j] != NULL; j++) { - HDmemcpy(buf_p, tmp_buf + listv[j]->tot_offset, listv[j]->last_tsize); + memcpy(buf_p, tmp_buf + listv[j]->tot_offset, listv[j]->last_tsize); buf_p += listv[j]->last_tsize; } /* end for */ tmp_buf += tot_tsize; @@ -555,13 +555,13 @@ done: /* Free the array of H5LD_memb_t pointers */ if (listv) - HDfree(listv); + free(listv); /* Free memory */ if (dup_fields) - HDfree(dup_fields); + free(dup_fields); if (sav_buf) - HDfree(sav_buf); + free(sav_buf); return (ret_value); } /* H5LD_get_dset_elmts() */ diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 4c61aa8..90f0fbf 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -304,7 +304,7 @@ image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void * if (udata->vfd_ref_count != 1) goto out; - if (NULL == (udata->vfd_image_ptr = HDrealloc(ptr, size))) + if (NULL == (udata->vfd_image_ptr = realloc(ptr, size))) goto out; udata->vfd_image_size = size; @@ -356,7 +356,7 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) * references */ if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { - HDfree(udata->fapl_image_ptr); + free(udata->fapl_image_ptr); udata->app_image_ptr = NULL; udata->fapl_image_ptr = NULL; udata->vfd_image_ptr = NULL; @@ -375,7 +375,7 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) * references */ if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { - HDfree(udata->vfd_image_ptr); + free(udata->vfd_image_ptr); udata->app_image_ptr = NULL; udata->fapl_image_ptr = NULL; udata->vfd_image_ptr = NULL; @@ -463,7 +463,7 @@ udata_free(void *_udata) /* checks that there are no references outstanding before deallocating udata */ if (udata->ref_count == 0 && udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0) - HDfree(udata); + free(udata); return (SUCCEED); @@ -832,7 +832,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) H5LT_file_image_ud_t *udata; /* Pointer to udata structure */ /* Allocate buffer to communicate user data to callbacks */ - if (NULL == (udata = (H5LT_file_image_ud_t *)HDmalloc(sizeof(H5LT_file_image_ud_t)))) + if (NULL == (udata = (H5LT_file_image_ud_t *)malloc(sizeof(H5LT_file_image_ud_t)))) goto out; /* Initialize udata with info about app buffer containing file image and flags */ @@ -852,7 +852,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) /* Set file image callbacks */ if (H5Pset_file_image_callbacks(fapl, &callbacks) < 0) { - HDfree(udata); + free(udata); goto out; } /* end if */ } /* end if */ @@ -2021,7 +2021,7 @@ H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) goto out; if (lang_type != H5LT_DDL) { - HDfprintf(stderr, "only DDL is supported for now.\n"); + fprintf(stderr, "only DDL is supported for now.\n"); goto out; } @@ -2029,11 +2029,11 @@ H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) myinput = HDstrdup(text); if ((type_id = H5LTyyparse()) < 0) { - HDfree(myinput); + free(myinput); goto out; } - HDfree(myinput); + free(myinput); input_len = 0; return type_id; @@ -2074,9 +2074,9 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str *len += INCREMENT; } - tmp_realloc = (char *)HDrealloc(buf, *len); + tmp_realloc = (char *)realloc(buf, *len); if (tmp_realloc == NULL) { - HDfree(buf); + free(buf); buf = NULL; goto out; } @@ -2131,7 +2131,7 @@ indentation(size_t x, char *str, hbool_t no_u_buf, size_t *s_len) char tmp_str[TMP_LEN]; if (x < 80) { - HDmemset(tmp_str, ' ', x); + memset(tmp_str, ' ', x); tmp_str[x] = '\0'; } else @@ -2191,8 +2191,8 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) dst_size = H5Tget_size(native); /* Get the names and raw values of all members */ - name = (char **)HDcalloc((size_t)nmembs, sizeof(char *)); - value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(dst_size, super_size)); + name = (char **)calloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char *)calloc((size_t)nmembs, MAX(dst_size, super_size)); for (i = 0; i < nmembs; i++) { if ((name[i] = H5Tget_member_name(type, (unsigned)i)) == NULL) @@ -2219,7 +2219,7 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) nchars = HDsnprintf(tmp_str, TMP_LEN, "\"%s\"", name[i]); if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) goto out; - HDmemset(tmp_str, ' ', (size_t)MAX(3, 19 - nchars) + 1); + memset(tmp_str, ' ', (size_t)MAX(3, 19 - nchars) + 1); tmp_str[MAX(3, 19 - nchars)] = '\0'; if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) goto out; @@ -2240,8 +2240,8 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) for (i = 0; i < nmembs; i++) H5free_memory(name[i]); - HDfree(name); - HDfree(value); + free(name); + free(value); H5Tclose(super); return str; @@ -2250,8 +2250,8 @@ out: if (0 == nmembs) { str = realloc_and_append(no_ubuf, str_len, str, "\n"); - HDassert((indt + 4) < TMP_LEN); - HDmemset(tmp_str, ' ', (indt + 4) + 1); + assert((indt + 4) < TMP_LEN); + memset(tmp_str, ' ', (indt + 4) + 1); tmp_str[(indt + 4)] = '\0'; str = realloc_and_append(no_ubuf, str_len, str, tmp_str); str = realloc_and_append(no_ubuf, str_len, str, " <empty>"); @@ -2261,12 +2261,12 @@ out: if (name) { for (i = 0; i < nmembs; i++) if (name[i]) - HDfree(name[i]); - HDfree(name); + free(name[i]); + free(name); } /* end if */ if (value) - HDfree(value); + free(value); if (super >= 0) H5Tclose(super); @@ -2300,13 +2300,13 @@ H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len) goto out; if (len && !str) { - text_str = (char *)HDcalloc(str_len, sizeof(char)); + text_str = (char *)calloc(str_len, sizeof(char)); text_str[0] = '\0'; if (!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1))) goto out; *len = HDstrlen(text_str) + 1; if (text_str) - HDfree(text_str); + free(text_str); text_str = NULL; } else if (len && str) { @@ -2318,7 +2318,7 @@ H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len) return ret; out: - HDfree(text_str); + free(text_str); return FAIL; } @@ -2694,18 +2694,18 @@ next: goto out; if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char *)HDcalloc(super_len, sizeof(char)); + stmp = (char *)calloc(super_len, sizeof(char)); if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) { - HDfree(stmp); + free(stmp); goto out; } if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) { - HDfree(stmp); + free(stmp); goto out; } if (stmp) - HDfree(stmp); + free(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, ";\n"); @@ -2741,18 +2741,18 @@ next: goto out; if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char *)HDcalloc(super_len, sizeof(char)); + stmp = (char *)calloc(super_len, sizeof(char)); if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) { - HDfree(stmp); + free(stmp); goto out; } if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) { - HDfree(stmp); + free(stmp); goto out; } if (stmp) - HDfree(stmp); + free(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2802,17 +2802,17 @@ next: goto out; if (H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char *)HDcalloc(super_len, sizeof(char)); + stmp = (char *)calloc(super_len, sizeof(char)); if (H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) { - HDfree(stmp); + free(stmp); goto out; } if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) { - HDfree(stmp); + free(stmp); goto out; } if (stmp) - HDfree(stmp); + free(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2860,17 +2860,17 @@ next: if (H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0) goto out; - mtmp = (char *)HDcalloc(mlen, sizeof(char)); + mtmp = (char *)calloc(mlen, sizeof(char)); if (H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) { - HDfree(mtmp); + free(mtmp); goto out; } if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp))) { - HDfree(mtmp); + free(mtmp); goto out; } if (mtmp) - HDfree(mtmp); + free(mtmp); mtmp = NULL; if (H5T_COMPOUND == mclass) @@ -3611,7 +3611,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) done: if (tmp_path != NULL) - HDfree(tmp_path); + free(tmp_path); return ret_value; } diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 3f6feaa..45e3c57 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1480,7 +1480,7 @@ case 55: YY_RULE_SETUP #line 117 "hl/src//H5LTanalyze.l" { - H5LTyylval.ival = HDatoi(yytext); + H5LTyylval.ival = atoi(yytext); return NUMBER; } YY_BREAK @@ -2552,7 +2552,7 @@ trim_quotes(const char *quoted) size_t len = HDstrlen(quoted); char *trimmed; - HDassert(quoted[0] == '"' && quoted[len - 1] == '"'); + assert(quoted[0] == '"' && quoted[len - 1] == '"'); trimmed = HDstrdup(quoted + 1); trimmed[len - 2] = '\0'; @@ -2564,14 +2564,14 @@ static int my_yyinput(char *buf, int max_size) { int ret; - HDmemcpy(buf, myinput, input_len); + memcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } int H5LTyyerror(const char *msg) { - HDprintf("ERROR: %s before \"%s\".\n", msg, yytext); + printf("ERROR: %s before \"%s\".\n", msg, yytext); return 0; } diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index fb12d2c..4386a7c 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1643,7 +1643,7 @@ yyreduce: } } if((yyvsp[-2].sval)) { - HDfree((yyvsp[-2].sval)); + free((yyvsp[-2].sval)); (yyvsp[-2].sval) = NULL; } cmpd_stack[csindex].is_field = 0; @@ -1658,7 +1658,7 @@ yyreduce: #line 205 "hl/src//H5LTparse.y" { (yyval.sval) = HDstrdup(yylval.sval); - HDfree(yylval.sval); + free(yylval.sval); yylval.sval = NULL; } #line 1634 "hl/src//H5LTparse.c" @@ -1728,7 +1728,7 @@ yyreduce: #line 253 "hl/src//H5LTparse.y" { H5Tset_tag((yyvsp[-3].hid), yylval.sval); - HDfree(yylval.sval); + free(yylval.sval); yylval.sval = NULL; } #line 1704 "hl/src//H5LTparse.c" @@ -1872,7 +1872,7 @@ yyreduce: { is_enum_memb = 1; /*indicate member of enum*/ enum_memb_symbol = HDstrdup(yylval.sval); - HDfree(yylval.sval); + free(yylval.sval); yylval.sval = NULL; } #line 1848 "hl/src//H5LTparse.c" @@ -1916,7 +1916,7 @@ yyreduce: } is_enum_memb = 0; - if(enum_memb_symbol) HDfree(enum_memb_symbol); + if(enum_memb_symbol) free(enum_memb_symbol); } H5Tclose(super); diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index 9d5d627..65cdce3 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -84,7 +84,7 @@ H5PTcreate(hid_t loc_id, const char *dset_name, hid_t dtype_id, hsize_t chunk_si goto error; /* Get memory for the table identifier */ - table = (htbl_t *)HDmalloc(sizeof(htbl_t)); + table = (htbl_t *)malloc(sizeof(htbl_t)); if (table == NULL) { goto error; } @@ -153,7 +153,7 @@ error: if (table) { if (table->type_id != H5I_INVALID_HID) H5Tclose(table->type_id); - HDfree(table); + free(table); } return ret_value; @@ -203,7 +203,7 @@ H5PTcreate_fl(hid_t loc_id, const char *dset_name, hid_t dtype_id, hsize_t chunk goto error; /* Get memory for the table identifier */ - table = (htbl_t *)HDmalloc(sizeof(htbl_t)); + table = (htbl_t *)malloc(sizeof(htbl_t)); if (table == NULL) { goto error; } @@ -267,7 +267,7 @@ error: if (table) { if (table->type_id != H5I_INVALID_HID) H5Tclose(table->type_id); - HDfree(table); + free(table); } return ret_value; @@ -310,7 +310,7 @@ H5PTopen(hid_t loc_id, const char *dset_name) H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)H5PT_free_id)) < 0) goto error; - table = (htbl_t *)HDmalloc(sizeof(htbl_t)); + table = (htbl_t *)malloc(sizeof(htbl_t)); if (table == NULL) { goto error; } @@ -370,7 +370,7 @@ error: H5Tclose(table->type_id); if (table->dset_id != H5I_INVALID_HID) H5Dclose(table->dset_id); - HDfree(table); + free(table); } return ret_value; @@ -387,7 +387,7 @@ error: static herr_t H5PT_free_id(void *id, void H5_ATTR_UNUSED **_ctx) { - HDfree(id); + free(id); return SUCCEED; } @@ -422,7 +422,7 @@ H5PT_close(htbl_t *table) if (H5Tclose(table->type_id) < 0) goto error; - HDfree(table); + free(table); return SUCCEED; @@ -432,7 +432,7 @@ error: H5Dclose(table->dset_id); H5Tclose(table->type_id); H5E_END_TRY - HDfree(table); + free(table); } return FAIL; } diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index dd938bf..ccbee50 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -1229,9 +1229,9 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr if (H5TBget_table_info(loc_id, dset_name, &nfields, &ntotal_records) < 0) goto out; - if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t)))) + if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)))) goto out; - if (NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t)))) + if (NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t)))) goto out; /* get field info */ @@ -1251,7 +1251,7 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr read_nrecords = ntotal_records - read_start; if (read_nrecords) { - if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)read_nrecords, src_size))) + if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)read_nrecords, src_size))) goto out; /* read the records after the deleted one(s) */ @@ -1317,11 +1317,11 @@ H5TBdelete_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr out: if (tmp_buf) - HDfree(tmp_buf); + free(tmp_buf); if (src_offset) - HDfree(src_offset); + free(src_offset); if (src_sizes) - HDfree(src_sizes); + free(src_sizes); if (mem_type_id > 0) if (H5Tclose(mem_type_id) < 0) ret_val = -1; @@ -1401,7 +1401,7 @@ H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr goto out; read_nrecords = ntotal_records - start; - if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)read_nrecords, type_size))) + if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)read_nrecords, type_size))) goto out; /* read the records after the inserted one(s) */ @@ -1473,7 +1473,7 @@ H5TBinsert_record(hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nr out: if (tmp_buf) - HDfree(tmp_buf); + free(tmp_buf); if (sid > 0) if (H5Sclose(sid) < 0) ret_val = -1; @@ -1543,9 +1543,9 @@ H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize if (H5TBget_table_info(loc_id, dset_name1, &nfields, &ntotal_records) < 0) goto out; - if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t)))) + if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)))) goto out; - if (NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t)))) + if (NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t)))) goto out; /* get field info */ @@ -1573,7 +1573,7 @@ H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize if (0 == (type_size1 = H5Tget_size(tid))) goto out; - if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, type_size1))) + if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size1))) goto out; /* define a hyperslab in the dataset of the size of the records */ @@ -1601,11 +1601,11 @@ H5TBadd_records_from(hid_t loc_id, const char *dset_name1, hsize_t start1, hsize out: if (tmp_buf) - HDfree(tmp_buf); + free(tmp_buf); if (src_offset) - HDfree(src_offset); + free(src_offset); if (src_sizes) - HDfree(src_sizes); + free(src_sizes); if (tid > 0) if (H5Tclose(tid) < 0) ret_val = -1; @@ -1696,9 +1696,9 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c if (H5TBget_table_info(loc_id1, dset_name1, &nfields, &nrecords) < 0) goto out; - if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t)))) + if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)))) goto out; - if (NULL == (src_sizes = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t)))) + if (NULL == (src_sizes = (size_t *)malloc((size_t)nfields * sizeof(size_t)))) goto out; /* get field info */ @@ -1773,7 +1773,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c goto out; /* alloc fill value attribute buffer */ - if (NULL == (tmp_fill_buf = (unsigned char *)HDmalloc(type_size))) + if (NULL == (tmp_fill_buf = (unsigned char *)malloc(type_size))) goto out; /* get the fill value attributes */ @@ -1823,7 +1823,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c * read data from 1st table *------------------------------------------------------------------------- */ - if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, type_size))) + if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size))) goto out; /* define a hyperslab in the dataset of the size of the records */ @@ -1856,7 +1856,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c if (H5Sclose(m_sid) < 0) goto out; m_sid = H5I_INVALID_HID; - HDfree(tmp_buf); + free(tmp_buf); tmp_buf = NULL; /*------------------------------------------------------------------------- @@ -1889,7 +1889,7 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c *------------------------------------------------------------------------- */ - if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, type_size))) + if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size))) goto out; /* define a hyperslab in the dataset of the size of the records */ @@ -1919,13 +1919,13 @@ H5TBcombine_tables(hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const c out: if (tmp_buf) - HDfree(tmp_buf); + free(tmp_buf); if (tmp_fill_buf) - HDfree(tmp_fill_buf); + free(tmp_fill_buf); if (src_offset) - HDfree(src_offset); + free(src_offset); if (src_sizes) - HDfree(src_sizes); + free(src_sizes); if (member_type_id > 0) if (H5Tclose(member_type_id) < 0) ret_val = -1; @@ -2087,7 +2087,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi goto out; /* alloc fill value attribute buffer */ - if (NULL == (tmp_fill_buf = (unsigned char *)HDmalloc(total_size))) + if (NULL == (tmp_fill_buf = (unsigned char *)malloc(total_size))) goto out; /* get the fill value attributes */ @@ -2188,7 +2188,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi *------------------------------------------------------------------------- */ - if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, (size_t)total_size))) + if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)total_size))) goto out; /* define a hyperslab in the dataset of the size of the records */ @@ -2346,9 +2346,9 @@ out: if (member_name) H5free_memory(member_name); if (tmp_buf) - HDfree(tmp_buf); + free(tmp_buf); if (tmp_fill_buf) - HDfree(tmp_fill_buf); + free(tmp_fill_buf); if (preserve_id > 0) if (H5Pclose(preserve_id) < 0) ret_val = -1; @@ -2544,7 +2544,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) curr_offset = 0; /* alloc fill value attribute buffer */ - if (NULL == (tmp_fill_buf = (unsigned char *)HDmalloc((size_t)type_size2))) + if (NULL == (tmp_fill_buf = (unsigned char *)malloc((size_t)type_size2))) goto out; /*------------------------------------------------------------------------- @@ -2653,7 +2653,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) if (H5Tinsert(read_type_id, member_name, (size_t)0, member_type_id) < 0) goto out; - if (NULL == (tmp_buf = (unsigned char *)HDcalloc((size_t)nrecords, member_size))) + if (NULL == (tmp_buf = (unsigned char *)calloc((size_t)nrecords, member_size))) goto out; /* read */ @@ -2698,7 +2698,7 @@ H5TBdelete_field(hid_t loc_id, const char *dset_name, const char *field_name) goto out; write_type_id = H5I_INVALID_HID; - HDfree(tmp_buf); + free(tmp_buf); tmp_buf = NULL; } /* end if */ @@ -2788,9 +2788,9 @@ out: if (member_name) H5free_memory(member_name); if (tmp_fill_buf) - HDfree(tmp_fill_buf); + free(tmp_fill_buf); if (tmp_buf) - HDfree(tmp_buf); + free(tmp_buf); if (attr_id > 0) if (H5Aclose(attr_id) < 0) ret_val = -1; @@ -2907,7 +2907,7 @@ H5TBAget_fill(hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char if (H5TBget_table_info(loc_id, dset_name, &nfields, &nrecords) < 0) goto out; - if (NULL == (src_offset = (size_t *)HDmalloc((size_t)nfields * sizeof(size_t)))) + if (NULL == (src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)))) goto out; /* get field info */ @@ -2931,7 +2931,7 @@ H5TBAget_fill(hid_t loc_id, const char *dset_name, hid_t dset_id, unsigned char out: if (src_offset) - HDfree(src_offset); + free(src_offset); return ret_val; } /* end H5TBAget_fill() */ @@ -3279,11 +3279,11 @@ H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_size, const si if (H5TBget_table_info(loc_id, dset_name, &nfields, NULL) < 0) goto out; - if (NULL == (fnames = (char **)HDcalloc(sizeof(char *), (size_t)nfields))) + if (NULL == (fnames = (char **)calloc(sizeof(char *), (size_t)nfields))) goto out; for (i = 0; i < nfields; i++) - if (NULL == (fnames[i] = (char *)HDmalloc(HLTB_MAX_FIELD_LEN))) + if (NULL == (fnames[i] = (char *)malloc(HLTB_MAX_FIELD_LEN))) goto out; /* get field info */ @@ -3321,8 +3321,8 @@ out: if (fnames) { for (i = 0; i < nfields; i++) if (fnames[i]) - HDfree(fnames[i]); - HDfree(fnames); + free(fnames[i]); + free(fnames); } /* end if */ if (mtype_id > 0) if (H5Tclose(mtype_id) < 0) diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index e0a3499..27a98e7 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -79,12 +79,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; } @@ -104,11 +104,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; } @@ -192,11 +192,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 "); } } } @@ -260,13 +260,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/test_ds.c b/hl/test/test_ds.c index 70af31a..3d31786 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -214,11 +214,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; } @@ -1111,7 +1111,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 "); } } } @@ -1175,13 +1175,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) { ret_value = SUCCEED; } - HDfree(name_out); + free(name_out); name_out = NULL; } } @@ -2371,7 +2371,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 @@ -3161,8 +3161,8 @@ 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) @@ -3174,11 +3174,11 @@ test_simple(void) if (HDstrncmp(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; } @@ -3225,7 +3225,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; @@ -3236,7 +3236,7 @@ test_simple(void) if (HDstrncmp("Latitude set 0", name_out, (size_t)name_len) != 0) goto out; if (name_out) { - HDfree(name_out); + free(name_out); name_out = NULL; } @@ -3497,7 +3497,7 @@ test_simple(void) goto out; break; default: - HDassert(0); + assert(0); break; } /*switch*/ } /*for*/ @@ -3627,7 +3627,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) @@ -3635,7 +3635,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; } } @@ -3649,7 +3649,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; @@ -3661,7 +3661,7 @@ out: H5Tclose(tid); H5Tclose(mtid); if (buf) { - HDfree(buf); + free(buf); } } H5E_END_TRY; @@ -3839,7 +3839,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 @@ -4213,7 +4213,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 @@ -4403,7 +4403,7 @@ test_rank(void) float buff[1] = {1}; int i; - HDprintf("Testing ranks\n"); + printf("Testing ranks\n"); /*------------------------------------------------------------------------- * create a file, a dataset, scales @@ -4610,7 +4610,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 @@ -4788,7 +4788,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 @@ -4818,7 +4818,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 */ @@ -4829,7 +4829,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 */ @@ -4849,7 +4849,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) @@ -4924,11 +4924,11 @@ out: H5_FAILED(); if (latbuf) - HDfree(latbuf); + free(latbuf); if (lonbuf) - HDfree(lonbuf); + free(lonbuf); if (vals) - HDfree(vals); + free(vals); return FAIL; } @@ -4957,20 +4957,20 @@ 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); + printf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; } /* end if */ if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s\n", data_file); + printf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; } /* end if */ @@ -4978,17 +4978,17 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf) nelms *= (size_t)n; } - *buf = (float *)HDmalloc(nelms * sizeof(float)); + *buf = (float *)malloc(nelms * sizeof(float)); if (*buf == NULL) { - HDprintf("memory allocation failed\n"); + printf("memory allocation failed\n"); HDfclose(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); + printf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; } /* end if */ @@ -5018,7 +5018,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 diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index c4afe89..e8b474c 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -251,7 +251,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) @@ -387,7 +387,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) @@ -524,7 +524,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) @@ -687,7 +687,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) @@ -850,7 +850,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) @@ -1009,7 +1009,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) @@ -1166,7 +1166,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 defaab2..e7d830b 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -76,27 +76,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"); @@ -109,9 +109,9 @@ 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); @@ -169,7 +169,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) */ @@ -233,28 +233,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, - (size_t)SUPER_STATUS_FLAGS_SIZE_V0_V1); + 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 */ @@ -268,7 +268,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 */ @@ -324,7 +324,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 */ @@ -508,20 +508,20 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) 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(); @@ -532,14 +532,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; @@ -572,10 +572,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 4a3c607..bf48e9b 100644 --- a/hl/test/test_h5do_compat.c +++ b/hl/test/test_h5do_compat.c @@ -192,7 +192,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) diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 462a3ce..6541ef5 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -71,11 +71,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; } @@ -111,14 +111,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; @@ -274,13 +274,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) @@ -293,13 +293,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); @@ -329,7 +329,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 @@ -480,7 +480,7 @@ test_data(void) goto out; /* Release memory buffer */ - HDfree(image_data); + free(image_data); return 0; @@ -488,7 +488,7 @@ test_data(void) out: /* Release memory buffer */ if (image_data) - HDfree(image_data); + free(image_data); H5E_BEGIN_TRY { @@ -531,16 +531,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,11 +580,11 @@ test_generate(void) */ if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) { - HDprintf("fscanf error in file %s.\n", data_file); + 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); + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -606,16 +606,16 @@ 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); + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ data[i] = value; @@ -712,8 +712,8 @@ test_generate(void) goto out; /* Release memory buffers */ - HDfree(data); - HDfree(image_data); + free(data); + free(image_data); /* Indicate success */ return 0; @@ -722,9 +722,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 { @@ -773,38 +773,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); + 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); + 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); + 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); + 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); + 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); + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -825,10 +825,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,7 +838,7 @@ 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); + printf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ image_data[i] = (unsigned char)n; @@ -889,8 +889,8 @@ 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; } diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index 11ea0e6..64bf09f 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -1036,10 +1036,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]); @@ -1247,10 +1247,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]); @@ -1350,19 +1350,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; /* @@ -1414,17 +1414,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 cf139d9..6ff3134 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1038,26 +1038,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(); @@ -1092,17 +1092,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); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1150,17 +1150,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); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1221,19 +1221,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 " "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; @@ -1256,46 +1256,46 @@ 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 " "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, "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 */ @@ -1306,12 +1306,12 @@ test_strings(void) "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; @@ -1321,7 +1321,7 @@ test_strings(void) out: if (dt_str) - HDfree(dt_str); + free(dt_str); H5_FAILED(); return -1; @@ -1358,21 +1358,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( 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; @@ -1438,22 +1438,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, "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; @@ -1502,18 +1502,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); + printf("dt=\n%s\n", dt_str); + free(dt_str); goto out; } - HDfree(dt_str); + free(dt_str); if (H5Tclose(dtype) < 0) goto out; @@ -1564,21 +1564,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 " " 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; @@ -1625,19 +1625,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 " "\"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; @@ -1738,13 +1738,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; @@ -1775,14 +1775,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; @@ -1813,9 +1813,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; } @@ -1823,15 +1823,15 @@ 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) goto out; while (HDstrlen(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; @@ -1857,7 +1857,7 @@ test_complicated_compound(void) goto out; if (line) - HDfree(line); + free(line); PASSED(); return 0; @@ -1865,7 +1865,7 @@ test_complicated_compound(void) out: if (line) - HDfree(line); + free(line); if (fp) HDfclose(fp); diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 3bfba6e..d4af45e 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -168,7 +168,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); @@ -445,7 +445,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); @@ -519,7 +519,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) @@ -595,7 +595,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); @@ -620,7 +620,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) diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index 5e06c85..bf95859 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; @@ -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; @@ -257,16 +257,16 @@ 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", - __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len); + 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( - 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]); + 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; } /* write value != read value */ } @@ -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; @@ -429,34 +429,34 @@ 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, - writeBuf[uu].u, uu, readBuf[uu].u); + 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, - (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); + 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, - "%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); + 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; } /* end if */ 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", - __LINE__, uu, vv, t1->len, t2->len); + 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, - ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[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 */ } /* end for */ @@ -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; @@ -655,7 +655,7 @@ verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value) HDstrcpy(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); + fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype); ret = FAIL; } @@ -1010,7 +1010,7 @@ verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type) HDstrcpy(lenthtype, "variable-length"); else HDstrcpy(lenthtype, "fixed-length"); - HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype); + 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; @@ -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; @@ -1292,16 +1292,15 @@ 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", - __LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len); + 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, - "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]); + 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; } /* write value != read value */ } @@ -1379,16 +1378,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; @@ -1464,34 +1463,34 @@ 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, - writeBuf[uu].u, uu, readBuf[uu].u); + 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, - (double)writeBuf[uu].f, uu, (double)readBuf[uu].f); + 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, - "%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); + 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; } /* end if */ 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", - __LINE__, uu, vv, t1->len, t2->len); + 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, - ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[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 */ } /* end for */ @@ -1562,16 +1561,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; diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 3c8246a..06e07b8 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -136,8 +136,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; @@ -153,11 +153,11 @@ 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 || 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, - rbuf[i].temperature, rbuf[i].lati); - HDfprintf(stderr, "%s %ld %f %f %d\n", wbuf[j].name, wbuf[j].longi, (double)wbuf[j].pressure, - wbuf[j].temperature, wbuf[j].lati); + 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); + 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; } return 0; @@ -1023,10 +1023,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, - rbuf[i].lati); - HDfprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i], - position_in[i].lati); + fprintf(stderr, "%ld %f %d\n", rbuf[i].longi, (double)rbuf[i].pressure, rbuf[i].lati); + fprintf(stderr, "%ld %f %d\n", position_in[i].longi, (double)pressure_in[i], + position_in[i].lati); goto out; } } @@ -1464,9 +1463,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 */ @@ -1481,9 +1480,9 @@ test_table(hid_t fid, int do_write) /* release */ for (i = 0; i < NFIELDS; i++) { - HDfree(names_out[i]); + free(names_out[i]); } - HDfree(names_out); + free(names_out); PASSED(); diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index 2fd9756..6b33b81 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -46,7 +46,7 @@ static void leave(int ret) { h5tools_close(); - HDexit(ret); + exit(ret); } FILE *fpGif = NULL; diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 97abbc6..59c5eb7 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -85,9 +85,9 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) set_t *cbuf = NULL; /* buffer for storing retrieved elements (compound) */ /* Allocate memory */ - if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int)))) + if (NULL == (ibuf = (int *)calloc(TEST_BUF_SIZE, sizeof(int)))) goto error; - if (NULL == (cbuf = (set_t *)HDcalloc(TEST_BUF_SIZE, sizeof(set_t)))) + if (NULL == (cbuf = (set_t *)calloc(TEST_BUF_SIZE, sizeof(set_t)))) goto error; /* Create a copy of file access property list */ @@ -148,7 +148,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) /* Compound type */ if (!HDstrcmp(dname, DSET_CMPD_TWO)) { - HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); + memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); for (i = 0; i < num_elmts; i++) { cbuf[i].field1 = action1; cbuf[i].field2.a = action1; @@ -166,7 +166,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) goto error; } else { /* Integer type */ - HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); + memset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); for (i = 0; i < num_elmts; i++) ibuf[i] = action1; @@ -189,9 +189,9 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) goto error; if (ibuf) - HDfree(ibuf); + free(ibuf); if (cbuf) - HDfree(cbuf); + free(cbuf); return SUCCEED; @@ -204,9 +204,9 @@ error: H5E_END_TRY if (ibuf) - HDfree(ibuf); + free(ibuf); if (cbuf) - HDfree(cbuf); + free(cbuf); return FAIL; @@ -239,9 +239,9 @@ extend_dset_one(const char *file, char *dname, int action) set_t *cbuf = NULL; /* buffer for storing retrieved elements (compound) */ /* Allocate memory */ - if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int)))) + if (NULL == (ibuf = (int *)calloc(TEST_BUF_SIZE, sizeof(int)))) goto error; - if (NULL == (cbuf = (set_t *)HDcalloc(TEST_BUF_SIZE, sizeof(set_t)))) + if (NULL == (cbuf = (set_t *)calloc(TEST_BUF_SIZE, sizeof(set_t)))) goto error; /* Create a copy of file access property list */ @@ -307,7 +307,7 @@ extend_dset_one(const char *file, char *dname, int action) /* Compound type */ if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { - HDmemset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); + memset(cbuf, 0, TEST_BUF_SIZE * sizeof(set_t)); for (i = 0; i < action; i++) { cbuf[i].field1 = i + 1; cbuf[i].field2.a = i + 2; @@ -328,7 +328,7 @@ extend_dset_one(const char *file, char *dname, int action) } else { /* Integer type */ - HDmemset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); + memset(ibuf, 0, TEST_BUF_SIZE * sizeof(int)); for (i = 0; i < action; i++) ibuf[i] = (int)i; @@ -358,9 +358,9 @@ extend_dset_one(const char *file, char *dname, int action) goto error; if (ibuf) - HDfree(ibuf); + free(ibuf); if (cbuf) - HDfree(cbuf); + free(cbuf); return SUCCEED; @@ -375,9 +375,9 @@ error: H5E_END_TRY if (ibuf) - HDfree(ibuf); + free(ibuf); if (cbuf) - HDfree(cbuf); + free(cbuf); return FAIL; } /* end extend_dset_one() */ @@ -398,15 +398,15 @@ main(int argc, char *argv[]) int action1, action2; if (argc != 5) { - HDfprintf(stderr, "Should have file name, dataset name, and the extended amount...\n"); + fprintf(stderr, "Should have file name, dataset name, and the extended amount...\n"); goto error; } /* end if */ /* Get the dataset name to be extended */ fname = HDstrdup(argv[1]); dname = HDstrdup(argv[2]); - action1 = HDatoi(argv[3]); - action2 = HDatoi(argv[4]); + action1 = atoi(argv[3]); + action2 = atoi(argv[4]); if (!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { if (extend_dset_one(fname, dname, action1) < 0) @@ -422,16 +422,16 @@ main(int argc, char *argv[]) goto error; } else { - HDfprintf(stdout, "Dataset cannot be extended...\n"); + fprintf(stdout, "Dataset cannot be extended...\n"); goto error; } /* end if-else */ - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); error: if (dname) - HDfree(dname); + free(dname); if (fname) - HDfree(fname); - HDexit(EXIT_FAILURE); + free(fname); + exit(EXIT_FAILURE); } /* end main() */ diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 248fb90..d5b4d6e 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -121,11 +121,11 @@ doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank) subset.block.data[i] = block[i]; } /* end for */ - HDmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.sset = ⊂ /* Set to all default values and then override */ - HDmemset(&info, 0, sizeof info); + memset(&info, 0, sizeof info); if (g_simple_output) { info.idx_fmt = ""; @@ -199,7 +199,7 @@ doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank) if ((ret_value = h5tools_dump_dset(stdout, &info, &ctx, did)) < 0) error_msg("unable to print data\n"); - HDfprintf(stdout, "\n"); + fprintf(stdout, "\n"); return ret_value; @@ -292,7 +292,7 @@ monitor_dataset(hid_t fid, char *dsetname) hsize_t cur_dims[H5S_MAX_RANK]; /* previous dataspace dimensions */ herr_t ret_value = SUCCEED; /* return value */ - HDfprintf(stdout, "Monitoring dataset %s...\n", dsetname); + fprintf(stdout, "Monitoring dataset %s...\n", dsetname); /* Open the dataset for minitoring */ if ((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { @@ -312,7 +312,7 @@ monitor_dataset(hid_t fid, char *dsetname) ret_value = FAIL; goto done; } - HDfflush(stdout); + fflush(stdout); /* Loop until an error occurs or the user interrupts execution */ while (!g_user_interrupt) { @@ -339,14 +339,13 @@ monitor_dataset(hid_t fid, char *dsetname) if (i != ndims) { /* Printing changes in dimension sizes */ for (u = 0; u < ndims; u++) { - HDfprintf(stdout, "dimension %d: %" PRIuHSIZE "->%" PRIuHSIZE "", u, prev_dims[u], - cur_dims[u]); + fprintf(stdout, "dimension %d: %" PRIuHSIZE "->%" PRIuHSIZE "", u, prev_dims[u], cur_dims[u]); if (cur_dims[u] > prev_dims[u]) - HDfprintf(stdout, " (increases)\n"); + fprintf(stdout, " (increases)\n"); else if (cur_dims[u] < prev_dims[u]) - HDfprintf(stdout, " (decreases)\n"); + fprintf(stdout, " (decreases)\n"); else - HDfprintf(stdout, " (unchanged)\n"); + fprintf(stdout, " (unchanged)\n"); } /* Printing elements appended to the dataset if there is */ @@ -360,7 +359,7 @@ monitor_dataset(hid_t fid, char *dsetname) /* Print the new appended data to the dataset */ if (cur_dims[u] > prev_dims[u]) { - HDfprintf(stdout, " Data:\n"); + fprintf(stdout, " Data:\n"); for (j = 0; j < ndims; j++) { start[j] = 0; @@ -374,17 +373,17 @@ monitor_dataset(hid_t fid, char *dsetname) } } /* end for */ } - HDfflush(stdout); + fflush(stdout); } /* Save the current dimension sizes */ - HDmemcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t)); + memcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t)); /* Sleep before next monitor */ HDsleep(g_polling_interval); } /* end while */ - HDfflush(stdout); + fflush(stdout); done: /* Closing */ @@ -415,7 +414,7 @@ process_cmpd_fields(hid_t fid, char *dsetname) size_t len; /* number of comma-separated fields in "g_list_of_fields" */ herr_t ret_value = SUCCEED; /* Return value */ - HDassert(g_list_of_fields && *g_list_of_fields); + assert(g_list_of_fields && *g_list_of_fields); /* Open the dataset */ if ((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { @@ -449,7 +448,7 @@ process_cmpd_fields(hid_t fid, char *dsetname) len = HDstrlen(g_list_of_fields) / 2 + 2; /* Allocate memory for a list vector of H5LD_memb_t structures to store "g_list_of_fields" info */ - if ((g_listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *))) == NULL) { + if ((g_listv = (H5LD_memb_t **)calloc(len, sizeof(H5LD_memb_t *))) == NULL) { error_msg("error in allocating memory for H5LD_memb_t\n"); ret_value = FAIL; goto done; @@ -532,8 +531,8 @@ check_dataset(hid_t fid, char *dsetname) goto done; } - HDmemset(cur_dims, 0, sizeof cur_dims); - HDmemset(max_dims, 0, sizeof max_dims); + memset(cur_dims, 0, sizeof cur_dims); + memset(max_dims, 0, sizeof max_dims); /* Get dataset's dataspace */ if ((sid = H5Dget_space(did)) < 0) { @@ -608,46 +607,46 @@ leave(int ret) static void usage(const char *prog) { - HDfflush(stdout); - HDfprintf(stdout, "Usage: %s [OPTIONS] [OBJECT]\n", prog); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " OPTIONS\n"); - HDfprintf(stdout, " --help Print a usage message and exit.\n"); - HDfprintf(stdout, " --version Print version number and exit.\n"); - HDfprintf(stdout, " --label Label members of compound typed dataset.\n"); - HDfprintf(stdout, " --simple Use a machine-readable output format.\n"); - HDfprintf(stdout, " --dim Monitor changes in size of dataset dimensions only.\n"); - HDfprintf(stdout, " --width=N Set the number of columns to N for output.\n"); - HDfprintf(stdout, " A value of 0 sets the number of columns to the\n"); - HDfprintf(stdout, " maximum (65535). The default width is 80 columns.\n"); - HDfprintf(stdout, " --polling=N Set the polling interval to N (in seconds) when the\n"); - HDfprintf(stdout, - " dataset will be checked for appended data. The default\n"); - HDfprintf(stdout, " polling interval is 1.\n"); - HDfprintf(stdout, " --fields=<list_of_fields>\n"); - HDfprintf(stdout, - " Display data for the fields specified in <list_of_fields>\n"); - HDfprintf(stdout, " for a compound data type. <list_of_fields> can be\n"); - HDfprintf(stdout, " specified as follows:\n"); - HDfprintf(stdout, " 1) A comma-separated list of field names in a\n"); - HDfprintf(stdout, " compound data type. \",\" is the separator\n"); - HDfprintf(stdout, " for field names while \".\" is the separator\n"); - HDfprintf(stdout, " for a nested field.\n"); - HDfprintf(stdout, " 2) A single field name in a compound data type.\n"); - HDfprintf(stdout, " Can use this option multiple times.\n"); - HDfprintf(stdout, " Note that backslash is the escape character to avoid\n"); - HDfprintf(stdout, - " characters in field names that conflict with the tool's\n"); - HDfprintf(stdout, " separators.\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, " OBJECT is specified as [<filename>/<path_to_dataset>/<dsetname>]\n"); - HDfprintf(stdout, " <filename> Name of the HDF5 file. It may be preceded by path\n"); - HDfprintf(stdout, " separated by slashes to the specified HDF5 file.\n"); - HDfprintf(stdout, " <path_to_dataset> Path separated by slashes to the specified dataset\n"); - HDfprintf(stdout, " <dsetname> Name of the dataset\n"); - HDfprintf(stdout, "\n"); - HDfprintf(stdout, - " User can end the h5watch process by ctrl-C (SIGINT) or kill the process (SIGTERM).\n"); + fflush(stdout); + fprintf(stdout, "Usage: %s [OPTIONS] [OBJECT]\n", prog); + fprintf(stdout, "\n"); + fprintf(stdout, " OPTIONS\n"); + fprintf(stdout, " --help Print a usage message and exit.\n"); + fprintf(stdout, " --version Print version number and exit.\n"); + fprintf(stdout, " --label Label members of compound typed dataset.\n"); + fprintf(stdout, " --simple Use a machine-readable output format.\n"); + fprintf(stdout, " --dim Monitor changes in size of dataset dimensions only.\n"); + fprintf(stdout, " --width=N Set the number of columns to N for output.\n"); + fprintf(stdout, " A value of 0 sets the number of columns to the\n"); + fprintf(stdout, " maximum (65535). The default width is 80 columns.\n"); + fprintf(stdout, " --polling=N Set the polling interval to N (in seconds) when the\n"); + fprintf(stdout, + " dataset will be checked for appended data. The default\n"); + fprintf(stdout, " polling interval is 1.\n"); + fprintf(stdout, " --fields=<list_of_fields>\n"); + fprintf(stdout, + " Display data for the fields specified in <list_of_fields>\n"); + fprintf(stdout, " for a compound data type. <list_of_fields> can be\n"); + fprintf(stdout, " specified as follows:\n"); + fprintf(stdout, " 1) A comma-separated list of field names in a\n"); + fprintf(stdout, " compound data type. \",\" is the separator\n"); + fprintf(stdout, " for field names while \".\" is the separator\n"); + fprintf(stdout, " for a nested field.\n"); + fprintf(stdout, " 2) A single field name in a compound data type.\n"); + fprintf(stdout, " Can use this option multiple times.\n"); + fprintf(stdout, " Note that backslash is the escape character to avoid\n"); + fprintf(stdout, + " characters in field names that conflict with the tool's\n"); + fprintf(stdout, " separators.\n"); + fprintf(stdout, "\n"); + fprintf(stdout, " OBJECT is specified as [<filename>/<path_to_dataset>/<dsetname>]\n"); + fprintf(stdout, " <filename> Name of the HDF5 file. It may be preceded by path\n"); + fprintf(stdout, " separated by slashes to the specified HDF5 file.\n"); + fprintf(stdout, " <path_to_dataset> Path separated by slashes to the specified dataset\n"); + fprintf(stdout, " <dsetname> Name of the dataset\n"); + fprintf(stdout, "\n"); + fprintf(stdout, + " User can end the h5watch process by ctrl-C (SIGINT) or kill the process (SIGTERM).\n"); } /* usage() */ @@ -732,7 +731,7 @@ parse_command_line(int argc, const char *const *argv) error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); } - if ((g_list_of_fields = (char *)HDrealloc( + if ((g_list_of_fields = (char *)realloc( g_list_of_fields, HDstrlen(g_list_of_fields) + HDstrlen(str) + 2)) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); @@ -868,7 +867,7 @@ main(int argc, char *argv[]) sizeof drivername); if (fid >= 0) { - HDfprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername); + fprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername); break; /*success*/ } /* end if */ @@ -928,17 +927,17 @@ main(int argc, char *argv[]) done: /* Free spaces */ if (fname) - HDfree(fname); + free(fname); if (dname) - HDfree(dname); + free(dname); if (g_list_of_fields) - HDfree(g_list_of_fields); + free(g_list_of_fields); if (g_listv) { H5LD_clean_vector(g_listv); - HDfree(g_listv); + free(g_listv); } if (g_dup_fields) - HDfree(g_dup_fields); + free(g_dup_fields); /* Close the file access property list */ if (fapl >= 0 && H5Pclose(fapl) < 0) { diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 5b8cf07..9fda9be 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -172,14 +172,14 @@ main(void) /* Create a copy of file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); /* Set to use the latest library format */ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); /* Create a file with the latest format */ if ((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); /* Initialization for one-dimensional dataset */ cur_dims[0] = ONE_DIMS0; @@ -341,7 +341,7 @@ main(void) if (H5Fclose(fid) < 0) goto done; - HDexit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); done: H5E_BEGIN_TRY @@ -356,5 +356,5 @@ done: H5Fclose(fid); H5E_END_TRY - HDexit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* end main() */ |