#include "mapping.h"
#include "sort.h"
-#include "lib/mem.h"
#include "lib/intl.h"
#include "lib/str.h"
#include "lib/debug.h"
if (first == NULL) {
FirstColumn = 0;
SecondColumn = 0;
- first = (QUERY *) mem_calloc (1, sizeof (QUERY));
+ first = p_new(QUERY, 1);
cur = first;
}
else {
- cur->next = (QUERY *) mem_calloc (1, sizeof (QUERY));
+ cur->next = p_new(QUERY, 1);
cur = cur->next;
}
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;
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++)
int clear = 0;
/* append */
- mem_realloc (&QueryTable, menu->max * sizeof (ENTRY));
+ p_realloc(&QueryTable, menu->max);
menu->data = QueryTable;