daily update
[binutils-gdb.git] / mmalloc / mfree.c
index 163d31e90211443ce5b9bff071cd6d417a9791d2..c509ac6e2a6865f8b4a5968fc7eae8118fa3ba7b 100644 (file)
@@ -16,13 +16,13 @@ Library General Public License for more details.
 
 You should have received a copy of the GNU Library General Public
 License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
 
    The author may be reached (Email) at the address mike@ai.mit.edu,
    or (US mail) as Mike Haertel c/o Free Software Foundation. */
 
-#include "mmalloc.h"
+#include "mmprivate.h"
 
 /* Return memory to the heap.
    Like `mfree' but don't call a mfree_hook if there is one.  */
@@ -67,7 +67,7 @@ __mmalloc_free (mdp, ptr)
            {
              i = mdp -> heapinfo[i].free.next;
            }
-         while (i > 0 && i < block);
+         while ((i != 0) && (i < block));
          i = mdp -> heapinfo[i].free.prev;
        }
 
@@ -162,7 +162,7 @@ __mmalloc_free (mdp, ptr)
          mdp -> heapstats.chunks_free -= BLOCKSIZE >> type;
          mdp -> heapstats.bytes_free -= BLOCKSIZE;
 
-         mfree (mdp, ADDRESS(block));
+         mfree ((PTR) mdp, (PTR) ADDRESS(block));
        }
       else if (mdp -> heapinfo[block].busy.info.frag.nfree != 0)
        {
@@ -237,13 +237,11 @@ mfree (md, ptr)
    on top of it, so that if we use the default sbrk() region we will not
    collide with another malloc package trying to do the same thing, if
    the application contains any "hidden" calls to malloc/realloc/free (such
-   as inside a system library).
-
-   NOTE:  Defining our own copy of this breaks ANSI conformance. */
+   as inside a system library). */
 
 void
 free (ptr)
   PTR ptr;
 {
-  mfree ((void *) NULL, ptr);
+  mfree ((PTR) NULL, ptr);
 }