projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move intl.h into lib-lib/macros.h
[apps/madmutt.git]
/
query.c
diff --git
a/query.c
b/query.c
index
893d2db
..
f7a7894
100644
(file)
--- a/
query.c
+++ b/
query.c
@@
-12,6
+12,7
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/macros.h>
#include "mutt.h"
#include "mutt_menu.h"
#include "mutt.h"
#include "mutt_menu.h"
@@
-19,8
+20,6
@@
#include "mapping.h"
#include "sort.h"
#include "mapping.h"
#include "sort.h"
-#include "lib/mem.h"
-#include "lib/intl.h"
#include "lib/str.h"
#include "lib/debug.h"
#include "lib/str.h"
#include "lib/debug.h"
@@
-102,11
+101,11
@@
static QUERY *run_query (char *s, int quiet)
if (first == NULL) {
FirstColumn = 0;
SecondColumn = 0;
if (first == NULL) {
FirstColumn = 0;
SecondColumn = 0;
- first =
(QUERY *) mem_calloc (1, sizeof (QUERY)
);
+ first =
p_new(QUERY, 1
);
cur = first;
}
else {
cur = first;
}
else {
- cur->next =
(QUERY *) mem_calloc (1, sizeof (QUERY)
);
+ cur->next =
p_new(QUERY, 1
);
cur = cur->next;
}
cur = cur->next;
}
@@
-289,8
+288,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
for (queryp = results; queryp; queryp = queryp->next)
menu->max++;
for (queryp = results; queryp; queryp = queryp->next)
menu->max++;
- menu->data = QueryTable =
- (ENTRY *) mem_calloc (menu->max, sizeof (ENTRY));
+ menu->data = QueryTable = p_new(ENTRY, menu->max);
for (i = 0, queryp = results; queryp; queryp = queryp->next, i++)
QueryTable[i].data = queryp;
for (i = 0, queryp = results; queryp; queryp = queryp->next, i++)
QueryTable[i].data = queryp;
@@
-346,8
+344,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
menu->max++;
if (op == OP_QUERY) {
menu->max++;
if (op == OP_QUERY) {
- menu->data = QueryTable =
- (ENTRY *) mem_calloc (menu->max, sizeof (ENTRY));
+ menu->data = QueryTable = p_new(ENTRY, menu->max);
for (i = 0, queryp = results; queryp;
queryp = queryp->next, i++)
for (i = 0, queryp = results; queryp;
queryp = queryp->next, i++)
@@
-357,7
+354,7
@@
static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf)
int clear = 0;
/* append */
int clear = 0;
/* append */
-
mem_realloc (&QueryTable, menu->max * sizeof (ENTRY)
);
+
p_realloc(&QueryTable, menu->max
);
menu->data = QueryTable;
menu->data = QueryTable;