Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 24 Jul 2005 11:58:10 +0000 (11:58 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 24 Jul 2005 11:58:10 +0000 (11:58 +0000)
- add typedef for list_del() to lib/list.h and use it to fix compiler warnings (fix other warnings as well)
- fix typo in manual for $xterm_leave

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@339 e385b8ad-14ed-0310-8656-cc95a2468c6d

buffy.c
charset.c
doc/manual.txt
init.c
init.h
lib/list.c
lib/list.h

diff --git a/buffy.c b/buffy.c
index f4718fe..4ede93b 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -168,8 +168,8 @@ void buffy_update_mailbox (BUFFY * b)
 #endif
 
 /* func to free buffy for list_del() */
-static void buffy_free (void** p) {
-  FREE(&(*((BUFFY**) p))->path);
+static void buffy_free (BUFFY** p) {
+  FREE(&(*p)->path);
   FREE(p);
 }
 
@@ -199,7 +199,7 @@ int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
     strfcpy (buf, path->data, sizeof (buf));
 
     if (data == M_UNMAILBOXES && str_eq (buf, "*") == 0) {
-      list_del (&Incoming, buffy_free);
+      list_del (&Incoming, (list_del_t*) buffy_free);
       return 0;
     }
 
index fbf8a69..46de91c 100644 (file)
--- a/charset.c
+++ b/charset.c
@@ -564,7 +564,7 @@ char *mutt_get_first_charset (const char *charset)
   if (!mutt_strlen (c))
     return "us-ascii";
   if (!(c1 = strchr (c, ':')))
-    return charset;
+    return ((char*) charset);
   strfcpy (fcharset, c, c1 - c + 1);
   return fcharset;
 }
index 57c2574..8f11ccd 100644 (file)
        there's no easy and portable way to read the current title so mutt-ng cannot
        read it upon startup and restore it when exiting.
 
-       Based on the xterm FAQ, the following might work: set xterm_leave = '`test
+       Based on the xterm FAQ, the following might work:
 
        The Mutt-ng E-Mail Client                                                   148
 
-       x_\bD_\bI_\bS_\bP_\bL_\bA_\bY (section , page ) != x && xprop -id _\bW_\bI_\bN_\bD_\bO_\bW_\bI_\bD (section , page ) | grep
-       WM_NAME | cut -d ''' -f 2`'
+       set xterm_leave = '`test x$DISPLAY != x && xprop -id $WINDOWID | grep WM_NAME |
+       cut -d ''' -f 2`'
 
        _\b6_\b._\b3_\b._\b3_\b3_\b7  _\bx_\bt_\be_\br_\bm_\b__\bs_\be_\bt_\b__\bt_\bi_\bt_\bl_\be_\bs
 
diff --git a/init.c b/init.c
index 6e0d902..7ffb37c 100644 (file)
--- a/init.c
+++ b/init.c
@@ -485,7 +485,7 @@ static int remove_from_rx_list (list2_t** l, const char *str)
   int i = 0;
 
   if (mutt_strcmp ("*", str) == 0) {
-    list_del (l, rx_free);
+    list_del (l, (list_del_t*) rx_free);
     return (0);
   }
   else {
@@ -698,7 +698,7 @@ static int parse_spam_list (BUFFER * buf, BUFFER * s, unsigned long data,
     /* "*" is a special case. */
     if (!mutt_strcmp (buf->data, "*")) {
       mutt_free_spam_list (&SpamList);
-      list_del (&NoSpamList, rx_free);
+      list_del (&NoSpamList, (list_del_t*) rx_free);
       return 0;
     }
 
diff --git a/init.h b/init.h
index 1ce0224..5886c78 100644 (file)
--- a/init.h
+++ b/init.h
@@ -3590,7 +3590,7 @@ struct option_t MuttVars[] = {
    ** Based on the xterm FAQ, the following might work:
    **
    ** .pp
-   ** \fTset xterm_leave = "`test x$DISPLAY != x && xprop -id $WINDOWID | grep WM_NAME | cut -d '"' -f 2`"\fT
+   ** \fTset xterm_leave = "`test x$$$DISPLAY != x && xprop -id $$$WINDOWID | grep WM_NAME | cut -d '"' -f 2`"\fP
    */
   {"xterm_title", DT_STR, R_BOTH, UL &XtermTitle, UL "Mutt-ng with %?m?%m messages&no messages?%?n? [%n New]?"},
   /*
index 7d233e7..e921b20 100644 (file)
@@ -18,13 +18,13 @@ list2_t* list_new (void) {
   return (safe_calloc (1, sizeof (list2_t)));
 }
 
-void list_del (list2_t** l, void (*edel) (void**)) {
+void list_del (list2_t** l, list_del_t* del) {
   size_t i = 0;
   if (!l || !*l)
     return;
-  if (*edel)
+  if (del)
     for (i = 0; i < (*l)->length; i++)
-      edel (&(*l)->data[i]);
+      del (&(*l)->data[i]);
   FREE(&(*l)->data);
   FREE(l);
 }
index 9cb4bb3..20f4c60 100644 (file)
@@ -28,9 +28,12 @@ typedef struct list2_t {
  */
 
 list2_t* list_new (void);
-/* frees all memory used by list and optionally used edel func
- * ptr to free items */
-void list_del (list2_t**, void (*edel) (void**));
+
+typedef void list_del_t (void**);
+
+/* free() all memory used by list and optionally
+ * use del function to free() items as well */
+void list_del (list2_t**, list_del_t* del);
 
 #define list_empty(l) (!l || l->length == 0 || !l->data)