summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-05-15 16:56:23 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-05-15 16:56:23 (GMT)
commit26780517e6e55f8f3d049a148251b0811332e01f (patch)
tree4d46d5261a489989d24f5d3665217beb305253fc
parent15f7ab354602bae26546027ba058eacd31ce0002 (diff)
parentae07c9ba2429a9c49291bcd9f02c0ce36b0a60ce (diff)
downloadhdf5-26780517e6e55f8f3d049a148251b0811332e01f.zip
hdf5-26780517e6e55f8f3d049a148251b0811332e01f.tar.gz
hdf5-26780517e6e55f8f3d049a148251b0811332e01f.tar.bz2
Merge pull request #2573 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop_minor to develop
* commit 'ae07c9ba2429a9c49291bcd9f02c0ce36b0a60ce': Replaced a few calls to HDmemcpy with H5MM_memcpy, which does overlap checking. Removed HDgets macros since gets was deprecated in C99 and removed in C11 (gets() is not used in our repo).
-rw-r--r--src/H5Odeprec.c12
-rw-r--r--src/H5Tref.c4
-rw-r--r--src/H5private.h7
-rw-r--r--tools/test/perform/pio_standalone.h2
-rw-r--r--tools/test/perform/sio_standalone.h2
5 files changed, 15 insertions, 12 deletions
diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c
index e43213d..aca0d59 100644
--- a/src/H5Odeprec.c
+++ b/src/H5Odeprec.c
@@ -189,10 +189,10 @@ H5O__iterate1_adapter(hid_t obj_id, const char *name, const H5O_info2_t *oinfo2,
/* Set the native fields */
if(shim_data->fields & H5O_INFO_HDR)
- HDmemcpy(&(oinfo.hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t));
+ H5MM_memcpy(&(oinfo.hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t));
if(shim_data->fields & H5O_INFO_META_SIZE) {
- HDmemcpy(&(oinfo.meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t));
- HDmemcpy(&(oinfo.meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t));
+ H5MM_memcpy(&(oinfo.meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t));
+ H5MM_memcpy(&(oinfo.meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t));
}
}
@@ -279,10 +279,10 @@ H5O__get_info_old(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params,
/* Set the native fields */
if(fields & H5O_INFO_HDR)
- HDmemcpy(&(oinfo->hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t));
+ H5MM_memcpy(&(oinfo->hdr), &(nat_info.hdr), sizeof(H5O_hdr_info_t));
if(fields & H5O_INFO_META_SIZE) {
- HDmemcpy(&(oinfo->meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t));
- HDmemcpy(&(oinfo->meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t));
+ H5MM_memcpy(&(oinfo->meta_size.obj), &(nat_info.meta_size.obj), sizeof(H5_ih_info_t));
+ H5MM_memcpy(&(oinfo->meta_size.attr), &(nat_info.meta_size.attr), sizeof(H5_ih_info_t));
} /* end if */
} /* end if */
diff --git a/src/H5Tref.c b/src/H5Tref.c
index f97b78a..b357baa 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -800,7 +800,7 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_
HDassert(dst_size);
/* Copy header manually */
- HDmemcpy(q, p, H5R_ENCODE_HEADER_SIZE);
+ H5MM_memcpy(q, p, H5R_ENCODE_HEADER_SIZE);
p += H5R_ENCODE_HEADER_SIZE;
q += H5R_ENCODE_HEADER_SIZE;
blob_size -= H5R_ENCODE_HEADER_SIZE;
@@ -860,7 +860,7 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf,
} /* end if */
/* Copy header manually so that it does not get encoded into the blob */
- HDmemcpy(q, p, H5R_ENCODE_HEADER_SIZE);
+ H5MM_memcpy(q, p, H5R_ENCODE_HEADER_SIZE);
p += H5R_ENCODE_HEADER_SIZE;
q += H5R_ENCODE_HEADER_SIZE;
src_size -= H5R_ENCODE_HEADER_SIZE;
diff --git a/src/H5private.h b/src/H5private.h
index 95d4885..2236ee6 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1030,9 +1030,12 @@ typedef off_t h5_stat_size_t;
#ifndef HDgetrusage
#define HDgetrusage(X,S) getrusage(X,S)
#endif /* HDgetrusage */
-#ifndef HDgets
- #define HDgets(S) gets(S)
+
+/* Don't define HDgets - gets() was deprecated in C99 and removed in C11 */
+#ifdef HDgets
+ #undef HDgets
#endif /* HDgets */
+
#ifndef HDgettimeofday
#define HDgettimeofday(S,P) gettimeofday(S,P)
#endif /* HDgettimeofday */
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index cf6d980..f2cda4f 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -213,7 +213,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDgetpwnam(S) getpwnam(S)
#define HDgetpwuid(U) getpwuid(U)
#define HDgetrusage(X,S) getrusage(X,S)
-#define HDgets(S) gets(S)
+/* Don't define a macro for gets() - it was removed in C11 */
#ifdef H5_HAVE_WIN32_API
H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz);
#define HDgettimeofday(V,Z) Wgettimeofday(V,Z)
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index 45f6d25..99e13bc 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -228,7 +228,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDgetpwnam(S) getpwnam(S)
#define HDgetpwuid(U) getpwuid(U)
#define HDgetrusage(X,S) getrusage(X,S)
-#define HDgets(S) gets(S)
+/* Don't define a macro for gets() - it was removed in C11 */
#ifdef H5_HAVE_WIN32_API
H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz);
#define HDgettimeofday(V,Z) Wgettimeofday(V,Z)