qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] RFC: mass comment conversion from C99 to C89


From: Blue Swirl
Subject: Re: [Qemu-devel] RFC: mass comment conversion from C99 to C89
Date: Sat, 15 Jan 2011 18:01:30 +0000

On Sat, Jan 15, 2011 at 5:44 PM, Stefan Weil <address@hidden> wrote:
> Am 15.01.2011 18:20, schrieb Laurent Vivier:
>>
>> Le samedi 15 janvier 2011 à 16:02 +0000, Blue Swirl a écrit :
>>>
>>> With the sed script below (my first I think), I'm able to convert most
>>
>> nice script. Did you try awk ?
>>
>>> files in QEMU from C99 comment style to C89. When successive line with
>>> C99 comments are converted, the comments are merged. Two files
>>
>> [ This remembers me the port of gstreamer to AIX using xlc, which was
>> C89 only... ]
>>
>>> (hw/rtl8139.c and microblaze-dis.c) still fail.
>>>
>>> Is this a good idea?
>>
>> I think line like:
>>
>> //#define DEBUG
>>
>> should be changed to
>>
>> #if 0
>> #define DEBUG
>> #endif
>>
>> as it is not really a comment but a flag.
>
> The pattern //~ is also some kind of flag.
>
> I must admit that I introduced some of these lines because
> my favorite editor (SciTE) allows to toggle these
> lines to code.
>
> Laurent's solution would be fine for those, too.
> It's also possible to replace all #if 0 by #if 1
> to test compilation of debug code.
>
> Is there an urgent need to fix all C99 comments?

Not really.

> I'd appreciate to see blanks at line endings or
> tabs fixed, too. At least fixing the blanks is
> much easier than fixing C99 comments.

Sure, for example the one line command in r3177 or
3b46e6242767a2c770c0aba0a6595e9511623c92
removes extra white space at the end of line.

Info page for sed presents example scripts which remove empty lines at
the end of the file and more than one successive empty line.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]