[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qapi: generate space in c_type() to fix coding
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH] qapi: generate space in c_type() to fix coding style |
Date: |
Tue, 22 Apr 2014 09:20:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Paolo Bonzini <address@hidden> writes:
> Il 18/04/2014 23:56, Amos Kong ha scritto:
>> Currently we always add a space after c_type in mcgen(), there is
>> some redundant space in generated code. The space isn't needed for
>> points by the coding style.
>>
>> char * value;
>> ^
>> qapi_free_NameInfo(NameInfo * obj)
>> ^
>> It's fussy to add checking in each mcgen(), this patch just addes
>> the necessary space in c_type(), and remove original space in mcgen().
>
> It also makes the generator harder to read to though, and the
> improvement in the generated code is minor enough that I think the
> change is overall negative. But I won't oppose the patch if the
> maintainers are fine with it.
The readability hit could be avoided: instead of moving the space from
mcgen()'s argument to c_type()'s result, add a "hungry character" to
c_type()'s result, then make it eat space to the right in mcgen().