#endif
/* Old hook values. */
-static void (*old_free_hook) __P ((__ptr_t ptr, __const __ptr_t));
-static __ptr_t (*old_malloc_hook) __P ((__malloc_size_t size, const __ptr_t));
-static __ptr_t (*old_memalign_hook) __P ((__malloc_size_t alignment,
- __malloc_size_t size,
- const __ptr_t));
-static __ptr_t (*old_realloc_hook) __P ((__ptr_t ptr, __malloc_size_t size,
- __const __ptr_t));
+static void (*old_free_hook) (__ptr_t ptr, __const __ptr_t);
+static __ptr_t (*old_malloc_hook) (__malloc_size_t size, const __ptr_t);
+static __ptr_t (*old_memalign_hook) (__malloc_size_t alignment,
+ __malloc_size_t size,
+ const __ptr_t);
+static __ptr_t (*old_realloc_hook) (__ptr_t ptr, __malloc_size_t size,
+ __const __ptr_t);
/* Function to call when something awful happens. */
-static void (*abortfunc) __P ((enum mcheck_status));
+static void (*abortfunc) (enum mcheck_status);
/* Arbitrary magical numbers. */
#define MAGICWORD 0xfedabeeb
# include <string.h>
# define flood memset
#else
-static void flood __P ((__ptr_t, int, __malloc_size_t));
+static void flood (__ptr_t, int, __malloc_size_t);
static void
flood (ptr, val, size)
__ptr_t ptr;
}
#endif
-static enum mcheck_status checkhdr __P ((const struct hdr *));
static enum mcheck_status
-checkhdr (hdr)
- const struct hdr *hdr;
+checkhdr (const struct hdr *hdr)
{
enum mcheck_status status;
}
void
-mcheck_check_all ()
+mcheck_check_all (void)
{
/* Walk through all the active blocks and test whether they were tempered
with. */
libc_hidden_def (mcheck_check_all)
#endif
-static void unlink_blk __P ((struct hdr *ptr));
static void
-unlink_blk (ptr)
- struct hdr *ptr;
+unlink_blk (struct hdr *ptr)
{
if (ptr->next != NULL)
{
root = ptr->next;
}
-static void link_blk __P ((struct hdr *ptr));
static void
-link_blk (hdr)
- struct hdr *hdr;
+link_blk (struct hdr *hdr)
{
hdr->prev = NULL;
hdr->next = root;
+ (uintptr_t) hdr->next->next);
}
}
-
-static void freehook __P ((__ptr_t, const __ptr_t));
static void
-freehook (ptr, caller)
- __ptr_t ptr;
- const __ptr_t caller;
+freehook (__ptr_t ptr, const __ptr_t caller)
{
if (pedantic)
mcheck_check_all ();
__free_hook = freehook;
}
-static __ptr_t mallochook __P ((__malloc_size_t, const __ptr_t));
static __ptr_t
-mallochook (size, caller)
- __malloc_size_t size;
- const __ptr_t caller;
+mallochook (__malloc_size_t size, const __ptr_t caller)
{
struct hdr *hdr;
return (__ptr_t) (hdr + 1);
}
-static __ptr_t memalignhook __P ((__malloc_size_t, __malloc_size_t,
- const __ptr_t));
static __ptr_t
-memalignhook (alignment, size, caller)
- __malloc_size_t alignment, size;
- const __ptr_t caller;
+memalignhook (__malloc_size_t alignment, __malloc_size_t size,
+ const __ptr_t caller)
{
struct hdr *hdr;
__malloc_size_t slop;
return (__ptr_t) (hdr + 1);
}
-static __ptr_t reallochook __P ((__ptr_t, __malloc_size_t, const __ptr_t));
static __ptr_t
-reallochook (ptr, size, caller)
- __ptr_t ptr;
- __malloc_size_t size;
- const __ptr_t caller;
+reallochook (__ptr_t ptr, __malloc_size_t size, const __ptr_t caller)
{
struct hdr *hdr;
__malloc_size_t osize;
return (__ptr_t) (hdr + 1);
}
-static void mabort __P ((enum mcheck_status status))
- __attribute__ ((noreturn));
+__attribute__ ((noreturn))
static void
-mabort (status)
- enum mcheck_status status;
+mabort (enum mcheck_status status)
{
const char *msg;
switch (status)
int
mcheck (func)
- void (*func) __P ((enum mcheck_status));
+ void (*func) (enum mcheck_status);
{
abortfunc = (func != NULL) ? func : &mabort;
int
mcheck_pedantic (func)
- void (*func) __P ((enum mcheck_status));
+ void (*func) (enum mcheck_status);
{
int res = mcheck (func);
if (res == 0)