async: Use bool for boolean struct members and remove a hole
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.
Signed-off-by Stefan Weil <[email protected]>
--- async.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
async.c +3 -3
@@ -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
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.
Signed-off-by Stefan Weil <[email protected]>
--- iohandler.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
iohandler.c +2 -2
@@ -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
Stefan Hajnoczi
AppliedQuoted 7 lines · Stefan Weil
Using bool reduces the size of the structure and improves readability. A hole in the structure was removed.
Signed-off-by Stefan Weil <[email protected]>--- async.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Thanks, applied both to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches
Stefan