summaryrefslogtreecommitdiffstats
path: root/src/H5MM.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-09-19 16:36:59 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-09-19 16:36:59 (GMT)
commit25d866e9b433142c38fa6c4c8d3cad5e00d46163 (patch)
tree8e68bab9cde1dd8f8e63b18d4b294093a1df9608 /src/H5MM.c
parent055daa52f0fe51423880551cd21b4b8c8d945130 (diff)
downloadhdf5-25d866e9b433142c38fa6c4c8d3cad5e00d46163.zip
hdf5-25d866e9b433142c38fa6c4c8d3cad5e00d46163.tar.gz
hdf5-25d866e9b433142c38fa6c4c8d3cad5e00d46163.tar.bz2
[svn-r100] Interim checkin for purify. Also contains H5G shadow stuff, changes
to int64 encode/decode to fix purify on 32-bit systems, changes to H5O_modify, changes to H5D.c to use H5F_open/close(), etc. Documentation will be mailed shortly...
Diffstat (limited to 'src/H5MM.c')
-rw-r--r--src/H5MM.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/H5MM.c b/src/H5MM.c
index 39da6d7..eb9c76e 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -168,6 +168,16 @@ H5MM_xstrdup (const char *s)
void *
H5MM_xfree (const void *mem)
{
- if (mem) HDfree (mem);
+ /*
+ * free(3) takes a non-const pointer as an argument even though
+ * conceptually the argument could be a constant because by time
+ * free() mucks with it's contents, it should already be free :-)
+ * Instead of passing a const arg to free, which generates a
+ * compiler warning, we cast it to a non-const arg first. With
+ * gcc, this results in a warning only if -Wcast-qual is turned on.
+ */
+ void *non_const_mem = mem;
+
+ if (mem) HDfree (non_const_mem);
return NULL;
}