[balsa/gtk3] Reduce scope of variables



commit f7bae031aba142b92f6ca8c4d10a7e21ff4bb526
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jul 22 15:07:38 2012 -0400

    Reduce scope of variables
    
    	* libbalsa/imap/imap-commands.c (imap_assure_needed_flags),
    	(imap_mbox_sort_msgno_srv), (imap_mbox_sort_filter): reduce
    	scope of variables.

 ChangeLog                     |    6 ++++++
 libbalsa/imap/imap-commands.c |    6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3dc975a..381e292 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-07-22  Peter Bloomfield
 
+	* libbalsa/imap/imap-commands.c (imap_assure_needed_flags),
+	(imap_mbox_sort_msgno_srv), (imap_mbox_sort_filter): reduce
+	scope of variables.
+
+2012-07-22  Peter Bloomfield
+
 	* libbalsa/imap-server.c (libbalsa_imap_server_get_handle,
 	libbalsa_imap_server_get_handle_with_user): reduce scope of
 	variables; suppress incorrect null pointer error.
diff --git a/libbalsa/imap/imap-commands.c b/libbalsa/imap/imap-commands.c
index c02b6bf..d74c8f6 100644
--- a/libbalsa/imap/imap-commands.c
+++ b/libbalsa/imap/imap-commands.c
@@ -906,8 +906,8 @@ imap_assure_needed_flags(ImapMboxHandle *h, ImapMsgFlag needed_flags)
 
   fnd.handle = h;
   for(shift=0; needed_flags>>shift; shift++) {
-    const char *flg;
     if((needed_flags>>shift) & 1) {
+      const char *flg;
       fnd.flag = 1<<shift;
       if(fnd.flag & IMSGF_SEEN)
         for(i=0; i<h->flag_cache->len; i++) {
@@ -1733,7 +1733,6 @@ imap_mbox_sort_msgno_srv(ImapMboxHandle *handle, ImapSortKey key,
   ImapResponse rc;
   const char *keystr;
   char *seq, *cmd, *cmd1;
-  unsigned i;
 
   /* IMAP_REQUIRED_STATE1(handle, IMHS_SELECTED, IMR_BAD); */
   if(!imap_mbox_handle_can_do(handle, IMCAP_SORT)) 
@@ -1756,6 +1755,7 @@ imap_mbox_sort_msgno_srv(ImapMboxHandle *handle, ImapSortKey key,
   g_free(cmd1);
 
   if(rc == IMR_OK) {
+    unsigned i;
   /* one version of dovecot (which?) returned insufficient number of
    * numbers, we need to work around it. */
     if(handle->mbox_view.entries == cnt)
@@ -1950,7 +1950,6 @@ imap_mbox_sort_filter(ImapMboxHandle *handle, ImapSortKey key, int ascending,
                       ImapSearchKey *filter)
 {
   ImapResponse rc;
-  const char *keystr;
   unsigned i;
 
 
@@ -1980,6 +1979,7 @@ imap_mbox_sort_filter(ImapMboxHandle *handle, ImapSortKey key, int ascending,
   } else { 
     if(imap_mbox_handle_can_do(handle, IMCAP_SORT)) { /* CASE 2a */
       unsigned cmdno;
+      const char *keystr;
       int can_do_literals =
         imap_mbox_handle_can_do(handle, IMCAP_LITERAL);
       ImapCmdTag tag;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]