Put bit fields together
authorBertram Scharpf <software@bertram-scharpf.de>
Wed, 20 Jun 2018 21:13:41 +0000 (23:13 +0200)
committerRichard Russon <rich@flatcap.org>
Sat, 23 Jun 2018 10:47:48 +0000 (11:47 +0100)
browser.h
hcache/hcache.c
mutt/address.h
mutt_menu.h

index ca7925163eb597266d0e55905b7cc5e569fda193..34a8e7f5c159487569838cf6887d8f09126242b0 100644 (file)
--- a/browser.h
+++ b/browser.h
@@ -54,11 +54,11 @@ struct FolderFile
   bool inferiors : 1;
 #endif
   bool has_buffy : 1;
+  bool local : 1; /**< folder is on local filesystem */
+  bool tagged : 1;
 #ifdef USE_NNTP
   struct NntpData *nd;
 #endif
-  bool local : 1; /**< folder is on local filesystem */
-  bool tagged : 1;
 };
 
 /**
index 557ef76e1689e5e75f77ea33aa1ee0221726f03a..01364e523aafdbdd7754541367d99d8ffd1c13b9 100644 (file)
@@ -332,7 +332,8 @@ static unsigned char *dump_address(struct Address *a, unsigned char *d, int *off
  */
 static void restore_address(struct Address **a, const unsigned char *d, int *off, bool convert)
 {
-  unsigned int counter;
+  unsigned int counter = 0;
+  unsigned int g = 0;
 
   restore_int(&counter, d, off);
 
@@ -341,7 +342,8 @@ static void restore_address(struct Address **a, const unsigned char *d, int *off
     *a = mutt_addr_new();
     restore_char(&(*a)->personal, d, off, convert);
     restore_char(&(*a)->mailbox, d, off, false);
-    restore_int((unsigned int *) &(*a)->group, d, off);
+    restore_int(&g, d, off);
+    (*a)->group = g;
     a = &(*a)->next;
     counter--;
   }
index 6798d50f1f073fe5011fc7a1174c7884bb3e83ea..cc3a7a8ef407917942497b47290c32c669bdccae 100644 (file)
@@ -33,10 +33,10 @@ struct Address
 {
   char *personal; /**< real name of address */
   char *mailbox;  /**< mailbox and host address */
-  int group;      /**< group mailbox? */
-  struct Address *next;
+  bool group : 1;      /**< group mailbox? */
   bool is_intl : 1;
   bool intl_checked : 1;
+  struct Address *next;
 };
 
 /**
index 3b33a66fa21c686d097d24054a44983c7d7eba79..998a4420b52d67056c074466ae370a97f4e8378a 100644 (file)
@@ -56,7 +56,7 @@ struct Menu
   int offset;  /**< row offset within the window to start the index */
   int pagelen; /**< number of entries per screen */
   bool tagprefix : 1;
-  int is_mailbox_list;
+  bool is_mailbox_list : 1;
   struct MuttWindow *indexwin;
   struct MuttWindow *statuswin;
   struct MuttWindow *helpwin;