Fix compilation warnings in crypt-gpgme.c, cryptglue.c and pgpkey.c
authorJulien Danjou <julien@danjou.info>
Fri, 17 Nov 2006 11:28:37 +0000 (12:28 +0100)
committerPierre Habouzit <pierre.habouzit@intersec.eu>
Fri, 17 Nov 2006 12:13:34 +0000 (13:13 +0100)
- Remove commented and dead code
- Include own header files

Signed-off-by: Julien Danjou <julien@danjou.info>
Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.eu>
lib-crypt/crypt-gpgme.c

index 428b872..c5c6986 100644 (file)
@@ -42,6 +42,7 @@
 #include "pager.h"
 #include "recvattach.h"
 #include "sort.h"
 #include "pager.h"
 #include "recvattach.h"
 #include "sort.h"
+#include "crypt-gpgme.h"
 
 /*
  * Helper macros.
 
 /*
  * Helper macros.
@@ -3502,7 +3503,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
 }
 
 
 }
 
 
-static crypt_key_t *crypt_getkeybystr (char *p, short abilities,
+static crypt_key_t *crypt_getkeybystr (const char *p, short abilities,
                                        unsigned int app, int *forced_valid)
 {
   string_list_t *hints = NULL;
                                        unsigned int app, int *forced_valid)
 {
   string_list_t *hints = NULL;
@@ -3616,7 +3617,8 @@ static crypt_key_t *crypt_ask_for_key (char *tag,
 static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
                         unsigned int app)
 {
 static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
                         unsigned int app)
 {
-  char *keyID, *keylist = NULL, *t;
+  char *keylist = NULL, *t;
+  const char *keyID;
   ssize_t keylist_size = 0;
   ssize_t keylist_used = 0;
   address_t *tmp = NULL, *addr = NULL;
   ssize_t keylist_size = 0;
   ssize_t keylist_used = 0;
   address_t *tmp = NULL, *addr = NULL;
@@ -3676,13 +3678,8 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
           q = addr;
         }
         else {
           q = addr;
         }
         else {
-#if 0
-          k_info = crypt_getkeybystr (keyID, KEYFLAG_CANENCRYPT,
-                                      *r_application, &forced_valid);
-#else
           k_info = crypt_getkeybystr (keyID, KEYFLAG_CANENCRYPT,
                                       app, &forced_valid);
           k_info = crypt_getkeybystr (keyID, KEYFLAG_CANENCRYPT,
                                       app, &forced_valid);
-#endif
         }
       }
       else if (r == -1) {
         }
       }
       else if (r == -1) {
@@ -3699,11 +3696,7 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
       snprintf (buf, sizeof (buf), _("Enter keyID for %s: "), q->mailbox);
 
       if ((key = crypt_ask_for_key (buf, q->mailbox, KEYFLAG_CANENCRYPT,
       snprintf (buf, sizeof (buf), _("Enter keyID for %s: "), q->mailbox);
 
       if ((key = crypt_ask_for_key (buf, q->mailbox, KEYFLAG_CANENCRYPT,
-#if 0
-                                    *r_application,
-#else
                                     app,
                                     app,
-#endif
                                     &forced_valid)) == NULL) {
         p_delete(&keylist);
         address_list_wipe(&tmp);
                                     &forced_valid)) == NULL) {
         p_delete(&keylist);
         address_list_wipe(&tmp);
@@ -3717,13 +3710,6 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
     {
       const char *s = crypt_fpr (key);
 
     {
       const char *s = crypt_fpr (key);
 
-#if 0
-      if (key->flags & KEYFLAG_ISX509)
-        *r_application &= ~APPLICATION_PGP;
-      if (!(key->flags & KEYFLAG_ISX509))
-        *r_application &= ~APPLICATION_SMIME;
-#endif
-
       keylist_size += m_strlen(s) + 4 + 1;
       p_realloc(&keylist, keylist_size);
       sprintf (keylist + keylist_used, "%s0x%s%s",      /* __SPRINTF_CHECKED__ */
       keylist_size += m_strlen(s) + 4 + 1;
       p_realloc(&keylist, keylist_size);
       sprintf (keylist + keylist_used, "%s0x%s%s",      /* __SPRINTF_CHECKED__ */
@@ -3817,11 +3803,6 @@ static int gpgme_send_menu (HEADER * msg, int *redraw, int is_smime)
 
       msg->security |= (is_smime ? SMIMESIGN : PGPSIGN);
     }
 
       msg->security |= (is_smime ? SMIMESIGN : PGPSIGN);
     }
-#if 0
-    else {
-      msg->security &= (is_smime ? ~SMIMESIGN : ~PGPSIGN);
-    }
-#endif
     *redraw = REDRAW_FULL;
     break;
 
     *redraw = REDRAW_FULL;
     break;