[libvirt] [PATCH] esx: Fix generator for string return values
Matthias Bolte
matthias.bolte at googlemail.com
Wed Sep 1 15:32:20 UTC 2010
2010/8/30 Eric Blake <eblake at redhat.com>:
> On 08/29/2010 05:00 PM, Matthias Bolte wrote:
>>
>> Distinguish between strings as parameters (const char *)
>> and strings as return values (char **).
>
> Here, you mention char**,
>
>> if self.type == "String" and \
>> self.occurrence not in [OCCURRENCE__REQUIRED_LIST,
>> OCCURRENCE__OPTIONAL_LIST]:
>> - return "const char *"
>> + if self.is_return_value:
>> + return "char *"
>
> But here, it is only char*. Which is it?
That's a bit tricky. In case Parameter.get_type_string() is called
from Parameter.generate_return() then
string += "%s*%s)%s" % (self.get_type_string(), self.name, end_of_line)
in line 104 adds the second *.
I attached v2 where this is simplified.
Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-esx-Fix-generator-for-string-return-values.diff
Type: text/x-diff
Size: 6778 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100901/af3aa579/attachment-0001.bin>
More information about the libvir-list
mailing list