From dcde3e4cdf751d564e17dceb2d55bf20bc4ba68e Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 27 Jan 2014 17:13:23 -0500 Subject: [svn-r24651] Merged changes in the fortran directory from the trunk into the branch, svn merge -r23351:24650 https://svn.hdfgroup.uiuc.edu/hdf5/trunk/fortran . Tested: jam (gcc, intel), koala (gcc) --- fortran/src/H5Df.c | 40 ++++++++++++++++++++-------------------- fortran/src/H5Fff_F03.f90 | 19 ++++++++++--------- fortran/src/H5Off.f90 | 14 +++++++------- fortran/src/H5Sf.c | 4 ++-- fortran/src/H5Sff.f90 | 4 ++-- fortran/src/Makefile.am | 5 ++++- fortran/src/Makefile.in | 13 ++++++++----- fortran/test/Makefile.in | 1 + fortran/test/tH5F_F03.f90 | 8 ++------ fortran/test/tH5O.f90 | 2 +- fortran/test/tH5T_F03.f90 | 13 +++++++++---- fortran/testpar/Makefile.in | 1 + 12 files changed, 67 insertions(+), 57 deletions(-) diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index ab7adf7..deab4f3 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1582,7 +1582,7 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id num_elem = H5Sget_select_npoints(c_space_id); if( num_elem < 0) return ret_value; - c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem); + c_buf = (hvl_t *)HDmalloc(sizeof(hvl_t)*(size_t)num_elem); if (c_buf == NULL) return ret_value; status = H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf); if(status < 0) goto DONE; @@ -1595,7 +1595,7 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id DONE: - free(c_buf); + HDfree(c_buf); return ret_value; } /****if* H5Df/nh5dwrite_vl_integer_c @@ -1651,7 +1651,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_ c_file_space_id = (hid_t)*file_space_id; c_xfer_prp = (hid_t)*xfer_prp; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; tmp = (int_f *)buf; for (i=0; i < num_elem; i++) { @@ -1667,7 +1667,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_ if( status < 0) goto DONE; ret_value = 0; DONE: - free(c_buf); + HDfree(c_buf); return ret_value; } @@ -1725,7 +1725,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s num_elem = H5Sget_select_npoints(c_mem_space_id); if(num_elem != dims[1]) return ret_value; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; /* * Call H5Dread function. @@ -1739,7 +1739,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); ret_value = 0; DONE: - free(c_buf); + HDfree(c_buf); return ret_value; } @@ -1798,12 +1798,12 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp /* * Allocate arra of character pointers */ - c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_buf = (char **)HDmalloc((size_t)num_elem * sizeof(char *)); if (c_buf == NULL) return ret_value; /* Copy data to long C string */ tmp = (char *)HD5f2cstring(buf, (size_t)(max_len*num_elem)); - if (tmp == NULL) { free(c_buf); + if (tmp == NULL) { HDfree(c_buf); return ret_value; } /* @@ -1811,7 +1811,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp */ tmp_p = tmp; for (i=0; i < num_elem; i++) { - c_buf[i] = (char *) malloc((size_t)len[i]+1); + c_buf[i] = (char *) HDmalloc((size_t)len[i]+1); memcpy(c_buf[i], tmp_p, (size_t)len[i]); c_buf[i][len[i]] = '\0'; tmp_p = tmp_p + max_len; @@ -1826,8 +1826,8 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp ret_value = 0; DONE: H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); - free(c_buf); - free(tmp); + HDfree(c_buf); + HDfree(tmp); return ret_value; } /****if* H5Df/nh5dread_vl_string_c @@ -1885,18 +1885,18 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa /* * Allocate array of character pointers */ - c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_buf = (char **)HDmalloc((size_t)num_elem * sizeof(char *)); if (c_buf == NULL) return ret_value; /* * Call H5Dread function. */ status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); - if (status < 0) { free(c_buf); + if (status < 0) { HDfree(c_buf); return ret_value; } /* Copy data to long C string */ - tmp = (char *)malloc((size_t)(max_len*num_elem) +1); + tmp = (char *)HDmalloc((size_t)(max_len*num_elem) +1); tmp_p = tmp; for (i=0; i