Re: [PATCH] Workaround apibuild.py warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/5/31 Daniel Veillard <veillard@xxxxxxxxxx>:
> On Tue, May 31, 2011 at 10:43:16AM +0200, Matthias Bolte wrote:
>> 2011/5/31 Daniel Veillard <veillard@xxxxxxxxxx>:
>> > On Sun, May 29, 2011 at 05:14:46PM +0200, Matthias Bolte wrote:
>> >> Parsing ./../include/libvirt/libvirt.h
>> >> Misformatted macro comment for _virSchedParameter
>> >> Â Expecting '* _virSchedParameter:' got '* virSchedParameter:'
>> >> Misformatted macro comment for _virBlkioParameter
>> >> Â Expecting '* _virBlkioParameter:' got '* virBlkioParameter:'
>> >> Misformatted macro comment for _virMemoryParameter
>> >> Â Expecting '* _virMemoryParameter:' got '* virMemoryParameter:'
>> >>
>> >> Replace '#define' with '# define' for the backward compatibility
>> >> defines to keep apibuild.py from parsing them and expecting
>> >> documentation comments for them.
>> >> ---
>> >> Âinclude/libvirt/libvirt.h.in | Â Â6 +++---
>> >> Â1 files changed, 3 insertions(+), 3 deletions(-)
>> >>
>> >> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
>> >> index 8058229..424e49b 100644
>> >> --- a/include/libvirt/libvirt.h.in
>> >> +++ b/include/libvirt/libvirt.h.in
>> >> @@ -2569,7 +2569,7 @@ typedef enum {
>> >> Â * Provided for backwards compatibility; virTypedParameter is the
>> >> Â * preferred alias since 0.9.2.
>> >> Â */
>> >> -#define _virSchedParameter _virTypedParameter
>> >> +# define _virSchedParameter _virTypedParameter
>> >> Âtypedef struct _virTypedParameter virSchedParameter;
>> >>
>> >> Â/**
>> >> @@ -2613,7 +2613,7 @@ typedef enum {
>> >> Â * Provided for backwards compatibility; virTypedParameter is the
>> >> Â * preferred alias since 0.9.2.
>> >> Â */
>> >> -#define _virBlkioParameter _virTypedParameter
>> >> +# define _virBlkioParameter _virTypedParameter
>> >> Âtypedef struct _virTypedParameter virBlkioParameter;
>> >>
>> >> Â/**
>> >> @@ -2657,7 +2657,7 @@ typedef enum {
>> >> Â * Provided for backwards compatibility; virTypedParameter is the
>> >> Â * preferred alias since 0.9.2.
>> >> Â */
>> >> -#define _virMemoryParameter _virTypedParameter
>> >> +# define _virMemoryParameter _virTypedParameter
>> >> Âtypedef struct _virTypedParameter virMemoryParameter;
>> >
>> > ÂThat's a bit odd ... it should be possibe to avoid those complaints
>> > from the generator, I can't look right now though
>> >
>> > Daniel
>>
>> Well, yes this was more like a hackish approach. Here's a v2 that
>> allows apibuild.py to ignore macros like it can already ignore
>> functions.
>>
>> Matthias
>
>> From ac679b3a929c22ae6cd3bf8733f57dca408f4e3b Mon Sep 17 00:00:00 2001
>> From: Matthias Bolte <matthias.bolte@xxxxxxxxxxxxxx>
>> Date: Tue, 31 May 2011 10:41:37 +0200
>> Subject: [PATCH] Ignore backward compatibility macros in apibuild.py
>>
>> This fixes this three warnings from the parser by allowing the parser
>> to ignore some macros in the same way as it can ignore functions.
>>
>> Parsing ./../include/libvirt/libvirt.h
>> Misformatted macro comment for _virSchedParameter
>> ÂExpecting '* _virSchedParameter:' got '* virSchedParameter:'
>> Misformatted macro comment for _virBlkioParameter
>> ÂExpecting '* _virBlkioParameter:' got '* virBlkioParameter:'
>> Misformatted macro comment for _virMemoryParameter
>> ÂExpecting '* _virMemoryParameter:' got '* virMemoryParameter:'
>> ---
>> Âdocs/apibuild.py | Â 10 ++++++++++
>> Â1 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/docs/apibuild.py b/docs/apibuild.py
>> index 2ab0599..f160c47 100755
>> --- a/docs/apibuild.py
>> +++ b/docs/apibuild.py
>> @@ -58,6 +58,12 @@ ignored_functions = {
>> Â Â"virEventRemoveTimeout": "internal function in event.c",
>> Â}
>>
>> +ignored_macros = {
>> + Â"_virSchedParameter": "backward compatibility macro for virTypedParameter",
>> + Â"_virBlkioParameter": "backward compatibility macro for virTypedParameter",
>> + Â"_virMemoryParameter": "backward compatibility macro for virTypedParameter",
>> +}
>> +
>> Âdef escape(raw):
>> Â Â Âraw = string.replace(raw, '&', '&amp;')
>> Â Â Âraw = string.replace(raw, '<', '&lt;')
>> @@ -716,8 +722,12 @@ class CParser:
>> Â Â Â# Parse a comment block associate to a macro
>> Â Â Â#
>> Â Â Âdef parseMacroComment(self, name, quiet = 0):
>> + Â Â Â Âglobal ignored_macros
>> +
>> Â Â Â Â Âif name[0:2] == '__':
>> Â Â Â Â Â Â Âquiet = 1
>> + Â Â Â Âif ignored_macros.has_key(name):
>> + Â Â Â Â Â Âquiet = 1
>>
>> Â Â Â Â Âargs = []
>> Â Â Â Â Âdesc = ""
>
> ÂExcellent, thanks ! ACK :-)
>
> Daniel
>

Thanks, pushed.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]