[PATCH v2 10/15] gmime-cleanup: drop unused gmime #defines and simplify g_mime_init ()
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu May 2 06:19:42 PDT 2019
Several of these #defines were not actually used in the notmuch
codebase any longer. And as of GMime 3.0, g_mime_init takes no
arguments, so we can also drop the bogus RFC2047 argument that we were
passing and then #defining away.
signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
---
lib/database.cc | 2 +-
lib/message-file.c | 2 +-
notmuch.c | 2 +-
util/gmime-extra.h | 7 -------
4 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/lib/database.cc b/lib/database.cc
index d2732f5e..1753117f 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -880,7 +880,7 @@ notmuch_database_open_verbose (const char *path,
/* Initialize gmime */
if (! initialized) {
- g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);
+ g_mime_init ();
initialized = 1;
}
diff --git a/lib/message-file.c b/lib/message-file.c
index ac5545b3..214f3c1d 100644
--- a/lib/message-file.c
+++ b/lib/message-file.c
@@ -135,7 +135,7 @@ _notmuch_message_file_parse (notmuch_message_file_t *message)
is_mbox = _is_mbox (message->file);
if (! initialized) {
- g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);
+ g_mime_init ();
initialized = 1;
}
diff --git a/notmuch.c b/notmuch.c
index de85041b..eeb794e8 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -463,7 +463,7 @@ main (int argc, char *argv[])
local = talloc_new (NULL);
- g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);
+ g_mime_init ();
#if !GLIB_CHECK_VERSION(2, 35, 1)
g_type_init ();
#endif
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
index 60ae8765..e646efee 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -9,13 +9,8 @@ extern "C" {
GMimeStream *g_mime_stream_stdout_new(void);
-#define GMIME_ENABLE_RFC_2047_WORKAROUNDS 0xdeadbeef
#define g_mime_content_type_to_string(c) g_mime_content_type_get_mime_type (c)
#define g_mime_filter_crlf_new(encode,dots) g_mime_filter_dos2unix_new (FALSE)
-#define g_mime_gpg_context_new(func,path) g_mime_gpg_context_new ()
-#define g_mime_gpg_context_set_use_agent(ctx,val) /*ignore*/
-#define g_mime_gpg_context_set_always_trust(ctx,val) /*ignore*/
-#define g_mime_init(flags) g_mime_init()
#define g_mime_message_add_recipient(m,t,n,a) g_mime_message_add_mailbox (m,t,n,a)
#define g_mime_message_set_subject(m,s) g_mime_message_set_subject(m,s,NULL)
#define g_mime_multipart_signed_verify(mps,ctx,err) g_mime_multipart_signed_verify(mps, GMIME_ENCRYPT_NONE, err)
@@ -23,8 +18,6 @@ GMimeStream *g_mime_stream_stdout_new(void);
#define g_mime_object_set_header(o,h,v) g_mime_object_set_header (o,h,v,NULL)
#define g_mime_parser_construct_message(p) g_mime_parser_construct_message (p, g_mime_parser_options_get_default ())
#define g_mime_part_get_content_object(p) g_mime_part_get_content (p)
-#define g_mime_pkcs7_context_new(arg) g_mime_pkcs7_context_new()
-#define g_mime_pkcs7_context_set_always_trust(ctx,val) /*ignore*/
#define g_mime_signature_get_errors(sig) g_mime_signature_get_status (sig)
#define g_mime_utils_header_decode_text(txt) g_mime_utils_header_decode_text (NULL, txt)
#define internet_address_to_string(ia,encode) internet_address_to_string (ia,NULL,encode)
--
2.20.1
More information about the notmuch
mailing list