projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exit mem_realloc, enters p_realloc/xrealloc.
[apps/madmutt.git]
/
color.c
diff --git
a/color.c
b/color.c
index
51d2f83
..
1c60c77
100644
(file)
--- a/
color.c
+++ b/
color.c
@@
-11,11
+11,14
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "mutt.h"
+#include "buffer.h"
+#include "ascii.h"
#include "mutt_curses.h"
#include "mapping.h"
#include "mutt_curses.h"
#include "mapping.h"
-#include "lib/mem.h"
#include "lib/intl.h"
#include "lib/str.h"
#include "lib/debug.h"
#include "lib/intl.h"
#include "lib/str.h"
#include "lib/debug.h"
@@
-96,7
+99,7
@@
static struct mapping_t Fields[] = {
static COLOR_LINE *mutt_new_color_line (void)
{
static COLOR_LINE *mutt_new_color_line (void)
{
- COLOR_LINE *p =
safe_calloc (1, sizeof (COLOR_LINE)
);
+ COLOR_LINE *p =
p_new(COLOR_LINE, 1
);
p->fg = p->bg = -1;
p->fg = p->bg = -1;
@@
-123,14
+126,14
@@
static void mutt_free_color_line (COLOR_LINE ** l, int free_colors)
regfree (&tmp->rx);
mutt_pattern_free (&tmp->color_pattern);
regfree (&tmp->rx);
mutt_pattern_free (&tmp->color_pattern);
-
FREE
(&tmp->pattern);
-
FREE
(l);
+
p_delete
(&tmp->pattern);
+
p_delete
(l);
}
void ci_start_color (void)
{
memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX);
}
void ci_start_color (void)
{
memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX);
- ColorQuote =
(int *) safe_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;
memset (ColorQuote, A_NORMAL, sizeof (int) * COLOR_QUOTE_INIT);
ColorQuoteSize = COLOR_QUOTE_INIT;
ColorQuoteUsed = 0;
@@
-223,7
+226,7
@@
int mutt_alloc_color (int fg, int bg)
i++;
}
i++;
}
- p =
(COLOR_LIST *) safe_malloc (sizeof (COLOR_LIST)
);
+ p =
p_new(COLOR_LIST, 1
);
p->next = ColorList;
ColorList = p;
p->next = ColorList;
ColorList = p;
@@
-267,14
+270,14
@@
void mutt_free_color (int fg, int bg)
if (p == ColorList) {
ColorList = ColorList->next;
if (p == ColorList) {
ColorList = ColorList->next;
-
FREE
(&p);
+
p_delete
(&p);
return;
}
q = ColorList;
while (q) {
if (q->next == p) {
q->next = p->next;
return;
}
q = ColorList;
while (q) {
if (q->next == p) {
q->next = p->next;
-
FREE
(&p);
+
p_delete
(&p);
return;
}
q = q->next;
return;
}
q = q->next;
@@
-698,7
+701,7
@@
_mutt_parse_color (BUFFER * buf, BUFFER * s, BUFFER * err,
}
else if (object == MT_COLOR_QUOTED) {
if (q_level >= ColorQuoteSize) {
}
else if (object == MT_COLOR_QUOTED) {
if (q_level >= ColorQuoteSize) {
-
safe_realloc (&ColorQuote, (ColorQuoteSize += 2) * sizeof (int)
);
+
p_realloc(&ColorQuote, ColorQuoteSize += 2
);
ColorQuote[ColorQuoteSize - 2] = ColorDefs[MT_COLOR_QUOTED];
ColorQuote[ColorQuoteSize - 1] = ColorDefs[MT_COLOR_QUOTED];
}
ColorQuote[ColorQuoteSize - 2] = ColorDefs[MT_COLOR_QUOTED];
ColorQuote[ColorQuoteSize - 1] = ColorDefs[MT_COLOR_QUOTED];
}