Use p_new instead of xmalloc()
[apps/madmutt.git] / score.c
diff --git a/score.c b/score.c
index aae4e0a..1826a95 100644 (file)
--- a/score.c
+++ b/score.c
@@ -7,19 +7,11 @@
  * please see the file GPL in the top level source directory.
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <lib-lib/mem.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
+#include <lib-lib/lib-lib.h>
 
 #include "mutt.h"
 #include "sort.h"
-
-#include <string.h>
-#include <stdlib.h>
+#include "pattern.h"
 
 typedef struct score_t {
   char *str;
@@ -55,7 +47,8 @@ void mutt_check_rescore (CONTEXT * ctx)
   unset_option (OPTNEEDRESCORE);
 }
 
-int mutt_parse_score (BUFFER * buf, BUFFER * s, unsigned long data,
+int mutt_parse_score (BUFFER * buf, BUFFER * s,
+                      unsigned long data __attribute__ ((unused)),
                       BUFFER * err)
 {
   SCORE *ptr, *last;
@@ -129,8 +122,9 @@ void mutt_score_message (CONTEXT * ctx, HEADER * hdr, int upd_ctx)
     _mutt_set_flag (ctx, hdr, M_FLAG, 1, upd_ctx);
 }
 
-int mutt_parse_unscore (BUFFER * buf, BUFFER * s, unsigned long data,
-                        BUFFER * err)
+int mutt_parse_unscore (BUFFER * buf, BUFFER * s,
+                        unsigned long data __attribute__ ((unused)),
+                        BUFFER * err __attribute__ ((unused)))
 {
   SCORE *tmp, *last = NULL;
 
@@ -140,7 +134,7 @@ int mutt_parse_unscore (BUFFER * buf, BUFFER * s, unsigned long data,
       for (tmp = Score; tmp;) {
         last = tmp;
         tmp = tmp->next;
-        mutt_pattern_free (&last->pat);
+        pattern_list_wipe(&last->pat);
         p_delete(&last);
       }
       Score = NULL;
@@ -152,7 +146,7 @@ int mutt_parse_unscore (BUFFER * buf, BUFFER * s, unsigned long data,
             last->next = tmp->next;
           else
             Score = tmp->next;
-          mutt_pattern_free (&tmp->pat);
+          pattern_list_wipe(&tmp->pat);
           p_delete(&tmp);
           /* there should only be one score per pattern, so we can stop here */
           break;