Skip to contentSkip to conversation

async: Use bool for boolean struct members and remove a hole

PATCH Applied Stefan Weil 2 participants 3 messages Apr 29, 2012 – May 1, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 async: Use bool for boolean struct members and remove a hole

Using bool reduces the size of the structure and improves readability. A hole in the structure was removed.

---
 async.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
async.c +3 -3
index ecdaf15..85cc641 100644
@@ -35,10 +35,10 @@ static struct QEMUBH *first_bh;
 struct QEMUBH {
     QEMUBHFunc *cb;
     void *opaque;
-    int scheduled;
-    int idle;
-    int deleted;
     QEMUBH *next;
+    bool scheduled;
+    bool idle;
+    bool deleted;
 };
 
 QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
Signature · 1 line
1.7.9
#1 lore raw

PATCH 2/2 iohandler: Use bool for boolean struct member and remove holes

Using bool reduces the size of the structure and improves readability. Two holes in the structure were removed.

---
 iohandler.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
iohandler.c +2 -2
index 5640d49..3c74de6 100644
@@ -33,13 +33,13 @@
 #endif
 
 typedef struct IOHandlerRecord {
-    int fd;
     IOCanReadHandler *fd_read_poll;
     IOHandler *fd_read;
     IOHandler *fd_write;
-    int deleted;
     void *opaque;
     QLIST_ENTRY(IOHandlerRecord) next;
+    int fd;
+    bool deleted;
 } IOHandlerRecord;
 
 static QLIST_HEAD(, IOHandlerRecord) io_handlers =
Signature · 1 line
1.7.9