|
From: | Paolo Bonzini |
Subject: | [Qemu-devel] Re: [PATCH] add VMSTATE_BOOL |
Date: | Tue, 09 Nov 2010 10:32:46 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.6 |
On 11/09/2010 10:23 AM, Markus Armbruster wrote:
+} + +static void put_bool(QEMUFile *f, void *pv, size_t size) +{ + bool *v = pv; + qemu_put_byte(f, *v);Is there a guarantee that bool is a single byte, BTW?Nope. Does it matter?
No. In fact I think QEMU makes (or tries to make) the QEMU dump format host-independent, and hence ABI-independent. So, writing a single byte is better than writing sizeof(bool) bytes.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |