]> granicus.if.org Git - neomutt/commitdiff
boolify
authorRichard Russon <rich@flatcap.org>
Fri, 20 Jul 2018 18:32:34 +0000 (19:32 +0100)
committerRichard Russon <rich@flatcap.org>
Fri, 20 Jul 2018 19:13:47 +0000 (20:13 +0100)
14 files changed:
compose.c
conn/tunnel.c
curs_lib.c
curs_lib.h
filter.c
mutt/signal.c
mutt/signal2.h
mutt_thread.c
mutt_thread.h
ncrypt/crypt_gpgme.c
ncrypt/smime.c
sendlib.c
sort.c
system.c

index 01f136517d323c7342b301cfb6e0715f2a693b79..1e1717928e977a4528149875d59bb20157e040d8 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -1293,7 +1293,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
         char **files = NULL;
         fname[0] = 0;
 
-        if (mutt_enter_fname_full(prompt, fname, sizeof(fname), 0, 1, &files,
+        if (mutt_enter_fname_full(prompt, fname, sizeof(fname), false, true, &files,
                                   &numfiles, MUTT_SEL_MULTI) == -1 ||
             *fname == '\0')
         {
index e1140a080463d1706148f2cb686f4398c65e834a..11d7128ab027014a5636e768614e631356d7cbda 100644 (file)
@@ -88,7 +88,7 @@ static int tunnel_socket_open(struct Connection *conn)
   int pid = fork();
   if (pid == 0)
   {
-    mutt_sig_unblock_system(0);
+    mutt_sig_unblock_system(false);
     const int devnull = open("/dev/null", O_RDWR);
     if (devnull < 0 || dup2(pout[0], STDIN_FILENO) < 0 ||
         dup2(pin[1], STDOUT_FILENO) < 0 || dup2(devnull, STDERR_FILENO) < 0)
@@ -107,7 +107,7 @@ static int tunnel_socket_open(struct Connection *conn)
     execle(EXECSHELL, "sh", "-c", Tunnel, NULL, mutt_envlist_getlist());
     _exit(127);
   }
-  mutt_sig_unblock_system(1);
+  mutt_sig_unblock_system(true);
 
   if (pid == -1)
   {
index 3cb5f29cb4acc9dadb1df9d2def2aabba073b69a..eab1f598dd515eaa1ca3883459f612dd63ca8f95 100644 (file)
@@ -553,8 +553,8 @@ int mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct
  * @retval  0 Success
  * @retval -1 Error
  */
-int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, int buffy,
-                          int multiple, char ***files, int *numfiles, int flags)
+int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool buffy,
+                          bool multiple, char ***files, int *numfiles, int flags)
 {
   struct Event ch;
 
index a81a6da84d60b9d9158b7e01f1d81fbf69a77e05..0c0a16b45c2204ac80c4687307ec1887ae7ea68a 100644 (file)
@@ -47,7 +47,7 @@ int          mutt_any_key_to_continue(const char *s);
 int          mutt_do_pager(const char *banner, const char *tempfile, int do_color, struct Pager *info);
 void         mutt_edit_file(const char *editor, const char *file);
 void         mutt_endwin(void);
-int          mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, int buffy, int multiple, char ***files, int *numfiles, int flags);
+int          mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, bool buffy, bool multiple, char ***files, int *numfiles, int flags);
 void         mutt_flushinp(void);
 void         mutt_flush_macro_to_endcond(void);
 void         mutt_flush_unget_to_endcond(void);
@@ -71,8 +71,8 @@ void         mutt_unget_string(char *s);
 size_t       mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
 int          mutt_yesorno(const char *msg, int def);
 
-#define mutt_enter_fname(A, B, C, D)   mutt_enter_fname_full(A, B, C, D, 0, NULL, NULL, 0)
-#define mutt_enter_vfolder(A, B, C, D) mutt_enter_fname_full(A, B, C, D, 0, NULL, NULL, MUTT_SEL_VFOLDER)
+#define mutt_enter_fname(A, B, C, D)   mutt_enter_fname_full(A, B, C, D, false, NULL, NULL, 0)
+#define mutt_enter_vfolder(A, B, C, D) mutt_enter_fname_full(A, B, C, D, false, NULL, NULL, MUTT_SEL_VFOLDER)
 #define mutt_get_field(A, B, C, D)     mutt_get_field_full(A, B, C, D, 0, NULL, NULL)
 #define mutt_get_password(A, B, C)     mutt_get_field_unbuffered(A, B, C, MUTT_PASS)
 
index 6978f9cc548412572f4f95ba597eaa73d00356a9..5c74f46cfa70448e8bb9d9f5efca5599c242ed95 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -108,7 +108,7 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
   thepid = fork();
   if (thepid == 0)
   {
-    mutt_sig_unblock_system(0);
+    mutt_sig_unblock_system(false);
 
     if (in)
     {
@@ -158,7 +158,7 @@ pid_t mutt_create_filter_fd(const char *cmd, FILE **in, FILE **out, FILE **err,
   }
   else if (thepid == -1)
   {
-    mutt_sig_unblock_system(1);
+    mutt_sig_unblock_system(true);
 
     if (in)
     {
@@ -226,7 +226,7 @@ int mutt_wait_filter(pid_t pid)
   int rc;
 
   waitpid(pid, &rc, 0);
-  mutt_sig_unblock_system(1);
+  mutt_sig_unblock_system(true);
   rc = WIFEXITED(rc) ? WEXITSTATUS(rc) : -1;
 
   return rc;
index 6a824c686779d86408e0b13fb2d8c6cd419f5b27..281a08205a5eb8c46d8cf48ab16c41f81145c6a8 100644 (file)
@@ -196,7 +196,7 @@ void mutt_sig_block_system(void)
  * mutt_sig_unblock_system - Restore previously blocked signals
  * @param catch If true, restore previous SIGINT, SIGQUIT behaviour
  */
-void mutt_sig_unblock_system(int catch)
+void mutt_sig_unblock_system(bool catch)
 {
   if (!SysSignalsBlocked)
     return;
index f29df659b521eec7d98b428545c511ce35dfbe02..e5288364b21c5494f73d137589bd7f0b0ed7d63c 100644 (file)
@@ -32,6 +32,6 @@ void mutt_sig_empty_handler(int sig);
 void mutt_sig_exit_handler(int sig);
 void mutt_sig_init(sig_handler_t sig_fn, sig_handler_t exit_fn);
 void mutt_sig_unblock(void);
-void mutt_sig_unblock_system(int catch);
+void mutt_sig_unblock_system(bool catch);
 
 #endif /* _MUTT_SIGNAL_H */
index 0233ecd03db6152fef869c845162b59a881fc36f..aa40fd4ef71bc1bb4b68688a42618de186d18932 100644 (file)
@@ -587,7 +587,7 @@ static int compare_threads(const void *a, const void *b)
   }
 }
 
-struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, int init)
+struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init)
 {
   struct MuttThread **array = NULL, *sort_key = NULL, *top = NULL, *tmp = NULL;
   struct Header *oldsort_key = NULL;
@@ -717,7 +717,7 @@ struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, int init)
   }
 }
 
