Daniel P. Berrange wrote:
On Wed, Aug 12, 2009 at 12:21:48PM +0100, Mark McLoughlin wrote:
> On Wed, 2009-08-12 at 12:04 +0100, Daniel P. Berrange wrote:
>> On Tue, Aug 11, 2009 at 01:25:59PM +0200, Chris Lalancette wrote:
>>> struct qemud_save_header {
>>> char magic[sizeof(QEMUD_SAVE_MAGIC)-1];
>>> int version;
>>> int xml_len;
>>> int was_running;
>>> - int unused[16];
>>> + char compressed;
>>> + int unused[15];
>>> };
>> Little mistake here - you removed sizeof(int) bytes, but only
>> added sizeof(char) replacement.
> struct alignment will cause padding to be added between the fields.
Hmm, true, but I think it'll be a little non-obvious to people if
adding more fields in the future. Should add a char padding[3] to
make it clear.
No, there is no real point in doing that. In fact, since I'm using an enum for
the compressed field, it makes sense to make that an int; it was just a careless
bug on my part. I'll change it so that "compressed" is an int, and
re-submit.
--
Chris Lalancette