]> git.notmuchmail.org Git - notmuch/commitdiff
gmime-cleanup: drop all arguments unused in GMime 3
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 2 May 2019 13:19:41 +0000 (09:19 -0400)
committerDavid Bremner <david@tethera.net>
Fri, 3 May 2019 09:56:38 +0000 (06:56 -0300)
This means dropping GMimeCryptoContext and notmuch_config arguments.

All the argument changes are to internal functions, so this is not an
API or ABI break.

We also get to drop the #define for g_mime_3_unused.

signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

lib/index.cc
mime-node.c
notmuch-client.h
notmuch-insert.c
notmuch-new.c
notmuch-reindex.c
notmuch.c
util/crypto.c
util/crypto.h
util/gmime-extra.h

index 768309219c3ba4b433a70c7ef7c7b708c2dc0f97..f21761d0c3d74133a676d082f7b1da01d3365a39 100644 (file)
@@ -528,12 +528,11 @@ _index_encrypted_mime_part (notmuch_message_t *message,
 
     notmuch = notmuch_message_get_database (message);
 
 
     notmuch = notmuch_message_get_database (message);
 
-    GMimeCryptoContext* crypto_ctx = NULL;
     bool attempted = false;
     GMimeDecryptResult *decrypt_result = NULL;
     bool get_sk = (notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_TRUE);
     clear = _notmuch_crypto_decrypt (&attempted, notmuch_indexopts_get_decrypt_policy (indexopts),
     bool attempted = false;
     GMimeDecryptResult *decrypt_result = NULL;
     bool get_sk = (notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_TRUE);
     clear = _notmuch_crypto_decrypt (&attempted, notmuch_indexopts_get_decrypt_policy (indexopts),
-                                    message, crypto_ctx, encrypted_data, get_sk ? &decrypt_result : NULL, &err);
+                                    message, encrypted_data, get_sk ? &decrypt_result : NULL, &err);
     if (!attempted)
        return;
     if (err || !clear) {
     if (!attempted)
        return;
     if (err || !clear) {
index 95dc5132eddda44091eebdd0a622f7ca8368fad3..19744f43eee7e6d0deb2b2bd455ae3f7cafe9995 100644 (file)
@@ -170,8 +170,7 @@ set_signature_list_destructor (mime_node_t *node)
 
 /* Verify a signed mime node */
 static void
 
 /* Verify a signed mime node */
 static void
-node_verify (mime_node_t *node, GMimeObject *part,
-            g_mime_3_unused(GMimeCryptoContext *cryptoctx))
+node_verify (mime_node_t *node, GMimeObject *part)
 {
     GError *err = NULL;
 
 {
     GError *err = NULL;
 
@@ -191,8 +190,7 @@ node_verify (mime_node_t *node, GMimeObject *part,
 
 /* Decrypt and optionally verify an encrypted mime node */
 static void
 
 /* Decrypt and optionally verify an encrypted mime node */
 static void
-node_decrypt_and_verify (mime_node_t *node, GMimeObject *part,
-                        g_mime_3_unused(GMimeCryptoContext *cryptoctx))
+node_decrypt_and_verify (mime_node_t *node, GMimeObject *part)
 {
     GError *err = NULL;
     GMimeDecryptResult *decrypt_result = NULL;
 {
     GError *err = NULL;
     GMimeDecryptResult *decrypt_result = NULL;
@@ -209,7 +207,7 @@ node_decrypt_and_verify (mime_node_t *node, GMimeObject *part,
        node->decrypted_child = _notmuch_crypto_decrypt (&node->decrypt_attempted,
                                                         node->ctx->crypto->decrypt,
                                                         message,
        node->decrypted_child = _notmuch_crypto_decrypt (&node->decrypt_attempted,
                                                         node->ctx->crypto->decrypt,
                                                         message,
-                                                        cryptoctx, encrypteddata, &decrypt_result, &err);
+                                                        encrypteddata, &decrypt_result, &err);
     }
     if (! node->decrypted_child) {
        fprintf (stderr, "Failed to decrypt part: %s\n",
     }
     if (! node->decrypted_child) {
        fprintf (stderr, "Failed to decrypt part: %s\n",
@@ -249,7 +247,6 @@ static mime_node_t *
 _mime_node_create (mime_node_t *parent, GMimeObject *part)
 {
     mime_node_t *node = talloc_zero (parent, mime_node_t);
 _mime_node_create (mime_node_t *parent, GMimeObject *part)
 {
     mime_node_t *node = talloc_zero (parent, mime_node_t);
-    GMimeCryptoContext *cryptoctx = NULL;
 
     /* Set basic node properties */
     node->part = part;
 
     /* Set basic node properties */
     node->part = part;
@@ -290,7 +287,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)
                     "message (must be exactly 2)\n",
                     node->nchildren);
        } else {
                     "message (must be exactly 2)\n",
                     node->nchildren);
        } else {
-           node_decrypt_and_verify (node, part, cryptoctx);
+           node_decrypt_and_verify (node, part);
        }
     } else if (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto->verify) {
        if (node->nchildren != 2) {
        }
     } else if (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto->verify) {
        if (node->nchildren != 2) {
@@ -299,7 +296,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)
                     "(must be exactly 2)\n",
                     node->nchildren);
        } else {
                     "(must be exactly 2)\n",
                     node->nchildren);
        } else {
-           node_verify (node, part, cryptoctx);
+           node_verify (node, part);
        }
     }
 
        }
     }
 
index fba282428470093a28f4caf57cbe2671c6c3a3f9..d762d3cc5cfc3a24bd17c98365672588f4913c5d 100644 (file)
@@ -506,6 +506,6 @@ struct _notmuch_client_indexing_cli_choices {
 extern struct _notmuch_client_indexing_cli_choices indexing_cli_choices;
 extern const notmuch_opt_desc_t  notmuch_shared_indexing_options [];
 notmuch_status_t
 extern struct _notmuch_client_indexing_cli_choices indexing_cli_choices;
 extern const notmuch_opt_desc_t  notmuch_shared_indexing_options [];
 notmuch_status_t
-notmuch_process_shared_indexing_options (notmuch_database_t *notmuch, notmuch_config_t *config);
+notmuch_process_shared_indexing_options (notmuch_database_t *notmuch);
 
 #endif
 
 #endif
index d229c9dc7ac9fa28468436d6146ed3770cdb80cc..327470d4288ee30a290e92b5c4fa74558779c009 100644 (file)
@@ -550,7 +550,7 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[])
 
     notmuch_exit_if_unmatched_db_uuid (notmuch);
 
 
     notmuch_exit_if_unmatched_db_uuid (notmuch);
 
-    status = notmuch_process_shared_indexing_options (notmuch, config);
+    status = notmuch_process_shared_indexing_options (notmuch);
     if (status != NOTMUCH_STATUS_SUCCESS) {
        fprintf (stderr, "Error: Failed to process index options. (%s)\n",
                 notmuch_status_to_string (status));
     if (status != NOTMUCH_STATUS_SUCCESS) {
        fprintf (stderr, "Error: Failed to process index options. (%s)\n",
                 notmuch_status_to_string (status));
index 6a54a1a169feb23aa0d860f66548e69d60e24dc0..184e9aa2189ab7d201f5e5ebc56db9ea9f2c4be6 100644 (file)
@@ -1198,7 +1198,7 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
     if (notmuch == NULL)
        return EXIT_FAILURE;
 
     if (notmuch == NULL)
        return EXIT_FAILURE;
 
-    status = notmuch_process_shared_indexing_options (notmuch, config);
+    status = notmuch_process_shared_indexing_options (notmuch);
     if (status != NOTMUCH_STATUS_SUCCESS) {
        fprintf (stderr, "Error: Failed to process index options. (%s)\n",
                 notmuch_status_to_string (status));
     if (status != NOTMUCH_STATUS_SUCCESS) {
        fprintf (stderr, "Error: Failed to process index options. (%s)\n",
                 notmuch_status_to_string (status));
index fefa7c63c64deec1ad6beb8c412acf9cdb897fb7..3139a8c665a0fb46bb6626a77c32f26c4ff5c60a 100644 (file)
@@ -117,7 +117,7 @@ notmuch_reindex_command (notmuch_config_t *config, int argc, char *argv[])
 
     notmuch_exit_if_unmatched_db_uuid (notmuch);
 
 
     notmuch_exit_if_unmatched_db_uuid (notmuch);
 
-    status = notmuch_process_shared_indexing_options (notmuch, config);
+    status = notmuch_process_shared_indexing_options (notmuch);
     if (status != NOTMUCH_STATUS_SUCCESS) {
        fprintf (stderr, "Error: Failed to process index options. (%s)\n",
                 notmuch_status_to_string (status));
     if (status != NOTMUCH_STATUS_SUCCESS) {
        fprintf (stderr, "Error: Failed to process index options. (%s)\n",
                 notmuch_status_to_string (status));
index c11e4cb1b1120b289a81ced81b6d0a8bc016be3c..de85041b4add2bb4bdcc18c4080f22414799163c 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -112,7 +112,7 @@ const notmuch_opt_desc_t  notmuch_shared_indexing_options [] = {
 
 
 notmuch_status_t
 
 
 notmuch_status_t
-notmuch_process_shared_indexing_options (notmuch_database_t *notmuch, g_mime_3_unused(notmuch_config_t *config))
+notmuch_process_shared_indexing_options (notmuch_database_t *notmuch)
 {
     if (indexing_cli_choices.opts == NULL)
        indexing_cli_choices.opts = notmuch_database_get_default_indexopts (notmuch);
 {
     if (indexing_cli_choices.opts == NULL)
        indexing_cli_choices.opts = notmuch_database_get_default_indexopts (notmuch);
index 8104263d1ace559d8928fd37326d0beb30b32099..ba67d4f4ebbd378d9833a1bb46c9a511d5a4fb91 100644 (file)
@@ -32,7 +32,6 @@ GMimeObject *
 _notmuch_crypto_decrypt (bool *attempted,
                         notmuch_decryption_policy_t decrypt,
                         notmuch_message_t *message,
 _notmuch_crypto_decrypt (bool *attempted,
                         notmuch_decryption_policy_t decrypt,
                         notmuch_message_t *message,
-                        g_mime_3_unused(GMimeCryptoContext* crypto_ctx),
                         GMimeMultipartEncrypted *part,
                         GMimeDecryptResult **decrypt_result,
                         GError **err)
                         GMimeMultipartEncrypted *part,
                         GMimeDecryptResult **decrypt_result,
                         GError **err)
index dbb333eb4c5d955648134fd7de3896d52a2fae02..af3998e8466e346bdcef95310031d88e68742c7a 100644 (file)
@@ -18,7 +18,6 @@ GMimeObject *
 _notmuch_crypto_decrypt (bool *attempted,
                         notmuch_decryption_policy_t decrypt,
                         notmuch_message_t *message,
 _notmuch_crypto_decrypt (bool *attempted,
                         notmuch_decryption_policy_t decrypt,
                         notmuch_message_t *message,
-                        GMimeCryptoContext* crypto_ctx,
                         GMimeMultipartEncrypted *part,
                         GMimeDecryptResult **decrypt_result,
                         GError **err);
                         GMimeMultipartEncrypted *part,
                         GMimeDecryptResult **decrypt_result,
                         GError **err);
index c17fa8fb6f3dd199913ea7436c9f487d7c553959..60ae876562decf6e0dbbd70979573b99d07221ac 100644 (file)
@@ -34,8 +34,6 @@ typedef GMimeAddressType GMimeRecipientType;
 
 typedef GMimeSignatureStatus GMimeSignatureError;
 
 
 typedef GMimeSignatureStatus GMimeSignatureError;
 
-#define g_mime_3_unused(arg) unused(arg)
-
 /**
  * Get last 16 hex digits of fingerprint ("keyid")
  */
 /**
  * Get last 16 hex digits of fingerprint ("keyid")
  */