Eric Blake <ebl...@redhat.com> writes:

> On 07/01/2015 02:22 PM, Markus Armbruster wrote:
>> Output unchanged except for white-space.
>
> Indeed, and the diffstat shows it was only one blank line:
>
>  qga-qmp-marshal.c |    1 +
>  1 file changed, 1 insertion(+)
>
> MUCH friendlier to review :)
>
>> 
>> Signed-off-by: Markus Armbruster <arm...@redhat.com>
>> ---
>>  scripts/qapi-commands.py | 157
>> ++++++++++++++++++++++++++---------------------
>>  scripts/qapi.py          |   2 +-
>>  2 files changed, 87 insertions(+), 72 deletions(-)
>> 
>
> Here, I can confidently say:
>
> Reviewed-by: Eric Blake <ebl...@redhat.com>

Thanks!

>> +++ b/scripts/qapi.py
>> @@ -1366,7 +1366,7 @@ def c_type(value, is_param=False):
>>          return c_name(value) + pointer_suffix
>>  
>>  def is_c_ptr(value):
>> -    return c_type(value).endswith(pointer_suffix)
>> +    return value.endswith(pointer_suffix)
>
> Perhaps this cleanup could be floated earlier in the series?

Before this patch, is_c_ptr() is called with an argument suitable for
c_type().  It returns true when c_type() returns a string ending with
pointer_suffix.

This patch replaces uses of function c_type() by QAPISchemaType method
c_type().

Two ways to do that for the is_c_ptr() calls:

1. Change the argument to a QAPISchemaType object, and make is_c_ptr()
call its .c_type().

2. Change the argument to a string, and make the caller compute it by
calling the appropriate object's .c_type().

I picked 2.  It hardly matters, because is_c_ptr() will go away in the
next patch.

I could do a part of 2. in an earlier patch, namely lifting the c_type()
call into the callers.  But I can't do the conversion from function to
method any earlier, because the objects become available only in this
patch.

Reply via email to