-static void check_subjects(struct Context *ctx, int init)
+static void check_subjects(struct Context *ctx, bool init)
 {
   struct Header *cur = NULL;
   struct MuttThread *tmp = NULL;
@@ -751,7 +751,7 @@ static void check_subjects(struct Context *ctx, int init)
   }
 }
 
-void mutt_sort_threads(struct Context *ctx, int init)
+void mutt_sort_threads(struct Context *ctx, bool init)
 {
   struct Header *cur = NULL;
   int i, oldsort, using_refs = 0;
@@ -767,7 +767,7 @@ void mutt_sort_threads(struct Context *ctx, int init)
   Sort = SortAux;
 
   if (!ctx->thread_hash)
-    init = 1;
+    init = true;
 
   if (init)
   {
index 0248852acda423532bfc17d1f8374aa1af3c88bc..fa6f602bae709ccb4f493bd3f603be675c40eaf7 100644 (file)
@@ -67,8 +67,8 @@ int mutt_messages_in_thread(struct Context *ctx, struct Header *hdr, int flag);
 void mutt_draw_tree(struct Context *ctx);
 
 void mutt_clear_threads(struct Context *ctx);
-struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, int init);
-void mutt_sort_threads(struct Context *ctx, int init);
+struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init);
+void mutt_sort_threads(struct Context *ctx, bool init);
 int mutt_parent_message(struct Context *ctx, struct Header *hdr, int find_root);
 void mutt_set_virtual(struct Context *ctx);
 struct Hash *mutt_make_id_hash(struct Context *ctx);
index 930099fa3140fef0f6fff7abb9c4678d09fcb423..041be471f563f746b93edc1e5685c89b596f981f 100644 (file)
@@ -2203,7 +2203,7 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo
  * @retval  0 Success
  * @retval -1 Error
  */
-static int pgp_gpgme_extract_keys(gpgme_data_t keydata, FILE **fp, int dryrun)
+static int pgp_gpgme_extract_keys(gpgme_data_t keydata, FILE **fp, bool dryrun)
 {
   /* there's no side-effect free way to view key data in GPGME,
    * so we import the key into a temporary keyring */
@@ -2462,7 +2462,7 @@ void pgp_gpgme_invoke_import(const char *fname)
     return;
   }
 
