X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=color.c;h=854dde5e0312389a94c3317d1f13b6790e5fe890;hb=b3cb6ed8d36c550a2e589910ce51bbc8352ff57c;hp=8980b0b69436bb1fc01221714b41eeedd50e5419;hpb=ba5e3af4ea19e1d20c80941c077039871ec84258;p=apps%2Fmadmutt.git diff --git a/color.c b/color.c index 8980b0b..854dde5 100644 --- a/color.c +++ b/color.c @@ -11,7 +11,11 @@ # include "config.h" #endif +#include + #include "mutt.h" +#include "buffer.h" +#include "ascii.h" #include "mutt_curses.h" #include "mapping.h" @@ -96,7 +100,7 @@ static struct mapping_t Fields[] = { static COLOR_LINE *mutt_new_color_line (void) { - COLOR_LINE *p = mem_calloc (1, sizeof (COLOR_LINE)); + COLOR_LINE *p = p_new(COLOR_LINE, 1); p->fg = p->bg = -1; @@ -123,14 +127,14 @@ static void mutt_free_color_line (COLOR_LINE ** l, int free_colors) regfree (&tmp->rx); mutt_pattern_free (&tmp->color_pattern); - mem_free (&tmp->pattern); - mem_free (l); + p_delete(&tmp->pattern); + p_delete(l); } void ci_start_color (void) { memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX); - ColorQuote = (int *) mem_malloc (COLOR_QUOTE_INIT * sizeof (int)); + ColorQuote = p_new(int, COLOR_QUOTE_INIT); memset (ColorQuote, A_NORMAL, sizeof (int) * COLOR_QUOTE_INIT); ColorQuoteSize = COLOR_QUOTE_INIT; ColorQuoteUsed = 0; @@ -223,7 +227,7 @@ int mutt_alloc_color (int fg, int bg) i++; } - p = (COLOR_LIST *) mem_malloc (sizeof (COLOR_LIST)); + p = p_new(COLOR_LIST, 1); p->next = ColorList; ColorList = p; @@ -267,14 +271,14 @@ void mutt_free_color (int fg, int bg) if (p == ColorList) { ColorList = ColorList->next; - mem_free (&p); + p_delete(&p); return; } q = ColorList; while (q) { if (q->next == p) { q->next = p->next; - mem_free (&p); + p_delete(&p); return; } q = q->next;