]> diplodocus.org Git - nmh/blobdiff - uip/mhfree.c
sh scripts: Remove `else' after exit at end of then-block.
[nmh] / uip / mhfree.c
index ec0f8d3b2c5ae377b5cd3b7198268423c4f79778..1bb488d1678147b5c8ddf9e9693671a55cc889fb 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * mhfree.c -- routines to free the data structures used to
+/* mhfree.c -- routines to free the data structures used to
  *          -- represent MIME messages
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
 #include <h/utils.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
+#include "../sbr/m_mktemp.h"
+#include "mhfree.h"
 
 /* The list of top-level contents to display */
 CT *cts = NULL;
 
-/*
- * prototypes
- */
-void free_header (CT);
-void free_ctinfo (CT);
-void free_encoding (CT, int);
-void freects_done (int);
-
 /*
  * static prototypes
  */
+static void free_header (CT);
 static void free_text (CT);
 static void free_multi (CT);
 static void free_partial (CT);
@@ -77,7 +70,9 @@ free_content (CT ct)
            }
            break;
 
-       case CT_TEXT:
+       default:
+           /* Assume that the ct is for text.  mhfixmsg(1) uses it for
+              decoding application content. */
            free_text (ct);
            break;
     }
@@ -124,7 +119,7 @@ free_content (CT ct)
  * for this content.
  */
 
-void
+static void
 free_header (CT ct)
 {
     HF hp1, hp2;
@@ -169,7 +164,7 @@ free_text (CT ct)
     if (!(t = (struct text *) ct->c_ctparams))
        return;
 
-    free ((char *) t);
+    free(t);
     ct->c_ctparams = NULL;
 }
 
@@ -191,11 +186,11 @@ free_multi (CT ct)
     for (part = m->mp_parts; part; part = next) {
        next = part->mp_next;
        free_content (part->mp_part);
-       free ((char *) part);
+       free(part);
     }
     m->mp_parts = NULL;
 
-    free ((char *) m);
+    free(m);
     ct->c_ctparams = NULL;
 }
 
@@ -210,7 +205,7 @@ free_partial (CT ct)
 
     mh_xfree(p->pm_partid);
 
-    free ((char *) p);
+    free(p);
     ct->c_ctparams = NULL;
 }
 
@@ -226,7 +221,7 @@ free_external (CT ct)
     free_content (e->eb_content);
     mh_xfree(e->eb_body);
     mh_xfree(e->eb_url);
-    free ((char *) e);
+    free(e);
     ct->c_ctparams = NULL;
 }
 
@@ -279,7 +274,7 @@ free_encoding (CT ct, int toplevel)
 }
 
 
-void
+void NORETURN
 freects_done (int status)
 {
     CT *ctp;