projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update gettext copy.
[apps/madmutt.git]
/
thread.c
diff --git
a/thread.c
b/thread.c
index
36ed25e
..
965c897
100644
(file)
--- a/
thread.c
+++ b/
thread.c
@@
-11,11
+11,12
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "sort.h"
#include "thread.h"
#include "mutt.h"
#include "sort.h"
#include "thread.h"
-#include "lib/mem.h"
#include "lib/intl.h"
#include <string.h>
#include "lib/intl.h"
#include <string.h>
@@
-129,7
+130,7
@@
static void calculate_visibility (CONTEXT * ctx, int *max_depth)
tree->subtree_visible = 0;
if (tree->message) {
tree->subtree_visible = 0;
if (tree->message) {
-
mem_free
(&tree->message->tree);
+
p_delete
(&tree->message->tree);
if (VISIBLE (tree->message, ctx)) {
tree->deep = 1;
tree->visible = 1;
if (VISIBLE (tree->message, ctx)) {
tree->deep = 1;
tree->visible = 1;
@@
-221,8
+222,8
@@
void mutt_draw_tree (CONTEXT * ctx)
* From now on we can simply ignore invisible subtrees
*/
calculate_visibility (ctx, &max_depth);
* From now on we can simply ignore invisible subtrees
*/
calculate_visibility (ctx, &max_depth);
- pfx =
mem_malloc (
width * max_depth + 2);
- arrow =
mem_malloc (
width * max_depth + 2);
+ pfx =
p_new(char,
width * max_depth + 2);
+ arrow =
p_new(char,
width * max_depth + 2);
while (tree) {
if (depth) {
myarrow = arrow + (depth - start_depth - (start_depth ? 0 : 1)) * width;
while (tree) {
if (depth) {
myarrow = arrow + (depth - start_depth - (start_depth ? 0 : 1)) * width;
@@
-240,7
+241,7
@@
void mutt_draw_tree (CONTEXT * ctx)
if (tree->visible) {
myarrow[width] = M_TREE_RARROW;
myarrow[width + 1] = 0;
if (tree->visible) {
myarrow[width] = M_TREE_RARROW;
myarrow[width + 1] = 0;
- new_tree =
mem_malloc (
(2 + depth * width));
+ new_tree =
p_new(char,
(2 + depth * width));
if (start_depth > 1) {
strncpy (new_tree, pfx, (start_depth - 1) * width);
strfcpy (new_tree + (start_depth - 1) * width,
if (start_depth > 1) {
strncpy (new_tree, pfx, (start_depth - 1) * width);
strfcpy (new_tree + (start_depth - 1) * width,
@@
-307,8
+308,8
@@
void mutt_draw_tree (CONTEXT * ctx)
while (!tree->deep);
}
while (!tree->deep);
}
-
mem_free
(&pfx);
-
mem_free
(&arrow);
+
p_delete
(&pfx);
+
p_delete
(&arrow);
}
/* since we may be trying to attach as a pseudo-thread a THREAD that
}
/* since we may be trying to attach as a pseudo-thread a THREAD that
@@
-344,7
+345,7
@@
static LIST *make_subject_list (THREAD * cur, time_t * dateptr)
break;
}
if (!curlist || rc > 0) {
break;
}
if (!curlist || rc > 0) {
- newlist =
mem_calloc (1, sizeof (LIST)
);
+ newlist =
p_new(LIST, 1
);
newlist->data = env->real_subj;
if (oldlist) {
newlist->next = oldlist->next;
newlist->data = env->real_subj;
if (oldlist) {
newlist->next = oldlist->next;
@@
-405,7
+406,7
@@
static THREAD *find_subject (CONTEXT * ctx, THREAD * cur)
oldlist = subjects;
subjects = subjects->next;
oldlist = subjects;
subjects = subjects->next;
-
mem_free
(&oldlist);
+
p_delete
(&oldlist);
}
return (last);
}
}
return (last);
}
@@
-547,7
+548,7
@@
THREAD *mutt_sort_subthreads (THREAD * thread, int init)
top = thread;
top = thread;
- array =
mem_calloc ((array_size = 256), sizeof (THREAD *
));
+ array =
p_new(THREAD *, (array_size = 256
));
while (1) {
if (init || !thread->sort_key) {
thread->sort_key = NULL;
while (1) {
if (init || !thread->sort_key) {
thread->sort_key = NULL;
@@
-579,7
+580,7
@@
THREAD *mutt_sort_subthreads (THREAD * thread, int init)
/* put them into the array */
for (i = 0; thread; i++, thread = thread->prev) {
if (i >= array_size)
/* put them into the array */
for (i = 0; thread; i++, thread = thread->prev) {
if (i >= array_size)
-
mem_realloc (&array, (array_size *= 2) * sizeof (THREAD *)
);
+
p_realloc(&array, array_size *= 2
);
array[i] = thread;
}
array[i] = thread;
}
@@
-639,7
+640,7
@@
THREAD *mutt_sort_subthreads (THREAD * thread, int init)
}
else {
Sort ^= SORT_REVERSE;
}
else {
Sort ^= SORT_REVERSE;
-
mem_free
(&array);
+
p_delete
(&array);
return (top);
}
}
return (top);
}
}
@@
-756,7
+757,7
@@
void mutt_sort_threads (CONTEXT * ctx, int init)
else {
new = (option (OPTDUPTHREADS) ? thread : NULL);
else {
new = (option (OPTDUPTHREADS) ? thread : NULL);
- thread =
mem_calloc (1, sizeof (THREAD)
);
+ thread =
p_new(THREAD, 1
);
thread->message = cur;
thread->check_subject = 1;
cur->thread = thread;
thread->message = cur;
thread->check_subject = 1;
cur->thread = thread;
@@
-837,7
+838,7
@@
void mutt_sort_threads (CONTEXT * ctx, int init)
break;
if ((new = hash_find (ctx->thread_hash, ref->data)) == NULL) {
break;
if ((new = hash_find (ctx->thread_hash, ref->data)) == NULL) {
- new =
mem_calloc (1, sizeof (THREAD)
);
+ new =
p_new(THREAD, 1
);
hash_insert (ctx->thread_hash, ref->data, new, 1);
}
else {
hash_insert (ctx->thread_hash, ref->data, new, 1);
}
else {
@@
-1271,7
+1272,7
@@
void mutt_break_thread (HEADER * hdr)
{
mutt_free_list (&hdr->env->in_reply_to);
mutt_free_list (&hdr->env->references);
{
mutt_free_list (&hdr->env->in_reply_to);
mutt_free_list (&hdr->env->references);
- hdr->env->irt_changed = hdr->env->refs_changed = 1;
+ hdr->env->irt_changed = hdr->env->refs_changed =
hdr->changed =
1;
clean_references (hdr->thread, hdr->thread->child);
}
clean_references (hdr->thread, hdr->thread->child);
}