-  if (pgp_gpgme_extract_keys(keydata, &out, 0))
+  if (pgp_gpgme_extract_keys(keydata, &out, false))
   {
     mutt_error(_("Error extracting key data!\n"));
   }
@@ -2613,7 +2613,7 @@ int pgp_gpgme_application_handler(struct Body *m, struct State *s)
       /* Invoke PGP if needed */
       if (pgp_keyblock)
       {
-        pgp_gpgme_extract_keys(armored_data, &pgpout, 1);
+        pgp_gpgme_extract_keys(armored_data, &pgpout, true);
       }
       else if (!clearsign || (s->flags & MUTT_VERIFY))
       {
@@ -5231,10 +5231,10 @@ int smime_gpgme_send_menu(struct Header *msg)
  * @param h Header of the email
  * @retval true If sender is verified
  */
-static int verify_sender(struct Header *h)
+static bool verify_sender(struct Header *h)
 {
   struct Address *sender = NULL;
-  unsigned int rc = 1;
+  bool rc = true;
 
   if (h->env->from)
   {
@@ -5264,7 +5264,7 @@ static int verify_sender(struct Header *h)
           if (!at_sign)
           {
             if (strncmp(uid->email + 1, sender->mailbox, sender_length) == 0)
-              rc = 0;
+              rc = false;
           }
           else
           {
@@ -5285,7 +5285,7 @@ static int verify_sender(struct Header *h)
             domainname_match =
                 (strncasecmp(tmp_email, tmp_sender, domainname_length) == 0);
             if (mailbox_match && domainname_match)
-              rc = 0;
+              rc = false;
           }
         }
       }
index 5143f07ec527e3a18c81dc7cca0c1b2bc4417086..d568b15eb96365acde36a787585a8b3c791f0b2d 100644 (file)
@@ -1103,7 +1103,7 @@ char *smime_class_find_keys(struct Address *addrlist, bool oppenc_mode)
  * @retval -1 Error
  * @retval -2 Error
  */
-static int smime_handle_cert_email(char *certificate, char *mailbox, int copy,
+static int smime_handle_cert_email(char *certificate, char *mailbox, bool copy,
                                    char ***buffer, int *num)
 {
   char email[STRING];
@@ -1479,7 +1479,7 @@ int smime_class_verify_sender(struct Header *h)
     if (certfile)
     {
       mutt_file_unlink(tempfname);
-      if (smime_handle_cert_email(certfile, mbox, 0, NULL, NULL))
+      if (smime_handle_cert_email(certfile, mbox, false, NULL, NULL))
       {
         if (isendwin())
           mutt_any_key_to_continue(NULL);
index 225ffd1262452949a243b2be1e2ce58ff4d896bf..137b0626a9f0de57e5990369702c20ac11033421 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2639,7 +2639,7 @@ static int send_msg(const char *path, char **args, const char *msg, char **tempf
   else
     st = S_ERR; /* error */
 
-  mutt_sig_unblock_system(1);
+  mutt_sig_unblock_system(true);
 
   return st;
 }
diff --git a/sort.c b/sort.c
index ead1a23ef71a7095208bf985bfeb6b81646a4ceb..78625b4fe43c45bedd7dae57057e76613635cf27 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -452,7 +452,7 @@ void mutt_sort_headers(struct Context *ctx, int init)
       int i = Sort;
       Sort = SortAux;
       if (ctx->tree)
-        ctx->tree = mutt_sort_subthreads(ctx->tree, 1);
+        ctx->tree = mutt_sort_subthreads(ctx->tree, true);
       Sort = i;
       OptSortSubthreads = false;
     }
index 285800ce1a3c081a067a17ebea9ff2a7366084e7..adada62616c66b0a943a456330626348967fca25 100644 (file)
--- a/system.c
+++ b/system.c
@@ -77,7 +77,7 @@ int mutt_system(const char *cmd)
     act.sa_flags = 0;
 
     /* reset signals for the child; not really needed, but... */
-    mutt_sig_unblock_system(0);
+    mutt_sig_unblock_system(false);
     act.sa_handler = SIG_DFL;
     act.sa_flags = 0;
     sigemptyset(&act.sa_mask);
@@ -99,7 +99,7 @@ int mutt_system(const char *cmd)
   sigaction(SIGTSTP, &oldtstp, NULL);
 
   /* reset SIGINT, SIGQUIT and SIGCHLD */
-  mutt_sig_unblock_system(1);
+  mutt_sig_unblock_system(true);
 
   rc = (thepid != -1) ? (WIFEXITED(rc) ? WEXITSTATUS(rc) : -1) : -1;