Patchwork [2/2] iohandler: Use bool for boolean struct member and remove holes

login
register
mail settings
Submitter Stefan Weil
Date April 29, 2012, 5:08 p.m.
Message ID <1335719326-31264-2-git-send-email-sw@weilnetz.de>
Download mbox | patch
Permalink /patch/155754/
State Accepted
Headers show

Comments

Stefan Weil - April 29, 2012, 5:08 p.m.
Using bool reduces the size of the structure and improves readability.
Two holes in the structure were removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 iohandler.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/iohandler.c b/iohandler.c
index 5640d49..3c74de6 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -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 =