diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-03-16 23:02:06 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-03-16 23:02:06 (GMT) |
commit | 5c80d3d91284bdcd048d9325b1a601d0ddfca8bd (patch) | |
tree | 8ad7066b9cc25f160c910955555492640a9bc9ba /src | |
parent | a98747c0f94386f7505210e78cd4b385682b0eba (diff) | |
download | hdf5-5c80d3d91284bdcd048d9325b1a601d0ddfca8bd.zip hdf5-5c80d3d91284bdcd048d9325b1a601d0ddfca8bd.tar.gz hdf5-5c80d3d91284bdcd048d9325b1a601d0ddfca8bd.tar.bz2 |
- Added H5MMprivate.h #includes where needed
- Added casts to quiet H5MM_memcpy warnings
- Removed char * casts from HDmemcpy
Diffstat (limited to 'src')
44 files changed, 48 insertions, 10 deletions
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 825043b..3377aa2 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -35,6 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ #include "H5SMprivate.h" /* Shared object header messages */ @@ -107,6 +107,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ diff --git a/src/H5B2int.c b/src/H5B2int.c index a6dfe0e..9940cd7 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -35,6 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5Bcache.c b/src/H5Bcache.c index cce10c9..c2c7a80 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -35,6 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Bpkg.h" /* B-link trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index e6f0674..c13c36a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -39,6 +39,7 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File space management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Sprivate.h" /* Dataspaces */ #include "H5VMprivate.h" /* Vector and array functions */ diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index f0a1380..d25e0f0 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -32,6 +32,7 @@ #include "H5Dpkg.h" /* Datasets */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector and array functions */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index adf6719..ed12a6a 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -40,6 +40,7 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5FOprivate.h" /* File objects */ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 8f6fae4..b23ac46 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -37,6 +37,7 @@ #include "H5EAprivate.h" /* Extensible arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector functions */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 1c501ce..69f4ff8 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -38,6 +38,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector and array functions */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 7498e63..0e0edf7 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -27,6 +27,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -46,6 +46,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector functions */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 9e908e7..da67e6b 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -41,6 +41,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index a0bea79..18d642f 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -41,6 +41,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5EAstat.c b/src/H5EAstat.c index 6c55d7e..509d3f8 100644 --- a/src/H5EAstat.c +++ b/src/H5EAstat.c @@ -40,6 +40,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -41,6 +41,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5FLprivate.h" /* Free Lists */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector functions */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 2726bff..f440efe 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -41,6 +41,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 5a6283f..8f29b83 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -39,6 +39,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5FAstat.c b/src/H5FAstat.c index e70fcb8..49a56a9 100644 --- a/src/H5FAstat.c +++ b/src/H5FAstat.c @@ -38,6 +38,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -36,6 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5FScache.c b/src/H5FScache.c index b0b282a..7525a9a 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -38,6 +38,7 @@ #include "H5Fprivate.h" /* File */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 053aad2..8d7852b 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -38,6 +38,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 94f66c6..e3860a0 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -28,6 +28,7 @@ typedef struct H5F_t H5F_t; #include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL #include "H5Pprivate.h" /* Property lists */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 425cc14..71e0b2d 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -35,6 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ +#include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 7387eae..0ffdc53 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -36,6 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 276da73..19aef10 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -32,6 +32,7 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5HLprivate.h" /* Local Heaps */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -42,6 +42,8 @@ #include "H5FOprivate.h" /* File objects */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ + /****************/ /* Local Macros */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 5a9b161..5750a03 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -36,6 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ /****************/ diff --git a/src/H5HFtest.c b/src/H5HFtest.c index 0ddcb34..6f174bb 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -32,6 +32,8 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ +#include "H5MMprivate.h" /* Memory management */ + /****************/ /* Local Macros */ diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 1407861..0c27180 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -35,6 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ +#include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 2841a4c..8b04b47 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -36,6 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5HLpkg.h" /* Local Heaps */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -568,7 +568,8 @@ H5MM_xfree(void *mem) /*------------------------------------------------------------------------- * Function: H5MM_memcpy * - * Purpose: Like memcpy(3) but with a check for buffer overlap. + * Purpose: Like memcpy(3) but with sanity checks on the parameters, + * particularly buffer overlap. * * Return: Success: pointer to dest * Failure: NULL @@ -588,7 +589,8 @@ H5MM_memcpy(void *dest, const void *src, size_t n) HDassert(dest); HDassert(src); - HDassert(dest >= src + n || src >= dest + n); + HDassert(n > 0); + HDassert((char *)dest >= (const char *)src + n || (const char *)src >= (char *)dest + n); ret = HDmemcpy(dest, src, n); diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 090df18..c1f90cb 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -36,6 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ /****************/ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 213dd11..683d155 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -36,6 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 8a10d04..570f94e 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -38,9 +38,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MFprivate.h" /* File memory management */ -#ifdef H5O_ENABLE_BOGUS #include "H5MMprivate.h" /* Memory management */ -#endif /* H5O_ENABLE_BOGUS */ #include "H5Opkg.h" /* Object headers */ #include "H5VLprivate.h" /* Virtual Object Layer */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index eec1a84..67ca76f 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -39,6 +39,7 @@ #include "H5Fprivate.h" /* File access */ #include "H5Gprivate.h" /* Groups */ #include "H5HFprivate.h" /* Fractal heap */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5SMprivate.h" /* Shared object header messages */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -36,6 +36,7 @@ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5PBpkg.h" /* File access */ #include "H5SLprivate.h" /* Skip List */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 9279615..5ce12b4 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -37,8 +37,8 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ -#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -26,6 +26,7 @@ #include "H5Fprivate.h" /* Files */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Spkg.h" /* Dataspaces */ diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 0c4224b..7f6c804 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -24,6 +24,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object Headers */ #include "H5SMpkg.h" /* Shared object header messages */ diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index 3e50fe5..0cca6bb 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -24,6 +24,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object Headers */ #include "H5SMpkg.h" /* Shared object header messages */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 96f3894..4cb5e28 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -32,6 +32,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* ID Functions */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Spkg.h" /* Dataspace functions */ #include "H5VMprivate.h" /* Vector functions */ @@ -19,6 +19,7 @@ #include "H5private.h" #include "H5Eprivate.h" +#include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" #include "H5VMprivate.h" diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 28248c0..26f59e2 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -21,6 +21,7 @@ /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /* Vector-Vector sequence operation callback */ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, diff --git a/src/H5private.h b/src/H5private.h index ef52ac6..dad2d94 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1104,12 +1104,8 @@ typedef off_t h5_stat_size_t; #ifndef HDmemcmp #define HDmemcmp(X,Y,Z) memcmp(X,Y,Z) #endif /* HDmemcmp */ -/* - * The (char*) casts are required for the DEC when optimizations are turned - * on and the source and/or destination are not aligned. - */ #ifndef HDmemcpy - #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z) + #define HDmemcpy(X,Y,Z) memcpy(X,Y,Z) #endif /* HDmemcpy */ #ifndef HDmemmove #define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z) |