From b3497a30453584bf88d4bb5cabbb87f8bf5ad6cf Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 4 Jun 2004 11:43:18 +0000 Subject: [PATCH] (mdebug__register_object, mdebug__unregister_object): Extern them. (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them respectively. --- src/internal.h | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/src/internal.h b/src/internal.h index 5352700..e009d86 100644 --- a/src/internal.h +++ b/src/internal.h @@ -341,36 +341,19 @@ typedef struct void **objects; } M17NObjectArray; +extern void mdebug__register_object (M17NObjectArray *array, void *object); -#define M17N_OBJECT_REGISTER(array, object) \ - if (mdebug__flag & MDEBUG_FINI) \ - { \ - if ((array).used == 0) \ - MLIST_INIT1 (&(array), objects, 256); \ - (array).count++; \ - MLIST_APPEND1 (&(array), objects, object, MERROR_OBJECT); \ - } \ +#define M17N_OBJECT_REGISTER(array, object) \ + if (mdebug__flag & MDEBUG_FINI) \ + mdebug__register_object (&array, object); \ else -#define M17N_OBJECT_UNREGISTER(array, object) \ - if (mdebug__flag & MDEBUG_FINI) \ - { \ - (array).count--; \ - if ((array).count >= 0) \ - { \ - int i = 0; \ - \ - while (i < (array).used && (array).objects[i] != object) i++; \ - if (i < (array).used) \ - (array).objects[i] = NULL; \ - else \ - mdebug_hook (); \ - } \ - else \ - mdebug_hook (); \ - } \ - else +extern void mdebug__unregister_object (M17NObjectArray *array, void *object); +#define M17N_OBJECT_UNREGISTER(array, object) \ + if (mdebug__flag & MDEBUG_FINI) \ + mdebug__unregister_object (&array, object); \ + else extern void mdebug__report_object (char *name, M17NObjectArray *array); -- 1.7.10.4