summaryrefslogtreecommitdiffstats
path: root/src/H5FDonion_header.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-08-25 20:56:50 (GMT)
committerGitHub <noreply@github.com>2023-08-25 20:56:50 (GMT)
commit627f7c5e026a55f176d8dfcab51633cf3b704ce6 (patch)
treeb8ef6ca645521104c25a7b5538259bb449d51c58 /src/H5FDonion_header.c
parent3dd60d914e762c6cf7d99646bc516015229176cd (diff)
downloadhdf5-627f7c5e026a55f176d8dfcab51633cf3b704ce6.zip
hdf5-627f7c5e026a55f176d8dfcab51633cf3b704ce6.tar.gz
hdf5-627f7c5e026a55f176d8dfcab51633cf3b704ce6.tar.bz2
Convert some H5MM calls to standard C equivalents (#2382)
* H5MM_calloc and malloc are now mapped to stdlib C calls * H5MM_memcpy now maps directly to memcpy in release builds * H5MM_memcpy is still implemented as a separate function that checks for buffer overlap when H5MM_DEBUG is defined (default w/ debug builds) * Switches many library memcpy calls to use H5MM_memcpy * Fixes a possible zero allocation in H5Olayout.c
Diffstat (limited to 'src/H5FDonion_header.c')
-rw-r--r--src/H5FDonion_header.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5FDonion_header.c b/src/H5FDonion_header.c
index a346ecf..55a632c 100644
--- a/src/H5FDonion_header.c
+++ b/src/H5FDonion_header.c
@@ -142,34 +142,34 @@ H5FD__onion_header_decode(unsigned char *buf, H5FD_onion_header_t *header)
ptr = buf + 5;
ui32 = 0;
- memcpy(&ui32, ptr, 3);
+ H5MM_memcpy(&ui32, ptr, 3);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, header->flags);
ptr += 3;
- memcpy(&ui32, ptr, 4);
+ H5MM_memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, header->page_size);
ptr += 4;
- memcpy(&ui64, ptr, 8);
+ H5MM_memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT32DECODE(ui8p, header->origin_eof);
ptr += 8;
- memcpy(&ui64, ptr, 8);
+ H5MM_memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT32DECODE(ui8p, header->history_addr);
ptr += 8;
- memcpy(&ui64, ptr, 8);
+ H5MM_memcpy(&ui64, ptr, 8);
ui8p = (uint8_t *)&ui64;
UINT32DECODE(ui8p, header->history_size);
ptr += 8;
sum = H5_checksum_fletcher32(buf, (size_t)(ptr - buf));
- memcpy(&ui32, ptr, 4);
+ H5MM_memcpy(&ui32, ptr, 4);
ui8p = (uint8_t *)&ui32;
UINT32DECODE(ui8p, header->checksum);
ptr += 4;
@@ -214,9 +214,9 @@ H5FD__onion_header_encode(H5FD_onion_header_t *header, unsigned char *buf, uint3
assert(H5FD_ONION_HEADER_VERSION_CURR == header->version);
assert(0 == (header->flags & 0xFF000000)); /* max three bits long */
- memcpy(ptr, H5FD_ONION_HEADER_SIGNATURE, 4);
+ H5MM_memcpy(ptr, H5FD_ONION_HEADER_SIGNATURE, 4);
ptr += 4;
- memcpy(ptr, (unsigned char *)&header->version, 1);
+ H5MM_memcpy(ptr, (unsigned char *)&header->version, 1);
ptr += 1;
UINT32ENCODE(ptr, header->flags);
ptr -= 1; /* truncate to three bytes */