register_ptr (void *ptr, const char *file, int line)
{
int i;
- for (i = 0; i < ARRAY_SIZE (malloc_debug); i++)
+ for (i = 0; i < countof (malloc_debug); i++)
if (malloc_debug[i].ptr == NULL)
{
malloc_debug[i].ptr = ptr;
unregister_ptr (void *ptr)
{
int i;
- for (i = 0; i < ARRAY_SIZE (malloc_debug); i++)
+ for (i = 0; i < countof (malloc_debug); i++)
if (malloc_debug[i].ptr == ptr)
{
malloc_debug[i].ptr = NULL;
int i;
printf ("\nMalloc: %d\nFree: %d\nBalance: %d\n\n",
malloc_count, free_count, malloc_count - free_count);
- for (i = 0; i < ARRAY_SIZE (malloc_debug); i++)
+ for (i = 0; i < countof (malloc_debug); i++)
if (malloc_debug[i].ptr != NULL)
printf ("0x%08ld: %s:%d\n", (long)malloc_debug[i].ptr,
malloc_debug[i].file, malloc_debug[i].line);
cnt = 16;
while (cnt--)
{
- *p2++ = XDIGIT_TO_xchar (*p1 >> 4);
- *p2++ = XDIGIT_TO_xchar (*p1 & 0xf);
+ *p2++ = XNUM_TO_digit (*p1 >> 4);
+ *p2++ = XNUM_TO_digit (*p1 & 0xf);
++p1;
}
*p2 = '\0';