[Xcb] [PATCH libxcb] generator: support parametrized structs

Ran Benita ran234 at gmail.com
Tue Oct 21 11:10:54 PDT 2014


On Mon, Sep 08, 2014 at 02:31:08AM +0200, Christian Linhart wrote:
[snip]
> +    #internal function to compute the parameterlist with given indentation
> +    #such that the formatting of the additional parameters is consistent with
> +    #the other parameters.
> +    def additional_params_to_str(self, indent):
> +        if len(self) == 0:
> +            return ''
> +        else:
> +            return (',\n' + indent).join([''] + map(lambda p: '%s %s /**< */' % p, self))

Haven't reviewed this one yet, but just an advance comment, or I'll
forget.

The above line doesn't work with python3, since they changed `map` to
reutrn an iterator instead of list, and that cannot be added.

I've fixed it with the attached diff locally. However I should also
mention that the name `self` here is confusing - it is usually reserved
for same as `this` in C++. It also shadows another `self`. In fact all
uses of `self` in the generator are confusing for this reason, but oh
well..


More information about the Xcb mailing list